| | |
| | | import com.dollearn.student.network.HttpManager |
| | | 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 com.dollearn.student.utils.event.IntEvent |
| | | import kotlinx.android.synthetic.main.activity_schedul.* |
| | | import org.greenrobot.eventbus.EventBus |
| | | import org.greenrobot.eventbus.Subscribe |
| | | |
| | | class ScheduleActivity :TransparentStatusBarActivity(){ |
| | | override fun setContentView() = R.layout.activity_schedul |
| | |
| | | override fun initView() { |
| | | title = "" |
| | | getSchedule() |
| | | EventBus.getDefault().register(this) |
| | | } |
| | | |
| | | private fun getSchedule(){ |
| | |
| | | tab_bar.currentTab = currentDay-1 |
| | | view_pager.offscreenPageLimit = day |
| | | } |
| | | |
| | | @Subscribe |
| | | fun nextSubject(e: IntEvent){ |
| | | if (e.code == Const.EventCode.NEXT_SUBJECT){ |
| | | (frags[view_pager.currentItem] as DailyFragment).nextSubject(e.i) |
| | | } |
| | | } |
| | | |
| | | override fun onDestroy() { |
| | | super.onDestroy() |
| | | EventBus.getDefault().unregister(this) |
| | | } |
| | | } |