Browse Source

1.修改MOCA测评bug

王鹏鹏 2 years ago
parent
commit
89b540adec

+ 2 - 0
.idea/misc.xml

@@ -600,6 +600,7 @@
         <entry key="..\:/workspace/hcp-pads/mmse/src/main/res/layout/item_choice.xml" value="0.536" />
         <entry key="..\:/workspace/hcp-pads/mmse/src/main/res/layout/item_number.xml" value="1.2" />
         <entry key="..\:/workspace/hcp-pads/moca/src/main/res/drawable/selector_text_choice.xml" value="0.151" />
+        <entry key="..\:/workspace/hcp-pads/moca/src/main/res/layout/activity_moca.xml" value="0.23697916666666666" />
         <entry key="..\:/workspace/hcp-pads/moca/src/main/res/layout/fragment_alternating_connection.xml" value="0.49146341463414633" />
         <entry key="..\:/workspace/hcp-pads/moca/src/main/res/layout/fragment_identify_picture.xml" value="0.4" />
         <entry key="..\:/workspace/hcp-pads/moca/src/main/res/layout/fragment_listen_record.xml" value="0.23697916666666666" />
@@ -709,6 +710,7 @@
         <entry key="..\:/workspace/hcp-pads/workbenches/src/main/res/drawable/selector_train_report_tab_right.xml" value="0.151" />
         <entry key="..\:/workspace/hcp-pads/workbenches/src/main/res/layout/activity_free_train.xml" value="0.23697916666666666" />
         <entry key="..\:/workspace/hcp-pads/workbenches/src/main/res/layout/activity_leisure_brain.xml" value="0.23697916666666666" />
+        <entry key="..\:/workspace/hcp-pads/workbenches/src/main/res/layout/activity_order_list.xml" value="0.23697916666666666" />
         <entry key="..\:/workspace/hcp-pads/workbenches/src/main/res/layout/activity_service_package.xml" value="0.3953084274543875" />
         <entry key="..\:/workspace/hcp-pads/workbenches/src/main/res/layout/activity_train_content_details.xml" value="0.536" />
         <entry key="..\:/workspace/hcp-pads/workbenches/src/main/res/layout/activity_train_data.xml" value="0.23697916666666666" />

+ 50 - 51
moca/src/main/java/com/yingyangfly/moca/alternatingconnection/AlternatingConnectionFragment.kt

