completed UI.
authorTrillGates <williamtrillgates@gmail.com>
Wed, 30 Jun 2021 02:59:32 +0000 (10:59 +0800)
committerTrillGates <williamtrillgates@gmail.com>
Wed, 30 Jun 2021 02:59:32 +0000 (10:59 +0800)
app/src/main/java/com/ic/sport/adapter/PedRecordAdapter.java
app/src/main/java/com/ic/sport/adapter/PedSetupAdapter.java
app/src/main/java/com/ic/sport/fragment/pedometer/PedRecordFragment.java
app/src/main/java/com/ic/sport/fragment/pedometer/PedSetupFragment.java
app/src/main/res/layout/dialog_ped_setup_layout.xml
app/src/main/res/layout/fragment_ped_setup.xml
app/src/main/res/layout/item_ped_record.xml
app/src/main/res/layout/item_ped_setup.xml
app/src/main/res/values-ja/strings.xml
app/src/main/res/values-zh/strings.xml
app/src/main/res/values/strings.xml

index a5d7df7..4cbd080 100644 (file)
@@ -63,7 +63,7 @@ public class PedRecordAdapter extends RecyclerView.Adapter<PedRecordAdapter.Reco
             }
 
             binding.setTakingIcon(R.mipmap.icon_step_green);
-            binding.setTakingColor(Color.parseColor("#FFA500"));
+            binding.setTakingColor(Color.WHITE);
             binding.setTakingUnit(context.getString(R.string.tips_target_unit));
 
             binding.setCaloriesIcon(R.mipmap.icon_calorie_small);
index 067d2e6..5be3b0b 100644 (file)
@@ -32,9 +32,9 @@ public class PedSetupAdapter extends RecyclerView.Adapter<PedSetupAdapter.SetUpH
     };
 
     private static final int[] ICON_RES = new int[]{
-            R.mipmap.tall,
-            R.mipmap.weight,
-            R.mipmap.flag,
+            R.mipmap.icon_height,
+            R.mipmap.icon_weight,
+            R.mipmap.icon_target,
     };
 
     private PedSetupFragment.OnPedSetupItemClickListener mListener;
index e8a6746..df06659 100644 (file)
@@ -83,7 +83,8 @@ public class PedRecordFragment extends Fragment {
     private void initRecyclerView() {
         setupAdapter = new PedRecordAdapter(mContext);
         LinearLayoutManager mLayoutManager =
-                new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, true);
+                new LinearLayoutManager(mContext,
+                        LinearLayoutManager.VERTICAL, true);
         mSetupRv.setLayoutManager(mLayoutManager);
         mSetupRv.setAdapter(setupAdapter);
     }
