From 34b7d58157a3180aed3261c92a8ff43fce22ddc0 Mon Sep 17 00:00:00 2001 From: Charles Lombardo Date: Mon, 1 May 2023 17:12:07 -0400 Subject: [PATCH] android: Persistent scrollbars on home settings fragment --- .../yuzu_emu/fragments/HomeSettingsFragment.kt | 17 ++++++++++++----- .../main/res/layout/fragment_home_settings.xml | 2 ++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/HomeSettingsFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/HomeSettingsFragment.kt index c7427e151a..ae920d692f 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/HomeSettingsFragment.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/HomeSettingsFragment.kt @@ -13,6 +13,7 @@ import android.provider.DocumentsContract import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import android.view.ViewGroup.MarginLayoutParams import android.widget.Toast import androidx.appcompat.app.AppCompatActivity import androidx.core.app.ActivityCompat @@ -241,13 +242,19 @@ class HomeSettingsFragment : Fragment() { val spacingNavigationRail = resources.getDimensionPixelSize(R.dimen.spacing_navigation_rail) - binding.scrollViewSettings.setPadding( - barInsets.left + cutoutInsets.left, - barInsets.top, - barInsets.right + cutoutInsets.right, - barInsets.bottom + val leftInsets = barInsets.left + cutoutInsets.left + val rightInsets = barInsets.right + cutoutInsets.right + + binding.scrollViewSettings.updatePadding( + top = barInsets.top, + bottom = barInsets.bottom ) + val mlpScrollSettings = binding.scrollViewSettings.layoutParams as MarginLayoutParams + mlpScrollSettings.leftMargin = leftInsets + mlpScrollSettings.rightMargin = rightInsets + binding.scrollViewSettings.layoutParams = mlpScrollSettings + binding.linearLayoutSettings.updatePadding(bottom = spacingNavigation) if (ViewCompat.getLayoutDirection(view) == ViewCompat.LAYOUT_DIRECTION_LTR) { diff --git a/src/android/app/src/main/res/layout/fragment_home_settings.xml b/src/android/app/src/main/res/layout/fragment_home_settings.xml index 82b037010e..02200e885e 100644 --- a/src/android/app/src/main/res/layout/fragment_home_settings.xml +++ b/src/android/app/src/main/res/layout/fragment_home_settings.xml @@ -5,6 +5,8 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:background="?attr/colorSurface" + android:scrollbars="vertical" + android:fadeScrollbars="false" android:clipToPadding="false">