-
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.
[0.2.0.alpha/AN_FEAT_UI] PokemonList Filter, PokeChip, PokeChipGroup …
…Component 구현 (#242) * refactor: PokeListFragment -> PokeActivity * test: EventFLowTest * chore: RefreshEventBus 네이밍 변경 * fix: 5초 지나고 화면 다시 돌아오면 오둥이 보이는 버그 수정 * feat: SearchView clearFocus * style: ktFormat * ui: margin 늘리기 * feat: Pokemon 프로퍼티 추가 * feat: Pokemon filter, sort * feat: Pokemon filtering, Sort 로직 * test: FakeDexRepository * style: KtFormat * [2.0.0-alph/AN-UI,Fix] 화면 나갔다가 5초 이후에 들어오면 오둥이 보이는 버그 수정 + clearFocus (#225) * refactor: PokeListFragment -> PokeActivity * test: EventFLowTest * chore: RefreshEventBus 네이밍 변경 * fix: 5초 지나고 화면 다시 돌아오면 오둥이 보이는 버그 수정 * feat: SearchView clearFocus * style: ktFormat * ui: margin 늘리기 * [2.0.0.alpha/AN-UI] 배틀 도우미 화면 구현 (#232) * feat: 배틀 페이지 이동 * chore: 필요한 아이콘 추가 * chore: 필요한 배경 및 스타일 지정 * ui: 배틀 페이지 xml 작성 * ui: 날씨 선택 스피너 구현 * ui: 배틀 페이지 액티비티 구현 * feat: 날씨 데이터 연결 * refactor: adapter의 리스트 데이터를 업데이트할 수 있도록 변경 * fix: 린트 수정 및 충돌 해결 * ui: PokeChip, PokeChipGroup * [0.2.0.alpha/AN-FEAT] Pokemon FIlter, Sort data 로직 (#228) * refactor: PokeListFragment -> PokeActivity * test: EventFLowTest * chore: RefreshEventBus 네이밍 변경 * fix: 5초 지나고 화면 다시 돌아오면 오둥이 보이는 버그 수정 * feat: SearchView clearFocus * style: ktFormat * ui: margin 늘리기 * feat: Pokemon 프로퍼티 추가 * feat: Pokemon filter, sort * feat: Pokemon filtering, Sort 로직 * test: FakeDexRepository * style: KtFormat * feat: 여러 filter 조건으로 받을 수 있도록 리팩토링 * refactor: filter 네이밍 변경 * refactor: packaing * ui: Chip select 시 bold 처리 * fix: DexRepository isBlanck() 로 변경 * build: crashlytics impl 위치 변경 * chore: sample Activity 삭제 * feat: PokeFIlter 구현 * style: ktFormat * refactor: 코드 정리 * chore: PokeChipSpec -> Spec * chore: 불필요한 Timber 삭제 * style: ktFormat * ui: PokeChip - ConerRadius, Padding 추가 * ui: PokeSpec - color, sizes naming 변경 --------- Co-authored-by: Yehyun Jo <[email protected]>
- Loading branch information
1 parent
5707f7c
commit ffcbbf3
Showing
29 changed files
with
1,251 additions
and
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,4 +62,4 @@ | |
android:exported="false" /> | ||
</application> | ||
|
||
</manifest> | ||
</manifest> |
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
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
14 changes: 14 additions & 0 deletions
14
android/app/src/main/java/poke/rogue/helper/presentation/dex/filter/PokeFilterUiEvent.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,14 @@ | ||
package poke.rogue.helper.presentation.dex.filter | ||
|
||
import poke.rogue.helper.presentation.type.model.TypeUiModel | ||
|
||
sealed interface PokeFilterUiEvent { | ||
data object IDLE : PokeFilterUiEvent | ||
|
||
data class ApplyFiltering( | ||
val selectedTypes: List<TypeUiModel>, | ||
val generation: PokeGenerationUiModel, | ||
) : PokeFilterUiEvent | ||
|
||
data object CloseFilter : PokeFilterUiEvent | ||
} |
11 changes: 11 additions & 0 deletions
11
android/app/src/main/java/poke/rogue/helper/presentation/dex/filter/PokeFilterUiModel.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,11 @@ | ||
package poke.rogue.helper.presentation.dex.filter | ||
|
||
import android.os.Parcelable | ||
import kotlinx.parcelize.Parcelize | ||
import poke.rogue.helper.presentation.type.model.TypeUiModel | ||
|
||
@Parcelize | ||
data class PokeFilterUiModel( | ||
val selectedTypes: List<TypeUiModel>, | ||
val selectedGeneration: PokeGenerationUiModel, | ||
) : Parcelable |
57 changes: 57 additions & 0 deletions
57
android/app/src/main/java/poke/rogue/helper/presentation/dex/filter/PokeFilterUiState.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,57 @@ | ||
package poke.rogue.helper.presentation.dex.filter | ||
|
||
import poke.rogue.helper.presentation.type.model.TypeUiModel | ||
|
||
data class PokeFilterUiState( | ||
val types: List<SelectableUiModel<TypeUiModel>>, | ||
val generations: List<SelectableUiModel<PokeGenerationUiModel>>, | ||
val selectedTypes: List<TypeUiModel> = emptyList(), | ||
) { | ||
init { | ||
require(generations.any { it.isSelected }) { | ||
"적어도 하나의 세대가 선택되어야 합니다." | ||
} | ||
require(generations.size == PokeGenerationUiModel.entries.size) { | ||
"세대의 크기는 ${PokeGenerationUiModel.entries.size}여야 합니다." | ||
} | ||
require(types.size == TypeUiModel.entries.size) { | ||
"타입의 크기는 ${TypeUiModel.entries.size}여야 합니다." | ||
} | ||
require(types.count { it.isSelected } <= 2) { | ||
"최대 2개의 타입만 선택할 수 있습니다." | ||
} | ||
} | ||
|
||
val selectedGeneration: PokeGenerationUiModel | ||
get() = generations.first { it.isSelected }.data | ||
|
||
companion object { | ||
val DEFAULT = | ||
PokeFilterUiState( | ||
types = | ||
TypeUiModel.entries.mapIndexed { index, typeUiModel -> | ||
SelectableUiModel( | ||
index, | ||
false, | ||
typeUiModel, | ||
) | ||
}, | ||
generations = | ||
PokeGenerationUiModel.entries.mapIndexed { index, pokeGenerationUiModel -> | ||
if (pokeGenerationUiModel == PokeGenerationUiModel.ALL) { | ||
SelectableUiModel( | ||
index, | ||
true, | ||
pokeGenerationUiModel, | ||
) | ||
} else { | ||
SelectableUiModel( | ||
index, | ||
false, | ||
pokeGenerationUiModel, | ||
) | ||
} | ||
}, | ||
) | ||
} | ||
} |
Oops, something went wrong.