A jogging timer for Android wear.
Revision | 8a1c0fecdd8aa1dc787bb1b5a28ec0d6a234e083 (tree) |
---|---|
Zeit | 2022-07-08 00:03:48 |
Autor | MRSa <mrsa@myad...> |
Commiter | MRSa |
ダイアログサイズ?の調整を実施。
@@ -1,17 +1,28 @@ | ||
1 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | 2 | <project version="4"> |
3 | 3 | <component name="deploymentTargetDropDown"> |
4 | + <runningDeviceTargetSelectedWithDropDown> | |
5 | + <Target> | |
6 | + <type value="RUNNING_DEVICE_TARGET" /> | |
7 | + <deviceKey> | |
8 | + <Key> | |
9 | + <type value="VIRTUAL_DEVICE_PATH" /> | |
10 | + <value value="C:\Users\MRSa\.android\avd\Android_Wear_Square_API_25.avd" /> | |
11 | + </Key> | |
12 | + </deviceKey> | |
13 | + </Target> | |
14 | + </runningDeviceTargetSelectedWithDropDown> | |
4 | 15 | <targetSelectedWithDropDown> |
5 | 16 | <Target> |
6 | 17 | <type value="QUICK_BOOT_TARGET" /> |
7 | 18 | <deviceKey> |
8 | 19 | <Key> |
9 | 20 | <type value="VIRTUAL_DEVICE_PATH" /> |
10 | - <value value="C:\Users\MRSa\.android\avd\Android_Wear_Round_Chin_API_26.avd" /> | |
21 | + <value value="C:\Users\MRSa\.android\avd\Android_Wear_Square_API_25.avd" /> | |
11 | 22 | </Key> |
12 | 23 | </deviceKey> |
13 | 24 | </Target> |
14 | 25 | </targetSelectedWithDropDown> |
15 | - <timeTargetWasSelectedWithDropDown value="2022-07-04T03:43:32.085812600Z" /> | |
26 | + <timeTargetWasSelectedWithDropDown value="2022-07-07T15:01:52.655400100Z" /> | |
16 | 27 | </component> |
17 | 28 | </project> |
\ No newline at end of file |
@@ -290,7 +290,7 @@ public class DetailActivity extends AppCompatActivity implements RecordDetailSet | ||
290 | 290 | try |
291 | 291 | { |
292 | 292 | // 基準値設定ダイアログを表示する |
293 | - SetReferenceDialog dialog = SetReferenceDialog.newInstance("Set Reference", "Please Select Reference Type", callback); | |
293 | + SetReferenceDialog dialog = SetReferenceDialog.newInstance(callback); | |
294 | 294 | FragmentManager manager = getSupportFragmentManager(); |
295 | 295 | dialog.show(manager, "dialog"); |
296 | 296 | } |
@@ -475,7 +475,7 @@ public class MainActivity extends AppCompatActivity implements IClickCallback, M | ||
475 | 475 | try |
476 | 476 | { |
477 | 477 | // 基準値&表示モード設定ダイアログを表示する |
478 | - SelectReferenceViewModeDialog dialog = SelectReferenceViewModeDialog.newInstance(getString(R.string.select_reference_title), " ", viewMode, selectionId, callback); | |
478 | + SelectReferenceViewModeDialog dialog = SelectReferenceViewModeDialog.newInstance(viewMode, selectionId, callback); | |
479 | 479 | FragmentManager manager = getSupportFragmentManager(); |
480 | 480 | dialog.show(manager, "dialog"); |
481 | 481 | } |
@@ -117,8 +117,8 @@ public class DataEditDialog extends DialogFragment | ||
117 | 117 | { |
118 | 118 | e.printStackTrace(); |
119 | 119 | } |
120 | - alertDialog.setIcon(iconResId); | |
121 | - alertDialog.setMessage(activity.getString(R.string.dialog_message_data_edit)); | |
120 | + //alertDialog.setIcon(iconResId); | |
121 | + //alertDialog.setMessage(activity.getString(R.string.dialog_message_data_edit)); | |
122 | 122 | alertDialog.setCancelable(true); |
123 | 123 | |
124 | 124 | // ボタンを設定する(実行ボタン) |
@@ -25,20 +25,16 @@ public class SelectReferenceViewModeDialog extends DialogFragment | ||
25 | 25 | |
26 | 26 | int selectedId = 0; |
27 | 27 | int selectedMode = 0; |
28 | - String title = ""; | |
29 | - String message = ""; | |
30 | 28 | SelectReferenceViewModeDialog.SelectReferenceCallback callback = null; |
31 | 29 | Dialog myDialog = null; |
32 | 30 | |
33 | - public static SelectReferenceViewModeDialog newInstance(String title, String message, boolean viewMode, int referenceId, @NonNull SelectReferenceViewModeDialog.SelectReferenceCallback callback) | |
31 | + public static SelectReferenceViewModeDialog newInstance(boolean viewMode, int referenceId, @NonNull SelectReferenceViewModeDialog.SelectReferenceCallback callback) | |
34 | 32 | { |
35 | 33 | SelectReferenceViewModeDialog instance = new SelectReferenceViewModeDialog(); |
36 | - instance.prepare(callback, viewMode, referenceId, title, message); | |
34 | + instance.prepare(callback, viewMode, referenceId); | |
37 | 35 | |
38 | 36 | // パラメータはBundleにまとめておく |
39 | 37 | Bundle arguments = new Bundle(); |
40 | - arguments.putString("title", title); | |
41 | - arguments.putString("message", message); | |
42 | 38 | instance.setArguments(arguments); |
43 | 39 | |
44 | 40 | return (instance); |
@@ -48,11 +44,9 @@ public class SelectReferenceViewModeDialog extends DialogFragment | ||
48 | 44 | * |
49 | 45 | * |
50 | 46 | */ |
51 | - private void prepare(SelectReferenceViewModeDialog.SelectReferenceCallback callback, boolean viewMode, int referenceId, String title, String message) | |
47 | + private void prepare(SelectReferenceViewModeDialog.SelectReferenceCallback callback, boolean viewMode, int referenceId) | |
52 | 48 | { |
53 | 49 | this.callback = callback; |
54 | - this.title = title; | |
55 | - this.message = message; | |
56 | 50 | selectedMode = (viewMode) ? 1 : 0; |
57 | 51 | selectedId = referenceId; |
58 | 52 | } |
@@ -64,24 +58,15 @@ public class SelectReferenceViewModeDialog extends DialogFragment | ||
64 | 58 | @Override |
65 | 59 | public @NonNull Dialog onCreateDialog(Bundle savedInstanceState) |
66 | 60 | { |
67 | - String title = this.title; | |
68 | - String message = this.message; | |
69 | - if (savedInstanceState != null) | |
70 | - { | |
71 | - title = savedInstanceState.getString("title"); | |
72 | - message = savedInstanceState.getString("message"); | |
73 | - } | |
74 | 61 | Activity activity = getActivity(); |
75 | 62 | final AlertDialog.Builder alertDialog = new AlertDialog.Builder(activity); |
76 | 63 | LayoutInflater inflater = activity.getLayoutInflater(); |
77 | 64 | final View alertView = inflater.inflate(R.layout.select_reference_dialog, null, false); |
78 | 65 | alertDialog.setView(alertView); |
79 | 66 | |
80 | - | |
81 | 67 | final String[] viewObjects = activity.getResources().getStringArray(R.array.show_laptime_array); |
82 | 68 | final Spinner spinner0 = alertView.findViewById(R.id.show_laptime_mode); |
83 | 69 | ArrayAdapter<String> arrayAdapter0 = new ArrayAdapter<>(activity, android.R.layout.simple_list_item_1, viewObjects); |
84 | - // selectedMode = 0; | |
85 | 70 | try |
86 | 71 | { |
87 | 72 | spinner0.setAdapter(arrayAdapter0); |
@@ -107,7 +92,6 @@ public class SelectReferenceViewModeDialog extends DialogFragment | ||
107 | 92 | final String[] objects = activity.getResources().getStringArray(R.array.reference_selection_array); |
108 | 93 | final Spinner spinner = alertView.findViewById(R.id.spinner_select_reference); |
109 | 94 | ArrayAdapter<String> arrayAdapter = new ArrayAdapter<>(activity, android.R.layout.simple_list_item_1, objects); |
110 | - // selectedId = 0; | |
111 | 95 | try |
112 | 96 | { |
113 | 97 | spinner.setAdapter(arrayAdapter); |
@@ -129,9 +113,6 @@ public class SelectReferenceViewModeDialog extends DialogFragment | ||
129 | 113 | { |
130 | 114 | e.printStackTrace(); |
131 | 115 | } |
132 | - | |
133 | - alertDialog.setTitle(title); | |
134 | - alertDialog.setIcon(android.R.drawable.ic_dialog_alert); | |
135 | 116 | alertDialog.setCancelable(true); |
136 | 117 | |
137 | 118 | String positiveLabel = activity.getString(R.string.dialog_positive_execute); |
@@ -19,20 +19,16 @@ public class SetReferenceDialog extends DialogFragment | ||
19 | 19 | { |
20 | 20 | private final String TAG = toString(); |
21 | 21 | int selectedId = 0; |
22 | - String title = ""; | |
23 | - String message = ""; | |
24 | 22 | SetReferenceDialog.SetReferenceCallback callback = null; |
25 | 23 | Dialog myDialog = null; |
26 | 24 | |
27 | - public static SetReferenceDialog newInstance(String title, String message, @NonNull SetReferenceDialog.SetReferenceCallback callback) | |
25 | + public static SetReferenceDialog newInstance(@NonNull SetReferenceDialog.SetReferenceCallback callback) | |
28 | 26 | { |
29 | 27 | SetReferenceDialog instance = new SetReferenceDialog(); |
30 | - instance.prepare(callback, title, message); | |
28 | + instance.prepare(callback); | |
31 | 29 | |
32 | 30 | // パラメータはBundleにまとめておく |
33 | 31 | Bundle arguments = new Bundle(); |
34 | - arguments.putString("title", title); | |
35 | - arguments.putString("message", message); | |
36 | 32 | instance.setArguments(arguments); |
37 | 33 | |
38 | 34 | return (instance); |
@@ -42,11 +38,9 @@ public class SetReferenceDialog extends DialogFragment | ||
42 | 38 | * |
43 | 39 | * |
44 | 40 | */ |
45 | - private void prepare(SetReferenceDialog.SetReferenceCallback callback, String title, String message) | |
41 | + private void prepare(SetReferenceDialog.SetReferenceCallback callback) | |
46 | 42 | { |
47 | 43 | this.callback = callback; |
48 | - this.title = title; | |
49 | - this.message = message; | |
50 | 44 | } |
51 | 45 | |
52 | 46 | /** |
@@ -56,13 +50,6 @@ public class SetReferenceDialog extends DialogFragment | ||
56 | 50 | @Override |
57 | 51 | public @NonNull Dialog onCreateDialog(Bundle savedInstanceState) |
58 | 52 | { |
59 | - String title = this.title; | |
60 | - String message = this.message; | |
61 | - if (savedInstanceState != null) | |
62 | - { | |
63 | - title = savedInstanceState.getString("title"); | |
64 | - message = savedInstanceState.getString("message"); | |
65 | - } | |
66 | 53 | Activity activity = getActivity(); |
67 | 54 | final AlertDialog.Builder alertDialog = new AlertDialog.Builder(activity); |
68 | 55 | LayoutInflater inflater = activity.getLayoutInflater(); |
@@ -76,6 +63,7 @@ public class SetReferenceDialog extends DialogFragment | ||
76 | 63 | try |
77 | 64 | { |
78 | 65 | spinner.setAdapter(arrayAdapter); |
66 | + spinner.setSelection(selectedId); | |
79 | 67 | spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { |
80 | 68 | @Override |
81 | 69 | public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { |
@@ -93,11 +81,8 @@ public class SetReferenceDialog extends DialogFragment | ||
93 | 81 | { |
94 | 82 | e.printStackTrace(); |
95 | 83 | } |
96 | - | |
97 | - alertDialog.setTitle(title); | |
98 | - alertDialog.setIcon(android.R.drawable.ic_dialog_alert); | |
99 | 84 | alertDialog.setCancelable(true); |
100 | - | |
85 | + alertDialog.setTitle(activity.getString(R.string.select_reference_title)); | |
101 | 86 | String positiveLabel = activity.getString(R.string.dialog_positive_execute); |
102 | 87 | String negativeLabel = activity.getString(R.string.dialog_negative_cancel); |
103 | 88 |
@@ -26,5 +26,5 @@ | ||
26 | 26 | <string name="time_picker_second_separator"> </string> |
27 | 27 | <string name="information_time_picker">LAPと総時間を入力</string> |
28 | 28 | <string name="information_modify_time">目標ラップタイムを設定</string> |
29 | - <string name="select_reference_title">表示/基準 設定</string> | |
29 | + <string name="select_reference_title">基準</string> | |
30 | 30 | </resources> |
\ No newline at end of file |
@@ -24,5 +24,5 @@ | ||
24 | 24 | <string name="time_picker_second_separator"> </string> |
25 | 25 | <string name="information_time_picker">Set LAP and total Time</string> |
26 | 26 | <string name="information_modify_time">Set Target LAP Time</string> |
27 | - <string name="select_reference_title">Set Mode/Ref.</string> | |
27 | + <string name="select_reference_title">Reference</string> | |
28 | 28 | </resources> |
@@ -26,5 +26,5 @@ | ||
26 | 26 | <string name="time_picker_second_separator"> </string> |
27 | 27 | <string name="information_time_picker">Set LAP and total Time</string> |
28 | 28 | <string name="information_modify_time">Set Target LAP Time</string> |
29 | - <string name="select_reference_title">Set Mode/Ref.</string> | |
29 | + <string name="select_reference_title">Reference</string> | |
30 | 30 | </resources> |