[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 <Nixy01@proton.me> Co-committed-by: Inix <Nixy01@proton.me>
This commit is contained in:
parent
54d6283ac3
commit
0eeeee515e
1 changed files with 9 additions and 3 deletions
|
|
@ -22,7 +22,7 @@ import androidx.fragment.app.activityViewModels
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import androidx.navigation.findNavController
|
import androidx.navigation.findNavController
|
||||||
import androidx.navigation.fragment.navArgs
|
import androidx.navigation.fragment.navArgs
|
||||||
import androidx.recyclerview.widget.GridLayoutManager
|
import androidx.recyclerview.widget.StaggeredGridLayoutManager
|
||||||
import com.google.android.material.transition.MaterialSharedAxis
|
import com.google.android.material.transition.MaterialSharedAxis
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
|
@ -457,8 +457,14 @@ class GamePropertiesFragment : Fragment() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
binding.listProperties.apply {
|
binding.listProperties.apply {
|
||||||
layoutManager =
|
val spanCount = resources.getInteger(R.integer.grid_columns)
|
||||||
GridLayoutManager(requireContext(), 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)
|
adapter = GamePropertiesAdapter(viewLifecycleOwner, properties)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue