OSDN Git Service

roundおよびchinの表示レイアウトを見直した。
authorMRSa <mrsa@myad.jp>
Sun, 22 Apr 2018 12:50:20 +0000 (21:50 +0900)
committerMRSa <mrsa@myad.jp>
Sun, 22 Apr 2018 12:50:20 +0000 (21:50 +0900)
17 files changed:
mobile/build.gradle
wear/build.gradle
wear/src/main/java/net/osdn/gokigen/joggingtimer/recorddetail/DetailActivity.java
wear/src/main/java/net/osdn/gokigen/joggingtimer/recordlist/ListActivity.java
wear/src/main/java/net/osdn/gokigen/joggingtimer/utilities/ConfirmationDialog.java
wear/src/main/java/net/osdn/gokigen/joggingtimer/utilities/CreateModelDataDialog.java
wear/src/main/java/net/osdn/gokigen/joggingtimer/utilities/DataEditDialog.java
wear/src/main/res/layout-round/activity_detail.xml
wear/src/main/res/layout-round/activity_list.xml
wear/src/main/res/layout-round/column_detail.xml
wear/src/main/res/layout-round/column_laptime.xml
wear/src/main/res/layout-round/column_list.xml
wear/src/main/res/layout-round/icon_list.xml
wear/src/main/res/layout-round/information_dialog.xml
wear/src/main/res/layout-round/time_model_picker.xml
wear/src/main/res/values-round/dimens.xml
wear/src/main/res/values/dimens.xml

