Skip to content

Commit

Permalink
add: 시내버스 "기점", "운행" 텍스트 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
ThirFir committed Nov 5, 2024
1 parent af44a8a commit 8dce681
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@ package `in`.koreatech.bus.screen.timetable.composable

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableIntStateOf
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
Expand All @@ -23,6 +26,7 @@ import `in`.koreatech.bus.viewstate.ArrivalViewState
import `in`.koreatech.bus.viewstate.CommonTimetableViewState
import `in`.koreatech.koin.core.designsystem.component.chip.TextChipGroup
import `in`.koreatech.koin.core.designsystem.theme.KoinTheme
import `in`.koreatech.koin.feature.bus.R

@Composable
internal fun CityTimetableScreen(
Expand All @@ -39,28 +43,52 @@ internal fun CityTimetableScreen(
Column(
modifier = modifier
) {
TextChipGroup(
Row(
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 24.dp)
.padding(top = 8.dp, bottom = 4.dp),
titles = CityBusNumberType.entries.map { stringResource(it.titleRes) },
onChipSelected = { title ->
selectedBusNumberTypeIndex = CityBusNumberType.entries.find { context.getString(it.titleRes) == title }?.ordinal ?: 0
},
selectedChipIndexes = intArrayOf(selectedBusNumberTypeIndex)
)
TextChipGroup(
verticalAlignment = Alignment.CenterVertically
) {
Text(
text = stringResource(R.string.routes),
style = KoinTheme.typography.regular16,
color = KoinTheme.colors.neutral600
)
TextChipGroup(
modifier = Modifier.padding(start = 16.dp),
titles = CityBusNumberType.entries.map { stringResource(it.titleRes) },
onChipSelected = { title ->
selectedBusNumberTypeIndex =
CityBusNumberType.entries.find { context.getString(it.titleRes) == title }?.ordinal
?: 0
},
selectedChipIndexes = intArrayOf(selectedBusNumberTypeIndex)
)
}
Row(
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 24.dp)
.padding(top = 4.dp, bottom = 8.dp),
titles = CommonDirectionType.entries.map { stringResource(it.titleRes) },
onChipSelected = { title ->
selectedDirectionTypeIndex = CommonDirectionType.entries.find { context.getString(it.titleRes) == title }?.ordinal ?: 0
},
selectedChipIndexes = intArrayOf(selectedDirectionTypeIndex)
)
verticalAlignment = Alignment.CenterVertically
) {
Text(
text = stringResource(R.string.operating),
style = KoinTheme.typography.regular16,
color = KoinTheme.colors.neutral600
)
TextChipGroup(
modifier = Modifier.padding(start = 16.dp),
titles = CommonDirectionType.entries.map { stringResource(it.titleRes) },
onChipSelected = { title ->
selectedDirectionTypeIndex =
CommonDirectionType.entries.find { context.getString(it.titleRes) == title }?.ordinal
?: 0
},
selectedChipIndexes = intArrayOf(selectedDirectionTypeIndex)
)
}

CommonTimetableView(
timetable = timetable,
Expand Down
2 changes: 2 additions & 0 deletions feature/bus/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
<string name="n405">405번</string>
<string name="n495">495번</string>
<string name="starting_point">기점</string>
<string name="routes">노선</string>
<string name="operating">운행</string>

<!-- Content description -->

Expand Down

0 comments on commit 8dce681

Please sign in to comment.