Kaynağa Gözat

Apply navigation bar insets to fast scroller and settings search list (#6015)

Ivan Iskandar 3 yıl önce
ebeveyn
işleme
4af578e310

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

@@ -281,11 +281,6 @@ class MangaController :
                 scroller.updateLayoutParams<ViewGroup.MarginLayoutParams> {
                     topMargin = getMainAppBarHeight()
                 }
-                scroller.applyInsetter {
-                    type(navigationBars = true) {
-                        margin()
-                    }
-                }
             }
 
             binding.swipeRefresh.doOnLayout { swipeRefresh ->

+ 7 - 0
app/src/main/java/eu/kanade/tachiyomi/ui/setting/search/SettingsSearchController.kt

@@ -8,6 +8,7 @@ import android.view.MenuItem
 import android.view.View
 import androidx.appcompat.widget.SearchView
 import androidx.recyclerview.widget.LinearLayoutManager
+import dev.chrisbanes.insetter.applyInsetter
 import eu.kanade.tachiyomi.R
 import eu.kanade.tachiyomi.databinding.SettingsSearchControllerBinding
 import eu.kanade.tachiyomi.ui.base.controller.NucleusController
@@ -56,6 +57,12 @@ class SettingsSearchController :
     override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
         inflater.inflate(R.menu.settings_main, menu)
 
+        binding.recycler.applyInsetter {
+            type(navigationBars = true) {
+                padding()
+            }
+        }
+
         // Initialize search menu
         val searchItem = menu.findItem(R.id.action_search)
         searchView = searchItem.actionView as SearchView

+ 7 - 0
app/src/main/java/eu/kanade/tachiyomi/widget/MaterialFastScroll.kt

@@ -5,6 +5,7 @@ import android.content.Context
 import android.util.AttributeSet
 import android.view.MotionEvent
 import androidx.core.view.ViewCompat
+import dev.chrisbanes.insetter.applyInsetter
 import eu.davidea.fastscroller.FastScroller
 import eu.kanade.tachiyomi.R
 import eu.kanade.tachiyomi.util.system.dpToPxEnd
@@ -21,6 +22,12 @@ class MaterialFastScroll @JvmOverloads constructor(context: Context, attrs: Attr
         )
         autoHideEnabled = true
         ignoreTouchesOutsideHandle = true
+
+        applyInsetter {
+            type(navigationBars = true) {
+                margin()
+            }
+        }
     }
 
     // Overridden to handle RTL