mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-21 12:41:09 +00:00
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.
This commit is contained in:
parent
4d86e44c12
commit
d32cc1e5eb
@ -31,12 +31,9 @@ public class InsetsHelper
|
|||||||
// navigation bar https://issuetracker.google.com/issues/248761842
|
// navigation bar https://issuetracker.google.com/issues/248761842
|
||||||
public static void applyNavbarWorkaround(int bottomInset, View workaroundView)
|
public static void applyNavbarWorkaround(int bottomInset, View workaroundView)
|
||||||
{
|
{
|
||||||
if (bottomInset > 0)
|
ViewGroup.LayoutParams lpWorkaround = workaroundView.getLayoutParams();
|
||||||
{
|
lpWorkaround.height = bottomInset;
|
||||||
ViewGroup.LayoutParams lpWorkaround = workaroundView.getLayoutParams();
|
workaroundView.setLayoutParams(lpWorkaround);
|
||||||
lpWorkaround.height = bottomInset;
|
|
||||||
workaroundView.setLayoutParams(lpWorkaround);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getSystemGestureType(Context context)
|
public static int getSystemGestureType(Context context)
|
||||||
|
@ -58,10 +58,14 @@
|
|||||||
|
|
||||||
</androidx.slidingpanelayout.widget.SlidingPaneLayout>
|
</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
|
<View
|
||||||
android:id="@+id/workaround_view"
|
android:id="@+id/workaround_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="1px"
|
||||||
android:layout_gravity="bottom"
|
android:layout_gravity="bottom"
|
||||||
android:background="@android:color/transparent"
|
android:background="@android:color/transparent"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user