-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[UI/#218] ์จ๋ณด๋ฉ / UI ์์
- Loading branch information
Showing
35 changed files
with
647 additions
and
206 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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,7 @@ | ||
package com.terning.core.extension | ||
|
||
import java.util.Calendar | ||
|
||
val Calendar.currentYear: Int get() = get(Calendar.YEAR) | ||
|
||
val Calendar.currentMonth: Int get() = get(Calendar.MONTH) + 1 |
This file contains 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,8 @@ | ||
package com.terning.core.util | ||
|
||
object CalendarDefaults { | ||
const val START_YEAR = 2010 | ||
const val END_YEAR = 2030 | ||
const val START_MONTH = 1 | ||
const val END_MONTH = 12 | ||
} |
8 changes: 0 additions & 8 deletions
8
feature/src/main/java/com/terning/feature/filtering/filtering/FilteringSideEffect.kt
This file was deleted.
Oops, something went wrong.
This file contains 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
5 changes: 5 additions & 0 deletions
5
feature/src/main/java/com/terning/feature/filtering/filteringone/FilteringOneSideEffect.kt
This file contains 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,5 @@ | ||
package com.terning.feature.filtering.filteringone | ||
|
||
sealed class FilteringOneSideEffect { | ||
data object NavigateUp : FilteringOneSideEffect() | ||
} |
6 changes: 6 additions & 0 deletions
6
feature/src/main/java/com/terning/feature/filtering/filteringone/FilteringOneState.kt
This file contains 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,6 @@ | ||
package com.terning.feature.filtering.filteringone | ||
|
||
data class FilteringOneState( | ||
val isButtonValid: Boolean = false, | ||
val grade: Int = -1 | ||
) |
30 changes: 30 additions & 0 deletions
30
feature/src/main/java/com/terning/feature/filtering/filteringone/FilteringOneViewModel.kt
This file contains 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,30 @@ | ||
package com.terning.feature.filtering.filteringone | ||
|
||
import androidx.lifecycle.ViewModel | ||
import androidx.lifecycle.viewModelScope | ||
import kotlinx.coroutines.flow.MutableSharedFlow | ||
import kotlinx.coroutines.flow.MutableStateFlow | ||
import kotlinx.coroutines.flow.SharedFlow | ||
import kotlinx.coroutines.flow.StateFlow | ||
import kotlinx.coroutines.flow.asSharedFlow | ||
import kotlinx.coroutines.flow.asStateFlow | ||
import kotlinx.coroutines.launch | ||
|
||
class FilteringOneViewModel : ViewModel() { | ||
|
||
private val _state: MutableStateFlow<FilteringOneState> = MutableStateFlow(FilteringOneState()) | ||
val state: StateFlow<FilteringOneState> get() = _state.asStateFlow() | ||
|
||
private val _sideEffects = MutableSharedFlow<FilteringOneSideEffect>() | ||
val sideEffects: SharedFlow<FilteringOneSideEffect> get() = _sideEffects.asSharedFlow() | ||
|
||
fun updateGradeAndButton(grade: Int) { | ||
_state.value = _state.value.copy( | ||
grade = grade, | ||
isButtonValid = true | ||
) | ||
} | ||
|
||
fun navigateUp() = | ||
viewModelScope.launch { _sideEffects.emit(FilteringOneSideEffect.NavigateUp) } | ||
} |
This file contains 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
This file contains 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
Oops, something went wrong.