summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Charles Lombardo2023-09-25 20:57:33 -0400
committerGravatar GitHub2023-09-25 20:57:33 -0400
commit4e855be38b720068a4d95cc53f3128d09f80c15e (patch)
tree6c48637e634dab2ff1d862c36afc158933ffedd8
parentMerge pull request #11597 from t895/drawer-fix (diff)
parentandroid: Prevent nav bar shade from laying out across screen (diff)
downloadyuzu-4e855be38b720068a4d95cc53f3128d09f80c15e.tar.gz
yuzu-4e855be38b720068a4d95cc53f3128d09f80c15e.tar.xz
yuzu-4e855be38b720068a4d95cc53f3128d09f80c15e.zip
Merge pull request #11594 from t895/rotation-fix
android: Prevent nav bar shade from laying out across screen
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsActivity.kt10
-rw-r--r--src/android/app/src/main/res/layout/activity_settings.xml2
2 files changed, 7 insertions, 5 deletions
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsActivity.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsActivity.kt
index 4d2f2f604..ea26a21d0 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsActivity.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsActivity.kt
@@ -181,12 +181,14 @@ class SettingsActivity : AppCompatActivity() {
181 private fun setInsets() { 181 private fun setInsets() {
182 ViewCompat.setOnApplyWindowInsetsListener( 182 ViewCompat.setOnApplyWindowInsetsListener(
183 binding.navigationBarShade 183 binding.navigationBarShade
184 ) { view: View, windowInsets: WindowInsetsCompat -> 184 ) { _: View, windowInsets: WindowInsetsCompat ->
185 val barInsets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars()) 185 val barInsets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars())
186 186
187 val mlpShade = view.layoutParams as MarginLayoutParams 187 // The only situation where we care to have a nav bar shade is when it's at the bottom
188 mlpShade.height = barInsets.bottom 188 // of the screen where scrolling list elements can go behind it.
189 view.layoutParams = mlpShade 189 val mlpNavShade = binding.navigationBarShade.layoutParams as MarginLayoutParams
190 mlpNavShade.height = barInsets.bottom
191 binding.navigationBarShade.layoutParams = mlpNavShade
190 192
191 windowInsets 193 windowInsets
192 } 194 }
diff --git a/src/android/app/src/main/res/layout/activity_settings.xml b/src/android/app/src/main/res/layout/activity_settings.xml
index 8a026a30a..a187665f2 100644
--- a/src/android/app/src/main/res/layout/activity_settings.xml
+++ b/src/android/app/src/main/res/layout/activity_settings.xml
@@ -22,7 +22,7 @@
22 22
23 <View 23 <View
24 android:id="@+id/navigation_bar_shade" 24 android:id="@+id/navigation_bar_shade"
25 android:layout_width="match_parent" 25 android:layout_width="0dp"
26 android:layout_height="1px" 26 android:layout_height="1px"
27 android:background="@android:color/transparent" 27 android:background="@android:color/transparent"
28 android:clickable="false" 28 android:clickable="false"