• R/O
  • HTTP
  • SSH
  • HTTPS

JoggingTimer: Commit

A jogging timer for Android wear.


Commit MetaInfo

Revision8a1c0fecdd8aa1dc787bb1b5a28ec0d6a234e083 (tree)
Zeit2022-07-08 00:03:48
AutorMRSa <mrsa@myad...>
CommiterMRSa

Log Message

ダイアログサイズ?の調整を実施。

Ändern Zusammenfassung

Diff

--- a/.idea/deploymentTargetDropDown.xml
+++ b/.idea/deploymentTargetDropDown.xml
@@ -1,17 +1,28 @@
11 <?xml version="1.0" encoding="UTF-8"?>
22 <project version="4">
33 <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>
415 <targetSelectedWithDropDown>
516 <Target>
617 <type value="QUICK_BOOT_TARGET" />
718 <deviceKey>
819 <Key>
920 <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" />
1122 </Key>
1223 </deviceKey>
1324 </Target>
1425 </targetSelectedWithDropDown>
15- <timeTargetWasSelectedWithDropDown value="2022-07-04T03:43:32.085812600Z" />
26+ <timeTargetWasSelectedWithDropDown value="2022-07-07T15:01:52.655400100Z" />
1627 </component>
1728 </project>
\ No newline at end of file
--- a/wear/src/main/java/net/osdn/gokigen/joggingtimer/recorddetail/DetailActivity.java
+++ b/wear/src/main/java/net/osdn/gokigen/joggingtimer/recorddetail/DetailActivity.java
@@ -290,7 +290,7 @@ public class DetailActivity extends AppCompatActivity implements RecordDetailSet
290290 try
291291 {
292292 // 基準値設定ダイアログを表示する
293- SetReferenceDialog dialog = SetReferenceDialog.newInstance("Set Reference", "Please Select Reference Type", callback);
293+ SetReferenceDialog dialog = SetReferenceDialog.newInstance(callback);
294294 FragmentManager manager = getSupportFragmentManager();
295295 dialog.show(manager, "dialog");
296296 }
--- a/wear/src/main/java/net/osdn/gokigen/joggingtimer/stopwatch/MainActivity.java
+++ b/wear/src/main/java/net/osdn/gokigen/joggingtimer/stopwatch/MainActivity.java
@@ -475,7 +475,7 @@ public class MainActivity extends AppCompatActivity implements IClickCallback, M
475475 try
476476 {
477477 // 基準値&表示モード設定ダイアログを表示する
478- SelectReferenceViewModeDialog dialog = SelectReferenceViewModeDialog.newInstance(getString(R.string.select_reference_title), " ", viewMode, selectionId, callback);
478+ SelectReferenceViewModeDialog dialog = SelectReferenceViewModeDialog.newInstance(viewMode, selectionId, callback);
479479 FragmentManager manager = getSupportFragmentManager();
480480 dialog.show(manager, "dialog");
481481 }
--- a/wear/src/main/java/net/osdn/gokigen/joggingtimer/utilities/DataEditDialog.java
+++ b/wear/src/main/java/net/osdn/gokigen/joggingtimer/utilities/DataEditDialog.java
@@ -117,8 +117,8 @@ public class DataEditDialog extends DialogFragment
117117 {
118118 e.printStackTrace();
119119 }
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));
122122 alertDialog.setCancelable(true);
123123
124124 // ボタンを設定する(実行ボタン)
--- a/wear/src/main/java/net/osdn/gokigen/joggingtimer/utilities/SelectReferenceViewModeDialog.java
+++ b/wear/src/main/java/net/osdn/gokigen/joggingtimer/utilities/SelectReferenceViewModeDialog.java
@@ -25,20 +25,16 @@ public class SelectReferenceViewModeDialog extends DialogFragment
2525
2626 int selectedId = 0;
2727 int selectedMode = 0;
28- String title = "";
29- String message = "";
3028 SelectReferenceViewModeDialog.SelectReferenceCallback callback = null;
3129 Dialog myDialog = null;
3230
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)
3432 {
3533 SelectReferenceViewModeDialog instance = new SelectReferenceViewModeDialog();
36- instance.prepare(callback, viewMode, referenceId, title, message);
34+ instance.prepare(callback, viewMode, referenceId);
3735
3836 // パラメータはBundleにまとめておく
3937 Bundle arguments = new Bundle();
40- arguments.putString("title", title);
41- arguments.putString("message", message);
4238 instance.setArguments(arguments);
4339
4440 return (instance);
@@ -48,11 +44,9 @@ public class SelectReferenceViewModeDialog extends DialogFragment
4844 *
4945 *
5046 */
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)
5248 {
5349 this.callback = callback;
54- this.title = title;
55- this.message = message;
5650 selectedMode = (viewMode) ? 1 : 0;
5751 selectedId = referenceId;
5852 }
@@ -64,24 +58,15 @@ public class SelectReferenceViewModeDialog extends DialogFragment
6458 @Override
6559 public @NonNull Dialog onCreateDialog(Bundle savedInstanceState)
6660 {
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- }
7461 Activity activity = getActivity();
7562 final AlertDialog.Builder alertDialog = new AlertDialog.Builder(activity);
7663 LayoutInflater inflater = activity.getLayoutInflater();
7764 final View alertView = inflater.inflate(R.layout.select_reference_dialog, null, false);
7865 alertDialog.setView(alertView);
7966
80-
8167 final String[] viewObjects = activity.getResources().getStringArray(R.array.show_laptime_array);
8268 final Spinner spinner0 = alertView.findViewById(R.id.show_laptime_mode);
8369 ArrayAdapter<String> arrayAdapter0 = new ArrayAdapter<>(activity, android.R.layout.simple_list_item_1, viewObjects);
84- // selectedMode = 0;
8570 try
8671 {
8772 spinner0.setAdapter(arrayAdapter0);
@@ -107,7 +92,6 @@ public class SelectReferenceViewModeDialog extends DialogFragment
10792 final String[] objects = activity.getResources().getStringArray(R.array.reference_selection_array);
10893 final Spinner spinner = alertView.findViewById(R.id.spinner_select_reference);
10994 ArrayAdapter<String> arrayAdapter = new ArrayAdapter<>(activity, android.R.layout.simple_list_item_1, objects);
110- // selectedId = 0;
11195 try
11296 {
11397 spinner.setAdapter(arrayAdapter);
@@ -129,9 +113,6 @@ public class SelectReferenceViewModeDialog extends DialogFragment
129113 {
130114 e.printStackTrace();
131115 }
132-
133- alertDialog.setTitle(title);
134- alertDialog.setIcon(android.R.drawable.ic_dialog_alert);
135116 alertDialog.setCancelable(true);
136117
137118 String positiveLabel = activity.getString(R.string.dialog_positive_execute);
--- a/wear/src/main/java/net/osdn/gokigen/joggingtimer/utilities/SetReferenceDialog.java
+++ b/wear/src/main/java/net/osdn/gokigen/joggingtimer/utilities/SetReferenceDialog.java
@@ -19,20 +19,16 @@ public class SetReferenceDialog extends DialogFragment
1919 {
2020 private final String TAG = toString();
2121 int selectedId = 0;
22- String title = "";
23- String message = "";
2422 SetReferenceDialog.SetReferenceCallback callback = null;
2523 Dialog myDialog = null;
2624
27- public static SetReferenceDialog newInstance(String title, String message, @NonNull SetReferenceDialog.SetReferenceCallback callback)
25+ public static SetReferenceDialog newInstance(@NonNull SetReferenceDialog.SetReferenceCallback callback)
2826 {
2927 SetReferenceDialog instance = new SetReferenceDialog();
30- instance.prepare(callback, title, message);
28+ instance.prepare(callback);
3129
3230 // パラメータはBundleにまとめておく
3331 Bundle arguments = new Bundle();
34- arguments.putString("title", title);
35- arguments.putString("message", message);
3632 instance.setArguments(arguments);
3733
3834 return (instance);
@@ -42,11 +38,9 @@ public class SetReferenceDialog extends DialogFragment
4238 *
4339 *
4440 */
45- private void prepare(SetReferenceDialog.SetReferenceCallback callback, String title, String message)
41+ private void prepare(SetReferenceDialog.SetReferenceCallback callback)
4642 {
4743 this.callback = callback;
48- this.title = title;
49- this.message = message;
5044 }
5145
5246 /**
@@ -56,13 +50,6 @@ public class SetReferenceDialog extends DialogFragment
5650 @Override
5751 public @NonNull Dialog onCreateDialog(Bundle savedInstanceState)
5852 {
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- }
6653 Activity activity = getActivity();
6754 final AlertDialog.Builder alertDialog = new AlertDialog.Builder(activity);
6855 LayoutInflater inflater = activity.getLayoutInflater();
@@ -76,6 +63,7 @@ public class SetReferenceDialog extends DialogFragment
7663 try
7764 {
7865 spinner.setAdapter(arrayAdapter);
66+ spinner.setSelection(selectedId);
7967 spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
8068 @Override
8169 public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
@@ -93,11 +81,8 @@ public class SetReferenceDialog extends DialogFragment
9381 {
9482 e.printStackTrace();
9583 }
96-
97- alertDialog.setTitle(title);
98- alertDialog.setIcon(android.R.drawable.ic_dialog_alert);
9984 alertDialog.setCancelable(true);
100-
85+ alertDialog.setTitle(activity.getString(R.string.select_reference_title));
10186 String positiveLabel = activity.getString(R.string.dialog_positive_execute);
10287 String negativeLabel = activity.getString(R.string.dialog_negative_cancel);
10388
--- a/wear/src/main/res/values-ja/strings.xml
+++ b/wear/src/main/res/values-ja/strings.xml
@@ -26,5 +26,5 @@
2626 <string name="time_picker_second_separator"> </string>
2727 <string name="information_time_picker">LAPと総時間を入力</string>
2828 <string name="information_modify_time">目標ラップタイムを設定</string>
29- <string name="select_reference_title">表示/基準 設定</string>
29+ <string name="select_reference_title">基準</string>
3030 </resources>
\ No newline at end of file
--- a/wear/src/main/res/values-round/strings.xml
+++ b/wear/src/main/res/values-round/strings.xml
@@ -24,5 +24,5 @@
2424 <string name="time_picker_second_separator"> </string>
2525 <string name="information_time_picker">Set LAP and total Time</string>
2626 <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>
2828 </resources>
--- a/wear/src/main/res/values/strings.xml
+++ b/wear/src/main/res/values/strings.xml
@@ -26,5 +26,5 @@
2626 <string name="time_picker_second_separator"> </string>
2727 <string name="information_time_picker">Set LAP and total Time</string>
2828 <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>
3030 </resources>
Show on old repository browser