From 4d86e44c12620bdecced54008d1df6f65a6dd901 Mon Sep 17 00:00:00 2001 From: Charles Lombardo Date: Fri, 6 Jan 2023 15:58:29 -0500 Subject: [PATCH 1/2] Android: Add hints to allow cheats activity to be previewed --- Source/Android/app/src/main/res/layout/activity_cheats.xml | 7 +++++-- .../app/src/main/res/layout/fragment_cheat_list.xml | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) 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 c2212d5602..030e8f3581 100644 --- a/Source/Android/app/src/main/res/layout/activity_cheats.xml +++ b/Source/Android/app/src/main/res/layout/activity_cheats.xml @@ -2,6 +2,7 @@ @@ -45,13 +46,15 @@ android:id="@+id/cheat_list" android:name="org.dolphinemu.dolphinemu.features.cheats.ui.CheatListFragment" android:layout_width="match_parent" - android:layout_height="match_parent" /> + android:layout_height="match_parent" + tools:layout="@layout/fragment_cheat_list" /> + android:layout_height="match_parent" + tools:layout="@layout/fragment_cheat_details" /> diff --git a/Source/Android/app/src/main/res/layout/fragment_cheat_list.xml b/Source/Android/app/src/main/res/layout/fragment_cheat_list.xml index 93649f4def..0ce5742c97 100644 --- a/Source/Android/app/src/main/res/layout/fragment_cheat_list.xml +++ b/Source/Android/app/src/main/res/layout/fragment_cheat_list.xml @@ -2,6 +2,7 @@ @@ -14,7 +15,8 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toTopOf="@id/gfx_mods_warning" /> + app:layout_constraintBottom_toTopOf="@id/gfx_mods_warning" + tools:layout="@layout/fragment_cheat_warning" /> + app:layout_constraintBottom_toTopOf="@id/cheat_list" + tools:layout="@layout/fragment_cheat_warning" /> Date: Fri, 6 Jan 2023 16:00:56 -0500 Subject: [PATCH 2/2] 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. --- .../org/dolphinemu/dolphinemu/utils/InsetsHelper.java | 9 +++------ .../Android/app/src/main/res/layout/activity_cheats.xml | 6 +++++- 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 @@ +