Explorar o código

添加物资使用说明item布局

Frankensteinly hai 9 meses
pai
achega
fa16418fd6

+ 11 - 0
app/src/main/java/com/grkj/iscs_mc/view/fragment/MaterialInstructionFragment.kt

@@ -1,9 +1,13 @@
 package com.grkj.iscs_mc.view.fragment
 
+import com.grkj.iscs_mc.R
 import com.grkj.iscs_mc.databinding.FragmentMaterialInstructionBinding
+import com.grkj.iscs_mc.extentions.navigateUp
 import com.grkj.iscs_mc.view.base.BaseMvpFragment
 import com.grkj.iscs_mc.view.iview.IMaterialInstructionView
 import com.grkj.iscs_mc.view.presenter.MaterialInstructionPresenter
+import com.zhy.adapter.recyclerview.CommonAdapter
+import com.zhy.adapter.recyclerview.base.ViewHolder
 
 /**
  * 物资管理 - 物资使用说明
@@ -15,7 +19,14 @@ class MaterialInstructionFragment :
         get() = FragmentMaterialInstructionBinding.inflate(layoutInflater)
 
     override fun initView() {
+        mBinding?.cbBack?.setOnClickListener { navigateUp() }
 
+        mBinding?.rvInstruction?.adapter = object :
+            CommonAdapter<String>(requireContext(), R.layout.item_rv_instruction, mutableListOf()) {
+            override fun convert(holder: ViewHolder, t: String, position: Int) {
+
+            }
+        }
     }
 
     override fun initPresenter(): MaterialInstructionPresenter {

+ 5 - 0
app/src/main/res/drawable/item_rv_instruction_bg.xml

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

+ 6 - 0
app/src/main/res/drawable/item_rv_instruction_pic_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_bg_white_70" />
+</shape>

+ 34 - 2
app/src/main/res/layout/fragment_material_instruction.xml

@@ -1,8 +1,40 @@
 <?xml version="1.0" encoding="utf-8"?>
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<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.MaterialInstructionFragment">
 
-</FrameLayout>
+    <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_instruction"
+        app:bar_title="@string/material_instruction" />
+
+    <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" />
+
+    <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_instruction"
+            style="@style/CommonRecyclerView"
+            app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
+            app:spanCount="4" />
+    </RelativeLayout>
+</RelativeLayout>

+ 25 - 0
app/src/main/res/layout/item_rv_instruction.xml

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/root"
+    android:layout_width="118dp"
+    android:layout_height="90dp"
+    android:layout_margin="@dimen/common_spacing_small"
+    android:background="@drawable/item_rv_instruction_bg"
+    android:gravity="center"
+    android:orientation="vertical">
+
+    <RelativeLayout
+        android:layout_width="96dp"
+        android:layout_height="60dp"
+        android:background="@drawable/item_rv_instruction_pic_bg">
+
+        <ImageView
+            android:layout_width="wrap_content"
+            android:layout_height="50dp"
+            android:layout_centerInParent="true" />
+    </RelativeLayout>
+
+    <TextView
+        style="@style/CommonTextView"
+        android:layout_marginTop="@dimen/common_spacing_small" />
+</LinearLayout>

BIN=BIN
app/src/main/res/mipmap/pdf.png


BIN=BIN
app/src/main/res/mipmap/video.png