From e67788571a9e6e72f6cf2cb4c239f3dc47960283 Mon Sep 17 00:00:00 2001 From: Charles Lombardo Date: Tue, 22 Nov 2022 15:18:45 -0500 Subject: [PATCH] Android: Fix condition where we set grid span too early --- .../dolphinemu/ui/platform/PlatformGamesFragment.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/platform/PlatformGamesFragment.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/platform/PlatformGamesFragment.java index 527b7d659d..d26476f1a6 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/platform/PlatformGamesFragment.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/platform/PlatformGamesFragment.java @@ -75,6 +75,11 @@ public final class PlatformGamesFragment extends Fragment implements PlatformGam @Override public void onGlobalLayout() { + if (mBinding.getRoot().getMeasuredWidth() == 0) + { + return; + } + int columns = mBinding.getRoot().getMeasuredWidth() / requireContext().getResources().getDimensionPixelSize(R.dimen.card_width); if (columns == 0)