Parcourir la source

1.添加获取moca试题库module

王鹏鹏 il y a 2 ans
Parent
commit
71ade835a2

+ 1 - 0
.idea/misc.xml

@@ -127,6 +127,7 @@
         <entry key="..\:/workspace/hcp-pad/moca/src/main/res/layout/fragment_designs_choice.xml" value="0.23697916666666666" />
         <entry key="..\:/workspace/hcp-pad/moca/src/main/res/layout/fragment_draw_design.xml" value="0.22239583333333332" />
         <entry key="..\:/workspace/hcp-pad/moca/src/main/res/layout/fragment_identify_picture.xml" value="0.23697916666666666" />
+        <entry key="..\:/workspace/hcp-pad/moca/src/main/res/layout/fragment_identify_result.xml" value="0.22239583333333332" />
         <entry key="..\:/workspace/hcp-pad/moca/src/main/res/layout/fragment_multiple_choice.xml" value="0.23697916666666666" />
         <entry key="..\:/workspace/hcp-pad/moca/src/main/res/layout/fragment_signature.xml" value="0.23697916666666666" />
         <entry key="..\:/workspace/hcp-pad/moca/src/main/res/layout/fragment_verify_answers.xml" value="0.22239583333333332" />

+ 7 - 2
moca/src/main/java/com/yingyangfly/moca/identify/IdentifyPictureFragment.kt

@@ -46,11 +46,16 @@ class IdentifyPictureFragment : BaseFragment<FragmentIdentifyPictureBinding>() {
             }
 
             btnNext.setOnSingleClickListener {
-                if (questionId < 44) {
+                if (questionId < 43) {
                     questionId++
                     loadData()
                 } else {
-
+                    val controller = Navigation.findNavController(it)
+                    val bundle = bundleOf("questionId" to 41)
+                    controller.navigate(
+                        R.id.action_identifyPictureFragment_to_identifyResultFragment,
+                        bundle
+                    )
                 }
             }
         }

+ 35 - 0
moca/src/main/java/com/yingyangfly/moca/identify/IdentifyResultFragment.kt

@@ -0,0 +1,35 @@
+package com.yingyangfly.moca.identify
+
+import androidx.core.os.bundleOf
+import androidx.navigation.Navigation
+import com.yingyang.moca.R
+import com.yingyang.moca.databinding.FragmentIdentifyResultBinding
+import com.yingyangfly.baselib.base.BaseFragment
+import com.yingyangfly.baselib.ext.setOnSingleClickListener
+
+/**
+ * 识图结果
+ */
+class IdentifyResultFragment : BaseFragment<FragmentIdentifyResultBinding>() {
+
+    override fun initViews() {
+
+    }
+
+    override fun initListener() {
+        binding {
+            btnPrevious.setOnSingleClickListener {
+                val controller = Navigation.findNavController(it)
+                val bundle = bundleOf("questionId" to 43)
+                controller.navigate(
+                    R.id.action_identifyResultFragment_to_identifyPictureFragment,
+                    bundle
+                )
+            }
+        }
+    }
+
+    override fun initData() {
+
+    }
+}

+ 40 - 0
moca/src/main/res/layout/fragment_identify_result.xml

@@ -0,0 +1,40 @@
+<?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">
+
+    <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>

+ 15 - 0
moca/src/main/res/navigation/nav_moca.xml

@@ -88,6 +88,21 @@
             android:id="@+id/action_identifyPictureFragment_to_verifyAnswersFragment"
             app:destination="@id/verifyAnswersFragment" />
 
+        <action
+            android:id="@+id/action_identifyPictureFragment_to_identifyResultFragment"
+            app:destination="@id/identifyResultFragment" />
+
+    </fragment>
+
+    <fragment
+        android:id="@+id/identifyResultFragment"
+        android:name="com.yingyangfly.moca.identify.IdentifyResultFragment"
+        android:label="identifyResultFragment">
+
+        <action
+            android:id="@+id/action_identifyResultFragment_to_identifyPictureFragment"
+            app:destination="@id/identifyPictureFragment" />
+
     </fragment>
 
 </navigation>