Browse Source

Handle bottom insets in FAB controllers too

arkon 4 years ago
parent
commit
60b2a4ea9d

+ 2 - 6
app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceController.kt

@@ -33,6 +33,7 @@ import eu.kanade.tachiyomi.source.model.FilterList
 import eu.kanade.tachiyomi.source.online.HttpSource
 import eu.kanade.tachiyomi.ui.base.controller.FabController
 import eu.kanade.tachiyomi.ui.base.controller.NucleusController
+import eu.kanade.tachiyomi.ui.base.controller.applyBottomInsetPadding
 import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction
 import eu.kanade.tachiyomi.ui.library.ChangeMangaCategoriesDialog
 import eu.kanade.tachiyomi.ui.manga.MangaController
@@ -237,12 +238,7 @@ open class BrowseSourceController(bundle: Bundle) :
 
         if (filterSheet != null) {
             // Add bottom padding if filter FAB is visible
-            recycler.setPadding(
-                recycler.paddingLeft,
-                recycler.paddingTop,
-                recycler.paddingRight,
-                view.resources.getDimensionPixelOffset(R.dimen.fab_list_padding)
-            )
+            applyBottomInsetPadding(recycler, view.resources.getDimensionPixelOffset(R.dimen.fab_list_padding))
             recycler.clipToPadding = false
 
             actionFab?.shrinkOnScroll(recycler)

+ 4 - 0
app/src/main/java/eu/kanade/tachiyomi/ui/category/CategoryController.kt

@@ -19,6 +19,7 @@ import eu.kanade.tachiyomi.data.database.models.Category
 import eu.kanade.tachiyomi.databinding.CategoriesControllerBinding
 import eu.kanade.tachiyomi.ui.base.controller.FabController
 import eu.kanade.tachiyomi.ui.base.controller.NucleusController
+import eu.kanade.tachiyomi.ui.base.controller.applyBottomInsetPadding
 import eu.kanade.tachiyomi.util.system.toast
 import eu.kanade.tachiyomi.util.view.shrinkOnScroll
 import kotlinx.android.synthetic.main.main_activity.root_coordinator
@@ -78,6 +79,9 @@ class CategoryController :
      */
     override fun inflateView(inflater: LayoutInflater, container: ViewGroup): View {
         binding = CategoriesControllerBinding.inflate(inflater)
+
+        applyBottomInsetPadding(binding.recycler)
+
         return binding.root
     }
 

+ 4 - 0
app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadController.kt

@@ -17,6 +17,7 @@ import eu.kanade.tachiyomi.databinding.DownloadControllerBinding
 import eu.kanade.tachiyomi.source.model.Page
 import eu.kanade.tachiyomi.ui.base.controller.FabController
 import eu.kanade.tachiyomi.ui.base.controller.NucleusController
+import eu.kanade.tachiyomi.ui.base.controller.applyBottomInsetPadding
 import eu.kanade.tachiyomi.util.view.shrinkOnScroll
 import kotlinx.coroutines.flow.launchIn
 import kotlinx.coroutines.flow.onEach
@@ -59,6 +60,9 @@ class DownloadController :
 
     override fun inflateView(inflater: LayoutInflater, container: ViewGroup): View {
         binding = DownloadControllerBinding.inflate(inflater)
+
+        applyBottomInsetPadding(binding.recycler)
+
         return binding.root
     }
 

+ 4 - 0
app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt

@@ -44,6 +44,7 @@ import eu.kanade.tachiyomi.source.online.HttpSource
 import eu.kanade.tachiyomi.ui.base.controller.FabController
 import eu.kanade.tachiyomi.ui.base.controller.NucleusController
 import eu.kanade.tachiyomi.ui.base.controller.ToolbarLiftOnScrollController
+import eu.kanade.tachiyomi.ui.base.controller.applyBottomInsetPadding
 import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction
 import eu.kanade.tachiyomi.ui.browse.migration.search.SearchController
 import eu.kanade.tachiyomi.ui.browse.source.browse.BrowseSourceController
@@ -194,6 +195,9 @@ class MangaController :
 
     override fun inflateView(inflater: LayoutInflater, container: ViewGroup): View {
         binding = MangaControllerBinding.inflate(inflater)
+
+        applyBottomInsetPadding(binding.recycler)
+
         return binding.root
     }