|
@@ -1,6 +1,7 @@
|
|
|
package com.yingyangfly.evaluation.questionlist
|
|
package com.yingyangfly.evaluation.questionlist
|
|
|
|
|
|
|
|
import android.annotation.SuppressLint
|
|
import android.annotation.SuppressLint
|
|
|
|
|
+import android.util.Log
|
|
|
import android.view.MotionEvent
|
|
import android.view.MotionEvent
|
|
|
import android.view.View
|
|
import android.view.View
|
|
|
import com.alibaba.android.arouter.facade.annotation.Route
|
|
import com.alibaba.android.arouter.facade.annotation.Route
|
|
@@ -144,23 +145,37 @@ class QuestionListActivity : BaseMVVMActivity<ActivityQuestionListBinding, Quest
|
|
|
* 展示选项列表
|
|
* 展示选项列表
|
|
|
*/
|
|
*/
|
|
|
private fun setOptionList() {
|
|
private fun setOptionList() {
|
|
|
- //底部按钮展示逻辑
|
|
|
|
|
- binding {
|
|
|
|
|
- btnPrevious.show(questionIndex > 0)
|
|
|
|
|
- }
|
|
|
|
|
- questionRecordsBean = questionRecordsBeans[questionIndex]
|
|
|
|
|
- if (questionRecordsBean != null) {
|
|
|
|
|
- binding.data = questionRecordsBean
|
|
|
|
|
- questionOptionBeans.clear()
|
|
|
|
|
- if (questionOptionDao != null) {
|
|
|
|
|
- val data =
|
|
|
|
|
- questionOptionDao?.getQuestionOptionBeanByQuestionId(questionRecordsBean?.id!!)
|
|
|
|
|
- if (data.isNullOrEmpty().not()) {
|
|
|
|
|
- questionListAdapter.setContent(questionRecordsBean?.selectedItemId!!)
|
|
|
|
|
- questionOptionBeans.addAll(data!!)
|
|
|
|
|
|
|
+ runOnUiThread {
|
|
|
|
|
+ //底部按钮展示逻辑
|
|
|
|
|
+ binding {
|
|
|
|
|
+
|
|
|
|
|
+ btnPrevious.visibility = if (questionIndex > 0) {
|
|
|
|
|
+ View.VISIBLE
|
|
|
|
|
+ } else {
|
|
|
|
|
+ View.GONE
|
|
|
|
|
+ }
|
|
|
|
|
+ btnNext.text = if (questionRecordsBeans.isNullOrEmpty()
|
|
|
|
|
+ .not() && questionIndex == questionRecordsBeans.size - 1
|
|
|
|
|
+ ) {
|
|
|
|
|
+ "提交"
|
|
|
|
|
+ } else {
|
|
|
|
|
+ "继续"
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ questionRecordsBean = questionRecordsBeans[questionIndex]
|
|
|
|
|
+ if (questionRecordsBean != null) {
|
|
|
|
|
+ binding.data = questionRecordsBean
|
|
|
|
|
+ questionOptionBeans.clear()
|
|
|
|
|
+ if (questionOptionDao != null) {
|
|
|
|
|
+ val data =
|
|
|
|
|
+ questionOptionDao?.getQuestionOptionBeanByQuestionId(questionRecordsBean?.id!!)
|
|
|
|
|
+ if (data.isNullOrEmpty().not()) {
|
|
|
|
|
+ questionListAdapter.setContent(questionRecordsBean?.selectedItemId!!)
|
|
|
|
|
+ questionOptionBeans.addAll(data!!)
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+ questionListAdapter.setData(questionOptionBeans)
|
|
|
}
|
|
}
|
|
|
- questionListAdapter.setData(questionOptionBeans)
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|