Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #11410 from t895/fullscreen-fix
Android: Fix use of fullscreen modes on Cheats Activity
  • Loading branch information
JosJuice committed Jan 7, 2023
2 parents 710d7e3 + d32cc1e commit dcded04
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
Expand Up @@ -31,12 +31,9 @@ public static void insetAppBar(Insets insets, AppBarLayout appBarLayout)
// 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)
Expand Down
13 changes: 10 additions & 3 deletions Source/Android/app/src/main/res/layout/activity_cheats.xml
Expand Up @@ -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">

Expand Down Expand Up @@ -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"
Expand Down
Expand Up @@ -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">

Expand All @@ -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"
Expand All @@ -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"
Expand Down

0 comments on commit dcded04

Please sign in to comment.