Skip to content

Commit ed9c027

Browse files
authored
[MERGE] #322 -> develop
[FIX/#322] 온보딩, 데이트피커 / 3차 스프린트 QA 반영
2 parents f51f632 + 7720087 commit ed9c027

File tree

4 files changed

+21
-25
lines changed

4 files changed

+21
-25
lines changed
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
package com.terning.core.designsystem.util
22

3+
import com.terning.core.designsystem.extension.currentMonth
4+
import com.terning.core.designsystem.extension.currentYear
5+
import java.util.Calendar
6+
37
object CalendarDefaults {
48
const val START_YEAR = 2010
5-
const val END_YEAR = 2030
9+
val END_YEAR =
10+
if (Calendar.getInstance().currentMonth >= 10) Calendar.getInstance().currentYear + 1
11+
else Calendar.getInstance().currentYear
612
const val START_MONTH = 1
713
const val END_MONTH = 12
814
}

feature/filtering/src/main/java/com/terning/feature/filtering/startfiltering/StartFilteringRoute.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ fun StartFilteringScreen(
106106
onStartClick = onStartClick,
107107
onLaterClick = onLaterClick
108108
)
109-
Spacer(modifier = Modifier.height((24 * screenHeight).dp))
109+
Spacer(modifier = Modifier.height((16 * screenHeight).dp))
110110
}
111111
}
112112

@@ -133,7 +133,7 @@ private fun ButtonAnimation(
133133
cornerRadius = 10.dp,
134134
modifier = Modifier.padding(horizontal = 24.dp)
135135
)
136-
Spacer(modifier = Modifier.height(12.dp))
136+
Spacer(modifier = Modifier.height(20.dp))
137137
Text(
138138
text = stringResource(R.string.start_filtering_later),
139139
style = TerningTheme.typography.detail3.copy(

feature/home/src/main/java/com/terning/feature/home/component/bottomsheet/HomeYearMonthPicker.kt

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,25 +58,22 @@ private fun rememberPickerState() = remember { PickerState() }
5858
internal fun HomeYearMonthPicker(
5959
chosenYear: Int?,
6060
chosenMonth: Int?,
61-
onYearChosen: (Int?, Boolean) -> Unit,
62-
onMonthChosen: (Int?, Boolean) -> Unit,
61+
onYearChosen: (Int?) -> Unit,
62+
onMonthChosen: (Int?) -> Unit,
6363
isYearNull: Boolean,
6464
isMonthNull: Boolean,
6565
yearsList: ImmutableList<String>,
6666
monthsList: ImmutableList<String>,
67-
isInitialNullState: Boolean,
6867
modifier: Modifier = Modifier,
6968
) {
7069
val yearPickerState = rememberPickerState()
7170
val monthPickerState = rememberPickerState()
7271

73-
var isInitialSelection by remember { mutableStateOf(isInitialNullState) }
74-
7572
val startYearIndex =
76-
if (isYearNull) yearsList.lastIndex else yearsList.indexOf("${chosenYear ?: "-"}")
73+
if (isYearNull) yearsList.lastIndex else yearsList.indexOf("${chosenYear ?: NULL_DATE}")
7774
.takeIf { it >= 0 } ?: yearsList.lastIndex
7875
val startMonthIndex =
79-
if (isMonthNull) monthsList.lastIndex else monthsList.indexOf("${chosenMonth ?: "-"}")
76+
if (isMonthNull) monthsList.lastIndex else monthsList.indexOf("${chosenMonth ?: NULL_DATE}")
8077
.takeIf { it >= 0 } ?: monthsList.lastIndex
8178

8279
Row(
@@ -91,10 +88,9 @@ internal fun HomeYearMonthPicker(
9188
items = yearsList,
9289
startIndex = startYearIndex,
9390
onItemSelected = { year ->
94-
if (year == NULL_DATE && !isInitialSelection) isInitialSelection = true
9591
onYearChosen(
96-
if (year == NULL_DATE) null else year.dropLast(1).toInt(),
97-
isInitialSelection
92+
if (year == NULL_DATE) null
93+
else year.dropLast(1).toInt()
9894
)
9995
}
10096
)
@@ -105,10 +101,9 @@ internal fun HomeYearMonthPicker(
105101
items = monthsList,
106102
startIndex = startMonthIndex,
107103
onItemSelected = { month ->
108-
if (month == NULL_DATE && !isInitialSelection) isInitialSelection = true
109104
onMonthChosen(
110-
if (month == NULL_DATE) null else month.dropLast(1).toInt(),
111-
isInitialSelection
105+
if (month == NULL_DATE) null
106+
else month.dropLast(1).toInt()
112107
)
113108
}
114109
)

feature/home/src/main/java/com/terning/feature/home/component/bottomsheet/PlanFilteringScreen.kt

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,15 @@ internal fun PlanFilteringScreen(
5454
var isYearNull by remember { mutableStateOf(currentFilteringInfo.startYear == 0 || currentFilteringInfo.startYear == null) }
5555
var isMonthNull by remember { mutableStateOf(currentFilteringInfo.startMonth == 0 || currentFilteringInfo.startMonth == null) }
5656

57-
var isInitialNullState by remember { mutableStateOf(false) }
58-
5957
val yearsList by remember(isYearNull) {
6058
mutableStateOf(
61-
if (isYearNull || isInitialNullState) years + NULL_DATE
59+
if (isYearNull) years + NULL_DATE
6260
else years
6361
)
6462
}
6563
val monthsList by remember(isMonthNull) {
6664
mutableStateOf(
67-
if (isMonthNull || isInitialNullState) months + NULL_DATE
65+
if (isMonthNull) months + NULL_DATE
6866
else months
6967
)
7068
}
@@ -133,27 +131,24 @@ internal fun PlanFilteringScreen(
133131
HomeYearMonthPicker(
134132
chosenYear = currentFilteringInfo.startYear,
135133
chosenMonth = currentFilteringInfo.startMonth,
136-
onYearChosen = { year, isInitialSelection ->
134+
onYearChosen = { year ->
137135
updateStartYear(year)
138136
if (year != null) {
139137
updateIsCheckBoxChecked(false)
140138
isYearNull = false
141-
isInitialNullState = isInitialSelection
142139
}
143140
},
144-
onMonthChosen = { month, isInitialSelection ->
141+
onMonthChosen = { month ->
145142
updateStartMonth(month)
146143
if (month != null) {
147144
updateIsCheckBoxChecked(false)
148145
isMonthNull = false
149-
isInitialNullState = isInitialSelection
150146
}
151147
},
152148
isYearNull = isYearNull,
153149
isMonthNull = isMonthNull,
154150
yearsList = yearsList.toImmutableList(),
155151
monthsList = monthsList.toImmutableList(),
156-
isInitialNullState = isInitialNullState
157152
)
158153

159154
Row(

0 commit comments

Comments
 (0)