|
|
@@ -1,11 +1,9 @@
|
|
|
package com.yingyangfly.evaluation.questionlist
|
|
|
|
|
|
import android.annotation.SuppressLint
|
|
|
-import android.util.Log
|
|
|
import android.view.MotionEvent
|
|
|
import android.view.View
|
|
|
import com.alibaba.android.arouter.facade.annotation.Route
|
|
|
-import com.yingyangfly.baselib.base.BaseActivity
|
|
|
import com.yingyangfly.baselib.db.QuestionOptionBean
|
|
|
import com.yingyangfly.baselib.db.QuestionRecordsBean
|
|
|
import com.yingyangfly.baselib.dialog.TipsDialog
|
|
|
@@ -15,7 +13,6 @@ import com.yingyangfly.baselib.ext.show
|
|
|
import com.yingyangfly.baselib.ext.toast
|
|
|
import com.yingyangfly.baselib.mvvm.BaseMVVMActivity
|
|
|
import com.yingyangfly.baselib.router.RouterUrlCommon
|
|
|
-import com.yingyangfly.baselib.utils.GsonUtil
|
|
|
import com.yingyangfly.baselib.utils.RxTimer
|
|
|
import com.yingyangfly.evaluation.R
|
|
|
import com.yingyangfly.evaluation.adapter.QuestionListAdapter
|
|
|
@@ -32,6 +29,7 @@ class QuestionListActivity : BaseMVVMActivity<ActivityQuestionListBinding, Quest
|
|
|
private var time: Long = 0
|
|
|
private var questionIndex = 0
|
|
|
|
|
|
+ private var questionRecordsBean: QuestionRecordsBean? = null
|
|
|
private var questionRecordsBeans = mutableListOf<QuestionRecordsBean>()
|
|
|
|
|
|
private var questionOptionBeans = mutableListOf<QuestionOptionBean>()
|
|
|
@@ -43,6 +41,9 @@ class QuestionListActivity : BaseMVVMActivity<ActivityQuestionListBinding, Quest
|
|
|
binding {
|
|
|
rvSelectedItem.adapter = questionListAdapter
|
|
|
}
|
|
|
+ questionListAdapter.onClickListener = {
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@SuppressLint("ClickableViewAccessibility")
|
|
|
@@ -73,10 +74,6 @@ class QuestionListActivity : BaseMVVMActivity<ActivityQuestionListBinding, Quest
|
|
|
if (data.isNullOrEmpty().not()) {
|
|
|
questionRecordsBeans.addAll(data!!)
|
|
|
}
|
|
|
- Log.e(
|
|
|
- "wpp",
|
|
|
- "1-------------->" + GsonUtil.GsonString(questionRecordsDao?.getAllQuestionRecordsBeanBean())
|
|
|
- )
|
|
|
setOptionList()
|
|
|
}
|
|
|
}
|
|
|
@@ -142,26 +139,19 @@ class QuestionListActivity : BaseMVVMActivity<ActivityQuestionListBinding, Quest
|
|
|
binding {
|
|
|
btnPrevious.show(questionIndex > 0)
|
|
|
}
|
|
|
- val questionRecordsBean = questionRecordsBeans[questionIndex]
|
|
|
+ questionRecordsBean = questionRecordsBeans[questionIndex]
|
|
|
if (questionRecordsBean != null) {
|
|
|
binding.data = questionRecordsBean
|
|
|
questionOptionBeans.clear()
|
|
|
if (questionOptionDao != null) {
|
|
|
val data =
|
|
|
- questionOptionDao?.getQuestionOptionBeanByQuestionId(questionRecordsBean.id)
|
|
|
+ questionOptionDao?.getQuestionOptionBeanByQuestionId(questionRecordsBean?.id!!)
|
|
|
if (data.isNullOrEmpty().not()) {
|
|
|
- Log.e("wpp", "2-------------->" + GsonUtil.GsonString(data))
|
|
|
+ questionListAdapter.setContent(questionRecordsBean?.selectedItemId!!)
|
|
|
questionOptionBeans.addAll(data!!)
|
|
|
- } else {
|
|
|
- Log.e("wpp", "2----------------信息错误")
|
|
|
}
|
|
|
- } else {
|
|
|
- Log.e("wpp", "1----------------信息错误")
|
|
|
}
|
|
|
questionListAdapter.setData(questionOptionBeans)
|
|
|
- } else {
|
|
|
- Log.e("wpp", "信息错误")
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|