| | |
| | | private val week by lazy { |
| | | (requireActivity() as ScheduleActivity).week |
| | | } |
| | | private val current by lazy { |
| | | (requireActivity() as ScheduleActivity).currentDay |
| | | } |
| | | |
| | | |
| | | override fun onFirstVisibleToUser() { |
| | | getProgress() |
| | |
| | | private fun getProgress(){ |
| | | HttpManager.studySchedule(week,day).requestByF(this){ _, data-> |
| | | data?.apply { |
| | | val scheduleActivity = activity as ScheduleActivity |
| | | if (day != scheduleActivity.currentDay){ //解锁了后一天 |
| | | scheduleActivity.unLockNext(day) |
| | | } |
| | | tv_current.text = "当前周目:${week.formatToChinese()}周目" |
| | | tv_progress.text = "${computeSchedule}%" |
| | | tv_total.text = "${totalStudy}小时" |
| | | tv_today.text = "${todayStudy}小时" |
| | | progress_bar.progress = computeSchedule |
| | | |
| | | if (this@DailyFragment.day == current){ |
| | | if (this@DailyFragment.day == scheduleActivity.currentDay){ |
| | | formatProgress(listen,tv_state) |
| | | formatProgress(look,tv_state_2) |
| | | formatProgress(induction,tv_state_3) |