index e9f6a45..04450b7 100644 (file)
@@ -54,7 +54,8 @@ public class PedSetupFragment extends Fragment {
     @Override
     public View onCreateView(LayoutInflater inflater, ViewGroup container,
                              Bundle savedInstanceState) {
-        View view = inflater.inflate(R.layout.fragment_ped_setup, container, false);
+        View view = inflater.inflate(R.layout.fragment_ped_setup,
+                container, false);
         mSetupRv = view.findViewById(R.id.ped_setup_rv);
         initRecyclerView();
         return view;
@@ -62,12 +63,16 @@ public class PedSetupFragment extends Fragment {
 
     private void initRecyclerView() {
         setupAdapter = new PedSetupAdapter(mContext, listener);
-        LinearLayoutManager mLayoutManager = new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false);
+        LinearLayoutManager mLayoutManager = new LinearLayoutManager(mContext,
+                LinearLayoutManager.VERTICAL, false);
         mSetupRv.setLayoutManager(mLayoutManager);
         mSetupRv.addItemDecoration(new RecyclerView.ItemDecoration() {
             @Override
-            public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
-                outRect.bottom = 5;
+            public void getItemOffsets(@NonNull Rect outRect, @NonNull View view,
+                                       @NonNull RecyclerView parent,
+                                       @NonNull RecyclerView.State state) {
+                outRect.bottom = 2;
+                outRect.top = 2;
             }
         });
         mSetupRv.setAdapter(setupAdapter);
index 8e2a7e3..c7f2ecd 100644 (file)
@@ -2,7 +2,7 @@
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:background="@mipmap/bg"
+    android:background="@color/black"
     android:orientation="vertical">
 
     <LinearLayout
index d21e029..ef4035b 100644 (file)
@@ -1,24 +1,12 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<FrameLayout 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:background="@mipmap/bg"
-    android:gravity="center_horizontal"
-    android:orientation="vertical"
-    tools:context=".fragment.pedometer.PedSetupFragment">
-
-    <TextView
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="10dp"
-        android:text="@string/ped_head_name"
-        android:textColor="@color/main_text_color"
-        android:textSize="42sp" />
+    android:layout_height="match_parent">
 
     <androidx.recyclerview.widget.RecyclerView
         android:id="@+id/ped_setup_rv"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:overScrollMode="never" />
-</LinearLayout>
\ No newline at end of file
+        android:layout_marginTop="10dp" />
+</FrameLayout>
\ No newline at end of file
index 9cdbe62..1b074f7 100644 (file)
@@ -63,9 +63,7 @@
         style="@style/Widget.MaterialComponents.CardView"
         android:layout_width="match_parent"
         android:layout_height="80dp"
-        android:background="@drawable/shape_bg"
-        app:cardBackgroundColor="#1D1D1D"
-        app:cardCornerRadius="50dp">
+        android:background="@drawable/shape_bg">
 
         <TextView
             android:id="@+id/item_record_date"
index cb1f69d..918495f 100644 (file)
@@ -1,8 +1,10 @@
 <?xml version="1.0" encoding="utf-8"?>
 
-<layout xmlns:android="http://schemas.android.com/apk/res/android">
+<layout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto">
 
     <data>
+
         <variable
             name="setupItemValue"
             type="String" />
             type="com.ic.sport.fragment.pedometer.PedSetupFragment.OnPedSetupItemClickListener" />
     </data>
 
-    <LinearLayout
+    <RelativeLayout
+        style="@style/Widget.MaterialComponents.CardView"
         android:layout_width="match_parent"
         android:layout_height="70dp"
-        android:orientation="horizontal"
-        android:gravity="center_vertical"
-        android:onClick="@{()->onItemClick.onPedSetupItem(itemPos)}">
+        android:background="@drawable/shape_bg"
+        android:onClick="@{()->onItemClick.onPedSetupItem(itemPos)}"
+        android:orientation="horizontal">
 
         <ImageView
+            android:id="@+id/left_icon"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:src="@{setupItemIcon}"
-            android:layout_marginStart="10dp"/>
+            android:layout_centerVertical="true"
+            android:layout_marginStart="10dp"
+            android:layout_marginLeft="5dp"
+            android:src="@{setupItemIcon}" />
 
         <TextView
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
+            android:layout_centerVertical="true"
+            android:layout_marginStart="5dp"
+            android:layout_toRightOf="@id/left_icon"
             android:text="@{setupItemTitle}"
             android:textColor="@color/white"
             android:textSize="30sp"
-            android:layout_marginStart="5dp"/>
+            android:textStyle="bold" />
 
         <TextView
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
+            android:layout_centerVertical="true"
+            android:layout_toLeftOf="@id/right_unit"
             android:text="@{setupItemValue}"
             android:textColor="@color/white"
             android:textSize="30sp"
-            android:layout_marginStart="5dp"/>
+            android:textStyle="bold" />
 
         <TextView
+            android:id="@+id/right_unit"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
+            android:layout_alignParentRight="true"
+            android:layout_centerVertical="true"
+            android:layout_marginRight="10dp"
             android:text="@{setupItemUnit}"
             android:textColor="@color/white"
             android:textSize="30sp"
-            android:layout_marginStart="5dp"/>
+            android:textStyle="bold" />
 
-    </LinearLayout>
+    </RelativeLayout>
 </layout>
index 8326cde..9a8165f 100644 (file)
@@ -35,8 +35,8 @@
     <string name="pedometer_invalid_input">输入值无效</string>
     <string name="pedometer_height">身高</string>
     <string name="pedometer_weight">体重</string>
-    <string name="pedometer_unit_cm">厘米</string>
-    <string name="pedometer_unit_kg">千克</string>
+    <string name="pedometer_unit_cm">cm</string>
+    <string name="pedometer_unit_kg">kg</string>
     <string name="pedometer_personal_info_settings">个人设置</string>
     <string name="_0">0</string>
     <string name="averagestep">平均步数</string>
index 4841326..836d23f 100644 (file)
@@ -10,8 +10,8 @@
     <string name="tips_weight_name">体重</string>
     <string name="tips_target_name">目标</string>
 
-    <string name="tips_height_unit">厘米</string>
-    <string name="tips_weight_unit">千克</string>
+    <string name="tips_height_unit">cm</string>
+    <string name="tips_weight_unit">kg</string>
     <string name="tips_target_unit">步</string>
 
     <string name="ped_record_name">最近记录</string>
@@ -36,8 +36,8 @@
     <string name="pedometer_invalid_input">输入值无效</string>
     <string name="pedometer_height">身高</string>
     <string name="pedometer_weight">体重</string>
-    <string name="pedometer_unit_cm">厘米</string>
-    <string name="pedometer_unit_kg">千克</string>
+    <string name="pedometer_unit_cm">cm</string>
+    <string name="pedometer_unit_kg">kg</string>
     <string name="pedometer_personal_info_settings">个人设置</string>
     <string name="_0">0</string>
     <string name="averagestep">平均步数</string>
index 005eeed..bf03db6 100644 (file)
@@ -10,8 +10,8 @@
     <string name="tips_weight_name">体重</string>
     <string name="tips_target_name">目标</string>
 
-    <string name="tips_height_unit">厘米</string>
-    <string name="tips_weight_unit">千克</string>
+    <string name="tips_height_unit">cm</string>
+    <string name="tips_weight_unit">kg</string>
     <string name="tips_target_unit">步</string>
 
     <string name="ped_record_name">最近记录</string>
@@ -36,8 +36,8 @@
     <string name="pedometer_invalid_input">输入值无效</string>
     <string name="pedometer_height">身高</string>
     <string name="pedometer_weight">体重</string>
-    <string name="pedometer_unit_cm">厘米</string>
-    <string name="pedometer_unit_kg">千克</string>
+    <string name="pedometer_unit_cm">cm</string>
+    <string name="pedometer_unit_kg">kg</string>
     <string name="pedometer_personal_info_settings">个人设置</string>
     <string name="_0">0</string>
     <string name="averagestep">平均步数</string>