Skip to content

Commit e7df83a

Browse files
authored
🚀 :: v2.1.11
🚀 :: v2.1.11
2 parents eaafd80 + 37b2026 commit e7df83a

4 files changed

Lines changed: 48 additions & 13 deletions

File tree

buildSrc/src/main/kotlin/ProjectProperties.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ object ProjectProperties {
22
const val COMPILE_SDK = 36
33
const val MIN_SDK = 28
44
const val TARGET_SDK = 36
5-
const val VERSION_CODE = 40
6-
const val VERSION_NAME = "2.1.10"
5+
const val VERSION_CODE = 41
6+
const val VERSION_NAME = "2.1.11"
77
}

feature/src/main/kotlin/team/aliens/dms/android/feature/latestudy/ui/component/LateStudyCalendarSection.kt

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import androidx.compose.ui.unit.dp
2727
import java.time.DayOfWeek
2828
import java.time.LocalDate
2929
import java.time.YearMonth
30+
import java.time.temporal.TemporalAdjusters
3031
import team.aliens.dms.android.core.designsystem.DmsTheme
3132
import team.aliens.dms.android.core.designsystem.bodyB
3233
import team.aliens.dms.android.core.designsystem.labelM
@@ -56,7 +57,7 @@ fun LateStudyCalendarSection(
5657
)
5758

5859
Text(
59-
text = "(새벽 자습은 금, 토, 일요일은 불가능합니다)",
60+
text = "(이번 주 월~목만 신청할 수 있습니다)",
6061
color = DmsTheme.colorScheme.inverseSurface,
6162
style = DmsTheme.typography.labelM,
6263
)
@@ -386,10 +387,20 @@ private fun buildCalendarDates(
386387
}
387388

388389
private fun isSelectableDate(date: LocalDate): Boolean {
389-
return when (date.dayOfWeek) {
390-
DayOfWeek.FRIDAY,
391-
DayOfWeek.SATURDAY,
392-
DayOfWeek.SUNDAY -> false
393-
else -> true
390+
val today = LocalDate.now()
391+
392+
val startOfSelectableWeek = if (
393+
today.dayOfWeek == DayOfWeek.FRIDAY ||
394+
today.dayOfWeek == DayOfWeek.SATURDAY ||
395+
today.dayOfWeek == DayOfWeek.SUNDAY
396+
) {
397+
today.with(TemporalAdjusters.next(DayOfWeek.MONDAY))
398+
} else {
399+
today.with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY))
394400
}
401+
402+
val endOfSelectableWeek = startOfSelectableWeek.plusDays(3)
403+
404+
return !date.isBefore(startOfSelectableWeek) &&
405+
!date.isAfter(endOfSelectableWeek)
395406
}

feature/src/main/kotlin/team/aliens/dms/android/feature/latestudy/ui/component/LateStudyReasonSection.kt

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,19 @@ import androidx.compose.foundation.layout.Row
77
import androidx.compose.foundation.layout.fillMaxWidth
88
import androidx.compose.foundation.layout.height
99
import androidx.compose.foundation.layout.padding
10+
import androidx.compose.foundation.relocation.BringIntoViewRequester
11+
import androidx.compose.foundation.relocation.bringIntoViewRequester
1012
import androidx.compose.foundation.shape.RoundedCornerShape
1113
import androidx.compose.foundation.text.BasicTextField
1214
import androidx.compose.material3.Text
1315
import androidx.compose.runtime.Composable
16+
import androidx.compose.runtime.remember
17+
import androidx.compose.runtime.rememberCoroutineScope
1418
import androidx.compose.ui.Modifier
19+
import androidx.compose.ui.focus.onFocusChanged
1520
import androidx.compose.ui.unit.dp
21+
import kotlinx.coroutines.delay
22+
import kotlinx.coroutines.launch
1623
import team.aliens.dms.android.core.designsystem.DmsTheme
1724
import team.aliens.dms.android.core.designsystem.bodyB
1825
import team.aliens.dms.android.core.designsystem.bodyM
@@ -26,6 +33,9 @@ fun LateStudyReasonSection(
2633
onValueChange: (String) -> Unit,
2734
modifier: Modifier = Modifier,
2835
) {
36+
val bringIntoViewRequester = remember { BringIntoViewRequester() }
37+
val coroutineScope = rememberCoroutineScope()
38+
2939
LateStudySectionCard(modifier = modifier) {
3040
Row(
3141
modifier = Modifier
@@ -56,6 +66,7 @@ fun LateStudyReasonSection(
5666
shape = RoundedCornerShape(20.dp),
5767
)
5868
.height(180.dp)
69+
.bringIntoViewRequester(bringIntoViewRequester)
5970
.padding(horizontal = 16.dp, vertical = 16.dp),
6071
) {
6172
BasicTextField(
@@ -65,7 +76,16 @@ fun LateStudyReasonSection(
6576
onValueChange(newValue)
6677
}
6778
},
68-
modifier = Modifier.fillMaxWidth(),
79+
modifier = Modifier
80+
.fillMaxWidth()
81+
.onFocusChanged { focusState ->
82+
if (focusState.isFocused) {
83+
coroutineScope.launch {
84+
delay(250)
85+
bringIntoViewRequester.bringIntoView()
86+
}
87+
}
88+
},
6989
textStyle = DmsTheme.typography.bodyM.copy(
7090
color = DmsTheme.colorScheme.onBackground,
7191
),

feature/src/main/kotlin/team/aliens/dms/android/feature/main/application/viewmodel/ApplicationViewModel.kt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,20 +195,24 @@ private fun StudyApplicationStatusResponse.buildRangeText(
195195
return when {
196196
start != null && end != null -> {
197197
if (start == end) {
198-
"$startDate $suffix"
198+
"${start.toMonthDayText()} $suffix"
199199
} else {
200-
"$startDate ~ $endDate $suffix"
200+
"${start.toMonthDayText()} ~ ${end.toMonthDayText()} $suffix"
201201
}
202202
}
203203

204-
start != null -> "$startDate $suffix"
204+
start != null -> "${start.toMonthDayText()} $suffix"
205205

206-
end != null -> "$endDate $suffix"
206+
end != null -> "${end.toMonthDayText()} $suffix"
207207

208208
else -> null
209209
}
210210
}
211211

212+
private fun LocalDate.toMonthDayText(): String {
213+
return "${monthValue}.${dayOfMonth}"
214+
}
215+
212216
private fun StudyApplicationStatusResponse.toUiStatus(): LateStudyStatusUi? {
213217
val today = LocalDate.now()
214218
val start = startDate.toLocalDateOrNull()

0 commit comments

Comments
 (0)