From e971d40e067853026fab48de020e918f6b864313 Mon Sep 17 00:00:00 2001 From: len Date: Fri, 8 Sep 2017 18:18:27 +0200 Subject: [PATCH] Lock drawer with gravity parameter instead of a view --- .../kanade/tachiyomi/ui/catalogue/CatalogueController.kt | 5 +---- .../eu/kanade/tachiyomi/ui/library/LibraryController.kt | 8 ++------ 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueController.kt index bb61a1ff3..edd51f174 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueController.kt @@ -187,10 +187,7 @@ open class CatalogueController(bundle: Bundle? = null) : } navView.setFilters(presenter.filterItems) - navView.post { - if (isAttached && !drawer.isDrawerOpen(navView)) - drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED, navView) - } + drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED, Gravity.END) navView.onSearchClicked = { val allDefault = presenter.sourceFilters == presenter.source.getFilterList() diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt index 34b190d2d..7b694cfbe 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt @@ -36,8 +36,8 @@ import eu.kanade.tachiyomi.ui.manga.MangaController import eu.kanade.tachiyomi.util.inflate import eu.kanade.tachiyomi.util.toast 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.main_activity.* import rx.Subscription import timber.log.Timber import uy.kohesive.injekt.Injekt @@ -189,11 +189,7 @@ class LibraryController( drawer.addDrawerListener(it) } navView = view - - navView?.post { - if (isAttached && drawer.isDrawerOpen(navView)) - drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED, navView) - } + drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED, Gravity.END) navView?.onGroupClicked = { group -> when (group) {