Frankensteinly 8 місяців тому
батько
коміт
3f8e2a4c9a

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

@@ -1,20 +1,40 @@
 package com.grkj.iscs_mc.view.fragment
 
+import com.grkj.iscs_mc.R
 import com.grkj.iscs_mc.databinding.FragmentExceptionHandleBinding
 import com.grkj.iscs_mc.view.base.BaseMvpFragment
 import com.grkj.iscs_mc.view.iview.IExceptionHandleView
 import com.grkj.iscs_mc.view.presenter.ExceptionHandlePresenter
+import com.zhy.adapter.recyclerview.CommonAdapter
+import com.zhy.adapter.recyclerview.base.ViewHolder
 
 /**
  * 异常处理页
  */
-class ExceptionHandleFragment : BaseMvpFragment<IExceptionHandleView, ExceptionHandlePresenter, FragmentExceptionHandleBinding>() {
+class ExceptionHandleFragment :
+    BaseMvpFragment<IExceptionHandleView, ExceptionHandlePresenter, FragmentExceptionHandleBinding>() {
 
     override val viewBinding: FragmentExceptionHandleBinding
         get() = FragmentExceptionHandleBinding.inflate(layoutInflater)
 
     override fun initView() {
+        mBinding?.rvException?.adapter = object :
+            CommonAdapter<String>(requireContext(), R.layout.item_rv_exception, mutableListOf()) {
+            override fun convert(holder: ViewHolder, t: String, position: Int) {
+                val recyclerView =
+                    holder.getView<androidx.recyclerview.widget.RecyclerView>(R.id.rv_exception_item)
+                recyclerView.adapter = object :
+                    CommonAdapter<String>(
+                        requireContext(),
+                        R.layout.item_rv_exception_item,
+                        mutableListOf()
+                    ) {
+                    override fun convert(holder: ViewHolder, t: String, position: Int) {
 
+                    }
+                }
+            }
+        }
     }
 
     override fun initPresenter(): ExceptionHandlePresenter {

+ 9 - 0
app/src/main/res/drawable/exception_type_bg.xml

@@ -0,0 +1,9 @@
+<?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/white" />
+    <stroke
+        android:width="@dimen/divider_line_width"
+        android:color="@color/common_btn_red_bg" />
+</shape>

+ 5 - 0
app/src/main/res/drawable/item_rv_exception_cover_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_big" />
+    <solid android:color="@color/common_bg_white_40" />
+</shape>

+ 65 - 2
app/src/main/res/layout/fragment_exception_handle.xml

@@ -1,8 +1,71 @@
 <?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.ExceptionHandleFragment">
 
-</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/exception"
+        app:bar_title="@string/exception_handle" />
+
+    <androidx.constraintlayout.widget.ConstraintLayout
+        android:id="@+id/rl_bar"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_alignParentBottom="true">
+
+        <com.grkj.iscs_mc.view.widget.CommonBtn
+            android:id="@+id/cb_close"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            app:btn_bg="@drawable/common_btn_blue_bg"
+            app:btn_name="@string/close"
+            app:layout_constraintRight_toRightOf="parent"
+            app:layout_constraintTop_toTopOf="parent" />
+
+        <com.grkj.iscs_mc.view.widget.CommonBtn
+            android:id="@+id/cb_open"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            app:btn_bg="@drawable/common_btn_red_bg"
+            app:btn_name="@string/open_cabinet"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintRight_toLeftOf="@id/cb_close" />
+
+        <ImageView
+            android:id="@+id/iv_icon"
+            android:layout_width="@dimen/common_icon_size_big"
+            android:layout_height="@dimen/common_icon_size_big"
+            android:layout_marginVertical="2dp"
+            android:background="@mipmap/settings"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintLeft_toLeftOf="parent"
+            app:layout_constraintTop_toTopOf="parent" />
+
+        <TextView
+            style="@style/CommonTextView"
+            android:layout_marginLeft="@dimen/common_spacing_small"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintLeft_toRightOf="@id/iv_icon"
+            app:layout_constraintTop_toTopOf="parent" />
+    </androidx.constraintlayout.widget.ConstraintLayout>
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_above="@id/rl_bar"
+        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_exception"
+            style="@style/CommonRecyclerView" />
+    </RelativeLayout>
+</RelativeLayout>

+ 54 - 0
app/src/main/res/layout/item_rv_exception.xml

@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/root"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:layout_margin="@dimen/common_spacing_small">
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:background="@drawable/item_rv_technology_sop_bg_normal"
+        android:orientation="vertical"
+        android:padding="@dimen/common_spacing_small">
+
+        <TextView
+            android:id="@+id/tv_type"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:background="@drawable/exception_type_bg"
+            android:paddingHorizontal="@dimen/common_spacing_small"
+            android:paddingVertical="1dp"
+            android:text="@string/exception_type"
+            android:textColor="@color/common_btn_red_bg"
+            android:textSize="@dimen/common_text_size" />
+
+        <TextView
+            android:id="@+id/tv_tip"
+            style="@style/CommonTextView"
+            android:layout_marginVertical="@dimen/common_spacing_small"
+            android:text="以下物资不属于该柜子,请取出!"
+            android:textColor="@color/common_light_gray"
+            android:textSize="@dimen/common_text_size_small" />
+
+        <androidx.recyclerview.widget.RecyclerView
+            android:id="@+id/rv_exception_item"
+            style="@style/CommonRecyclerView"
+            android:layout_height="wrap_content"
+            android:orientation="horizontal" />
+    </LinearLayout>
+
+    <RelativeLayout
+        android:id="@+id/rl_cover"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:background="@drawable/item_rv_exception_cover_bg">
+
+        <ImageView
+            android:layout_width="@dimen/common_icon_size_big"
+            android:layout_height="@dimen/common_icon_size_big"
+            android:layout_alignParentRight="true"
+            android:layout_margin="@dimen/common_spacing_small"
+            android:background="@mipmap/pass" />
+    </RelativeLayout>
+</FrameLayout>

+ 20 - 0
app/src/main/res/layout/item_rv_exception_item.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/root"
+    android:layout_width="@dimen/item_rv_menu_size"
+    android:layout_height="wrap_content"
+    android:layout_marginHorizontal="@dimen/common_spacing_small"
+    android:gravity="center"
+    android:orientation="vertical">
+
+    <ImageView
+        android:id="@+id/iv_icon"
+        android:layout_width="53dp"
+        android:layout_height="53dp" />
+
+    <TextView
+        android:id="@+id/tv_rfid"
+        style="@style/CommonTextView"
+        android:layout_marginTop="@dimen/common_spacing_small"
+        android:textSize="@dimen/common_text_size_small" />
+</LinearLayout>

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


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


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

@@ -87,4 +87,8 @@
     <string name="valid_date">有效期</string>
     <string name="confirm_replacement">确定更换</string>
     <string name="reset_modification">重新填写</string>
+
+    <string name="close">关闭</string>
+    <string name="open_cabinet">开柜</string>
+    <string name="exception_type">异常类型:%s</string>
 </resources>