From b8a77849cf66760dd44eb49a739a8c05bc67490e Mon Sep 17 00:00:00 2001 From: murjune Date: Sun, 27 Oct 2024 20:49:59 +0900 Subject: [PATCH] =?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),