index bb0e444..582fb83 100644 (file)
@@ -7,8 +7,8 @@ android {
         applicationId "net.osdn.gokigen.joggingtimer"
         minSdkVersion 14  // 14
         targetSdkVersion 27
-        versionCode 100002
-        versionName "1.0.0"
+        versionCode 100012
+        versionName "1.0.1"
     }
     buildTypes {
         release {
index cb786c0..2a30286 100644 (file)
@@ -7,8 +7,8 @@ android {
         applicationId "net.osdn.gokigen.joggingtimer"
         minSdkVersion 23
         targetSdkVersion 27
-        versionCode 100001
-        versionName "1.0.0"
+        versionCode 100011
+        versionName "1.0.1"
     }
     buildTypes {
         release {
index e732a59..c5adcec 100644 (file)
@@ -56,7 +56,8 @@ public class DetailActivity extends WearableActivity implements RecordDetailSetu
             detailAdapter = new RecordDetailAdapter();
             WearableLinearLayoutManager layoutManager = new WearableLinearLayoutManager(this);
 
-            view.setCircularScrollingGestureEnabled(getResources().getConfiguration().isScreenRound());
+            //view.setCircularScrollingGestureEnabled(getResources().getConfiguration().isScreenRound());
+            view.setCircularScrollingGestureEnabled(false);
 
             DividerItemDecoration dividerDecoration = new DividerItemDecoration(view.getContext(), layoutManager.getOrientation());
 
index 0b9fdc8..ace7404 100644 (file)
@@ -55,7 +55,8 @@ public class ListActivity extends WearableActivity implements IDetailLauncher, R
             summaryAdapter = new RecordSummaryAdapter();
             WearableLinearLayoutManager layoutManager = new WearableLinearLayoutManager(this);
 
-            view.setCircularScrollingGestureEnabled(getResources().getConfiguration().isScreenRound());
+            //view.setCircularScrollingGestureEnabled(getResources().getConfiguration().isScreenRound());
+            view.setCircularScrollingGestureEnabled(false);
 
             DividerItemDecoration dividerDecoration = new DividerItemDecoration(view.getContext(), layoutManager.getOrientation());
 
index d4a2a03..4bb2012 100644 (file)
@@ -8,6 +8,7 @@ import android.content.DialogInterface;
 import android.os.Bundle;
 import android.support.annotation.NonNull;
 import android.util.Log;
+import android.view.ContextThemeWrapper;
 
 import net.osdn.gokigen.joggingtimer.R;
 
@@ -64,7 +65,9 @@ public class ConfirmationDialog extends DialogFragment
             message = savedInstanceState.getString("message");
         }
         Context context = getContext();
+        //AlertDialog.Builder alertDialog = new AlertDialog.Builder(new ContextThemeWrapper(context, R.style.wear2_dialog_theme));
         AlertDialog.Builder alertDialog = new AlertDialog.Builder(context);
+
         alertDialog.setTitle(title);
         alertDialog.setIcon(android.R.drawable.ic_dialog_alert);
         alertDialog.setMessage(message);
index 7703a10..76efbaf 100644 (file)
@@ -75,7 +75,8 @@ public class CreateModelDataDialog  extends DialogFragment
 
         Activity activity = getActivity();
         // 確認ダイアログの生成
-        final AlertDialog.Builder alertDialog = new AlertDialog.Builder(new ContextThemeWrapper(activity, R.style.wear2_dialog_theme));
+        //final AlertDialog.Builder alertDialog = new AlertDialog.Builder(new ContextThemeWrapper(activity, R.style.wear2_dialog_theme));
+        final AlertDialog.Builder alertDialog = new AlertDialog.Builder(activity);
 
         // Get the layout inflater
         LayoutInflater inflater = activity.getLayoutInflater();
index 8f84baf..abc8165 100644 (file)
@@ -7,15 +7,20 @@ import android.app.DialogFragment;
 import android.content.Context;
 import android.content.DialogInterface;
 import android.content.res.TypedArray;
+import android.graphics.Color;
+import android.graphics.drawable.Drawable;
+import android.os.Build;
 import android.os.Bundle;
 import android.support.annotation.NonNull;
 import android.util.Log;
+import android.view.ContextThemeWrapper;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.AdapterView;
 import android.widget.ArrayAdapter;
 import android.widget.EditText;
+import android.widget.LinearLayout;
 import android.widget.Spinner;
 import android.widget.TextView;
 
@@ -73,8 +78,10 @@ public class DataEditDialog  extends DialogFragment
         Activity activity = getActivity();
 
         // 確認ダイアログの生成
+        //final AlertDialog.Builder alertDialog = new AlertDialog.Builder(new ContextThemeWrapper(activity, R.style.wear2_dialog_theme));
         final AlertDialog.Builder alertDialog = new AlertDialog.Builder(activity);
 
+
         // Get the layout inflater
         LayoutInflater inflater = activity.getLayoutInflater();
         final View alertView = inflater.inflate(R.layout.information_dialog, null, false);
@@ -83,6 +90,13 @@ public class DataEditDialog  extends DialogFragment
         final String[] objects = activity.getResources().getStringArray(R.array.icon_selection_id);
         final Spinner spinner = alertView.findViewById(R.id.spinner_selection);
         final EditText titleText = alertView.findViewById(R.id.edit_title);
+
+        // もー苦肉の策だ。。。
+        if (Build.VERSION.SDK_INT <= android.os.Build.VERSION_CODES.M)
+        {
+            titleText.setTextColor(Color.BLACK);
+        }
+
         try
         {
             titleText.setText(title);
index ddeae9b..2a26b31 100644 (file)
             android:layout_width="match_parent"
             android:layout_height="match_parent"
             android:scrollbars="vertical"
+            android:clipChildren="true"
+            android:clipToPadding="true"
+            android:paddingTop="@dimen/list_top_padding"
+            android:paddingBottom="@dimen/list_bottom_padding"
+            android:paddingStart="@dimen/list_start_padding"
+            android:paddingEnd="@dimen/list_end_padding"
             >
         </android.support.wear.widget.WearableRecyclerView>
     </LinearLayout>
index c170c2d..d8dc136 100644 (file)
@@ -7,10 +7,12 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:background="@color/black"
+    android:layoutMode="clipBounds"
     tools:context="net.osdn.gokigen.joggingtimer.recordlist.ListActivity">
 
-    <LinearLayout
+    <android.support.wear.widget.BoxInsetLayout
         xmlns:android="http://schemas.android.com/apk/res/android"
+        xmlns:tools="http://schemas.android.com/tools"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:id="@+id/time_list"
             android:id="@+id/recycler_list_view"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
+            android:clipChildren="true"
+            android:clipToPadding="true"
+            android:paddingTop="@dimen/list_top_padding"
+            android:paddingBottom="@dimen/list_bottom_padding"
+            android:paddingStart="@dimen/list_start_padding"
+            android:paddingEnd="@dimen/list_end_padding"
             android:scrollbars="vertical"
             >
         </android.support.wear.widget.WearableRecyclerView>
-    </LinearLayout>
+    </android.support.wear.widget.BoxInsetLayout>
 
     <android.support.wear.widget.drawer.WearableNavigationDrawerView
         android:id="@+id/list_top_navigation_drawer"
index 891c878..d83c8b3 100644 (file)
@@ -3,6 +3,10 @@
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"
     android:orientation="horizontal"
+    android:clipChildren="true"
+    android:clipToPadding="true"
+    android:paddingTop="@dimen/header_top_padding"
+    android:paddingBottom="@dimen/header_bottom_padding"
     >
     <TextView xmlns:android="http://schemas.android.com/apk/res/android"
         android:id="@+id/detail_lap_count"
index 1d87b91..48c80f5 100644 (file)
@@ -4,6 +4,10 @@
     android:layout_height="wrap_content"
     android:orientation="horizontal"
     android:id="@+id/laptime_item"
+    android:clipChildren="true"
+    android:clipToPadding="true"
+    android:paddingTop="@dimen/header_top_padding"
+    android:paddingBottom="@dimen/header_bottom_padding"
     >
     <TextView xmlns:android="http://schemas.android.com/apk/res/android"
         android:layout_width="wrap_content"
index 862476a..9811789 100644 (file)
@@ -3,6 +3,10 @@
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"
     android:orientation="horizontal"
+    android:clipChildren="true"
+    android:clipToPadding="true"
+    android:paddingTop="@dimen/header_top_padding"
+    android:paddingBottom="@dimen/header_bottom_padding"
     >
     <ImageView xmlns:android="http://schemas.android.com/apk/res/android"
         android:id="@+id/gokigen_icon"
index b2945bf..fda6ebd 100644 (file)
@@ -4,16 +4,16 @@
     android:orientation="horizontal"
     android:layout_width="fill_parent"
     android:layout_height="fill_parent"
-    android:padding="12dp"
+    android:padding="@dimen/icon_list_padding"
     android:background="@color/white"
     >
     <TextView android:id="@+id/selection_icon"
         android:layout_width="fill_parent"
         android:layout_height="fill_parent"
         android:contentDescription="@string/blank"
-        android:drawableTint="@color/black"
         android:foregroundTint="@color/black"
+        android:drawableTint="@color/black"
         android:drawableEnd="@drawable/ic_build_black_24dp"
-        android:layout_marginEnd="12dp"
+        android:layout_marginEnd="6dp"
         />
 </LinearLayout>
index 7b8532d..6276a48 100644 (file)
@@ -1,23 +1,27 @@
 <?xml version="1.0" encoding="utf-8"?>
-<android.support.wear.widget.drawer.WearableDrawerLayout
+
+<android.support.wear.widget.BoxInsetLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/list_drawer_layout"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:nestedScrollingEnabled="true"
-    android:background="@color/white">
+    android:paddingStart="@dimen/list_start_padding"
+    android:paddingEnd="@dimen/list_end_padding"
+    android:background="@color/white"
+>
     <ScrollView
         android:layout_width="match_parent"
-        android:layout_height="wrap_content">
+        android:layout_height="wrap_content"
+        >
 
         <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
             android:id="@+id/info_edit_data"
             android:orientation="vertical"
             android:layout_width="fill_parent"
             android:layout_height="wrap_content"
-            android:padding="6dp"
+            android:padding="2dp"
             >
-
             <Spinner
                 android:id="@+id/spinner_selection"
                 android:layout_width="fill_parent"
@@ -38,4 +42,4 @@
                 />
         </LinearLayout>
     </ScrollView>
-</android.support.wear.widget.drawer.WearableDrawerLayout>
+</android.support.wear.widget.BoxInsetLayout>
index bb0d8bb..fa98f8c 100644 (file)
@@ -43,7 +43,7 @@
                 android:id="@+id/number_picker_lap_count"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:layout_weight="4"
+                android:layout_weight="2"
                 />
             <TextView
                 android:id="@+id/lap_end"
@@ -76,7 +76,7 @@
                 android:id="@+id/number_picker_minutes"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:layout_weight="1"
+                android:layout_weight="2"
                 />
             <TextView
                 android:id="@+id/separator_minute"
@@ -89,7 +89,7 @@
                 android:id="@+id/number_picker_seconds"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:layout_weight="1"
+                android:layout_weight="2"
                 />
             <TextView
                 android:id="@+id/separator_second"
index 9c09969..ad5ba08 100644 (file)
@@ -1,15 +1,15 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
-    <!--
-    Because the window insets on round devices are larger than 15dp, this padding only applies
-    to square screens.
-    -->
-    <dimen name="box_inset_layout_padding">0dp</dimen>
 
-    <!--
-    This padding applies to both square and round screens. The total padding between the buttons
-    and the window insets is box_inset_layout_padding (above variable) on square screens and
-    inner_frame_layout_padding (below variable) on round screens.
-    -->
+    <dimen name="box_inset_layout_padding">0dp</dimen>
     <dimen name="inner_frame_layout_padding">1dp</dimen>
+    <dimen name="icon_list_padding">12dp</dimen>
+    <dimen name="header_top_padding">8dp</dimen>
+    <dimen name="header_bottom_padding">6dp</dimen>
+    <dimen name="header_start_padding">6dp</dimen>
+    <dimen name="header_end_padding">6dp</dimen>
+    <dimen name="list_start_padding">6dp</dimen>
+    <dimen name="list_end_padding">6dp</dimen>
+    <dimen name="list_top_padding">40dp</dimen>
+    <dimen name="list_bottom_padding">40dp</dimen>
 </resources>
index 5145574..cbcb635 100644 (file)
     inner_frame_layout_padding (below variable) on round screens.
     -->
     <dimen name="inner_frame_layout_padding">0dp</dimen>
+    <dimen name="icon_list_padding">0dp</dimen>
+    <dimen name="header_start_padding">0dp</dimen>
+    <dimen name="header_end_padding">0dp</dimen>
+    <dimen name="header_top_padding">0dp</dimen>
+    <dimen name="header_bottom_padding">0dp</dimen>
+
+    <dimen name="list_start_padding">0dp</dimen>
+    <dimen name="list_end_padding">0dp</dimen>
+    <dimen name="list_top_padding">0dp</dimen>
+    <dimen name="list_bottom_padding">0dp</dimen>
 </resources>