From d2364ae1f7f6ea962d296148d85fe08549baed37 Mon Sep 17 00:00:00 2001 From: xbzk Date: Thu, 5 Jun 2025 18:58:43 +0000 Subject: [PATCH] Built-in landscape searchbar & status bar fixes (#154) android layout: landscape: moves the searchbar to top bar's free space, increasing room for gamelist; minor fixes: landscape: avoid settings button getting beneath android navbar; portrait: avoid top bar's getting beneath android status bar. Co-authored-by: Allison Cunha Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/154 Co-authored-by: xbzk Co-committed-by: xbzk --- .../org/yuzu/yuzu_emu/ui/GamesFragment.kt | 7 + .../main/res/layout-land/fragment_games.xml | 219 ++++++++++++++++++ 2 files changed, 226 insertions(+) create mode 100644 src/android/app/src/main/res/layout-land/fragment_games.xml diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/GamesFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/GamesFragment.kt index c1d0f6297a..b0121ad132 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/GamesFragment.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/GamesFragment.kt @@ -454,6 +454,7 @@ class GamesFragment : Fragment() { val leftInsets = barInsets.left + cutoutInsets.left val rightInsets = barInsets.right + cutoutInsets.right + val topInsets = barInsets.top + cutoutInsets.top val mlpSwipe = binding.swipeRefresh.layoutParams as ViewGroup.MarginLayoutParams if (view.getLayoutDirection() == View.LAYOUT_DIRECTION_LTR) { mlpSwipe.leftMargin = leftInsets @@ -464,6 +465,12 @@ class GamesFragment : Fragment() { } binding.swipeRefresh.layoutParams = mlpSwipe + val mlpHeader = binding.header.layoutParams as ViewGroup.MarginLayoutParams + mlpHeader.leftMargin += leftInsets + mlpHeader.rightMargin += rightInsets + mlpHeader.topMargin += if (!isLandscape) topInsets else 0 + binding.header.layoutParams = mlpHeader + binding.noticeText.updatePadding(bottom = spacingNavigation) binding.header.updatePadding(top = cutoutInsets.top + resources.getDimensionPixelSize(R.dimen.spacing_large) + if (isLandscape) barInsets.top else 0) binding.gridGames.updatePadding( diff --git a/src/android/app/src/main/res/layout-land/fragment_games.xml b/src/android/app/src/main/res/layout-land/fragment_games.xml new file mode 100644 index 0000000000..68ccb86b57 --- /dev/null +++ b/src/android/app/src/main/res/layout-land/fragment_games.xml @@ -0,0 +1,219 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file