From 0eeeee515e8c8c533b8514b2bbaf7f2d17e93341 Mon Sep 17 00:00:00 2001 From: Inix Date: Mon, 20 Oct 2025 06:46:31 +0200 Subject: [PATCH] [android, gameProperties] Use StaggeredGrid instead stead of Grid layout for cards (#2781) Fixes weird behavior with new secondary action chips. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2781 Co-authored-by: Inix Co-committed-by: Inix --- .../yuzu_emu/fragments/GamePropertiesFragment.kt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/GamePropertiesFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/GamePropertiesFragment.kt index eedddb557e..6861916430 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/GamePropertiesFragment.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/GamePropertiesFragment.kt @@ -22,7 +22,7 @@ import androidx.fragment.app.activityViewModels import androidx.lifecycle.lifecycleScope import androidx.navigation.findNavController import androidx.navigation.fragment.navArgs -import androidx.recyclerview.widget.GridLayoutManager +import androidx.recyclerview.widget.StaggeredGridLayoutManager import com.google.android.material.transition.MaterialSharedAxis import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -457,8 +457,14 @@ class GamePropertiesFragment : Fragment() { } } binding.listProperties.apply { - layoutManager = - GridLayoutManager(requireContext(), resources.getInteger(R.integer.grid_columns)) + val spanCount = resources.getInteger(R.integer.grid_columns) + val staggered = StaggeredGridLayoutManager( + spanCount, + StaggeredGridLayoutManager.VERTICAL + ).apply { + gapStrategy = StaggeredGridLayoutManager.GAP_HANDLING_MOVE_ITEMS_BETWEEN_SPANS + } + layoutManager = staggered adapter = GamePropertiesAdapter(viewLifecycleOwner, properties) } }