Fix Browse sources padding

This commit is contained in:
Jays2Kings 2021-03-31 17:36:52 -04:00
parent a830e0ccee
commit 004b596671
2 changed files with 11 additions and 3 deletions

View File

@ -131,9 +131,13 @@ class BrowseController :
array.recycle() array.recycle()
scrollViewWith( scrollViewWith(
binding.sourceRecycler, binding.sourceRecycler,
customPadding = true,
afterInsets = { afterInsets = {
headerHeight = it.systemWindowInsetTop + appBarHeight headerHeight = it.systemWindowInsetTop + appBarHeight
binding.sourceRecycler.updatePaddingRelative(bottom = activityBinding?.bottomNav?.height ?: 0) binding.sourceRecycler.updatePaddingRelative(
top = activityBinding?.appBar?.height ?: 0,
bottom = (activityBinding?.bottomNav?.height ?: 0) + 58.spToPx
)
}, },
onBottomNavUpdate = { onBottomNavUpdate = {
setBottomPadding() setBottomPadding()
@ -146,6 +150,9 @@ class BrowseController :
if (binding.bottomSheet.root.sheetBehavior.isCollapsed()) 0f else 1f * 15f, if (binding.bottomSheet.root.sheetBehavior.isCollapsed()) 0f else 1f * 15f,
if (binding.sourceRecycler.canScrollVertically(-1)) 15f else 0f if (binding.sourceRecycler.canScrollVertically(-1)) 15f else 0f
) )
binding.sourceRecycler.updatePaddingRelative(
bottom = (activityBinding?.bottomNav?.height ?: 0) + 58.spToPx
)
} }
requestPermissionsSafe(arrayOf(WRITE_EXTERNAL_STORAGE), 301) requestPermissionsSafe(arrayOf(WRITE_EXTERNAL_STORAGE), 301)
@ -270,6 +277,9 @@ class BrowseController :
binding.bottomSheet.root.migrationFrameLayout?.binding?.fastScroller?.updateLayoutParams<ViewGroup.MarginLayoutParams> { binding.bottomSheet.root.migrationFrameLayout?.binding?.fastScroller?.updateLayoutParams<ViewGroup.MarginLayoutParams> {
bottomMargin = -pad.toInt() bottomMargin = -pad.toInt()
} }
binding.sourceRecycler.updatePaddingRelative(
bottom = (activityBinding?.bottomNav?.height ?: 0) + 58.spToPx
)
} }
override fun showSheet() { override fun showSheet() {

View File

@ -17,8 +17,6 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:clipToPadding="false" android:clipToPadding="false"
android:layout_marginBottom="30dp"
android:paddingBottom="20dp"
tools:listitem="@layout/source_header_item" /> tools:listitem="@layout/source_header_item" />
</FrameLayout> </FrameLayout>