diff options
| author | 2023-05-01 17:12:07 -0400 | |
|---|---|---|
| committer | 2023-06-03 00:05:58 -0700 | |
| commit | 34b7d58157a3180aed3261c92a8ff43fce22ddc0 (patch) | |
| tree | b54144f59afdd4d86faa3bdb93a6143ea8497987 /src/android | |
| parent | android: Use short build hash (diff) | |
| download | yuzu-34b7d58157a3180aed3261c92a8ff43fce22ddc0.tar.gz yuzu-34b7d58157a3180aed3261c92a8ff43fce22ddc0.tar.xz yuzu-34b7d58157a3180aed3261c92a8ff43fce22ddc0.zip | |
android: Persistent scrollbars on home settings fragment
Diffstat (limited to 'src/android')
| -rw-r--r-- | src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/HomeSettingsFragment.kt | 17 | ||||
| -rw-r--r-- | src/android/app/src/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 c7427e151..ae920d692 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 | |||
| 13 | import android.view.LayoutInflater | 13 | import android.view.LayoutInflater |
| 14 | import android.view.View | 14 | import android.view.View |
| 15 | import android.view.ViewGroup | 15 | import android.view.ViewGroup |
| 16 | import android.view.ViewGroup.MarginLayoutParams | ||
| 16 | import android.widget.Toast | 17 | import android.widget.Toast |
| 17 | import androidx.appcompat.app.AppCompatActivity | 18 | import androidx.appcompat.app.AppCompatActivity |
| 18 | import androidx.core.app.ActivityCompat | 19 | import androidx.core.app.ActivityCompat |
| @@ -241,13 +242,19 @@ class HomeSettingsFragment : Fragment() { | |||
| 241 | val spacingNavigationRail = | 242 | val spacingNavigationRail = |
| 242 | resources.getDimensionPixelSize(R.dimen.spacing_navigation_rail) | 243 | resources.getDimensionPixelSize(R.dimen.spacing_navigation_rail) |
| 243 | 244 | ||
| 244 | binding.scrollViewSettings.setPadding( | 245 | val leftInsets = barInsets.left + cutoutInsets.left |
| 245 | barInsets.left + cutoutInsets.left, | 246 | val rightInsets = barInsets.right + cutoutInsets.right |
| 246 | barInsets.top, | 247 | |
| 247 | barInsets.right + cutoutInsets.right, | 248 | binding.scrollViewSettings.updatePadding( |
| 248 | barInsets.bottom | 249 | top = barInsets.top, |
| 250 | bottom = barInsets.bottom | ||
| 249 | ) | 251 | ) |
| 250 | 252 | ||
| 253 | val mlpScrollSettings = binding.scrollViewSettings.layoutParams as MarginLayoutParams | ||
| 254 | mlpScrollSettings.leftMargin = leftInsets | ||
| 255 | mlpScrollSettings.rightMargin = rightInsets | ||
| 256 | binding.scrollViewSettings.layoutParams = mlpScrollSettings | ||
| 257 | |||
| 251 | binding.linearLayoutSettings.updatePadding(bottom = spacingNavigation) | 258 | binding.linearLayoutSettings.updatePadding(bottom = spacingNavigation) |
| 252 | 259 | ||
| 253 | if (ViewCompat.getLayoutDirection(view) == ViewCompat.LAYOUT_DIRECTION_LTR) { | 260 | 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 82b037010..02200e885 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 @@ | |||
| 5 | android:layout_width="match_parent" | 5 | android:layout_width="match_parent" |
| 6 | android:layout_height="match_parent" | 6 | android:layout_height="match_parent" |
| 7 | android:background="?attr/colorSurface" | 7 | android:background="?attr/colorSurface" |
| 8 | android:scrollbars="vertical" | ||
| 9 | android:fadeScrollbars="false" | ||
| 8 | android:clipToPadding="false"> | 10 | android:clipToPadding="false"> |
| 9 | 11 | ||
| 10 | <androidx.appcompat.widget.LinearLayoutCompat | 12 | <androidx.appcompat.widget.LinearLayoutCompat |