|
|
@@ -16,6 +16,8 @@ import com.yingyangfly.baselib.ext.getScaleAnimation
|
|
|
import com.yingyangfly.baselib.ext.toast
|
|
|
import com.yingyangfly.baselib.mvvm.BaseMVVMActivity
|
|
|
import com.yingyangfly.baselib.router.RouterUrlCommon
|
|
|
+import com.yingyangfly.baselib.utils.JumpUtil
|
|
|
+import com.yingyangfly.baselib.utils.User
|
|
|
import com.yingyangfly.evaluation.R
|
|
|
import com.yingyangfly.evaluation.adapter.EvaluationTypeAdapter
|
|
|
import com.yingyangfly.evaluation.adapter.ExaminationAdapter
|
|
|
@@ -71,7 +73,7 @@ class OtherEvaluationActivity :
|
|
|
override fun initListener() {
|
|
|
binding {
|
|
|
layoutHead.setOnTouchListener(this@OtherEvaluationActivity)
|
|
|
-
|
|
|
+ loginOutLayout.setOnTouchListener(this@OtherEvaluationActivity)
|
|
|
swipeEvaluation.setOnRefreshListener {
|
|
|
getExaminationList(true, false)
|
|
|
}
|
|
|
@@ -147,7 +149,7 @@ class OtherEvaluationActivity :
|
|
|
override fun onTouch(v: View, event: MotionEvent): Boolean {
|
|
|
when (event.action) {
|
|
|
MotionEvent.ACTION_DOWN -> {
|
|
|
- if (v.id == R.id.layoutHead) {
|
|
|
+ if (v.id == R.id.layoutHead || v.id == R.id.loginOutLayout) {
|
|
|
v.startAnimation(getScaleAnimation())
|
|
|
}
|
|
|
}
|
|
|
@@ -158,11 +160,15 @@ class OtherEvaluationActivity :
|
|
|
R.id.layoutHead -> {
|
|
|
finish()
|
|
|
}
|
|
|
+
|
|
|
+ R.id.loginOutLayout -> {
|
|
|
+ loginOut()
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
MotionEvent.ACTION_CANCEL -> {
|
|
|
- if (v.id == R.id.layoutHead) {
|
|
|
+ if (v.id == R.id.layoutHead || v.id == R.id.loginOutLayout) {
|
|
|
v.startAnimation(getEndAnimation())
|
|
|
}
|
|
|
}
|
|
|
@@ -192,8 +198,7 @@ class OtherEvaluationActivity :
|
|
|
questionOptionDao?.insertAll(questionOptionBean)
|
|
|
}
|
|
|
ARouter.getInstance().build(RouterUrlCommon.questionList)
|
|
|
- .withLong("examinationId", bean.id)
|
|
|
- .withString("examinationTitle", bean.title)
|
|
|
+ .withLong("examinationId", bean.id).withString("examinationTitle", bean.title)
|
|
|
.withTransition(R.anim.leftin, R.anim.leftout).navigation(mContext)
|
|
|
}
|
|
|
})
|
|
|
@@ -208,4 +213,20 @@ class OtherEvaluationActivity :
|
|
|
swipeEvaluation.finishLoadMore()
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 退出登录
|
|
|
+ */
|
|
|
+ private fun loginOut() {
|
|
|
+ viewModel.logout(fail = {
|
|
|
+ "解绑失败,请重试".toast()
|
|
|
+ }, success = {
|
|
|
+ runOnUiThread {
|
|
|
+ "解绑成功".toast()
|
|
|
+ User.saveToken("")
|
|
|
+ User.savePhone("")
|
|
|
+ JumpUtil.jumpActivity(RouterUrlCommon.hospitalEvaluation, mContext)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|