-
Notifications
You must be signed in to change notification settings - Fork 2
[Feature] 콜밴 리스트의 필터 및 검색 기능 UI 구현 #1355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
+714
−0
Closed
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
654e0ab
feat: Callvan list filter and search
TTRR1007 0fb1fa9
refactor: apply suggestions from code review
TTRR1007 f1d8de1
Merge branch 'develop' into feature/#1283-callvan-list-filter-and-search
TTRR1007 5ee23ed
refactor: apply suggestions from Nitpick comments
TTRR1007 6ebeaea
Merge remote-tracking branch 'origin/feature/#1283-callvan-list-filte…
TTRR1007 d1f0335
chore: kt lint
TTRR1007 683a5bf
refactor: add @Immutable and default values to FilterBottomSheetState
TTRR1007 416c118
fix: fix filter state and compile errors in FilterBottomSheet
TTRR1007 9434dd7
refactor: add modifier parameter to FilterSection and FilterDuplicate…
TTRR1007 49420b7
refactor: add @Stable annotation
TTRR1007 c9dbea3
chore: kt lint
TTRR1007 f50fb8d
refactor: simplify maxLength clamping logic using take()
TTRR1007 085b34c
fix: prevent IllegalArgumentException for negative maxLength
TTRR1007 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
feature/callvan/src/main/java/in/koreatech/koin/feature/callvan/Constant.kt
This file contains hidden or 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,3 @@ | ||
| package `in`.koreatech.koin.feature.callvan | ||
|
|
||
| const val TEXT_FIELD_MAX_LENGTH = 255 |
115 changes: 115 additions & 0 deletions
115
feature/callvan/src/main/java/in/koreatech/koin/feature/callvan/enums/CallvanFilterType.kt
This file contains hidden or 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,115 @@ | ||
| package `in`.koreatech.koin.feature.callvan.enums | ||
|
|
||
| import android.os.Parcelable | ||
| import androidx.annotation.StringRes | ||
| import `in`.koreatech.koin.feature.callvan.R | ||
| import kotlinx.parcelize.Parcelize | ||
|
|
||
| @Parcelize | ||
| sealed class CallvanFilterType( | ||
| @StringRes open val stringRes: Int, | ||
| open val value: String? | ||
| ) : Parcelable { | ||
|
|
||
| @Parcelize | ||
| sealed class DeparturesFilterType( | ||
| @StringRes override val stringRes: Int, | ||
| override val value: String? | ||
| ) : CallvanFilterType(stringRes, value) { | ||
| @Parcelize | ||
| object All : DeparturesFilterType(R.string.filter_list_all, null) | ||
|
|
||
| @Parcelize | ||
| object FrontGate : DeparturesFilterType(R.string.filter_list_front_gate, "FRONT_GATE") | ||
|
|
||
| @Parcelize | ||
| object BackGate : DeparturesFilterType(R.string.filter_list_back_gate, "BACK_GATE") | ||
|
|
||
| @Parcelize | ||
| object TennisCourt : DeparturesFilterType(R.string.filter_list_tennis_court, "TENNIS_COURT") | ||
|
|
||
| @Parcelize | ||
| object DormitoryMain : DeparturesFilterType(R.string.filter_list_dormitory_main, "DORMITORY_MAIN") | ||
|
|
||
| @Parcelize | ||
| object DormitorySub : DeparturesFilterType(R.string.filter_list_dormitory_sub, "DORMITORY_SUB") | ||
|
|
||
| @Parcelize | ||
| object Terminal : DeparturesFilterType(R.string.filter_list_terminal, "TERMINAL") | ||
|
|
||
| @Parcelize | ||
| object Station : DeparturesFilterType(R.string.filter_list_station, "STATION") | ||
|
|
||
| @Parcelize | ||
| object AsanStation : DeparturesFilterType(R.string.filter_list_asan_station, "ASAN_STATION") | ||
| } | ||
|
|
||
| @Parcelize | ||
| sealed class ArrivalsFilterType( | ||
| @StringRes override val stringRes: Int, | ||
| override val value: String? | ||
| ) : CallvanFilterType(stringRes, value) { | ||
| @Parcelize | ||
| object All : ArrivalsFilterType(R.string.filter_list_all, null) | ||
|
|
||
| @Parcelize | ||
| object FrontGate : ArrivalsFilterType(R.string.filter_list_front_gate, "FRONT_GATE") | ||
|
|
||
| @Parcelize | ||
| object BackGate : ArrivalsFilterType(R.string.filter_list_back_gate, "BACK_GATE") | ||
|
|
||
| @Parcelize | ||
| object TennisCourt : ArrivalsFilterType(R.string.filter_list_tennis_court, "TENNIS_COURT") | ||
|
|
||
| @Parcelize | ||
| object DormitoryMain : ArrivalsFilterType(R.string.filter_list_dormitory_main, "DORMITORY_MAIN") | ||
|
|
||
| @Parcelize | ||
| object DormitorySub : ArrivalsFilterType(R.string.filter_list_dormitory_sub, "DORMITORY_SUB") | ||
|
|
||
| @Parcelize | ||
| object Terminal : ArrivalsFilterType(R.string.filter_list_terminal, "TERMINAL") | ||
|
|
||
| @Parcelize | ||
| object Station : ArrivalsFilterType(R.string.filter_list_station, "STATION") | ||
|
|
||
| @Parcelize | ||
| object AsanStation : ArrivalsFilterType(R.string.filter_list_asan_station, "ASAN_STATION") | ||
| } | ||
|
|
||
| @Parcelize | ||
| sealed class StatusesType( | ||
| @StringRes override val stringRes: Int, | ||
| override val value: String? | ||
| ) : CallvanFilterType(stringRes, value) { | ||
| @Parcelize | ||
| object All : StatusesType(R.string.filter_list_all, null) | ||
|
|
||
| @Parcelize | ||
| object Recruiting : StatusesType(R.string.filter_list_recruiting, "RECRUITING") | ||
|
|
||
| @Parcelize | ||
| object Closed : StatusesType(R.string.filter_list_closed, "CLOSED") | ||
|
|
||
| @Parcelize | ||
| object Completed : StatusesType(R.string.filter_list_completed, "COMPLETED") | ||
| } | ||
|
|
||
| @Parcelize | ||
| sealed class SortType( | ||
| @StringRes override val stringRes: Int, | ||
| override val value: String? | ||
| ) : CallvanFilterType(stringRes, value) { | ||
| @Parcelize | ||
| object LatestDesc : SortType(R.string.filter_list_latest_desc, "LATEST_DESC") | ||
|
|
||
| @Parcelize | ||
| object LatestAsc : SortType(R.string.filter_list_latest_asc, "LATEST_ASC") | ||
|
|
||
| @Parcelize | ||
| object DepartureDesc : SortType(R.string.filter_list_departure_desc, "DEPARTURE_DESC") | ||
|
|
||
| @Parcelize | ||
| object DepartureAsc : SortType(R.string.filter_list_departure_asc, "DEPARTURE_ASC") | ||
| } | ||
| } | ||
15 changes: 15 additions & 0 deletions
15
...llvan/src/main/java/in/koreatech/koin/feature/callvan/ui/list/FilterBottomSheetActions.kt
This file contains hidden or 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,15 @@ | ||
| package `in`.koreatech.koin.feature.callvan.ui.list | ||
|
|
||
| import androidx.compose.runtime.Stable | ||
| import `in`.koreatech.koin.feature.callvan.enums.CallvanFilterType | ||
| import kotlinx.collections.immutable.ImmutableList | ||
|
|
||
| @Stable | ||
| data class FilterBottomSheetActions( | ||
| val onSortTypeChange: (CallvanFilterType.SortType) -> Unit, | ||
| val onStatusesTypeChange: (CallvanFilterType.StatusesType) -> Unit, | ||
| val onDeparturesTypeChange: (ImmutableList<CallvanFilterType.DeparturesFilterType>) -> Unit, | ||
| val onArrivalsTypeChange: (ImmutableList<CallvanFilterType.ArrivalsFilterType>) -> Unit, | ||
| val onReset: () -> Unit, | ||
| val onApplyClick: () -> Unit | ||
| ) |
17 changes: 17 additions & 0 deletions
17
...callvan/src/main/java/in/koreatech/koin/feature/callvan/ui/list/FilterBottomSheetState.kt
This file contains hidden or 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,17 @@ | ||
| package `in`.koreatech.koin.feature.callvan.ui.list | ||
|
|
||
| import androidx.compose.runtime.Immutable | ||
| import `in`.koreatech.koin.feature.callvan.enums.CallvanFilterType.ArrivalsFilterType | ||
| import `in`.koreatech.koin.feature.callvan.enums.CallvanFilterType.DeparturesFilterType | ||
| import `in`.koreatech.koin.feature.callvan.enums.CallvanFilterType.SortType | ||
| import `in`.koreatech.koin.feature.callvan.enums.CallvanFilterType.StatusesType | ||
| import kotlinx.collections.immutable.ImmutableList | ||
| import kotlinx.collections.immutable.persistentListOf | ||
|
|
||
| @Immutable | ||
| data class FilterBottomSheetState( | ||
| val selectedSortType: SortType = SortType.LatestDesc, | ||
| val selectedStatusesType: StatusesType = StatusesType.All, | ||
| val selectedDeparturesType: ImmutableList<DeparturesFilterType> = persistentListOf(DeparturesFilterType.All), | ||
| val selectedArrivalsType: ImmutableList<ArrivalsFilterType> = persistentListOf(ArrivalsFilterType.All) | ||
| ) | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
61 changes: 61 additions & 0 deletions
61
...an/src/main/java/in/koreatech/koin/feature/callvan/ui/list/component/CallvanFilterChip.kt
This file contains hidden or 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,61 @@ | ||
| package `in`.koreatech.koin.feature.callvan.ui.list.component | ||
|
|
||
| import androidx.compose.foundation.layout.Arrangement | ||
| import androidx.compose.foundation.layout.Row | ||
| import androidx.compose.foundation.layout.height | ||
| import androidx.compose.foundation.layout.padding | ||
| import androidx.compose.foundation.layout.size | ||
| import androidx.compose.foundation.shape.RoundedCornerShape | ||
| import androidx.compose.material3.Icon | ||
| import androidx.compose.material3.Surface | ||
| import androidx.compose.material3.Text | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.Alignment | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.graphics.vector.ImageVector | ||
| import androidx.compose.ui.res.stringResource | ||
| import androidx.compose.ui.res.vectorResource | ||
| import androidx.compose.ui.tooling.preview.Preview | ||
| import androidx.compose.ui.unit.dp | ||
| import `in`.koreatech.koin.core.designsystem.theme.KoinTheme | ||
| import `in`.koreatech.koin.core.designsystem.theme.RebrandKoinTheme | ||
| import `in`.koreatech.koin.feature.callvan.R | ||
|
|
||
| @Composable | ||
| fun CallvanFilterChip(onClick: () -> Unit) { | ||
| Surface( | ||
| onClick = { | ||
| onClick() | ||
| }, | ||
| modifier = Modifier | ||
| .height(34.dp), | ||
| shape = RoundedCornerShape(24.dp), | ||
| color = RebrandKoinTheme.colors.primary100, | ||
| contentColor = RebrandKoinTheme.colors.primary900 | ||
| ) { | ||
| Row( | ||
| verticalAlignment = Alignment.CenterVertically, | ||
| horizontalArrangement = Arrangement.spacedBy(4.dp), | ||
| modifier = Modifier.padding(horizontal = 12.dp, vertical = 4.dp) | ||
|
|
||
| ) { | ||
| Text( | ||
| text = stringResource(R.string.filter_container), | ||
| style = KoinTheme.typography.bold14 | ||
| ) | ||
| Icon( | ||
| imageVector = ImageVector.vectorResource(R.drawable.ic_list_filter), | ||
| contentDescription = "", | ||
| modifier = Modifier.size(16.dp) | ||
| ) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| @Preview(showBackground = true) | ||
| @Composable | ||
| private fun CallvanFilterChipPreview() { | ||
| KoinTheme { | ||
| CallvanFilterChip(onClick = {}) | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.