소스 검색

添加物资更换手动操作页基础和部分布局

Frankensteinly 9 달 전
부모
커밋
d643b30e12

+ 38 - 0
app/src/main/java/com/grkj/iscs_mc/view/fragment/MaterialManualReplacementFragment.kt

@@ -0,0 +1,38 @@
+package com.grkj.iscs_mc.view.fragment
+
+import com.grkj.iscs_mc.R
+import com.grkj.iscs_mc.databinding.FragmentMaterialManualReplacementBinding
+import com.grkj.iscs_mc.extentions.navigateUp
+import com.grkj.iscs_mc.view.base.BaseMvpFragment
+import com.grkj.iscs_mc.view.iview.IMaterialManualReplacementView
+import com.grkj.iscs_mc.view.presenter.MaterialManualReplacementPresenter
+import com.zhy.adapter.recyclerview.CommonAdapter
+import com.zhy.adapter.recyclerview.base.ViewHolder
+
+/**
+ * 物资更换手动操作页
+ */
+class MaterialManualReplacementFragment :
+    BaseMvpFragment<IMaterialManualReplacementView, MaterialManualReplacementPresenter, FragmentMaterialManualReplacementBinding>() {
+
+    override val viewBinding: FragmentMaterialManualReplacementBinding
+        get() = FragmentMaterialManualReplacementBinding.inflate(layoutInflater)
+
+    override fun initView() {
+        mBinding?.cbBack?.setOnClickListener { navigateUp() }
+
+        mBinding?.rvReplacement?.adapter = object : CommonAdapter<String>(
+            requireContext(),
+            R.layout.item_rv_manual_replacement,
+            mutableListOf()
+        ) {
+            override fun convert(holder: ViewHolder, t: String, position: Int) {
+
+            }
+        }
+    }
+
+    override fun initPresenter(): MaterialManualReplacementPresenter {
+        return MaterialManualReplacementPresenter()
+    }
+}

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

@@ -29,7 +29,7 @@ class MaterialReplacementFragment :
             }
         }
 
-        navigateTo(MaterialReplacementFragmentDirections.actionReplacementFragmentToReplacementRecordFragment())
+        navigateTo(MaterialReplacementFragmentDirections.actionReplacementFragmentToManualReplacementFragment())
     }
 
     override fun initPresenter(): MaterialReplacementPresenter {

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

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

+ 7 - 0
app/src/main/java/com/grkj/iscs_mc/view/presenter/MaterialManualReplacementPresenter.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.IMaterialManualReplacementView
+
+class MaterialManualReplacementPresenter : BasePresenter<IMaterialManualReplacementView>() {
+}

+ 7 - 0
app/src/main/res/drawable/item_rv_manual_replacement_bg.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <stroke
+        android:width="@dimen/divider_line_width"
+        android:color="@color/main_color" />
+</shape>

+ 50 - 0
app/src/main/res/layout/fragment_material_manual_replacement.xml

@@ -0,0 +1,50 @@
+<?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.MaterialManualReplacementFragment">
+
+    <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_replacement"
+        app:bar_title="@string/material_replacement" />
+
+    <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_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_back"
+        app:btn_bg="@drawable/common_btn_red_bg"
+        app:btn_name="@string/submit" />
+
+    <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">
+
+        <androidx.recyclerview.widget.RecyclerView
+            android:id="@+id/rv_replacement"
+            style="@style/CommonRecyclerView"
+            android:orientation="horizontal" />
+
+    </RelativeLayout>
+</RelativeLayout>

+ 100 - 0
app/src/main/res/layout/item_rv_manual_replacement.xml

@@ -0,0 +1,100 @@
+<?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"
+    android:id="@+id/root"
+    android:layout_width="243dp"
+    android:layout_height="212dp"
+    android:layout_margin="@dimen/common_spacing_small"
+    android:background="@drawable/item_rv_manual_replacement_bg">
+
+    <LinearLayout
+        android:id="@+id/ll_title"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginHorizontal="@dimen/divider_line_width"
+        android:layout_marginTop="@dimen/divider_line_width"
+        android:orientation="horizontal">
+
+        <TextView
+            style="@style/CommonTextView"
+            android:layout_width="0dp"
+            android:layout_weight="1"
+            android:background="@color/bar_bg"
+            android:paddingVertical="@dimen/common_spacing_small"
+            android:text="@string/old_material" />
+
+        <TextView
+            style="@style/CommonTextView"
+            android:layout_width="0dp"
+            android:layout_weight="1"
+            android:background="@color/bar_bg"
+            android:paddingVertical="@dimen/common_spacing_small"
+            android:text="@string/new_material" />
+    </LinearLayout>
+
+    <com.grkj.iscs_mc.view.widget.CommonBtn
+        android:id="@+id/cb_confirm"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignParentRight="true"
+        android:layout_alignParentBottom="true"
+        android:layout_marginVertical="@dimen/common_spacing_small"
+        android:layout_marginRight="@dimen/common_spacing_small"
+        app:btn_bg="@drawable/common_btn_red_bg"
+        app:btn_name="@string/save" />
+
+    <View
+        android:id="@+id/v_bottom_divider"
+        android:layout_width="match_parent"
+        android:layout_height="@dimen/divider_line_width"
+        android:layout_above="@id/cb_confirm"
+        android:background="@color/main_color" />
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_above="@id/v_bottom_divider"
+        android:layout_below="@id/ll_title"
+        android:orientation="horizontal">
+
+        <!-- 旧物资 -->
+        <LinearLayout
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="1"
+            android:orientation="vertical">
+
+            <RelativeLayout
+                android:layout_width="match_parent"
+                android:layout_height="71dp">
+
+                <ImageView
+                    android:layout_width="50dp"
+                    android:layout_height="50dp"
+                    android:layout_centerInParent="true" />
+            </RelativeLayout>
+
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="@dimen/divider_line_width"
+                android:background="@color/main_color" />
+
+
+        </LinearLayout>
+
+        <View
+            android:layout_width="@dimen/divider_line_width"
+            android:layout_height="match_parent"
+            android:background="@color/main_color" />
+
+        <!-- 新物资 -->
+        <LinearLayout
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="1"
+            android:orientation="vertical">
+
+        </LinearLayout>
+    </LinearLayout>
+
+</RelativeLayout>

+ 13 - 0
app/src/main/res/navigation/nav_graph.xml

@@ -84,8 +84,21 @@
             app:exitAnim="@anim/slide_out_left"
             app:popEnterAnim="@anim/slide_in_left"
             app:popExitAnim="@anim/slide_out_right" />
+
+        <action
+            android:id="@+id/action_replacement_fragment_to_manual_replacement_fragment"
+            app:destination="@id/material_manual_replacement_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_manual_replacement_fragment"
+        android:name="com.grkj.iscs_mc.view.fragment.MaterialManualReplacementFragment"
+        tools:layout="@layout/fragment_material_manual_replacement" />
+
     <fragment
         android:id="@+id/material_replacement_record_fragment"
         android:name="com.grkj.iscs_mc.view.fragment.MaterialReplacementRecordFragment"

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

@@ -73,4 +73,9 @@
     <string name="inspection_dialog_tip">将待检查的%d件物资,全部标注为:</string>
 
     <string name="material_replacement_record_title">本次物资取还记录如下:</string>
+
+    <string name="submit">提交</string>
+
+    <string name="old_material">旧物资</string>
+    <string name="new_material">新物资</string>
 </resources>