Fix empty container id in grade fragemnt adapter (#289)

This commit is contained in:
Rafał Borcz 2019-03-21 22:34:41 +01:00 committed by Mikołaj Pich
parent 5add95ece1
commit 20d0abba29

View File

@ -7,9 +7,7 @@ import io.github.wulkanowy.ui.base.session.BaseSessionPresenter
import io.github.wulkanowy.ui.base.session.SessionErrorHandler import io.github.wulkanowy.ui.base.session.SessionErrorHandler
import io.github.wulkanowy.utils.FirebaseAnalyticsHelper import io.github.wulkanowy.utils.FirebaseAnalyticsHelper
import io.github.wulkanowy.utils.SchedulersProvider import io.github.wulkanowy.utils.SchedulersProvider
import io.reactivex.Completable
import timber.log.Timber import timber.log.Timber
import java.util.concurrent.TimeUnit.MILLISECONDS
import javax.inject.Inject import javax.inject.Inject
class GradePresenter @Inject constructor( class GradePresenter @Inject constructor(
@ -30,15 +28,12 @@ class GradePresenter @Inject constructor(
fun onAttachView(view: GradeView, savedIndex: Int?) { fun onAttachView(view: GradeView, savedIndex: Int?) {
super.onAttachView(view) super.onAttachView(view)
Timber.i("Grade view is attached") Timber.i("Grade view is attached")
disposable.add(Completable.timer(150, MILLISECONDS, schedulers.mainThread) selectedIndex = savedIndex ?: 0
.subscribe { view.run {
selectedIndex = savedIndex ?: 0 initView()
view.run { enableSwipe(false)
initView() }
enableSwipe(false) loadData()
}
loadData()
})
} }
fun onCreateMenu() { fun onCreateMenu() {