| | |
| | | fun next(){ |
| | | if (view_pager.currentItem == fragments.lastIndex){ |
| | | handler?.removeMessages(0) |
| | | ResultActivity.startResult(this,day,week,season,3,totalCount,rightCount,data!!.data.integral,time,data!!.data.id) |
| | | ResultActivity.startResult(this,day,week,season,5,totalCount,rightCount,data!!.data.integral,time,data!!.data.id) |
| | | finish() |
| | | }else{ |
| | | (fragments[view_pager.currentItem+1] as MatchFragment).recover() |
| | |
| | | } |
| | | |
| | | private fun recover(){ |
| | | HttpManager.teamSchedule(day,week,3).request(this){_,data-> |
| | | view_pager.setCurrentItem(data?.topicIds?.size?:0,false) |
| | | HttpManager.teamSchedule(day,week,5).request(this){_,data-> |
| | | view_pager.setCurrentItem((data?.schedule?:1)-1,false) |
| | | if (view_pager.currentItem != 0) |
| | | tv_last.visible() |
| | | totalCount = data?.answerNumber?:0 |
| | | rightCount = data?.correctNumber?:0 |
| | | } |
| | |
| | | finish() |
| | | else{ |
| | | val list = (data?.subjectList?: arrayListOf()).flatMap { it }.subList(0,view_pager.currentItem) |
| | | HttpManager.exitLearning(totalCount,rightCount,day,week,3,data?.data?.id?:"", list.joinToString(",") { it.id }).request(this@MatchActivity){ _, _-> |
| | | HttpManager.exitLearning(view_pager.currentItem,season,time,totalCount,rightCount,day,week,5,data?.data?.id?:"", list.joinToString(",") { it.id }).request(this@MatchActivity){ _, _-> |
| | | finish() |
| | | } |
| | | } |