Selaa lähdekoodia

1.添加获取mmse试题库UI跳转

王鹏鹏 2 vuotta sitten
vanhempi
commit
ea7e6e3b0e

+ 1 - 0
.idea/misc.xml

@@ -102,6 +102,7 @@
         <entry key="..\:/workspace/hcp-pad/mmse/src/main/res/layout/fragment_judgment.xml" value="0.536" />
         <entry key="..\:/workspace/hcp-pad/mmse/src/main/res/layout/fragment_multiple_choice.xml" value="0.2845528455284553" />
         <entry key="..\:/workspace/hcp-pad/mmse/src/main/res/layout/fragment_number.xml" value="0.23697916666666666" />
+        <entry key="..\:/workspace/hcp-pad/mmse/src/main/res/layout/fragment_recognition_image.xml" value="0.22239583333333332" />
         <entry key="..\:/workspace/hcp-pad/mmse/src/main/res/layout/fragment_selected_item.xml" value="0.23697916666666666" />
         <entry key="..\:/workspace/hcp-pad/mmse/src/main/res/layout/fragment_single_judgment.xml" value="0.22239583333333332" />
         <entry key="..\:/workspace/hcp-pad/mmse/src/main/res/layout/fragment_sound_record.xml" value="0.4421768707482993" />

+ 31 - 8
mmse/src/main/java/com/yingyangfly/mmse/fragment/CountFragment.kt

@@ -1,8 +1,12 @@
 package com.yingyangfly.mmse.fragment
 
+import androidx.core.os.bundleOf
+import androidx.navigation.Navigation
 import androidx.recyclerview.widget.GridLayoutManager
+import com.yingyang.mmse.R
 import com.yingyang.mmse.databinding.FragmentCountBinding
 import com.yingyangfly.baselib.base.BaseFragment
+import com.yingyangfly.baselib.ext.setOnSingleClickListener
 import com.yingyangfly.mmse.adapter.NumberAdapter
 
 /**
@@ -15,13 +19,39 @@ class CountFragment : BaseFragment<FragmentCountBinding>() {
 
     override fun initViews() {
         binding {
+            numberList.clear()
+            for (i in 1..9) {
+                numberList.add(i.toString())
+            }
+            numberList.add("删除")
+            numberList.add("0")
+            numberList.add("确定")
             rvInput.layoutManager = GridLayoutManager(mContext, 3)
             rvInput.adapter = adapter
+            adapter.setData(numberList)
         }
     }
 
     override fun initListener() {
+        binding {
+            btnPrevious.setOnSingleClickListener {
+                val bundle = bundleOf("questionId" to 19)
+                val controller = Navigation.findNavController(it)
+                controller.navigate(
+                    R.id.action_countFragment_to_multipleChoiceFragment,
+                    bundle
+                )
+            }
 
+            btnNext.setOnSingleClickListener {
+                val bundle = bundleOf("questionId" to 22)
+                val controller = Navigation.findNavController(it)
+                controller.navigate(
+                    R.id.action_countFragment_to_recognitionImageFragment,
+                    bundle
+                )
+            }
+        }
     }
 
     override fun initData() {
@@ -37,13 +67,6 @@ class CountFragment : BaseFragment<FragmentCountBinding>() {
      * 加载数据
      */
     private fun loadData() {
-        numberList.clear()
-        for (i in 1..9) {
-            numberList.add(i.toString())
-        }
-        numberList.add("删除")
-        numberList.add("0")
-        numberList.add("确定")
-        adapter.setData(numberList)
+
     }
 }

+ 39 - 0
mmse/src/main/java/com/yingyangfly/mmse/fragment/RecognitionImageFragment.kt

@@ -0,0 +1,39 @@
+package com.yingyangfly.mmse.fragment
+
+import androidx.core.os.bundleOf
+import androidx.navigation.Navigation
+import com.yingyang.mmse.R
+import com.yingyang.mmse.databinding.FragmentRecognitionImageBinding
+import com.yingyangfly.baselib.base.BaseFragment
+import com.yingyangfly.baselib.ext.setOnSingleClickListener
+
+/**
+ * 识图功能
+ */
+class RecognitionImageFragment : BaseFragment<FragmentRecognitionImageBinding>() {
+    override fun initViews() {
+
+    }
+
+    override fun initListener() {
+        binding {
+            btnPrevious.setOnSingleClickListener {
+                val bundle = bundleOf("questionId" to 21)
+                val controller = Navigation.findNavController(it)
+                controller.navigate(
+                    R.id.action_recognitionImageFragment_to_countFragment,
+                    bundle
+                )
+            }
+
+            btnNext.setOnSingleClickListener {
+
+            }
+
+        }
+    }
+
+    override fun initData() {
+
+    }
+}

+ 42 - 0
mmse/src/main/res/layout/fragment_recognition_image.xml

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layout 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"
+    tools:ignore="ResourceName">
+
+    <androidx.constraintlayout.widget.ConstraintLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
+
+        <androidx.appcompat.widget.AppCompatButton
+            android:id="@+id/btnPrevious"
+            android:layout_width="@dimen/divider_240px"
+            android:layout_height="@dimen/divider_68px"
+            android:layout_marginStart="@dimen/divider_307px"
+            android:layout_marginBottom="@dimen/divider_60px"
+            android:background="@drawable/bg_previous_question"
+            android:gravity="center"
+            android:text="@string/previous_question"
+            android:textColor="@color/color_FF4A76FF"
+            android:textSize="@dimen/divider_28px"
+            android:textStyle="bold"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintStart_toStartOf="parent" />
+
+        <androidx.appcompat.widget.AppCompatButton
+            android:id="@+id/btnNext"
+            android:layout_width="@dimen/divider_240px"
+            android:layout_height="@dimen/divider_68px"
+            android:layout_marginEnd="@dimen/divider_305px"
+            android:layout_marginBottom="@dimen/divider_60px"
+            android:background="@drawable/bg_next_question"
+            android:gravity="center"
+            android:text="@string/continues"
+            android:textColor="@android:color/white"
+            android:textSize="@dimen/divider_28px"
+            android:textStyle="bold"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintEnd_toEndOf="parent" />
+    </androidx.constraintlayout.widget.ConstraintLayout>
+
+</layout>

+ 12 - 0
mmse/src/main/res/navigation/nav_home.xml

@@ -95,6 +95,18 @@
         <action
             android:id="@+id/action_countFragment_to_multipleChoiceFragment"
             app:destination="@id/multipleChoiceFragment" />
+
+        <action
+            android:id="@+id/action_countFragment_to_recognitionImageFragment"
+            app:destination="@id/recognitionImageFragment" />
     </fragment>
 
+    <fragment
+        android:id="@+id/recognitionImageFragment"
+        android:name="com.yingyangfly.mmse.fragment.RecognitionImageFragment"
+        android:label="recognitionImageFragment">
+        <action
+            android:id="@+id/action_recognitionImageFragment_to_countFragment"
+            app:destination="@id/countFragment" />
+    </fragment>
 </navigation>