summaryrefslogtreecommitdiff
path: root/Source/Android/app/src
diff options
context:
space:
mode:
authorCharles Lombardo <clombardo169@gmail.com>2023-01-06 16:00:56 -0500
committerCharles Lombardo <clombardo169@gmail.com>2023-01-07 13:08:51 -0500
commitd32cc1e5eb6402dff1229626855482076d9aa0da (patch)
treee8ffdac4eddd745e4180be30c07f0b66c20994a8 /Source/Android/app/src
parent4d86e44c12620bdecced54008d1df6f65a6dd901 (diff)
Android: Fix workaround view in cheats activity
When using a fullscreen mode on some phones that remove the navigation bar, inset callbacks will not be fired. To account for this we set the workaround view at a height of 1px to prevent the view from filling the entire screen due to this activity using a Constraint layout.
Diffstat (limited to 'Source/Android/app/src')
-rw-r--r--Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/InsetsHelper.java9
-rw-r--r--Source/Android/app/src/main/res/layout/activity_cheats.xml6
2 files changed, 8 insertions, 7 deletions
diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/InsetsHelper.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/InsetsHelper.java
index b4670341a9..cfbb859676 100644
--- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/InsetsHelper.java
+++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/InsetsHelper.java
@@ -31,12 +31,9 @@ public class InsetsHelper
// navigation bar https://issuetracker.google.com/issues/248761842
public static void applyNavbarWorkaround(int bottomInset, View workaroundView)
{
- if (bottomInset > 0)
- {
- ViewGroup.LayoutParams lpWorkaround = workaroundView.getLayoutParams();
- lpWorkaround.height = bottomInset;
- workaroundView.setLayoutParams(lpWorkaround);
- }
+ ViewGroup.LayoutParams lpWorkaround = workaroundView.getLayoutParams();
+ lpWorkaround.height = bottomInset;
+ workaroundView.setLayoutParams(lpWorkaround);
}
public static int getSystemGestureType(Context context)
diff --git a/Source/Android/app/src/main/res/layout/activity_cheats.xml b/Source/Android/app/src/main/res/layout/activity_cheats.xml
index 030e8f3581..f8be839551 100644
--- a/Source/Android/app/src/main/res/layout/activity_cheats.xml
+++ b/Source/Android/app/src/main/res/layout/activity_cheats.xml
@@ -58,10 +58,14 @@
</androidx.slidingpanelayout.widget.SlidingPaneLayout>
+ <!-- We have to set the layout height at 1px because when a device forces fullscreen mode,
+ inset callbacks are not triggered and using 0dp will make this view cover the entire
+ display since this activity uses a constraint layout. Now, even if the callback isn't
+ triggered, this view will remain at 1px height. -->
<View
android:id="@+id/workaround_view"
android:layout_width="match_parent"
- android:layout_height="0dp"
+ android:layout_height="1px"
android:layout_gravity="bottom"
android:background="@android:color/transparent"
android:clickable="true"