}
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);
};
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;
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);
}
@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;
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);
<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
<?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
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"
<?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>
<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>
<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>
<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>
<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>
<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>