Browse Source
Merge pull request #11594 from t895/rotation-fix
android: Prevent nav bar shade from laying out across screen
pull/15/merge
Charles Lombardo
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
7 additions and
5 deletions
-
src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsActivity.kt
-
src/android/app/src/main/res/layout/activity_settings.xml
|
|
|
@ -181,12 +181,14 @@ class SettingsActivity : AppCompatActivity() { |
|
|
|
private fun setInsets() { |
|
|
|
ViewCompat.setOnApplyWindowInsetsListener( |
|
|
|
binding.navigationBarShade |
|
|
|
) { view: View, windowInsets: WindowInsetsCompat -> |
|
|
|
) { _: View, windowInsets: WindowInsetsCompat -> |
|
|
|
val barInsets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars()) |
|
|
|
|
|
|
|
val mlpShade = view.layoutParams as MarginLayoutParams |
|
|
|
mlpShade.height = barInsets.bottom |
|
|
|
view.layoutParams = mlpShade |
|
|
|
// The only situation where we care to have a nav bar shade is when it's at the bottom |
|
|
|
// of the screen where scrolling list elements can go behind it. |
|
|
|
val mlpNavShade = binding.navigationBarShade.layoutParams as MarginLayoutParams |
|
|
|
mlpNavShade.height = barInsets.bottom |
|
|
|
binding.navigationBarShade.layoutParams = mlpNavShade |
|
|
|
|
|
|
|
windowInsets |
|
|
|
} |
|
|
|
|
|
|
|
@ -22,7 +22,7 @@ |
|
|
|
|
|
|
|
<View |
|
|
|
android:id="@+id/navigation_bar_shade" |
|
|
|
android:layout_width="match_parent" |
|
|
|
android:layout_width="0dp" |
|
|
|
android:layout_height="1px" |
|
|
|
android:background="@android:color/transparent" |
|
|
|
android:clickable="false" |
|
|
|
|