A jogging timer for Android wear.
Révision | 04110a3f45f6b07779e915c8221921aeb84445e0 (tree) |
---|---|
l'heure | 2018-04-22 21:50:20 |
Auteur | MRSa <mrsa@myad...> |
Commiter | MRSa |
roundおよびchinの表示レイアウトを見直した。
@@ -7,8 +7,8 @@ android { | ||
7 | 7 | applicationId "net.osdn.gokigen.joggingtimer" |
8 | 8 | minSdkVersion 14 // 14 |
9 | 9 | targetSdkVersion 27 |
10 | - versionCode 100002 | |
11 | - versionName "1.0.0" | |
10 | + versionCode 100012 | |
11 | + versionName "1.0.1" | |
12 | 12 | } |
13 | 13 | buildTypes { |
14 | 14 | release { |
@@ -7,8 +7,8 @@ android { | ||
7 | 7 | applicationId "net.osdn.gokigen.joggingtimer" |
8 | 8 | minSdkVersion 23 |
9 | 9 | targetSdkVersion 27 |
10 | - versionCode 100001 | |
11 | - versionName "1.0.0" | |
10 | + versionCode 100011 | |
11 | + versionName "1.0.1" | |
12 | 12 | } |
13 | 13 | buildTypes { |
14 | 14 | release { |
@@ -56,7 +56,8 @@ public class DetailActivity extends WearableActivity implements RecordDetailSetu | ||
56 | 56 | detailAdapter = new RecordDetailAdapter(); |
57 | 57 | WearableLinearLayoutManager layoutManager = new WearableLinearLayoutManager(this); |
58 | 58 | |
59 | - view.setCircularScrollingGestureEnabled(getResources().getConfiguration().isScreenRound()); | |
59 | + //view.setCircularScrollingGestureEnabled(getResources().getConfiguration().isScreenRound()); | |
60 | + view.setCircularScrollingGestureEnabled(false); | |
60 | 61 | |
61 | 62 | DividerItemDecoration dividerDecoration = new DividerItemDecoration(view.getContext(), layoutManager.getOrientation()); |
62 | 63 |
@@ -55,7 +55,8 @@ public class ListActivity extends WearableActivity implements IDetailLauncher, R | ||
55 | 55 | summaryAdapter = new RecordSummaryAdapter(); |
56 | 56 | WearableLinearLayoutManager layoutManager = new WearableLinearLayoutManager(this); |
57 | 57 | |
58 | - view.setCircularScrollingGestureEnabled(getResources().getConfiguration().isScreenRound()); | |
58 | + //view.setCircularScrollingGestureEnabled(getResources().getConfiguration().isScreenRound()); | |
59 | + view.setCircularScrollingGestureEnabled(false); | |
59 | 60 | |
60 | 61 | DividerItemDecoration dividerDecoration = new DividerItemDecoration(view.getContext(), layoutManager.getOrientation()); |
61 | 62 |
@@ -8,6 +8,7 @@ import android.content.DialogInterface; | ||
8 | 8 | import android.os.Bundle; |
9 | 9 | import android.support.annotation.NonNull; |
10 | 10 | import android.util.Log; |
11 | +import android.view.ContextThemeWrapper; | |
11 | 12 | |
12 | 13 | import net.osdn.gokigen.joggingtimer.R; |
13 | 14 |
@@ -64,7 +65,9 @@ public class ConfirmationDialog extends DialogFragment | ||
64 | 65 | message = savedInstanceState.getString("message"); |
65 | 66 | } |
66 | 67 | Context context = getContext(); |
68 | + //AlertDialog.Builder alertDialog = new AlertDialog.Builder(new ContextThemeWrapper(context, R.style.wear2_dialog_theme)); | |
67 | 69 | AlertDialog.Builder alertDialog = new AlertDialog.Builder(context); |
70 | + | |
68 | 71 | alertDialog.setTitle(title); |
69 | 72 | alertDialog.setIcon(android.R.drawable.ic_dialog_alert); |
70 | 73 | alertDialog.setMessage(message); |
@@ -75,7 +75,8 @@ public class CreateModelDataDialog extends DialogFragment | ||
75 | 75 | |
76 | 76 | Activity activity = getActivity(); |
77 | 77 | // 確認ダイアログの生成 |
78 | - final AlertDialog.Builder alertDialog = new AlertDialog.Builder(new ContextThemeWrapper(activity, R.style.wear2_dialog_theme)); | |
78 | + //final AlertDialog.Builder alertDialog = new AlertDialog.Builder(new ContextThemeWrapper(activity, R.style.wear2_dialog_theme)); | |
79 | + final AlertDialog.Builder alertDialog = new AlertDialog.Builder(activity); | |
79 | 80 | |
80 | 81 | // Get the layout inflater |
81 | 82 | LayoutInflater inflater = activity.getLayoutInflater(); |
@@ -7,15 +7,20 @@ import android.app.DialogFragment; | ||
7 | 7 | import android.content.Context; |
8 | 8 | import android.content.DialogInterface; |
9 | 9 | import android.content.res.TypedArray; |
10 | +import android.graphics.Color; | |
11 | +import android.graphics.drawable.Drawable; | |
12 | +import android.os.Build; | |
10 | 13 | import android.os.Bundle; |
11 | 14 | import android.support.annotation.NonNull; |
12 | 15 | import android.util.Log; |
16 | +import android.view.ContextThemeWrapper; | |
13 | 17 | import android.view.LayoutInflater; |
14 | 18 | import android.view.View; |
15 | 19 | import android.view.ViewGroup; |
16 | 20 | import android.widget.AdapterView; |
17 | 21 | import android.widget.ArrayAdapter; |
18 | 22 | import android.widget.EditText; |
23 | +import android.widget.LinearLayout; | |
19 | 24 | import android.widget.Spinner; |
20 | 25 | import android.widget.TextView; |
21 | 26 |
@@ -73,8 +78,10 @@ public class DataEditDialog extends DialogFragment | ||
73 | 78 | Activity activity = getActivity(); |
74 | 79 | |
75 | 80 | // 確認ダイアログの生成 |
81 | + //final AlertDialog.Builder alertDialog = new AlertDialog.Builder(new ContextThemeWrapper(activity, R.style.wear2_dialog_theme)); | |
76 | 82 | final AlertDialog.Builder alertDialog = new AlertDialog.Builder(activity); |
77 | 83 | |
84 | + | |
78 | 85 | // Get the layout inflater |
79 | 86 | LayoutInflater inflater = activity.getLayoutInflater(); |
80 | 87 | final View alertView = inflater.inflate(R.layout.information_dialog, null, false); |
@@ -83,6 +90,13 @@ public class DataEditDialog extends DialogFragment | ||
83 | 90 | final String[] objects = activity.getResources().getStringArray(R.array.icon_selection_id); |
84 | 91 | final Spinner spinner = alertView.findViewById(R.id.spinner_selection); |
85 | 92 | final EditText titleText = alertView.findViewById(R.id.edit_title); |
93 | + | |
94 | + // もー苦肉の策だ。。。 | |
95 | + if (Build.VERSION.SDK_INT <= android.os.Build.VERSION_CODES.M) | |
96 | + { | |
97 | + titleText.setTextColor(Color.BLACK); | |
98 | + } | |
99 | + | |
86 | 100 | try |
87 | 101 | { |
88 | 102 | titleText.setText(title); |
@@ -32,6 +32,12 @@ | ||
32 | 32 | android:layout_width="match_parent" |
33 | 33 | android:layout_height="match_parent" |
34 | 34 | android:scrollbars="vertical" |
35 | + android:clipChildren="true" | |
36 | + android:clipToPadding="true" | |
37 | + android:paddingTop="@dimen/list_top_padding" | |
38 | + android:paddingBottom="@dimen/list_bottom_padding" | |
39 | + android:paddingStart="@dimen/list_start_padding" | |
40 | + android:paddingEnd="@dimen/list_end_padding" | |
35 | 41 | > |
36 | 42 | </android.support.wear.widget.WearableRecyclerView> |
37 | 43 | </LinearLayout> |
@@ -7,10 +7,12 @@ | ||
7 | 7 | android:layout_width="match_parent" |
8 | 8 | android:layout_height="match_parent" |
9 | 9 | android:background="@color/black" |
10 | + android:layoutMode="clipBounds" | |
10 | 11 | tools:context="net.osdn.gokigen.joggingtimer.recordlist.ListActivity"> |
11 | 12 | |
12 | - <LinearLayout | |
13 | + <android.support.wear.widget.BoxInsetLayout | |
13 | 14 | xmlns:android="http://schemas.android.com/apk/res/android" |
15 | + xmlns:tools="http://schemas.android.com/tools" | |
14 | 16 | android:layout_width="match_parent" |
15 | 17 | android:layout_height="match_parent" |
16 | 18 | android:id="@+id/time_list" |
@@ -31,10 +33,16 @@ | ||
31 | 33 | android:id="@+id/recycler_list_view" |
32 | 34 | android:layout_width="match_parent" |
33 | 35 | android:layout_height="match_parent" |
36 | + android:clipChildren="true" | |
37 | + android:clipToPadding="true" | |
38 | + android:paddingTop="@dimen/list_top_padding" | |
39 | + android:paddingBottom="@dimen/list_bottom_padding" | |
40 | + android:paddingStart="@dimen/list_start_padding" | |
41 | + android:paddingEnd="@dimen/list_end_padding" | |
34 | 42 | android:scrollbars="vertical" |
35 | 43 | > |
36 | 44 | </android.support.wear.widget.WearableRecyclerView> |
37 | - </LinearLayout> | |
45 | + </android.support.wear.widget.BoxInsetLayout> | |
38 | 46 | |
39 | 47 | <android.support.wear.widget.drawer.WearableNavigationDrawerView |
40 | 48 | android:id="@+id/list_top_navigation_drawer" |
@@ -3,6 +3,10 @@ | ||
3 | 3 | android:layout_width="fill_parent" |
4 | 4 | android:layout_height="wrap_content" |
5 | 5 | android:orientation="horizontal" |
6 | + android:clipChildren="true" | |
7 | + android:clipToPadding="true" | |
8 | + android:paddingTop="@dimen/header_top_padding" | |
9 | + android:paddingBottom="@dimen/header_bottom_padding" | |
6 | 10 | > |
7 | 11 | <TextView xmlns:android="http://schemas.android.com/apk/res/android" |
8 | 12 | android:id="@+id/detail_lap_count" |
@@ -4,6 +4,10 @@ | ||
4 | 4 | android:layout_height="wrap_content" |
5 | 5 | android:orientation="horizontal" |
6 | 6 | android:id="@+id/laptime_item" |
7 | + android:clipChildren="true" | |
8 | + android:clipToPadding="true" | |
9 | + android:paddingTop="@dimen/header_top_padding" | |
10 | + android:paddingBottom="@dimen/header_bottom_padding" | |
7 | 11 | > |
8 | 12 | <TextView xmlns:android="http://schemas.android.com/apk/res/android" |
9 | 13 | android:layout_width="wrap_content" |
@@ -3,6 +3,10 @@ | ||
3 | 3 | android:layout_width="fill_parent" |
4 | 4 | android:layout_height="wrap_content" |
5 | 5 | android:orientation="horizontal" |
6 | + android:clipChildren="true" | |
7 | + android:clipToPadding="true" | |
8 | + android:paddingTop="@dimen/header_top_padding" | |
9 | + android:paddingBottom="@dimen/header_bottom_padding" | |
6 | 10 | > |
7 | 11 | <ImageView xmlns:android="http://schemas.android.com/apk/res/android" |
8 | 12 | android:id="@+id/gokigen_icon" |
@@ -4,16 +4,16 @@ | ||
4 | 4 | android:orientation="horizontal" |
5 | 5 | android:layout_width="fill_parent" |
6 | 6 | android:layout_height="fill_parent" |
7 | - android:padding="12dp" | |
7 | + android:padding="@dimen/icon_list_padding" | |
8 | 8 | android:background="@color/white" |
9 | 9 | > |
10 | 10 | <TextView android:id="@+id/selection_icon" |
11 | 11 | android:layout_width="fill_parent" |
12 | 12 | android:layout_height="fill_parent" |
13 | 13 | android:contentDescription="@string/blank" |
14 | - android:drawableTint="@color/black" | |
15 | 14 | android:foregroundTint="@color/black" |
15 | + android:drawableTint="@color/black" | |
16 | 16 | android:drawableEnd="@drawable/ic_build_black_24dp" |
17 | - android:layout_marginEnd="12dp" | |
17 | + android:layout_marginEnd="6dp" | |
18 | 18 | /> |
19 | 19 | </LinearLayout> |
@@ -1,23 +1,27 @@ | ||
1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | -<android.support.wear.widget.drawer.WearableDrawerLayout | |
2 | + | |
3 | +<android.support.wear.widget.BoxInsetLayout | |
3 | 4 | xmlns:android="http://schemas.android.com/apk/res/android" |
4 | 5 | android:id="@+id/list_drawer_layout" |
5 | 6 | android:layout_width="match_parent" |
6 | 7 | android:layout_height="match_parent" |
7 | 8 | android:nestedScrollingEnabled="true" |
8 | - android:background="@color/white"> | |
9 | + android:paddingStart="@dimen/list_start_padding" | |
10 | + android:paddingEnd="@dimen/list_end_padding" | |
11 | + android:background="@color/white" | |
12 | +> | |
9 | 13 | <ScrollView |
10 | 14 | android:layout_width="match_parent" |
11 | - android:layout_height="wrap_content"> | |
15 | + android:layout_height="wrap_content" | |
16 | + > | |
12 | 17 | |
13 | 18 | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
14 | 19 | android:id="@+id/info_edit_data" |
15 | 20 | android:orientation="vertical" |
16 | 21 | android:layout_width="fill_parent" |
17 | 22 | android:layout_height="wrap_content" |
18 | - android:padding="6dp" | |
23 | + android:padding="2dp" | |
19 | 24 | > |
20 | - | |
21 | 25 | <Spinner |
22 | 26 | android:id="@+id/spinner_selection" |
23 | 27 | android:layout_width="fill_parent" |
@@ -38,4 +42,4 @@ | ||
38 | 42 | /> |
39 | 43 | </LinearLayout> |
40 | 44 | </ScrollView> |
41 | -</android.support.wear.widget.drawer.WearableDrawerLayout> | |
45 | +</android.support.wear.widget.BoxInsetLayout> |
@@ -43,7 +43,7 @@ | ||
43 | 43 | android:id="@+id/number_picker_lap_count" |
44 | 44 | android:layout_width="wrap_content" |
45 | 45 | android:layout_height="wrap_content" |
46 | - android:layout_weight="4" | |
46 | + android:layout_weight="2" | |
47 | 47 | /> |
48 | 48 | <TextView |
49 | 49 | android:id="@+id/lap_end" |
@@ -76,7 +76,7 @@ | ||
76 | 76 | android:id="@+id/number_picker_minutes" |
77 | 77 | android:layout_width="wrap_content" |
78 | 78 | android:layout_height="wrap_content" |
79 | - android:layout_weight="1" | |
79 | + android:layout_weight="2" | |
80 | 80 | /> |
81 | 81 | <TextView |
82 | 82 | android:id="@+id/separator_minute" |
@@ -89,7 +89,7 @@ | ||
89 | 89 | android:id="@+id/number_picker_seconds" |
90 | 90 | android:layout_width="wrap_content" |
91 | 91 | android:layout_height="wrap_content" |
92 | - android:layout_weight="1" | |
92 | + android:layout_weight="2" | |
93 | 93 | /> |
94 | 94 | <TextView |
95 | 95 | android:id="@+id/separator_second" |
@@ -1,15 +1,15 @@ | ||
1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | 2 | <resources> |
3 | - <!-- | |
4 | - Because the window insets on round devices are larger than 15dp, this padding only applies | |
5 | - to square screens. | |
6 | - --> | |
7 | - <dimen name="box_inset_layout_padding">0dp</dimen> | |
8 | 3 | |
9 | - <!-- | |
10 | - This padding applies to both square and round screens. The total padding between the buttons | |
11 | - and the window insets is box_inset_layout_padding (above variable) on square screens and | |
12 | - inner_frame_layout_padding (below variable) on round screens. | |
13 | - --> | |
4 | + <dimen name="box_inset_layout_padding">0dp</dimen> | |
14 | 5 | <dimen name="inner_frame_layout_padding">1dp</dimen> |
6 | + <dimen name="icon_list_padding">12dp</dimen> | |
7 | + <dimen name="header_top_padding">8dp</dimen> | |
8 | + <dimen name="header_bottom_padding">6dp</dimen> | |
9 | + <dimen name="header_start_padding">6dp</dimen> | |
10 | + <dimen name="header_end_padding">6dp</dimen> | |
11 | + <dimen name="list_start_padding">6dp</dimen> | |
12 | + <dimen name="list_end_padding">6dp</dimen> | |
13 | + <dimen name="list_top_padding">40dp</dimen> | |
14 | + <dimen name="list_bottom_padding">40dp</dimen> | |
15 | 15 | </resources> |
@@ -12,4 +12,14 @@ | ||
12 | 12 | inner_frame_layout_padding (below variable) on round screens. |
13 | 13 | --> |
14 | 14 | <dimen name="inner_frame_layout_padding">0dp</dimen> |
15 | + <dimen name="icon_list_padding">0dp</dimen> | |
16 | + <dimen name="header_start_padding">0dp</dimen> | |
17 | + <dimen name="header_end_padding">0dp</dimen> | |
18 | + <dimen name="header_top_padding">0dp</dimen> | |
19 | + <dimen name="header_bottom_padding">0dp</dimen> | |
20 | + | |
21 | + <dimen name="list_start_padding">0dp</dimen> | |
22 | + <dimen name="list_end_padding">0dp</dimen> | |
23 | + <dimen name="list_top_padding">0dp</dimen> | |
24 | + <dimen name="list_bottom_padding">0dp</dimen> | |
15 | 25 | </resources> |