Lock drawer with gravity parameter instead of a view

This commit is contained in:
len 2017-09-08 18:18:27 +02:00
parent c65a01a5f0
commit e971d40e06
2 changed files with 3 additions and 10 deletions

View File

@ -187,10 +187,7 @@ open class CatalogueController(bundle: Bundle? = null) :
} }
navView.setFilters(presenter.filterItems) navView.setFilters(presenter.filterItems)
navView.post { drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED, Gravity.END)
if (isAttached && !drawer.isDrawerOpen(navView))
drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED, navView)
}
navView.onSearchClicked = { navView.onSearchClicked = {
val allDefault = presenter.sourceFilters == presenter.source.getFilterList() val allDefault = presenter.sourceFilters == presenter.source.getFilterList()

View File

@ -36,8 +36,8 @@ import eu.kanade.tachiyomi.ui.manga.MangaController
import eu.kanade.tachiyomi.util.inflate import eu.kanade.tachiyomi.util.inflate
import eu.kanade.tachiyomi.util.toast import eu.kanade.tachiyomi.util.toast
import eu.kanade.tachiyomi.widget.DrawerSwipeCloseListener import eu.kanade.tachiyomi.widget.DrawerSwipeCloseListener
import kotlinx.android.synthetic.main.main_activity.*
import kotlinx.android.synthetic.main.library_controller.view.* import kotlinx.android.synthetic.main.library_controller.view.*
import kotlinx.android.synthetic.main.main_activity.*
import rx.Subscription import rx.Subscription
import timber.log.Timber import timber.log.Timber
import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.Injekt
@ -189,11 +189,7 @@ class LibraryController(
drawer.addDrawerListener(it) drawer.addDrawerListener(it)
} }
navView = view navView = view
drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED, Gravity.END)
navView?.post {
if (isAttached && drawer.isDrawerOpen(navView))
drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED, navView)
}
navView?.onGroupClicked = { group -> navView?.onGroupClicked = { group ->
when (group) { when (group) {