@@ -48,15 +48,15 @@ class AlternatingConnectionFragment : BaseFragment<FragmentAlternatingConnection
             tvFirstes.setOnCheckedChangeListener { _, isChecked ->
                 if (isChecked) {
                     stringBuffer.append("甲")
-                    tvFirst.isEnabled = false
+                    tvFirstes.isEnabled = false
                     if (firstChecked) {
                         firstChecked = false
-                        endx = tvFirst.left + tvFirst.width / 2
-                        endy = tvFirst.top + tvFirst.height / 2
+                        endx = tvFirstes.left + tvFirstes.width / 2
+                        endy = tvFirstes.top + tvFirstes.height / 2
                     } else {
                         val myLine = MyLine()
-                        val x = tvFirst.left + tvFirst.width / 2
-                        val y = tvFirst.top + tvFirst.height / 2
+                        val x = tvFirstes.left + tvFirstes.width / 2
+                        val y = tvFirstes.top + tvFirstes.height / 2
                         myLine.startx = x
                         myLine.starty = y
                         myLine.endx = endx
@@ -72,15 +72,15 @@ class AlternatingConnectionFragment : BaseFragment<FragmentAlternatingConnection
             tvOnees.setOnCheckedChangeListener { _, isChecked ->
                 if (isChecked) {
                     stringBuffer.append("1")
-                    tvOne.isEnabled = false
+                    tvOnees.isEnabled = false
                     if (firstChecked) {
                         firstChecked = false
-                        endx = tvOne.left + tvOne.width / 2
-                        endy = tvOne.top + tvOne.height / 2
+                        endx = tvOnees.left + tvOnees.width / 2
+                        endy = tvOnees.top + tvOnees.height / 2
                     } else {
                         val myLine = MyLine()
-                        val x = tvOne.left + tvOne.width / 2
-                        val y = tvOne.top + tvOne.height / 2
+                        val x = tvOnees.left + tvOnees.width / 2
+                        val y = tvOnees.top + tvOnees.height / 2
                         myLine.startx = x
                         myLine.starty = y
                         myLine.endx = endx
@@ -96,15 +96,15 @@ class AlternatingConnectionFragment : BaseFragment<FragmentAlternatingConnection
             tvSecondses.setOnCheckedChangeListener { _, isChecked ->
                 if (isChecked) {
                     stringBuffer.append("乙")
-                    tvSeconds.isEnabled = false
+                    tvSecondses.isEnabled = false
                     if (firstChecked) {
                         firstChecked = false
-                        endx = tvSeconds.left + tvSeconds.width / 2
-                        endy = tvSeconds.top + tvSeconds.height / 2
+                        endx = tvSecondses.left + tvSecondses.width / 2
+                        endy = tvSecondses.top + tvSecondses.height / 2
                     } else {
                         val myLine = MyLine()
-                        val x = tvSeconds.left + tvSeconds.width / 2
-                        val y = tvSeconds.top + tvSeconds.height / 2
+                        val x = tvSecondses.left + tvSecondses.width / 2
+                        val y = tvSecondses.top + tvSecondses.height / 2
                         myLine.startx = x
                         myLine.starty = y
                         myLine.endx = endx
@@ -119,15 +119,15 @@ class AlternatingConnectionFragment : BaseFragment<FragmentAlternatingConnection
             tvTwoes.setOnCheckedChangeListener { _, isChecked ->
                 if (isChecked) {
                     stringBuffer.append("2")
-                    tvTwo.isEnabled = false
+                    tvTwoes.isEnabled = false
                     if (firstChecked) {
                         firstChecked = false
-                        endx = tvTwo.left + tvTwo.width / 2
-                        endy = tvTwo.top + tvTwo.height / 2
+                        endx = tvTwoes.left + tvTwoes.width / 2
+                        endy = tvTwoes.top + tvTwoes.height / 2
                     } else {
                         val myLine = MyLine()
-                        val x = tvTwo.left + tvTwo.width / 2
-                        val y = tvTwo.top + tvTwo.height / 2
+                        val x = tvTwoes.left + tvTwoes.width / 2
+                        val y = tvTwoes.top + tvTwoes.height / 2
                         myLine.startx = x
                         myLine.starty = y
                         myLine.endx = endx
@@ -143,15 +143,15 @@ class AlternatingConnectionFragment : BaseFragment<FragmentAlternatingConnection
             tvThirdes.setOnCheckedChangeListener { _, isChecked ->
                 if (isChecked) {
                     stringBuffer.append("丙")
-                    tvThird.isEnabled = false
+                    tvThirdes.isEnabled = false
                     if (firstChecked) {
                         firstChecked = false
-                        endx = tvThird.left + tvThird.width / 2
-                        endy = tvThird.top + tvThird.height / 2
+                        endx = tvThirdes.left + tvThirdes.width / 2
+                        endy = tvThirdes.top + tvThirdes.height / 2
                     } else {
                         val myLine = MyLine()
-                        val x = tvThird.left + tvThird.width / 2
-                        val y = tvThird.top + tvThird.height / 2
+                        val x = tvThirdes.left + tvThirdes.width / 2
+                        val y = tvThirdes.top + tvThirdes.height / 2
                         myLine.startx = x
                         myLine.starty = y
                         myLine.endx = endx
@@ -167,15 +167,15 @@ class AlternatingConnectionFragment : BaseFragment<FragmentAlternatingConnection
             tvThreees.setOnCheckedChangeListener { _, isChecked ->
                 if (isChecked) {
                     stringBuffer.append("3")
-                    tvThree.isEnabled = false
+                    tvThreees.isEnabled = false
                     if (firstChecked) {
                         firstChecked = false
-                        endx = tvThree.left + tvThree.width / 2
-                        endy = tvThree.top + tvThree.height / 2
+                        endx = tvThreees.left + tvThreees.width / 2
+                        endy = tvThreees.top + tvThreees.height / 2
                     } else {
                         val myLine = MyLine()
-                        val x = tvThree.left + tvThree.width / 2
-                        val y = tvThree.top + tvThree.height / 2
+                        val x = tvThreees.left + tvThreees.width / 2
+                        val y = tvThreees.top + tvThreees.height / 2
                         myLine.startx = x
                         myLine.starty = y
                         myLine.endx = endx
@@ -191,15 +191,15 @@ class AlternatingConnectionFragment : BaseFragment<FragmentAlternatingConnection
             tvFourthes.setOnCheckedChangeListener { _, isChecked ->
                 if (isChecked) {
                     stringBuffer.append("丁")
-                    tvFourth.isEnabled = false
+                    tvFourthes.isEnabled = false
                     if (firstChecked) {
                         firstChecked = false
-                        endx = tvFourth.left + tvFourth.width / 2
-                        endy = tvFourth.top + tvFourth.height / 2
+                        endx = tvFourthes.left + tvFourthes.width / 2
+                        endy = tvFourthes.top + tvFourthes.height / 2
                     } else {
                         val myLine = MyLine()
-                        val x = tvFourth.left + tvFourth.width / 2
-                        val y = tvFourth.top + tvFourth.height / 2
+                        val x = tvFourthes.left + tvFourthes.width / 2
+                        val y = tvFourthes.top + tvFourthes.height / 2
                         myLine.startx = x
                         myLine.starty = y
                         myLine.endx = endx
@@ -215,15 +215,15 @@ class AlternatingConnectionFragment : BaseFragment<FragmentAlternatingConnection
             tvFoures.setOnCheckedChangeListener { _, isChecked ->
                 if (isChecked) {
                     stringBuffer.append("4")
-                    tvFour.isEnabled = false
+                    tvFoures.isEnabled = false
                     if (firstChecked) {
                         firstChecked = false
-                        endx = tvFour.left + tvFour.width / 2
-                        endy = tvFour.top + tvFour.height / 2
+                        endx = tvFoures.left + tvFoures.width / 2
+                        endy = tvFoures.top + tvFoures.height / 2
                     } else {
                         val myLine = MyLine()
-                        val x = tvFour.left + tvFour.width / 2
-                        val y = tvFour.top + tvFour.height / 2
+                        val x = tvFoures.left + tvFoures.width / 2
+                        val y = tvFoures.top + tvFoures.height / 2
                         myLine.startx = x
                         myLine.starty = y
                         myLine.endx = endx
@@ -239,15 +239,15 @@ class AlternatingConnectionFragment : BaseFragment<FragmentAlternatingConnection
             tvFifthes.setOnCheckedChangeListener { _, isChecked ->
                 if (isChecked) {
                     stringBuffer.append("戊")
-                    tvFifth.isEnabled = false
+                    tvFifthes.isEnabled = false
                     if (firstChecked) {
                         firstChecked = false
-                        endx = tvFifth.left + tvFifth.width / 2
-                        endy = tvFifth.top + tvFifth.height / 2
+                        endx = tvFifthes.left + tvFifthes.width / 2
+                        endy = tvFifthes.top + tvFifthes.height / 2
                     } else {
                         val myLine = MyLine()
-                        val x = tvFifth.left + tvFifth.width / 2
-                        val y = tvFifth.top + tvFifth.height / 2
+                        val x = tvFifthes.left + tvFifthes.width / 2
+                        val y = tvFifthes.top + tvFifthes.height / 2
                         myLine.startx = x
                         myLine.starty = y
                         myLine.endx = endx
@@ -263,15 +263,15 @@ class AlternatingConnectionFragment : BaseFragment<FragmentAlternatingConnection
             tvFivees.setOnCheckedChangeListener { _, isChecked ->
                 if (isChecked) {
                     stringBuffer.append("5")
-                    tvFive.isEnabled = false
+                    tvFivees.isEnabled = false
                     if (firstChecked) {
                         firstChecked = false
-                        endx = tvFive.left + tvFive.width / 2
-                        endy = tvFive.top + tvFive.height / 2
+                        endx = tvFivees.left + tvFivees.width / 2
+                        endy = tvFivees.top + tvFivees.height / 2
                     } else {
                         val myLine = MyLine()
-                        val x = tvFive.left + tvFive.width / 2
-                        val y = tvFive.top + tvFive.height / 2
+                        val x = tvFivees.left + tvFivees.width / 2
+                        val y = tvFivees.top + tvFivees.height / 2
                         myLine.startx = x
                         myLine.starty = y
                         myLine.endx = endx
@@ -356,7 +356,6 @@ class AlternatingConnectionFragment : BaseFragment<FragmentAlternatingConnection
             tvOnees.isChecked = false
             tvTwoes.isChecked = false
             tvThreees.isChecked = false
-            tvThirdes.isChecked = false
             tvFoures.isChecked = false
             tvFivees.isChecked = false
             if (stringBuffer.toString().isEmpty().not()) {

+ 10 - 79
moca/src/main/res/layout/fragment_alternating_connection.xml

@@ -47,172 +47,103 @@
                 android:layout_width="match_parent"
                 android:layout_height="match_parent">
 
-                <androidx.appcompat.widget.AppCompatCheckBox
+                <androidx.appcompat.widget.AppCompatTextView
                     android:id="@+id/tvFirst"
                     android:layout_width="@dimen/divider_60px"
                     android:layout_height="@dimen/divider_60px"
                     android:layout_marginTop="@dimen/divider_37px"
                     android:layout_marginEnd="@dimen/divider_218px"
-                    android:background="@drawable/selector_text_choice"
-                    android:button="@null"
-                    android:gravity="center"
-                    android:text="@string/first"
-                    android:textColor="@android:color/white"
-                    android:textSize="@dimen/divider_30px"
-                    android:textStyle="bold"
                     android:visibility="invisible"
                     app:layout_constraintEnd_toEndOf="parent"
                     app:layout_constraintTop_toTopOf="parent" />
 
-                <androidx.appcompat.widget.AppCompatCheckBox
+                <androidx.appcompat.widget.AppCompatTextView
                     android:id="@+id/tvTwo"
                     android:layout_width="@dimen/divider_60px"
                     android:layout_height="@dimen/divider_60px"
                     android:layout_marginTop="@dimen/divider_9px"
                     android:layout_marginEnd="@dimen/divider_148px"
                     android:background="@drawable/selector_text_choice"
-                    android:button="@null"
-                    android:gravity="center"
-                    android:text="@string/two"
-                    android:textColor="@android:color/white"
-                    android:textSize="@dimen/divider_30px"
-                    android:textStyle="bold"
                     android:visibility="invisible"
                     app:layout_constraintEnd_toEndOf="parent"
                     app:layout_constraintTop_toBottomOf="@+id/tvFirst" />
 
-                <androidx.appcompat.widget.AppCompatCheckBox
+                <androidx.appcompat.widget.AppCompatTextView
                     android:id="@+id/tvSeconds"
                     android:layout_width="@dimen/divider_60px"
                     android:layout_height="@dimen/divider_60px"
                     android:layout_marginTop="@dimen/divider_18px"
                     android:layout_marginEnd="@dimen/divider_42px"
-                    android:background="@drawable/selector_text_choice"
-                    android:button="@null"
-                    android:gravity="center"
-                    android:text="@string/seconds"
-                    android:textColor="@android:color/white"
-                    android:textSize="@dimen/divider_30px"
-                    android:textStyle="bold"
                     android:visibility="invisible"
                     app:layout_constraintEnd_toStartOf="@+id/tvTwo"
                     app:layout_constraintTop_toBottomOf="@+id/tvFirst" />
 
-                <androidx.appcompat.widget.AppCompatCheckBox
+                <androidx.appcompat.widget.AppCompatTextView
                     android:id="@+id/tvOne"
                     android:layout_width="@dimen/divider_60px"
                     android:layout_height="@dimen/divider_60px"
                     android:layout_marginTop="@dimen/divider_13px"
                     android:layout_marginEnd="@dimen/divider_42px"
-                    android:background="@drawable/selector_text_choice"
-                    android:button="@null"
-                    android:gravity="center"
-                    android:text="@string/one"
-                    android:textColor="@android:color/white"
-                    android:textSize="@dimen/divider_30px"
-                    android:textStyle="bold"
                     android:visibility="invisible"
                     app:layout_constraintEnd_toStartOf="@+id/tvSeconds"
                     app:layout_constraintTop_toBottomOf="@+id/tvFirst" />
 
-                <androidx.appcompat.widget.AppCompatCheckBox
+                <androidx.appcompat.widget.AppCompatTextView
                     android:id="@+id/tvFifth"
                     android:layout_width="@dimen/divider_60px"
                     android:layout_height="@dimen/divider_60px"
                     android:layout_marginStart="@dimen/divider_265px"
                     android:layout_marginTop="@dimen/divider_45px"
-                    android:background="@drawable/selector_text_choice"
-                    android:button="@null"
-                    android:gravity="center"
-                    android:text="@string/fifth"
-                    android:textColor="@android:color/white"
-                    android:textSize="@dimen/divider_30px"
-                    android:textStyle="bold"
                     android:visibility="invisible"
                     app:layout_constraintStart_toStartOf="parent"
                     app:layout_constraintTop_toTopOf="parent" />
 
-                <androidx.appcompat.widget.AppCompatCheckBox
+                <androidx.appcompat.widget.AppCompatTextView
                     android:id="@+id/tvFive"
                     android:layout_width="@dimen/divider_60px"
                     android:layout_height="@dimen/divider_60px"
                     android:layout_marginStart="@dimen/divider_179px"
                     android:layout_marginTop="@dimen/divider_101px"
-                    android:background="@drawable/selector_text_choice"
-                    android:button="@null"
-                    android:gravity="center"
-                    android:text="@string/five"
-                    android:textColor="@android:color/white"
-                    android:textSize="@dimen/divider_30px"
-                    android:textStyle="bold"
                     android:visibility="invisible"
                     app:layout_constraintStart_toStartOf="parent"
                     app:layout_constraintTop_toTopOf="parent" />
 
-                <androidx.appcompat.widget.AppCompatCheckBox
+                <androidx.appcompat.widget.AppCompatTextView
                     android:id="@+id/tvFourth"
                     android:layout_width="@dimen/divider_60px"
                     android:layout_height="@dimen/divider_60px"
                     android:layout_marginStart="@dimen/divider_148px"
                     android:layout_marginTop="@dimen/divider_31px"
-                    android:background="@drawable/selector_text_choice"
-                    android:button="@null"
-                    android:gravity="center"
-                    android:text="@string/fourth"
-                    android:textColor="@android:color/white"
-                    android:textSize="@dimen/divider_30px"
-                    android:textStyle="bold"
                     android:visibility="invisible"
                     app:layout_constraintStart_toStartOf="parent"
                     app:layout_constraintTop_toBottomOf="@+id/tvFive" />
 
-                <androidx.appcompat.widget.AppCompatCheckBox
+                <androidx.appcompat.widget.AppCompatTextView
                     android:id="@+id/tvThird"
                     android:layout_width="@dimen/divider_60px"
                     android:layout_height="@dimen/divider_60px"
                     android:layout_marginStart="@dimen/divider_134px"
                     android:layout_marginTop="@dimen/divider_45px"
-                    android:background="@drawable/selector_text_choice"
-                    android:button="@null"
-                    android:gravity="center"
-                    android:text="@string/third"
-                    android:textColor="@android:color/white"
-                    android:textSize="@dimen/divider_30px"
-                    android:textStyle="bold"
                     android:visibility="invisible"
                     app:layout_constraintStart_toEndOf="@+id/tvFourth"
                     app:layout_constraintTop_toBottomOf="@+id/tvOne" />
 
-                <androidx.appcompat.widget.AppCompatCheckBox
+                <androidx.appcompat.widget.AppCompatTextView
                     android:id="@+id/tvThree"
                     android:layout_width="@dimen/divider_60px"
                     android:layout_height="@dimen/divider_60px"
                     android:layout_marginStart="@dimen/divider_36px"
                     android:layout_marginTop="@dimen/divider_52px"
-                    android:background="@drawable/selector_text_choice"
-                    android:button="@null"
-                    android:gravity="center"
-                    android:text="@string/three"
-                    android:textColor="@android:color/white"
-                    android:textSize="@dimen/divider_30px"
-                    android:textStyle="bold"
                     android:visibility="invisible"
                     app:layout_constraintStart_toEndOf="@+id/tvThird"
                     app:layout_constraintTop_toBottomOf="@+id/tvSeconds" />
 
-                <androidx.appcompat.widget.AppCompatCheckBox
+                <androidx.appcompat.widget.AppCompatTextView
                     android:id="@+id/tvFour"
                     android:layout_width="@dimen/divider_60px"
                     android:layout_height="@dimen/divider_60px"
                     android:layout_marginStart="@dimen/divider_48px"
                     android:layout_marginTop="@dimen/divider_5px"
-                    android:background="@drawable/selector_text_choice"
-                    android:button="@null"
-                    android:gravity="center"
-                    android:text="@string/four"
-                    android:textColor="@android:color/white"
-                    android:textSize="@dimen/divider_30px"
-                    android:textStyle="bold"
                     android:visibility="invisible"
                     app:layout_constraintStart_toEndOf="@+id/tvFourth"
                     app:layout_constraintTop_toBottomOf="@+id/tvFourth" />