-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AN_UI] 포켓몬 도감 목록에서 포켓몬 이름을 통해 검색 (#60)
* feat: 포켓몬 목록의 검색 바 ui 를 추가한다 * feat: 포켓몬 리스트에 서치바를 추가한다 * feat: 포켓몬 이름으로 검색한 포켓몬 결과 목록을 구한다 * feat: 포켓몬 목록 검색 바에서 포켓몬 이름을 검색하면 그를 포함하는 포켓몬을 구한다 * feat: 포켓몬 쿼리 리스너에서 이름으로 포켓몬들을 쿼리한다 * refactor: 포켓몬 검색 쿼리를 데이터바인딩으로 쿼리한다 * feat: 가짜 포켓몬 목록 데이터 소스에서 쿼리된 포켓몬 목록을 리턴한다 * feat: 포켓몬 목록 레포지토리에서 모든 포켓몬 목록과 검색된 포켓몬 목록을 flow 로 래핑하여 리턴한다 * feat: 포켓몬 목록 데이터 리스트를 ui 모델로 변환한다 * refactor: 레포지토리의 Flow 로 감싸진 결과를 가지고 ui 에 쿼리된 포켓몬을 표시한다 * refactor: 포켓몬 목록 레포지토리의 기존 함수 제거하고 함수명을 변경한다 - 포켓몬 목록을 리턴하는 함수 제거 - 포켓몬 목록 플로우를 리턴하는 함수 이름 변경 pokemons2 -> pokemons * refactor: 포켓몬 목록 프래그먼트에 필요없는 애노테이션 제거 * chore(PokemonQueryListener -> PokemonQueryHandler) 이름 변경 - 새로 정해진 컨벤션에 맞춰 수정한다 * refactor: 가짜 포켓몬 목록 데이터소스의 메서드 네이밍 변경 - searchedPokemons -> pokemons * feet: 가짜 포켓몬 목록 레포지토리의 Flow 가 아닌 결과를 리턴하는 메서드 * refactor: 포켓몬 목록 뷰모델에서 flow 로 래핑되지 않은 포케몬 목록 반환 함수를 사용한다 * refactor: PokemonListRepository 의 flow 를 리턴하는 함수 제거 * refactor(PokeMonItemClickListener -> PokemonDetailNavigateHandler) 이름 변경 * refactor: 포켓몬 목록 뷰모델 map 함수를 mapLatest 로 바꾼다
- Loading branch information
Showing
15 changed files
with
129 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 0 additions & 5 deletions
5
android/app/src/main/java/poke/rogue/helper/presentation/dex/PokeMonItemClickListener.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
android/app/src/main/java/poke/rogue/helper/presentation/dex/PokemonDetailNavigateHandler.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package poke.rogue.helper.presentation.dex | ||
|
||
fun interface PokemonDetailNavigateHandler { | ||
fun navigateToPokemonDetail(pokemonId: Long) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
android/app/src/main/java/poke/rogue/helper/presentation/dex/PokemonQueryHandler.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package poke.rogue.helper.presentation.dex | ||
|
||
fun interface PokemonQueryHandler { | ||
fun onQueryName(name: String) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
android/app/src/main/java/poke/rogue/helper/presentation/dex/SearchViewBindingAdapter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package poke.rogue.helper.presentation.dex | ||
|
||
import androidx.appcompat.widget.SearchView | ||
import androidx.databinding.BindingAdapter | ||
|
||
@BindingAdapter("onQueryTextChange") | ||
fun setOnQueryTextListener( | ||
searchView: SearchView, | ||
onQueryTextChangeListener: PokemonQueryHandler, | ||
) { | ||
searchView.setOnQueryTextListener( | ||
object : SearchView.OnQueryTextListener { | ||
override fun onQueryTextSubmit(query: String?): Boolean = false | ||
|
||
override fun onQueryTextChange(newText: String?): Boolean { | ||
onQueryTextChangeListener.onQueryName(newText.toString()) | ||
return true | ||
} | ||
}, | ||
) | ||
} |
10 changes: 10 additions & 0 deletions
10
android/app/src/main/res/drawable/rounded_searchbar_background.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<shape xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<solid android:color="@color/poke_white" /> | ||
<corners android:radius="40dp" /> | ||
<padding | ||
android:bottom="4dp" | ||
android:left="4dp" | ||
android:right="4dp" | ||
android:top="4dp" /> | ||
</shape> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters