-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[UI/#218] 온보딩 / UI 수정 #219
Changes from 16 commits
3a9f663
b65f773
34542d3
6211928
df37526
90f1c9e
8b65715
9b9c7d2
0a643bf
a3c673a
de56489
aa2531f
b7d263c
990a776
93ca5c6
016fc7c
48ee63a
e410bb5
278d274
fc8c1f3
f5d1c60
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 확인했습니당!! 최고최고💚 |
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 |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 상수로 저장한거 좋네욤!! |
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 | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,5 +100,4 @@ dependencies { | |
|
||
// KakaoDependencies | ||
implementation(libs.kakao.user) | ||
|
||
} |
This file was deleted.
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() | ||
} |
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 | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
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 updateButtonValidation() { | ||
_state.value = _state.value.copy(isButtonValid = true) | ||
} | ||
|
||
fun updateGrade(grade: Int) { | ||
_state.value = _state.value.copy(grade = grade) | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 최근에 든 의문인데, 예를 들어 어떤 버튼을 누르면 두 함수를 모두 호출하는 상황이 존재한다면 이렇게 나눠서 관리하는게 좋을까요 아니면 용도에 맞게 합쳐서 관리하는게 좋을까요..? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 저도 관련해서 고민중이었는데 추후에 개별적으로 사용될 가능성을 고려해서 나눠놓는게 좋을까 싶다가도 확실하게 항상 같이 호출하는 상황이라면 합쳐서 관리하는게 더 효율적일 것 같기도 하고... 진짜 어렵다 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 사실 저도 그 고민이 들긴 했습니다.. |
||
|
||
fun navigateUp() = | ||
viewModelScope.launch { _sideEffects.emit(FilteringOneSideEffect.NavigateUp) } | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
편-안