From 72172090f1f4f81bc6d48c7d258afeeca31a31b0 Mon Sep 17 00:00:00 2001 From: murjune Date: Sun, 27 Oct 2024 20:07:04 +0900 Subject: [PATCH 1/3] =?UTF-8?q?refactor:=20=EB=B6=88=ED=95=84=EC=9A=94?= =?UTF-8?q?=ED=95=9C=20=EB=B3=80=EC=88=98(fm)=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rogue/helper/presentation/dex/PokemonListActivity.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/android/app/src/main/java/poke/rogue/helper/presentation/dex/PokemonListActivity.kt b/android/app/src/main/java/poke/rogue/helper/presentation/dex/PokemonListActivity.kt index 8e7e7c21..5b5d196e 100644 --- a/android/app/src/main/java/poke/rogue/helper/presentation/dex/PokemonListActivity.kt +++ b/android/app/src/main/java/poke/rogue/helper/presentation/dex/PokemonListActivity.kt @@ -111,15 +111,14 @@ class PokemonListActivity : startActivity(PokemonDetailActivity.intent(this, pokemonId)) } } - val fm: FragmentManager = supportFragmentManager - fm.setFragmentResultListener(FILTER_RESULT_KEY, this) { key, bundle -> + supportFragmentManager.setFragmentResultListener(FILTER_RESULT_KEY, this) { key, bundle -> val filterArgs: PokeFilterUiModel = PokemonFilterBottomSheetFragment.argsFrom(bundle) ?: return@setFragmentResultListener viewModel.filterPokemon(filterArgs) } - fm.setFragmentResultListener(SORT_RESULT_KEY, this) { key, bundle -> + supportFragmentManager.setFragmentResultListener(SORT_RESULT_KEY, this) { key, bundle -> val sortArgs: PokemonSortUiModel = PokemonSortBottomSheetFragment.argsFrom(bundle) ?: return@setFragmentResultListener From b8a77849cf66760dd44eb49a739a8c05bc67490e Mon Sep 17 00:00:00 2001 From: murjune Date: Sun, 27 Oct 2024 20:49:59 +0900 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20pokemones=20=EA=B0=80=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=EB=90=98=EC=97=88=EC=9D=84=20=EB=95=8C=20=EC=8A=A4?= =?UTF-8?q?=ED=81=AC=EB=A1=A4=20=EC=B5=9C=EC=83=81=EB=8B=A8=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EC=9D=B4=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../helper/presentation/dex/PokemonListActivity.kt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/android/app/src/main/java/poke/rogue/helper/presentation/dex/PokemonListActivity.kt b/android/app/src/main/java/poke/rogue/helper/presentation/dex/PokemonListActivity.kt index 5b5d196e..7e16ab2d 100644 --- a/android/app/src/main/java/poke/rogue/helper/presentation/dex/PokemonListActivity.kt +++ b/android/app/src/main/java/poke/rogue/helper/presentation/dex/PokemonListActivity.kt @@ -3,7 +3,6 @@ package poke.rogue.helper.presentation.dex import android.content.res.Configuration import android.os.Bundle import androidx.appcompat.widget.Toolbar -import androidx.fragment.app.FragmentManager import androidx.recyclerview.widget.GridLayoutManager import org.koin.androidx.viewmodel.ext.android.viewModel import poke.rogue.helper.R @@ -65,15 +64,17 @@ class PokemonListActivity : private fun initObservers() { repeatOnStarted { viewModel.uiState.collect { uiState -> - pokemonAdapter.submitList(uiState.pokemons) + pokemonAdapter.submitList(uiState.pokemons) { + binding.rvPokemonList.scrollToPosition(0) + } binding.chipPokeFiter.bindPokeChip( PokeChip.Spec( label = - stringOf( - R.string.dex_filter_chip, - if (uiState.isFiltered) uiState.filterCount.toString() else "", - ), + stringOf( + R.string.dex_filter_chip, + if (uiState.isFiltered) uiState.filterCount.toString() else "", + ), trailingIconRes = R.drawable.ic_filter, isSelected = uiState.isFiltered, padding = PaddingValues(horizontal = 10.dp, vertical = 8.dp), From 1704e4ab12e3cc275e2d0ee6d6d93a4b94bdb6e8 Mon Sep 17 00:00:00 2001 From: murjune Date: Mon, 28 Oct 2024 03:49:26 +0900 Subject: [PATCH 3/3] ktlintFormat --- .../rogue/helper/presentation/dex/PokemonListActivity.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/android/app/src/main/java/poke/rogue/helper/presentation/dex/PokemonListActivity.kt b/android/app/src/main/java/poke/rogue/helper/presentation/dex/PokemonListActivity.kt index 7e16ab2d..6e089b75 100644 --- a/android/app/src/main/java/poke/rogue/helper/presentation/dex/PokemonListActivity.kt +++ b/android/app/src/main/java/poke/rogue/helper/presentation/dex/PokemonListActivity.kt @@ -71,10 +71,10 @@ class PokemonListActivity : binding.chipPokeFiter.bindPokeChip( PokeChip.Spec( label = - stringOf( - R.string.dex_filter_chip, - if (uiState.isFiltered) uiState.filterCount.toString() else "", - ), + stringOf( + R.string.dex_filter_chip, + if (uiState.isFiltered) uiState.filterCount.toString() else "", + ), trailingIconRes = R.drawable.ic_filter, isSelected = uiState.isFiltered, padding = PaddingValues(horizontal = 10.dp, vertical = 8.dp),