| | |
| | | import com.dollearn.student.network.entity.SubjectBean |
| | | import com.dollearn.student.network.request |
| | | import com.dollearn.student.ui.TransparentStatusBarActivity |
| | | import com.dollearn.student.utils.Const |
| | | import com.dollearn.student.utils.event.EmptyEvent |
| | | import kotlinx.android.synthetic.main.activity_listen.* |
| | | import org.greenrobot.eventbus.EventBus |
| | | |
| | | class LookImgActivity:TransparentStatusBarActivity() { |
| | | override fun setContentView() = R.layout.activity_listen |
| | |
| | | handler?.sendEmptyMessageDelayed(0,1000L) |
| | | } |
| | | |
| | | private fun recover(){ |
| | | HttpManager.teamSchedule(day,week,3).request(this){_,data-> |
| | | view_pager.setCurrentItem(data?.topicIds?.size?:0,false) |
| | | totalCount = data?.answerNumber?:0 |
| | | rightCount = data?.correctNumber?:0 |
| | | } |
| | | } |
| | | |
| | | override fun onBackPressed() { |
| | | val tipDialog = TipDialog() |
| | | tipDialog.arguments = bundleOf("msg" to "未完成全部答题,确认退出吗?") |
| | | tipDialog.setCallback(object :TipDialog.OnClickCallback{ |
| | | override fun onOk() { |
| | | finish() |
| | | HttpManager.exitGameOrStory(time).request(this@LookImgActivity){_,_-> |
| | | finish() |
| | | } |
| | | } |
| | | |
| | | override fun onCancel() { |
| | |
| | | super.onDestroy() |
| | | handler?.removeMessages(0) |
| | | handler = null |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.STOP_TIMER)) |
| | | } |
| | | } |