Skip to content

Commit fe2095c

Browse files
authored
Merge pull request #187 from YAPP-Github/feat/#184-alarm-item-delete-actions
[FEAT] μ•ŒλžŒ μ•„μ΄ν…œ μ‚­μ œ λ™μž‘μ„ λ‹€μ–‘ν™”ν•©λ‹ˆλ‹€.
2 parents 560a9ec + 8f4fbda commit fe2095c

File tree

12 files changed

+512
-257
lines changed

12 files changed

+512
-257
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="24dp"
3+
android:height="24dp"
4+
android:viewportWidth="24"
5+
android:viewportHeight="24">
6+
<path
7+
android:pathData="M16.219,4.948V5.161C17.437,5.272 18.649,5.432 19.854,5.641C19.945,5.657 20.032,5.69 20.11,5.74C20.188,5.789 20.256,5.853 20.309,5.929C20.362,6.004 20.4,6.089 20.42,6.179C20.441,6.27 20.443,6.363 20.427,6.454C20.411,6.545 20.378,6.632 20.329,6.71C20.279,6.788 20.215,6.855 20.139,6.908C20.064,6.962 19.979,6.999 19.889,7.02C19.799,7.04 19.705,7.042 19.614,7.027L19.418,6.994L18.476,19.247C18.422,19.953 18.103,20.613 17.583,21.095C17.063,21.576 16.381,21.844 15.672,21.844H8.329C7.62,21.844 6.938,21.576 6.418,21.095C5.898,20.613 5.579,19.953 5.525,19.247L4.582,6.994L4.386,7.027C4.202,7.058 4.013,7.016 3.861,6.908C3.708,6.801 3.605,6.637 3.573,6.454C3.541,6.27 3.583,6.081 3.691,5.929C3.798,5.776 3.962,5.673 4.146,5.641C5.351,5.432 6.563,5.272 7.781,5.161V4.948C7.781,3.482 8.918,2.229 10.421,2.182C11.474,2.148 12.527,2.148 13.58,2.182C15.083,2.229 16.219,3.482 16.219,4.948ZM10.466,3.587C11.489,3.554 12.512,3.554 13.535,3.587C14.241,3.609 14.813,4.204 14.813,4.948V5.054C12.939,4.94 11.061,4.94 9.188,5.054V4.948C9.188,4.204 9.758,3.609 10.466,3.587ZM10.133,9.16C10.13,9.068 10.108,8.977 10.069,8.893C10.031,8.809 9.976,8.734 9.908,8.671C9.84,8.608 9.761,8.559 9.674,8.527C9.588,8.495 9.495,8.481 9.403,8.484C9.311,8.488 9.22,8.51 9.136,8.548C9.052,8.587 8.977,8.642 8.914,8.709C8.851,8.777 8.802,8.857 8.77,8.943C8.738,9.03 8.724,9.122 8.727,9.215L9.053,17.652C9.06,17.838 9.141,18.014 9.278,18.141C9.414,18.268 9.596,18.335 9.782,18.328C9.969,18.32 10.145,18.24 10.271,18.103C10.398,17.966 10.465,17.784 10.458,17.598L10.133,9.16ZM15.271,9.215C15.278,9.121 15.266,9.026 15.235,8.937C15.205,8.847 15.157,8.765 15.094,8.695C15.031,8.624 14.955,8.567 14.869,8.527C14.784,8.487 14.691,8.464 14.597,8.461C14.503,8.457 14.408,8.473 14.32,8.506C14.232,8.539 14.151,8.59 14.083,8.656C14.015,8.721 13.961,8.799 13.924,8.886C13.886,8.973 13.867,9.066 13.867,9.16L13.541,17.598C13.534,17.784 13.601,17.966 13.728,18.103C13.855,18.24 14.031,18.321 14.217,18.328C14.404,18.335 14.585,18.268 14.722,18.141C14.859,18.015 14.94,17.839 14.948,17.652L15.271,9.215Z"
8+
android:fillColor="#ffffff"
9+
android:fillType="evenOdd"/>
10+
</vector>

β€Žcore/ui/src/main/java/com/yapp/ui/component/button/OrbitButton.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ fun OrbitButton(
6767

6868
Button(
6969
onClick = ::handleClick,
70-
enabled = enabled,
70+
enabled = enabled && isClickable,
7171
shape = shape,
7272
colors = ButtonDefaults.buttonColors(
7373
containerColor = if (isPressed) pressedContainerColor else containerColor,

β€Žfeature/home/src/main/java/com/yapp/alarm/addedit/AlarmAddEditScreen.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ import com.yapp.ui.component.snackbar.showCustomSnackBar
6868
import com.yapp.ui.component.switch.OrbitSwitch
6969
import com.yapp.ui.component.timepicker.OrbitPicker
7070
import feature.home.R
71+
import kotlinx.coroutines.flow.collectLatest
7172
import kotlinx.coroutines.launch
7273

7374
@Composable
@@ -82,7 +83,7 @@ fun AlarmAddEditRoute(
8283
val coroutineScope = rememberCoroutineScope()
8384

8485
LaunchedEffect(sideEffect) {
85-
sideEffect.collect { effect ->
86+
sideEffect.collectLatest { effect ->
8687
when (effect) {
8788
is AlarmAddEditContract.SideEffect.NavigateBack -> {
8889
navigator.navigateBack()

β€Žfeature/home/src/main/java/com/yapp/alarm/addedit/AlarmAddEditViewModel.kt

+6
Original file line numberDiff line numberDiff line change
@@ -521,13 +521,19 @@ class AlarmAddEditViewModel @Inject constructor(
521521

522522
val currentDayOfWeek = now.dayOfWeek.value
523523
val selectedDaysOfWeek = selectedDays.map { it.toDayOfWeek().value }.sorted()
524+
525+
if (selectedDaysOfWeek.contains(currentDayOfWeek) && now.toLocalTime().isBefore(alarmTimeToday.toLocalTime())) {
526+
return alarmTimeToday
527+
}
528+
524529
val nextDay = selectedDaysOfWeek.firstOrNull { it > currentDayOfWeek }
525530
?: selectedDaysOfWeek.first()
526531
val daysToAdd = if (nextDay > currentDayOfWeek) {
527532
nextDay - currentDayOfWeek
528533
} else {
529534
7 - (currentDayOfWeek - nextDay)
530535
}
536+
531537
val nextAlarmDate = now.toLocalDate().plusDays(daysToAdd.toLong())
532538
return nextAlarmDate.atTime(alarmTimeToday.toLocalTime())
533539
}

0 commit comments

Comments
Β (0)