| | |
| | | import com.dollearn.student.network.request |
| | | import com.dollearn.student.ui.TransparentStatusBarActivity |
| | | import kotlinx.android.synthetic.main.activity_listen.* |
| | | import org.jetbrains.anko.startActivity |
| | | |
| | | class ListenActivity:TransparentStatusBarActivity() { |
| | | override fun setContentView() = R.layout.activity_listen |
| | |
| | | |
| | | private fun recover(){ |
| | | HttpManager.teamSchedule(day,week,1).request(this){_,data-> |
| | | view_pager.setCurrentItem(data?.topicIds?.size?:0,false) |
| | | 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,1,data?.data?.id?:"", list.joinToString(",") { it.id }).request(this@ListenActivity){_,_-> |
| | | HttpManager.exitLearning(view_pager.currentItem,season,time,totalCount,rightCount,day,week,1,data?.data?.id?:"", list.joinToString(",") { it.id }).request(this@ListenActivity){_,_-> |
| | | finish() |
| | | } |
| | | } |