Ver Fonte

添加分配人员页基础

Frankensteinly há 10 meses atrás
pai
commit
e32157e722

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

@@ -45,5 +45,5 @@ class HomeActivity : BaseMvpActivity<IHomeView, HomePresenter, ActivityHomeBindi
         return HomePresenter()
     }
 
-    data class Menu(val title: String, val icon: String? = null, val fragment: BaseFragment<*>)
+    data class Menu(val title: String? = null, val icon: String? = null, val fragment: BaseFragment<*>)
 }

+ 11 - 0
app/src/main/java/com/grkj/iscs/view/fragment/JobExecutionFragment.kt

@@ -1,6 +1,8 @@
 package com.grkj.iscs.view.fragment
 
 import com.grkj.iscs.databinding.FragmentJobExecutionBinding
+import com.grkj.iscs.view.activity.HomeActivity.Menu
+import com.grkj.iscs.view.adapter.MenuAdapter
 import com.grkj.iscs.view.base.BaseMvpFragment
 import com.grkj.iscs.view.iview.IJobExecutionView
 import com.grkj.iscs.view.presenter.JobExecutionPresenter
@@ -11,11 +13,20 @@ import com.grkj.iscs.view.presenter.JobExecutionPresenter
 class JobExecutionFragment :
     BaseMvpFragment<IJobExecutionView, JobExecutionPresenter, FragmentJobExecutionBinding>() {
 
+    private lateinit var mMenuList: MutableList<Menu>
+
     override val viewBinding: FragmentJobExecutionBinding
         get() = FragmentJobExecutionBinding.inflate(layoutInflater)
 
     override fun initView() {
+        mMenuList = mutableListOf(
+            Menu(fragment = StepFragment()),
+            Menu(fragment = WorkerFragment()),
+            Menu(fragment = JobProgressFragment())
+        )
 
+        mBinding?.vp?.isUserInputEnabled = false
+        mBinding?.vp?.adapter = MenuAdapter(requireActivity().supportFragmentManager, lifecycle, mMenuList)
     }
 
     override fun initPresenter(): JobExecutionPresenter {

+ 23 - 0
app/src/main/java/com/grkj/iscs/view/fragment/WorkerFragment.kt

@@ -0,0 +1,23 @@
+package com.grkj.iscs.view.fragment
+
+import com.grkj.iscs.databinding.FragmentWorkerBinding
+import com.grkj.iscs.view.base.BaseMvpFragment
+import com.grkj.iscs.view.iview.IWorkerView
+import com.grkj.iscs.view.presenter.WorkerPresenter
+
+/**
+ * 分配人员页
+ */
+class WorkerFragment : BaseMvpFragment<IWorkerView, WorkerPresenter, FragmentWorkerBinding>() {
+
+    override val viewBinding: FragmentWorkerBinding
+        get() = FragmentWorkerBinding.inflate(layoutInflater)
+
+    override fun initView() {
+
+    }
+
+    override fun initPresenter(): WorkerPresenter {
+        return WorkerPresenter()
+    }
+}

+ 6 - 0
app/src/main/java/com/grkj/iscs/view/iview/IWorkerView.kt

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

+ 7 - 0
app/src/main/java/com/grkj/iscs/view/presenter/WorkerPresenter.kt

@@ -0,0 +1,7 @@
+package com.grkj.iscs.view.presenter
+
+import com.grkj.iscs.view.base.BasePresenter
+import com.grkj.iscs.view.iview.IWorkerView
+
+class WorkerPresenter : BasePresenter<IWorkerView>() {
+}

+ 6 - 2
app/src/main/res/layout/fragment_job_execution.xml

@@ -1,8 +1,12 @@
 <?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:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     tools:context=".view.fragment.JobExecutionFragment">
 
-</FrameLayout>
+    <androidx.viewpager2.widget.ViewPager2
+        android:id="@+id/vp"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"/>
+</RelativeLayout>

+ 111 - 0
app/src/main/res/layout/fragment_worker.xml

@@ -0,0 +1,111 @@
+<?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.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"
+        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" />
+
+    <TextView
+        android:id="@+id/tv_cancel"
+        style="@style/CommonBtn"
+        android:layout_alignParentBottom="true"
+        android:layout_toLeftOf="@id/tv_confirm"
+        android:text="@string/cancel" />
+
+    <LinearLayout
+        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">
+
+        <LinearLayout
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="1"
+            android:orientation="vertical">
+
+            <LinearLayout
+                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>
+
+            <include
+                android:id="@+id/layout_locker"
+                layout="@layout/item_rv_worker" />
+
+            <LinearLayout
+                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>
+
+            <androidx.recyclerview.widget.RecyclerView
+                android:id="@+id/rv_worker_selected"
+                style="@style/CommonRecyclerView"
+                app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
+                app:spanCount="3" />
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="3"
+            android:orientation="vertical">
+
+            <androidx.recyclerview.widget.RecyclerView
+                android:id="@+id/rv_worker_list"
+                style="@style/CommonRecyclerView"
+                app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
+                app:spanCount="10" />
+        </LinearLayout>
+    </LinearLayout>
+</RelativeLayout>

+ 7 - 22
app/src/main/res/layout/item_rv_worker.xml

@@ -3,29 +3,14 @@
     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="2" />
-
-    <ImageView
-        android:id="@+id/iv_status_prepare"
-        android:layout_width="0dp"
-        android:layout_height="wrap_content"
-        android:layout_weight="1" />
+    android:orientation="vertical">
 
     <ImageView
-        android:id="@+id/tiv_status_locked"
-        android:layout_width="0dp"
-        android:layout_height="wrap_content"
-        android:layout_weight="1" />
+        android:id="@+id/iv_photo"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content" />
 
-    <ImageView
-        android:id="@+id/iv_status_unlocked"
-        android:layout_width="0dp"
-        android:layout_height="wrap_content"
-        android:layout_weight="1" />
+    <TextView
+        android:id="@+id/tv_name"
+        style="@style/CommonTextView" />
 </LinearLayout>