소스 검색

添加物资检查计划页基础和部分布局

Frankensteinly 9 달 전
부모
커밋
7691f4463b

+ 2 - 1
app/src/main/java/com/grkj/iscs_mc/view/fragment/MaterialInspectionFragment.kt

@@ -1,6 +1,7 @@
 package com.grkj.iscs_mc.view.fragment
 
 import com.grkj.iscs_mc.databinding.FragmentMaterialInspectionBinding
+import com.grkj.iscs_mc.extentions.navigateTo
 import com.grkj.iscs_mc.view.base.BaseMvpFragment
 import com.grkj.iscs_mc.view.iview.IMaterialInspectionView
 import com.grkj.iscs_mc.view.presenter.MaterialInspectionPresenter
@@ -15,7 +16,7 @@ class MaterialInspectionFragment :
         get() = FragmentMaterialInspectionBinding.inflate(layoutInflater)
 
     override fun initView() {
-
+        navigateTo(MaterialInspectionFragmentDirections.actionInspectionFragmentToInspectionPlanFragment())
     }
 
     override fun initPresenter(): MaterialInspectionPresenter {

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

@@ -0,0 +1,25 @@
+package com.grkj.iscs_mc.view.fragment
+
+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
+
+/**
+ * 物资检查计划页
+ */
+class MaterialInspectionPlanFragment :
+    BaseMvpFragment<IMaterialInspectionPlanView, MaterialInspectionPlanPresenter, FragmentMaterialInspectionPlanBinding>() {
+
+    override val viewBinding: FragmentMaterialInspectionPlanBinding
+        get() = FragmentMaterialInspectionPlanBinding.inflate(layoutInflater)
+
+    override fun initView() {
+        mBinding?.cbBack?.setOnClickListener { navigateUp() }
+    }
+
+    override fun initPresenter(): MaterialInspectionPlanPresenter {
+        return MaterialInspectionPlanPresenter()
+    }
+}

+ 6 - 0
app/src/main/java/com/grkj/iscs_mc/view/iview/IMaterialInspectionPlanView.kt

@@ -0,0 +1,6 @@
+package com.grkj.iscs_mc.view.iview
+
+import com.grkj.iscs_mc.view.base.IView
+
+interface IMaterialInspectionPlanView : IView {
+}

+ 7 - 0
app/src/main/java/com/grkj/iscs_mc/view/presenter/MaterialInspectionPlanPresenter.kt

@@ -0,0 +1,7 @@
+package com.grkj.iscs_mc.view.presenter
+
+import com.grkj.iscs_mc.view.base.BasePresenter
+import com.grkj.iscs_mc.view.iview.IMaterialInspectionPlanView
+
+class MaterialInspectionPlanPresenter : BasePresenter<IMaterialInspectionPlanView>() {
+}

+ 6 - 0
app/src/main/res/drawable/common_btn_yellow_bg.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <corners android:radius="@dimen/common_radius_small" />
+    <solid android:color="@color/common_btn_yellow_bg" />
+</shape>

+ 170 - 0
app/src/main/res/layout/fragment_material_inspection_plan.xml

@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    tools:context=".view.fragment.MaterialInspectionPlanFragment">
+
+    <com.grkj.iscs_mc.view.widget.TitleBar
+        android:id="@+id/tb"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        app:bar_icon="@mipmap/material_inspection_plan"
+        app:bar_title="@string/material_inspection_plan" />
+
+    <com.grkj.iscs_mc.view.widget.CommonBtn
+        android:id="@+id/cb_back"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignParentRight="true"
+        android:layout_alignParentBottom="true"
+        app:btn_bg="@drawable/common_btn_blue_bg"
+        app:btn_name="@string/back" />
+
+    <com.grkj.iscs_mc.view.widget.CommonBtn
+        android:id="@+id/cb_start"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignParentBottom="true"
+        android:layout_marginRight="@dimen/common_spacing"
+        android:layout_toLeftOf="@id/cb_back"
+        app:btn_bg="@drawable/common_btn_red_bg"
+        app:btn_name="@string/start_inspection" />
+
+    <com.grkj.iscs_mc.view.widget.CommonBtn
+        android:id="@+id/cb_continue"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignParentBottom="true"
+        android:layout_marginRight="@dimen/common_spacing"
+        android:layout_toLeftOf="@id/cb_start"
+        app:btn_bg="@drawable/common_btn_yellow_bg"
+        app:btn_name="@string/continue_inspection" />
+
+    <com.grkj.iscs_mc.view.widget.CommonBtn
+        android:id="@+id/cb_submit"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignParentBottom="true"
+        android:layout_marginRight="@dimen/common_spacing"
+        android:layout_toLeftOf="@id/cb_continue"
+        app:btn_bg="@drawable/common_btn_red_bg"
+        app:btn_name="@string/submit_result" />
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_above="@id/cb_back"
+        android:layout_below="@id/tb"
+        android:layout_marginVertical="@dimen/common_spacing"
+        android:background="@drawable/item_rv_technology_sop_bg_normal"
+        android:padding="@dimen/common_spacing_small">
+
+        <TextView
+            android:id="@+id/tv_title"
+            style="@style/CommonTextView"
+            android:layout_marginBottom="@dimen/common_spacing"
+            android:text="计划日期" />
+
+        <LinearLayout
+            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">
+
+            <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" />
+
+                <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>
+
+            <androidx.recyclerview.widget.RecyclerView
+                android:id="@+id/rv_material_inspection_plan"
+                style="@style/CommonRecyclerView"
+                android:layout_height="wrap_content" />
+        </LinearLayout>
+    </RelativeLayout>
+</RelativeLayout>

BIN
app/src/main/res/mipmap/material_inspection_plan.png


+ 15 - 1
app/src/main/res/navigation/nav_graph.xml

@@ -63,7 +63,15 @@
     <fragment
         android:id="@+id/material_inspection_fragment"
         android:name="com.grkj.iscs_mc.view.fragment.MaterialInspectionFragment"
-        tools:layout="@layout/fragment_material_inspection" />
+        tools:layout="@layout/fragment_material_inspection" >
+        <action
+            android:id="@+id/action_inspection_fragment_to_inspection_plan_fragment"
+            app:destination="@id/material_inspection_plan_fragment"
+            app:enterAnim="@anim/slide_in_right"
+            app:exitAnim="@anim/slide_out_left"
+            app:popEnterAnim="@anim/slide_in_left"
+            app:popExitAnim="@anim/slide_out_right" />
+    </fragment>
 
     <fragment
         android:id="@+id/material_replacement_fragment"
@@ -74,4 +82,10 @@
         android:id="@+id/material_instruction_detail_fragment"
         android:name="com.grkj.iscs_mc.view.fragment.MaterialInstructionDetailFragment"
         tools:layout="@layout/fragment_material_instruction_detail" />
+
+    <fragment
+        android:id="@+id/material_inspection_plan_fragment"
+        android:name="com.grkj.iscs_mc.view.fragment.MaterialInspectionPlanFragment"
+        tools:layout="@layout/fragment_material_inspection_plan" />
+
 </navigation>

+ 1 - 0
app/src/main/res/values/colors.xml

@@ -28,6 +28,7 @@
     <color name="home_menu_bg">#4D2B7AE9</color>
     <color name="common_btn_red_bg">#80FF0000</color>
     <color name="common_btn_green_bg">#80047b0f</color>
+    <color name="common_btn_yellow_bg">#80e8900d</color>
     <color name="lock_status_unlocked">#99008000</color>
     <color name="lock_status_locked">#CCFF0000</color>
     <color name="point_text_bg">#70b26f</color>

+ 13 - 0
app/src/main/res/values/strings.xml

@@ -33,6 +33,7 @@
     <string name="material_replacement">物资更换</string>
     <string name="material_replacement_english">Materials Replacement</string>
     <string name="exception_handle">异常处理</string>
+    <string name="material_inspection_plan">物资检查计划</string>
 
     <string name="action_confirm">操作确认</string>
     <string name="confirm">确定</string>
@@ -44,4 +45,16 @@
 
     <string name="expired">过期</string>
     <string name="damaged">损坏</string>
+
+    <string name="start_inspection">开始检查</string>
+    <string name="continue_inspection">继续检查</string>
+    <string name="submit_result">提交结果</string>
+
+    <string name="material_type">物资类型</string>
+    <string name="total_count">总数量</string>
+    <string name="borrowed_count">借出数量</string>
+    <string name="to_be_inspected_count">待检数量</string>
+    <string name="normal_count">正常数量</string>
+    <string name="expired_count">过期数量</string>
+    <string name="damaged_count">损坏数量</string>
 </resources>