summaryrefslogtreecommitdiff
path: root/Source/Android/app/src
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2023-01-07 19:27:30 +0100
committerGitHub <noreply@github.com>2023-01-07 19:27:30 +0100
commitdcded0471986a0e8fea3fb69f596350228097189 (patch)
treecda6736d06a93640690c33600c237098df994953 /Source/Android/app/src
parent710d7e3637f9da1d0974572f04cf73f5fffe9b4b (diff)
parentd32cc1e5eb6402dff1229626855482076d9aa0da (diff)
Merge pull request #11410 from t895/fullscreen-fix
Android: Fix use of fullscreen modes on Cheats Activity
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.xml13
-rw-r--r--Source/Android/app/src/main/res/layout/fragment_cheat_list.xml7
3 files changed, 18 insertions, 11 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 c2212d5602..f8be839551 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 @@
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
@@ -45,20 +46,26 @@
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" />
<androidx.fragment.app.FragmentContainerView
android:id="@+id/cheat_details"
android:name="org.dolphinemu.dolphinemu.features.cheats.ui.CheatDetailsFragment"
android:layout_width="match_parent"
- android:layout_height="match_parent" />
+ android:layout_height="match_parent"
+ tools:layout="@layout/fragment_cheat_details" />
</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"
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 @@
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
@@ -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" />
<androidx.fragment.app.FragmentContainerView
android:id="@+id/gfx_mods_warning"
@@ -25,7 +27,8 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/cheats_warning"
- app:layout_constraintBottom_toTopOf="@id/cheat_list" />
+ app:layout_constraintBottom_toTopOf="@id/cheat_list"
+ tools:layout="@layout/fragment_cheat_warning" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/cheat_list"