Forráskód Böngészése

根据高保真调整工作进度页

Frankensteinly 9 hónapja
szülő
commit
9872272806

+ 1 - 1
app/src/main/java/com/grkj/iscs/view/activity/test/WidgetTestActivity.kt

@@ -33,7 +33,7 @@ class WidgetTestActivity : BaseActivity<ActivityWidgetTestBinding>() {
         mBinding?.rvSnake?.layoutManager = SnakeGridLayoutManager(this, 5)
         mBinding?.rvSnake?.adapter = object : CommonAdapter<String>(this, R.layout.item_rv_menu, list) {
             override fun convert(holder: ViewHolder, t: String?, position: Int) {
-                holder.setText(R.id.tv_number, t)
+//                holder.setText(R.id.tv_number, t)
             }
         }
     }

+ 18 - 0
app/src/main/java/com/grkj/iscs/view/fragment/JobProgressFragment.kt

@@ -1,9 +1,12 @@
 package com.grkj.iscs.view.fragment
 
+import com.grkj.iscs.R
 import com.grkj.iscs.databinding.FragmentJobProgressBinding
 import com.grkj.iscs.view.base.BaseMvpFragment
 import com.grkj.iscs.view.iview.IJobProgressVIew
 import com.grkj.iscs.view.presenter.JobProgressPresenter
