lmw
2024-07-17 98faa1d5d540a7e4de4086ea11df3fd61b5c7ab9
app/src/main/java/com/dollearn/student/ui/home/MatchActivity.kt
@@ -17,7 +17,10 @@
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 MatchActivity:TransparentStatusBarActivity() {
    override fun setContentView() = R.layout.activity_listen
@@ -129,13 +132,9 @@
        tipDialog.arguments = bundleOf("msg" to "未完成全部答题,确认退出吗?")
        tipDialog.setCallback(object :TipDialog.OnClickCallback{
            override fun onOk() {
                if (view_pager.currentItem == 0)
                val list = (data?.subjectList?: arrayListOf()).flatMap { it }.subList(0,view_pager.currentItem)
                HttpManager.exitLearning(view_pager.currentItem,season,time,totalCount,rightCount,day,week,5,data?.data?.id?:"", list.joinToString(",") { it.id }).request(this@MatchActivity){ _, _->
                    finish()
                else{
                    val list = (data?.subjectList?: arrayListOf()).flatMap { it }.subList(0,view_pager.currentItem)
                    HttpManager.exitLearning(view_pager.currentItem,season,time,totalCount,rightCount,day,week,5,data?.data?.id?:"", list.joinToString(",") { it.id }).request(this@MatchActivity){ _, _->
                        finish()
                    }
                }
            }
@@ -149,5 +148,6 @@
        super.onDestroy()
        handler?.removeMessages(0)
        handler = null
        EventBus.getDefault().post(EmptyEvent(Const.EventCode.STOP_TIMER))
    }
}