Browse Source

优化物资检查计划页显示

Frankensteinly 9 months ago
parent
commit
eb38647d9d

+ 13 - 0
app/src/main/java/com/grkj/iscs_mc/view/fragment/MaterialInspectionPlanFragment.kt

@@ -1,10 +1,13 @@
 package com.grkj.iscs_mc.view.fragment
 
+import com.grkj.iscs_mc.R
 import com.grkj.iscs_mc.databinding.FragmentMaterialInspectionPlanBinding
 import com.grkj.iscs_mc.extentions.navigateUp
 import com.grkj.iscs_mc.view.base.BaseMvpFragment
 import com.grkj.iscs_mc.view.iview.IMaterialInspectionPlanView
 import com.grkj.iscs_mc.view.presenter.MaterialInspectionPlanPresenter
+import com.zhy.adapter.recyclerview.CommonAdapter
+import com.zhy.adapter.recyclerview.base.ViewHolder
 
 /**
  * 物资检查计划页
@@ -17,6 +20,16 @@ class MaterialInspectionPlanFragment :
 
     override fun initView() {
         mBinding?.cbBack?.setOnClickListener { navigateUp() }
+
+        mBinding?.rvMaterialInspectionPlan?.adapter = object : CommonAdapter<String>(
+            requireContext(),
+            R.layout.item_rv_material_inspection_plan,
+            mutableListOf()
+        ) {
+            override fun convert(holder: ViewHolder, t: String, position: Int) {
+
+            }
+        }
     }
 
     override fun initPresenter(): MaterialInspectionPlanPresenter {

+ 99 - 86
app/src/main/res/layout/fragment_material_inspection_plan.xml

@@ -67,104 +67,117 @@
             android:layout_marginBottom="@dimen/common_spacing"
             android:text="计划日期" />
 
-        <LinearLayout
+        <com.google.android.material.card.MaterialCardView
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_below="@id/tv_title"
             android:layout_marginVertical="@dimen/common_spacing"
-            android:background="@drawable/item_rv_technology_sop_bg_normal"
-            android:orientation="vertical">
+            app:cardBackgroundColor="@color/common_bg_white_10"
+            app:cardCornerRadius="@dimen/common_radius_big"
+            app:cardElevation="0dp"
+            app:strokeColor="@color/common_transparent">
 
             <LinearLayout
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:background="@drawable/item_rv_technology_sop_bg_normal"
-                android:orientation="horizontal">
-
-                <TextView
-                    style="@style/CommonTextView"
-                    android:layout_width="0dp"
-                    android:layout_weight="1"
-                    android:paddingVertical="@dimen/common_spacing"
-                    android:text="@string/material_type" />
-
-                <View
-                    android:layout_width="@dimen/divider_line_width"
-                    android:layout_height="match_parent"
-                    android:background="@color/main_color" />
-
-                <TextView
-                    style="@style/CommonTextView"
-                    android:layout_width="0dp"
-                    android:layout_weight="1"
-                    android:paddingVertical="@dimen/common_spacing"
-                    android:text="@string/total_count" />
-
-                <View
-                    android:layout_width="@dimen/divider_line_width"
-                    android:layout_height="match_parent"
-                    android:background="@color/main_color" />
-
-                <TextView
-                    style="@style/CommonTextView"
-                    android:layout_width="0dp"
-                    android:layout_weight="1"
-                    android:paddingVertical="@dimen/common_spacing"
-                    android:text="@string/borrowed_count" />
-
-                <View
-                    android:layout_width="@dimen/divider_line_width"
-                    android:layout_height="match_parent"
-                    android:background="@color/main_color" />
-
-                <TextView
-                    style="@style/CommonTextView"
-                    android:layout_width="0dp"
-                    android:layout_weight="1"
-                    android:paddingVertical="@dimen/common_spacing"
-                    android:text="@string/to_be_inspected_count" />
-
-                <View
-                    android:layout_width="@dimen/divider_line_width"
-                    android:layout_height="match_parent"
-                    android:background="@color/main_color" />
-
-                <TextView
-                    style="@style/CommonTextView"
-                    android:layout_width="0dp"
-                    android:layout_weight="1"
-                    android:paddingVertical="@dimen/common_spacing"
-                    android:text="@string/normal_count" />
+                android:orientation="vertical">
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:background="@color/common_bg_white_10"
+                    android:orientation="horizontal">
+
+                    <TextView
+                        style="@style/CommonTextView"
+                        android:layout_width="0dp"
+                        android:layout_weight="1"
+                        android:paddingVertical="@dimen/common_spacing"
+                        android:text="@string/material_type" />
+
+                    <View
+                        android:layout_width="@dimen/divider_line_width"
+                        android:layout_height="match_parent"
+                        android:background="@color/main_color" />
+
+                    <TextView
+                        style="@style/CommonTextView"
+                        android:layout_width="0dp"
+                        android:layout_weight="1"
+                        android:paddingVertical="@dimen/common_spacing"
+                        android:text="@string/total_count" />
+
+                    <View
+                        android:layout_width="@dimen/divider_line_width"
+                        android:layout_height="match_parent"
+                        android:background="@color/main_color" />
+
+                    <TextView
+                        style="@style/CommonTextView"
+                        android:layout_width="0dp"
+                        android:layout_weight="1"
+                        android:paddingVertical="@dimen/common_spacing"
+                        android:text="@string/borrowed_count" />
+
+                    <View
+                        android:layout_width="@dimen/divider_line_width"
+                        android:layout_height="match_parent"
+                        android:background="@color/main_color" />
+
+                    <TextView
+                        style="@style/CommonTextView"
+                        android:layout_width="0dp"
+                        android:layout_weight="1"
+                        android:paddingVertical="@dimen/common_spacing"
+                        android:text="@string/to_be_inspected_count" />
+
+                    <View
+                        android:layout_width="@dimen/divider_line_width"
+                        android:layout_height="match_parent"
+                        android:background="@color/main_color" />
+
+                    <TextView
+                        style="@style/CommonTextView"
+                        android:layout_width="0dp"
+                        android:layout_weight="1"
+                        android:paddingVertical="@dimen/common_spacing"
+                        android:text="@string/normal_count" />
+
+                    <View
+                        android:layout_width="@dimen/divider_line_width"
+                        android:layout_height="match_parent"
+                        android:background="@color/main_color" />
+
+                    <TextView
+                        style="@style/CommonTextView"
+                        android:layout_width="0dp"
+                        android:layout_weight="1"
+                        android:paddingVertical="@dimen/common_spacing"
+                        android:text="@string/expired_count" />
+
+                    <View
+                        android:layout_width="@dimen/divider_line_width"
+                        android:layout_height="match_parent"
+                        android:background="@color/main_color" />
+
+                    <TextView
+                        style="@style/CommonTextView"
+                        android:layout_width="0dp"
+                        android:layout_weight="1"
+                        android:paddingVertical="@dimen/common_spacing"
+                        android:text="@string/damaged_count" />
+                </LinearLayout>
 
                 <View
-                    android:layout_width="@dimen/divider_line_width"
-                    android:layout_height="match_parent"
+                    android:layout_width="match_parent"
+                    android:layout_height="@dimen/divider_line_width"
                     android:background="@color/main_color" />
 
-                <TextView
-                    style="@style/CommonTextView"
-                    android:layout_width="0dp"
-                    android:layout_weight="1"
-                    android:paddingVertical="@dimen/common_spacing"
-                    android:text="@string/expired_count" />
-
-                <View
-                    android:layout_width="@dimen/divider_line_width"
-                    android:layout_height="match_parent"
-                    android:background="@color/main_color" />
-
-                <TextView
-                    style="@style/CommonTextView"
-                    android:layout_width="0dp"
-                    android:layout_weight="1"
-                    android:paddingVertical="@dimen/common_spacing"
-                    android:text="@string/damaged_count" />
+                <androidx.recyclerview.widget.RecyclerView
+                    android:id="@+id/rv_material_inspection_plan"
+                    style="@style/CommonRecyclerView"
+                    android:layout_height="wrap_content" />
             </LinearLayout>
-
-            <androidx.recyclerview.widget.RecyclerView
-                android:id="@+id/rv_material_inspection_plan"
-                style="@style/CommonRecyclerView"
-                android:layout_height="wrap_content" />
-        </LinearLayout>
+        </com.google.android.material.card.MaterialCardView>
     </RelativeLayout>
 </RelativeLayout>

+ 102 - 0
app/src/main/res/layout/item_rv_material_inspection_plan.xml

@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/root"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content">
+
+    <View
+        android:id="@+id/v_divider"
+        android:layout_width="match_parent"
+        android:layout_height="@dimen/divider_line_width"
+        android:background="@color/main_color" />
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_below="@id/v_divider"
+        android:orientation="horizontal">
+
+        <LinearLayout
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:gravity="center"
+            android:orientation="horizontal">
+
+            <ImageView
+                android:layout_width="@dimen/common_icon_size"
+                android:layout_height="@dimen/common_icon_size" />
+
+            <TextView
+                style="@style/CommonTextView"
+                android:layout_marginLeft="@dimen/common_spacing_small"
+                android:paddingVertical="@dimen/common_spacing" />
+        </LinearLayout>
+
+        <View
+            android:layout_width="@dimen/divider_line_width"
+            android:layout_height="match_parent"
+            android:background="@color/main_color" />
+
+        <TextView
+            style="@style/CommonTextView"
+            android:layout_width="0dp"
+            android:layout_weight="1"
+            android:paddingVertical="@dimen/common_spacing" />
+
+        <View
+            android:layout_width="@dimen/divider_line_width"
+            android:layout_height="match_parent"
+            android:background="@color/main_color" />
+
+        <TextView
+            style="@style/CommonTextView"
+            android:layout_width="0dp"
+            android:layout_weight="1"
+            android:paddingVertical="@dimen/common_spacing" />
+
+        <View
+            android:layout_width="@dimen/divider_line_width"
+            android:layout_height="match_parent"
+            android:background="@color/main_color" />
+
+        <TextView
+            style="@style/CommonTextView"
+            android:layout_width="0dp"
+            android:layout_weight="1"
+            android:paddingVertical="@dimen/common_spacing" />
+
+        <View
+            android:layout_width="@dimen/divider_line_width"
+            android:layout_height="match_parent"
+            android:background="@color/main_color" />
+
+        <TextView
+            style="@style/CommonTextView"
+            android:layout_width="0dp"
+            android:layout_weight="1"
+            android:paddingVertical="@dimen/common_spacing" />
+
+        <View
+            android:layout_width="@dimen/divider_line_width"
+            android:layout_height="match_parent"
+            android:background="@color/main_color" />
+
+        <TextView
+            style="@style/CommonTextView"
+            android:layout_width="0dp"
+            android:layout_weight="1"
+            android:paddingVertical="@dimen/common_spacing" />
+
+        <View
+            android:layout_width="@dimen/divider_line_width"
+            android:layout_height="match_parent"
+            android:background="@color/main_color" />
+
+        <TextView
+            style="@style/CommonTextView"
+            android:layout_width="0dp"
+            android:layout_weight="1"
+            android:paddingVertical="@dimen/common_spacing" />
+    </LinearLayout>
+</RelativeLayout>