+import com.zhy.adapter.recyclerview.CommonAdapter
+import com.zhy.adapter.recyclerview.base.ViewHolder
 
 /**
  * 作业票工作进度页
@@ -14,7 +17,22 @@ class JobProgressFragment : BaseMvpFragment<IJobProgressVIew, JobProgressPresent
         get() = FragmentJobProgressBinding.inflate(layoutInflater)
 
     override fun initView() {
+        // TODO 测试数据
+        val list = mutableListOf<String>()
+        for (i in 0..10) {
+            list.add("$i")
+        }
+        mBinding?.rvPoint?.adapter = object : CommonAdapter<String>(requireActivity(), R.layout.item_rv_point, list) {
+            override fun convert(holder: ViewHolder, t: String, position: Int) {
 
+            }
+        }
+
+        mBinding?.rvColocker?.adapter = object : CommonAdapter<String>(requireActivity(), R.layout.item_rv_worker_status, list) {
+            override fun convert(holder: ViewHolder, t: String, position: Int) {
+
+            }
+        }
     }
 
     override fun initPresenter(): JobProgressPresenter {

+ 1 - 1
app/src/main/java/com/grkj/iscs/view/fragment/StepFragment.kt

@@ -57,7 +57,7 @@ class StepFragment(val goBack: () -> Unit, val changePage: (Int) -> Unit) : Base
         }
 
         mBinding?.llDetail?.setOnClickListener {
-            changePage(1)
+            changePage(2)
         }
     }
 

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

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

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

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:drawable="@drawable/lock_status_bg_normal" android:state_selected="false" />
+    <item android:drawable="@drawable/lock_status_bg_selected" android:state_selected="true" />
+</selector>

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

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:drawable="@mipmap/ticket_lock" android:state_selected="false" />
+    <item android:drawable="@mipmap/ticket_unlocked" android:state_selected="true" />
+</selector>

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

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:drawable="@mipmap/not_ok" android:state_selected="false" />
+    <item android:drawable="@mipmap/ok" android:state_selected="true" />
+</selector>

+ 144 - 43
app/src/main/res/layout/fragment_job_progress.xml

@@ -1,59 +1,160 @@
 <?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.JobProgressFragment">
 
-    <TextView
-        android:id="@+id/tv_title"
-        style="@style/CommonTextView" />
-
-    <TextView
-        android:id="@+id/tv_worker"
-        style="@style/CommonTextView"
-        android:layout_alignParentRight="true" />
-
-    <ImageView
-        android:id="@+id/iv_worker"
+    <com.grkj.iscs.view.widget.CommonBtn
+        android:id="@+id/cb_back"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_toLeftOf="@id/tv_worker" />
-
-    <TextView
-        android:id="@+id/tv_lock"
-        style="@style/CommonTextView"
-        android:layout_toLeftOf="@id/iv_worker" />
+        android:layout_alignParentRight="true"
+        android:layout_alignParentBottom="true"
+        app:btn_bg="@drawable/common_btn_blue_bg"
+        app:btn_icon="@mipmap/go_back"
+        app:btn_name="@string/back" />
 
-    <ImageView
+    <com.grkj.iscs.view.widget.CommonBtn
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_toLeftOf="@id/tv_lock" />
-
-    <TextView
-        android:id="@+id/tv_back"
-        style="@style/CommonBtn"
-        android:layout_alignParentRight="true"
         android:layout_alignParentBottom="true"
-        android:text="@string/back" />
+        android:layout_marginRight="@dimen/common_spacing"
+        android:layout_toLeftOf="@id/cb_back"
+        app:btn_bg="@drawable/common_btn_red_bg"
+        app:btn_icon="@mipmap/stop"
+        app:btn_name="@string/go_unlocking" />
 
-    <LinearLayout
+    <RelativeLayout
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_above="@id/tv_back"
-        android:layout_below="@id/tv_title"
-        android:orientation="horizontal">
-
-        <androidx.recyclerview.widget.RecyclerView
-            android:id="@+id/rv_point"
-            style="@style/CommonRecyclerView"
-            android:layout_width="0dp"
-            android:layout_weight="1" />
-
-        <androidx.recyclerview.widget.RecyclerView
-            android:id="@+id/rv_worker"
-            style="@style/CommonRecyclerView"
-            android:layout_width="0dp"
-            android:layout_weight="1" />
-    </LinearLayout>
+        android:layout_height="match_parent"
+        android:layout_above="@id/cb_back"
+        android:layout_marginBottom="@dimen/common_spacing"
+        android:background="@drawable/item_rv_technology_sop_bg_normal"
+        android:padding="@dimen/common_spacing">
+
+        <TextView
+            android:id="@+id/tv_title"
+            style="@style/CommonTextView" />
+
+        <LinearLayout
+            android:id="@+id/ll_detail"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_alignParentRight="true"
+            android:orientation="horizontal">
+
+            <ImageView
+                android:id="@+id/iv_worker"
+                android:layout_width="@dimen/common_icon_size_small"
+                android:layout_height="@dimen/common_icon_size_small"
+                android:src="@mipmap/ticket_worker" />
+
+            <TextView
+                android:id="@+id/tv_worker"
+                style="@style/CommonTextView" />
+
+            <ImageView
+                android:id="@+id/iv_lock"
+                android:layout_width="@dimen/common_icon_size_small"
+                android:layout_height="@dimen/common_icon_size_small"
+                android:src="@mipmap/ticket_lock" />
+
+            <TextView
+                android:id="@+id/tv_lock"
+                style="@style/CommonTextView" />
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:layout_below="@id/tv_title"
+            android:orientation="horizontal">
+
+            <LinearLayout
+                android:layout_width="0dp"
+                android:layout_height="match_parent"
+                android:layout_marginRight="@dimen/common_spacing"
+                android:layout_weight="1"
+                android:background="@drawable/item_rv_technology_sop_bg_normal"
+                android:clipToOutline="true"
+                android:orientation="vertical">
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:background="#7b88af"
+                    android:orientation="horizontal">
+
+                    <TextView
+                        style="@style/CommonTextView"
+                        android:layout_weight="1"
+                        android:paddingVertical="@dimen/common_spacing_small"
+                        android:text="@string/isolation_point" />
+
+                    <TextView
+                        style="@style/CommonTextView"
+                        android:layout_weight="1"
+                        android:text="@string/effect" />
+
+                    <TextView
+                        style="@style/CommonTextView"
+                        android:layout_weight="1"
+                        android:text="@string/switch_status" />
+
+                    <TextView
+                        style="@style/CommonTextView"
+                        android:layout_weight="1"
+                        android:text="@string/lock_status" />
+                </LinearLayout>
+
+                <androidx.recyclerview.widget.RecyclerView
+                    android:id="@+id/rv_point"
+                    style="@style/CommonRecyclerView" />
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_width="0dp"
+                android:layout_height="match_parent"
+                android:layout_marginLeft="@dimen/common_spacing"
+                android:layout_weight="1"
+                android:background="@drawable/item_rv_technology_sop_bg_normal"
+                android:clipToOutline="true"
+                android:orientation="vertical">
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:background="#7b88af"
+                    android:orientation="horizontal">
+
+                    <TextView
+                        style="@style/CommonTextView"
+                        android:layout_weight="1"
+                        android:paddingVertical="@dimen/common_spacing_small"
+                        android:text="@string/colocker" />
+
+                    <TextView
+                        style="@style/CommonTextView"
+                        android:layout_weight="1"
+                        android:text="@string/ready_to_colock" />
+
+                    <TextView
+                        style="@style/CommonTextView"
+                        android:layout_weight="1"
+                        android:text="@string/colocked" />
+
+                    <TextView
+                        style="@style/CommonTextView"
+                        android:layout_weight="1"
+                        android:text="@string/unlocked" />
+                </LinearLayout>
+
+                <androidx.recyclerview.widget.RecyclerView
+                    android:id="@+id/rv_colocker"
+                    style="@style/CommonRecyclerView" />
+            </LinearLayout>
+        </LinearLayout>
+    </RelativeLayout>
 </RelativeLayout>

+ 70 - 23
app/src/main/res/layout/item_rv_point.xml

@@ -3,29 +3,76 @@
     android:id="@+id/root"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    android:orientation="horizontal">
-
-    <TextView
-        android:id="@+id/tv_name"
-        style="@style/CommonTextView"
-        android:layout_width="0dp"
-        android:layout_weight="1" />
-
-    <TextView
-        android:id="@+id/tv_function"
-        style="@style/CommonTextView"
-        android:layout_width="0dp"
-        android:layout_weight="1" />
-
-    <ImageView
-        android:id="@+id/iv_status"
-        android:layout_width="0dp"
-        android:layout_height="wrap_content"
-        android:layout_weight="1" />
+    android:orientation="vertical">
 
-    <TextView
-        android:id="@+id/tv_lock_status"
-        android:layout_width="0dp"
+    <LinearLayout
+        android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_weight="1" />
+        android:orientation="horizontal">
+
+        <TextView
+            android:id="@+id/tv_name"
+            style="@style/CommonTextView"
+            android:layout_weight="1" />
+
+        <View
+            android:layout_width="@dimen/divider_line_width"
+            android:layout_height="match_parent"
+            android:layout_marginVertical="@dimen/common_spacing_small"
+            android:background="@color/common_bg_white_30" />
+
+        <TextView
+            android:id="@+id/tv_function"
+            style="@style/CommonTextView"
+            android:layout_weight="1" />
+
+        <View
+            android:layout_width="@dimen/divider_line_width"
+            android:layout_height="match_parent"
+            android:layout_marginVertical="@dimen/common_spacing_small"
+            android:background="@color/common_bg_white_30" />
+
+        <ImageView
+            android:id="@+id/iv_status"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="1" />
+
+        <View
+            android:layout_width="@dimen/divider_line_width"
+            android:layout_height="match_parent"
+            android:layout_marginVertical="@dimen/common_spacing_small"
+            android:background="@color/common_bg_white_30" />
+
+        <RelativeLayout
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:paddingHorizontal="@dimen/common_spacing"
+            android:paddingVertical="@dimen/common_spacing_small">
+
+            <LinearLayout
+                android:id="@+id/ll_lock_status"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:background="@drawable/lock_status_bg_selector"
+                android:orientation="horizontal">
+
+                <ImageView
+                    android:layout_width="@dimen/common_icon_size_small"
+                    android:layout_height="@dimen/common_icon_size_small"
+                    android:src="@drawable/lock_status_icon_selector" />
+
+                <TextView
+                    android:id="@+id/tv_lock_status"
+                    style="@style/CommonTextView"
+                    android:textSize="@dimen/common_text_size_small" />
+            </LinearLayout>
+        </RelativeLayout>
+    </LinearLayout>
+
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="@dimen/divider_line_width"
+        android:background="@color/common_bg_white_30" />
 </LinearLayout>

+ 96 - 0
app/src/main/res/layout/item_rv_worker_status.xml

@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/root"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:orientation="vertical">
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginVertical="@dimen/common_spacing_small"
+        android:orientation="horizontal">
+
+        <RelativeLayout
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="1">
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:gravity="center_vertical"
+                android:orientation="horizontal">
+
+                <ImageView
+                    android:layout_width="@dimen/common_icon_size"
+                    android:layout_height="@dimen/common_icon_size"
+                    android:src="@mipmap/worker_selected" />
+
+                <TextView
+                    android:id="@+id/tv_name"
+                    style="@style/CommonTextView"
+                    android:textSize="@dimen/common_text_size_small" />
+            </LinearLayout>
+        </RelativeLayout>
+
+        <View
+            android:layout_width="@dimen/divider_line_width"
+            android:layout_height="match_parent"
+            android:layout_marginVertical="@dimen/common_spacing_small"
+            android:background="@color/common_bg_white_30" />
+
+        <RelativeLayout
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="1">
+
+            <ImageView
+                android:layout_width="@dimen/common_icon_size"
+                android:layout_height="@dimen/common_icon_size"
+                android:layout_centerInParent="true"
+                android:src="@drawable/worker_status_bg_selector" />
+        </RelativeLayout>
+
+        <View
+            android:layout_width="@dimen/divider_line_width"
+            android:layout_height="match_parent"
+            android:layout_marginVertical="@dimen/common_spacing_small"
+            android:background="@color/common_bg_white_30" />
+
+        <RelativeLayout
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="1">
+
+            <ImageView
+                android:layout_width="@dimen/common_icon_size"
+                android:layout_height="@dimen/common_icon_size"
+                android:layout_centerInParent="true"
+                android:src="@drawable/worker_status_bg_selector" />
+        </RelativeLayout>
+
+        <View
+            android:layout_width="@dimen/divider_line_width"
+            android:layout_height="match_parent"
+            android:layout_marginVertical="@dimen/common_spacing_small"
+            android:background="@color/common_bg_white_30" />
+
+        <RelativeLayout
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="1">
+
+            <ImageView
+                android:layout_width="@dimen/common_icon_size"
+                android:layout_height="@dimen/common_icon_size"
+                android:layout_centerInParent="true"
+                android:src="@drawable/worker_status_bg_selector" />
+        </RelativeLayout>
+    </LinearLayout>
+
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="@dimen/divider_line_width"
+        android:background="@color/common_bg_white_30" />
+</LinearLayout>

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


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


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


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


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


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

@@ -27,4 +27,6 @@
     <color name="dialog_card_login_bg">#990E57EA</color>
     <color name="home_menu_bg">#4D2B7AE9</color>
     <color name="common_btn_red_bg">#80FF0000</color>
+    <color name="lock_status_unlocked">#99008000</color>
+    <color name="lock_status_locked">#CCFF0000</color>
 </resources>

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

@@ -9,6 +9,7 @@
     <dimen name="common_radius_small">5dp</dimen>
     <dimen name="common_spacing">10dp</dimen>
     <dimen name="common_spacing_small">5dp</dimen>
+    <dimen name="common_icon_size">15dp</dimen>
     <dimen name="common_icon_size_small">12dp</dimen>
 
     <dimen name="common_btn_width">150dp</dimen>

+ 9 - 1
app/src/main/res/values/strings.xml

@@ -53,7 +53,6 @@
     <string name="ready_to_lock">待上锁</string>
     <string name="on_process">进行中</string>
     <string name="ready_to_unlock">待解锁</string>
-    <string name="unlocked">已解锁</string>
     <string name="finished">已结束</string>
     <string name="key_return_confirm_tip">工作票尚未完成,是否确认归还钥匙?</string>
     <string name="cancel">取消</string>
@@ -146,4 +145,13 @@
     <string name="select_locker">选择上锁人</string>
     <string name="select_coloker_mars">选择共锁人(玛氏)</string>
     <string name="select_coloker_outside">选择共锁人(外部)</string>
+    <string name="isolation_point">隔离点</string>
+    <string name="effect">作用</string>
+    <string name="switch_status">开关状态</string>
+    <string name="lock_status">上锁状态</string>
+    <string name="ready_to_colock">待共锁</string>
+    <string name="colocked">已共锁</string>
+    <string name="unlocked">已解锁</string>
+    <string name="locked">未解锁</string>
+    <string name="go_unlocking">去解锁</string>
 </resources>