瀏覽代碼

调整分配人员页效果

Frankensteinly 10 月之前
父節點
當前提交
75fbd921c2

+ 10 - 2
app/src/main/java/com/grkj/iscs/view/fragment/JobExecutionFragment.kt

@@ -20,8 +20,12 @@ class JobExecutionFragment :
 
     override fun initView() {
         mMenuList = mutableListOf(
-            Menu(fragment = StepFragment { refreshPage() }),
-            Menu(fragment = WorkerFragment()),
+            Menu(fragment = StepFragment({ refreshPage() }) {
+                changePage(it)
+            }),
+            Menu(fragment = WorkerFragment({ refreshPage() }) {
+                changePage(it)
+            }),
             Menu(fragment = JobProgressFragment())
         )
 
@@ -36,4 +40,8 @@ class JobExecutionFragment :
     fun refreshPage() {
         mBinding?.vp?.currentItem = 0
     }
+
+    private fun changePage(pageIndex: Int) {
+        mBinding?.vp?.currentItem = pageIndex
+    }
 }

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

@@ -12,7 +12,7 @@ import com.zhy.adapter.recyclerview.base.ViewHolder
 /**
  * 作业票执行步骤页 - 八大步骤
  */
-class StepFragment(val goBack: () -> Unit) : BaseMvpFragment<IStepView, StepPresenter, FragmentStepBinding>() {
+class StepFragment(val goBack: () -> Unit, val changePage: (Int) -> Unit) : BaseMvpFragment<IStepView, StepPresenter, FragmentStepBinding>() {
 
     private lateinit var mStepList: MutableList<StepBO>
 
@@ -55,6 +55,10 @@ class StepFragment(val goBack: () -> Unit) : BaseMvpFragment<IStepView, StepPres
         mBinding?.cbCancel?.setOnClickListener {
 
         }
+
+        mBinding?.llDetail?.setOnClickListener {
+            changePage(1)
+        }
     }
 
     fun refreshPage() {

+ 4 - 2
app/src/main/java/com/grkj/iscs/view/fragment/WorkerFragment.kt

@@ -8,13 +8,15 @@ import com.grkj.iscs.view.presenter.WorkerPresenter
 /**
  * 分配人员页
  */
-class WorkerFragment : BaseMvpFragment<IWorkerView, WorkerPresenter, FragmentWorkerBinding>() {
+class WorkerFragment(val goBack: () -> Unit, val changePage: (Int) -> Unit) : BaseMvpFragment<IWorkerView, WorkerPresenter, FragmentWorkerBinding>() {
 
     override val viewBinding: FragmentWorkerBinding
         get() = FragmentWorkerBinding.inflate(layoutInflater)
 
     override fun initView() {
-
+        mBinding?.cbBack?.setOnClickListener {
+            goBack()
+        }
     }
 
     override fun initPresenter(): WorkerPresenter {

+ 5 - 0
app/src/main/res/drawable/item_rv_worker_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:state_selected="false" android:drawable="@mipmap/ticket_worker" />
+    <item android:state_selected="true" android:drawable="@mipmap/worker_selected" />
+</selector>

+ 10 - 0
app/src/main/res/drawable/select_btn_bg.xml

@@ -0,0 +1,10 @@
+<?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" />
+    <gradient
+        android:angle="90"
+        android:endColor="#005eb3"
+        android:startColor="#5374ac"
+        android:type="linear" />
+</shape>

+ 27 - 26
app/src/main/res/layout/fragment_step.xml

@@ -41,33 +41,34 @@
             app:layout_constraintLeft_toLeftOf="parent"
             app:layout_constraintTop_toTopOf="parent" />
 
-        <TextView
-            android:id="@+id/tv_lock"
-            style="@style/CommonTextView"
+        <LinearLayout
+            android:id="@+id/ll_detail"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:orientation="horizontal"
             app:layout_constraintRight_toRightOf="parent"
-            app:layout_constraintTop_toTopOf="parent" />
-
-        <ImageView
-            android:id="@+id/iv_lock"
-            android:layout_width="12dp"
-            android:layout_height="12dp"
-            android:src="@mipmap/ticket_lock"
-            app:layout_constraintRight_toLeftOf="@id/tv_lock"
-            app:layout_constraintTop_toTopOf="parent" />
-
-        <TextView
-            android:id="@+id/tv_worker"
-            style="@style/CommonTextView"
-            app:layout_constraintRight_toLeftOf="@id/iv_lock"
-            app:layout_constraintTop_toTopOf="parent" />
-
-        <ImageView
-            android:id="@+id/iv_worker"
-            android:layout_width="12dp"
-            android:layout_height="12dp"
-            android:src="@mipmap/ticket_worker"
-            app:layout_constraintRight_toLeftOf="@id/tv_worker"
-            app:layout_constraintTop_toTopOf="parent" />
+            app:layout_constraintTop_toTopOf="parent">
+
+            <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:id="@+id/ll_container"

+ 159 - 66
app/src/main/res/layout/fragment_worker.xml

@@ -6,87 +6,174 @@
     android:layout_height="match_parent"
     tools:context=".view.fragment.WorkerFragment">
 
-    <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" />
-
-    <ImageView
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_toLeftOf="@id/tv_lock" />
-
-    <TextView
-        android:id="@+id/tv_confirm"
-        style="@style/CommonBtn"
         android:layout_alignParentRight="true"
         android:layout_alignParentBottom="true"
-        android:text="@string/confirm" />
+        app:btn_bg="@drawable/common_btn_blue_bg"
+        app:btn_icon="@mipmap/go_back"
+        app:btn_name="@string/back" />
 
-    <TextView
-        android:id="@+id/tv_cancel"
-        style="@style/CommonBtn"
+    <com.grkj.iscs.view.widget.CommonBtn
+        android:id="@+id/cb_cancel"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
         android:layout_alignParentBottom="true"
-        android:layout_toLeftOf="@id/tv_confirm"
-        android:text="@string/cancel" />
+        android:layout_marginRight="@dimen/common_padding"
+        android:layout_toLeftOf="@id/cb_back"
+        app:btn_bg="@drawable/common_btn_red_bg"
+        app:btn_icon="@mipmap/stop"
+        app:btn_name="@string/cancel_the_job" />
 
-    <LinearLayout
+    <androidx.constraintlayout.widget.ConstraintLayout
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:layout_above="@id/tv_cancel"
-        android:layout_below="@id/tv_title"
-        android:orientation="horizontal">
+        android:layout_above="@id/cb_cancel"
+        android:background="@drawable/item_rv_technology_sop_bg_normal"
+        android:orientation="horizontal"
+        android:padding="@dimen/common_padding">
+
+        <TextView
+            android:id="@+id/tv_title"
+            style="@style/CommonTextView"
+            app:layout_constraintLeft_toLeftOf="parent"
+            app:layout_constraintTop_toTopOf="parent" />
 
         <LinearLayout
-            android:layout_width="0dp"
-            android:layout_height="match_parent"
-            android:layout_weight="1"
-            android:orientation="vertical">
+            android:id="@+id/ll_detail"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:orientation="horizontal"
+            app:layout_constraintRight_toRightOf="parent"
+            app:layout_constraintTop_toTopOf="parent">
+
+            <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
+        <LinearLayout
+            android:id="@+id/ll_selected"
+            android:layout_width="0dp"
+            android:layout_height="0dp"
+            android:layout_marginRight="@dimen/common_padding"
+            android:background="@drawable/item_rv_technology_sop_bg_normal"
+            android:gravity="center_horizontal"
+            android:orientation="vertical"
+            android:padding="5dp"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintHorizontal_weight="300"
+            app:layout_constraintLeft_toLeftOf="parent"
+            app:layout_constraintRight_toLeftOf="@id/ll_list"
+            app:layout_constraintTop_toBottomOf="@id/tv_title">
+
+            <!--     上锁人       -->
+            <com.google.android.material.card.MaterialCardView
                 android:layout_width="match_parent"
-                android:layout_height="0dp"
-                android:layout_weight="1"
-                android:orientation="horizontal">
-
-                <TextView style="@style/CommonTextView" />
-
-                <TextView
-                    android:id="@+id/tv_select_locker"
-                    style="@style/CommonBtn" />
-            </LinearLayout>
+                android:layout_height="wrap_content"
+                android:layout_marginBottom="@dimen/common_padding"
+                app:cardBackgroundColor="@color/common_bg_white_10"
+                app:cardCornerRadius="@dimen/common_radius"
+                app:cardElevation="0dp"
+                app:strokeColor="@color/common_transparent">
+
+                <androidx.constraintlayout.widget.ConstraintLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="horizontal"
+                    android:padding="2dp">
+
+                    <TextView
+                        android:id="@+id/tv_locker"
+                        style="@style/CommonTextView"
+                        android:paddingHorizontal="5dp"
+                        android:paddingVertical="3dp"
+                        android:text="@string/locker"
+                        android:textSize="@dimen/common_text_size_small"
+                        app:layout_constraintBottom_toBottomOf="parent"
+                        app:layout_constraintLeft_toLeftOf="parent"
+                        app:layout_constraintRight_toLeftOf="@id/tv_locker_select"
+                        app:layout_constraintTop_toTopOf="parent" />
+
+                    <TextView
+                        android:id="@+id/tv_locker_select"
+                        style="@style/CommonTextView"
+                        android:background="@drawable/select_btn_bg"
+                        android:paddingHorizontal="@dimen/common_padding"
+                        android:paddingVertical="3dp"
+                        android:text="@string/select"
+                        android:textSize="@dimen/common_text_size_small"
+                        app:layout_constraintBottom_toBottomOf="parent"
+                        app:layout_constraintLeft_toRightOf="@id/tv_locker"
+                        app:layout_constraintRight_toRightOf="parent"
+                        app:layout_constraintTop_toTopOf="parent" />
+                </androidx.constraintlayout.widget.ConstraintLayout>
+            </com.google.android.material.card.MaterialCardView>
 
             <include
                 android:id="@+id/layout_locker"
                 layout="@layout/item_rv_worker" />
 
-            <LinearLayout
+            <!--     共锁人       -->
+            <com.google.android.material.card.MaterialCardView
                 android:layout_width="match_parent"
-                android:layout_height="0dp"
-                android:layout_weight="1"
-                android:orientation="horizontal">
-
-                <TextView style="@style/CommonTextView" />
-
-                <TextView
-                    android:id="@+id/tv_select_colocker"
-                    style="@style/CommonBtn" />
-            </LinearLayout>
+                android:layout_height="wrap_content"
+                android:layout_marginTop="@dimen/common_padding"
+                app:cardBackgroundColor="@color/common_bg_white_10"
+                app:cardCornerRadius="@dimen/common_radius"
+                app:cardElevation="0dp"
+                app:strokeColor="@color/common_transparent">
+
+                <androidx.constraintlayout.widget.ConstraintLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="horizontal"
+                    android:padding="2dp">
+
+                    <TextView
+                        android:id="@+id/tv_colocker"
+                        style="@style/CommonTextView"
+                        android:paddingHorizontal="5dp"
+                        android:paddingVertical="3dp"
+                        android:text="@string/colocker"
+                        android:textSize="@dimen/common_text_size_small"
+                        app:layout_constraintBottom_toBottomOf="parent"
+                        app:layout_constraintLeft_toLeftOf="parent"
+                        app:layout_constraintRight_toLeftOf="@id/tv_colocker_select"
+                        app:layout_constraintTop_toTopOf="parent" />
+
+                    <TextView
+                        android:id="@+id/tv_colocker_select"
+                        style="@style/CommonTextView"
+                        android:background="@drawable/select_btn_bg"
+                        android:paddingHorizontal="@dimen/common_padding"
+                        android:paddingVertical="3dp"
+                        android:text="@string/select"
+                        android:textSize="@dimen/common_text_size_small"
+                        app:layout_constraintBottom_toBottomOf="parent"
+                        app:layout_constraintLeft_toRightOf="@id/tv_colocker"
+                        app:layout_constraintRight_toRightOf="parent"
+                        app:layout_constraintTop_toTopOf="parent" />
+                </androidx.constraintlayout.widget.ConstraintLayout>
+            </com.google.android.material.card.MaterialCardView>
 
             <androidx.recyclerview.widget.RecyclerView
                 android:id="@+id/rv_worker_selected"
@@ -96,10 +183,16 @@
         </LinearLayout>
 
         <LinearLayout
+            android:id="@+id/ll_list"
             android:layout_width="0dp"
-            android:layout_height="match_parent"
-            android:layout_weight="3"
-            android:orientation="vertical">
+            android:layout_height="0dp"
+            android:background="@drawable/item_rv_technology_sop_bg_normal"
+            android:orientation="vertical"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintHorizontal_weight="1150"
+            app:layout_constraintLeft_toRightOf="@id/ll_selected"
+            app:layout_constraintRight_toRightOf="parent"
+            app:layout_constraintTop_toTopOf="@id/ll_selected">
 
             <androidx.recyclerview.widget.RecyclerView
                 android:id="@+id/rv_worker_list"
@@ -107,5 +200,5 @@
                 app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
                 app:spanCount="10" />
         </LinearLayout>
-    </LinearLayout>
+    </androidx.constraintlayout.widget.ConstraintLayout>
 </RelativeLayout>

+ 10 - 5
app/src/main/res/layout/item_rv_worker.xml

@@ -1,16 +1,21 @@
 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/root"
-    android:layout_width="wrap_content"
-    android:layout_height="wrap_content"
+    android:layout_width="30dp"
+    android:layout_height="31dp"
+    android:background="@drawable/item_rv_technology_sop_bg_normal"
+    android:gravity="center"
     android:orientation="vertical">
 
     <ImageView
         android:id="@+id/iv_photo"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" />
+        android:layout_width="@dimen/common_icon_size_small"
+        android:layout_height="@dimen/common_icon_size_small"
+        android:background="@drawable/item_rv_worker_bg_selector" />
 
     <TextView
         android:id="@+id/tv_name"
-        style="@style/CommonTextView" />
+        style="@style/CommonTextView"
+        android:layout_marginTop="3dp"
+        android:textSize="@dimen/common_text_size_small"/>
 </LinearLayout>

二進制
app/src/main/res/mipmap/worker_selected.png


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

@@ -8,6 +8,8 @@
     <dimen name="common_radius">10dp</dimen>
     <dimen name="common_radius_small">5dp</dimen>
     <dimen name="common_padding">10dp</dimen>
+    <dimen name="common_padding_small">5dp</dimen>
+    <dimen name="common_icon_size_small">12dp</dimen>
 
     <dimen name="common_btn_width">150dp</dimen>
     <dimen name="common_btn_height">50dp</dimen>

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

@@ -140,4 +140,7 @@
     <string name="current_sop">当前SOP:%s</string>
     <string name="machinery_pic">工艺图</string>
     <string name="lock_station">锁定站</string>
+    <string name="locker">上锁人</string>
+    <string name="colocker">共锁人</string>
+    <string name="select">选择</string>
 </resources>