VERY experimental Nintendo Switch 2 emulator
C++
android: Sort games alphabetically by default
Charles Lombardodfd005533929
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.ktindex cc17b86264..0b4ae8744e 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@@ -20,8 +20,10 @@ import org.yuzu.yuzu_emu.Rimport org.yuzu.yuzu_emu.adapters.GameAdapterimport org.yuzu.yuzu_emu.databinding.FragmentGamesBindingimport org.yuzu.yuzu_emu.layout.AutofitGridLayoutManager+import org.yuzu.yuzu_emu.model.Gameimport org.yuzu.yuzu_emu.model.GamesViewModelimport org.yuzu.yuzu_emu.model.HomeViewModel+import java.util.Localeclass GamesFragment : Fragment() {private var _binding: FragmentGamesBinding? = null@@ -73,7 +75,7 @@ class GamesFragment : Fragment() {binding.swipeRefresh.isRefreshing = isReloading}gamesViewModel.games.observe(viewLifecycleOwner) {- (binding.gridGames.adapter as GameAdapter).submitList(it)+ submitGamesList(it)if (it.isEmpty()) {binding.noticeText.visibility = View.VISIBLE} else {@@ -83,7 +85,7 @@ class GamesFragment : Fragment() {gamesViewModel.shouldSwapData.observe(viewLifecycleOwner) { shouldSwapData ->if (shouldSwapData) {- (binding.gridGames.adapter as GameAdapter).submitList(gamesViewModel.games.value)+ submitGamesList(gamesViewModel.games.value!!)gamesViewModel.setShouldSwapData(false)}}@@ -107,6 +109,11 @@ class GamesFragment : Fragment() {}}+ private fun submitGamesList(gameList: List<Game>) {+ val sortedList = gameList.sortedBy { it.title.lowercase(Locale.getDefault()) }+ (binding.gridGames.adapter as GameAdapter).submitList(sortedList)+ }+override fun onDestroyView() {super.onDestroyView()_binding = null