generated from AND-SOPT-ANDROID/and-sopt-android-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#13 [Feat] : State, SideEffect, Event에 따른 SignUp 수정
- Loading branch information
1 parent
1c51977
commit 637a829
Showing
9 changed files
with
197 additions
and
131 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package org.sopt.and.presentation.core | ||
|
||
interface UiEvent |
3 changes: 3 additions & 0 deletions
3
app/src/main/java/org/sopt/and/presentation/core/UiSideEffect.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,3 @@ | ||
package org.sopt.and.presentation.core | ||
|
||
interface UiSideEffect |
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,3 @@ | ||
package org.sopt.and.presentation.core | ||
|
||
interface UiState |
27 changes: 27 additions & 0 deletions
27
app/src/main/java/org/sopt/and/presentation/signup/SignUpContract.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,27 @@ | ||
package org.sopt.and.presentation.signup | ||
|
||
import org.sopt.and.presentation.core.UiEvent | ||
import org.sopt.and.presentation.core.UiSideEffect | ||
import org.sopt.and.presentation.core.UiState | ||
|
||
// State 정의 | ||
data class SignUpState( | ||
val username: String = "", | ||
val password: String = "", | ||
val hobby: String = "", | ||
val isLoading: Boolean = false | ||
) : UiState | ||
|
||
// Event 정의 | ||
sealed class SignUpEvent : UiEvent { | ||
data class UsernameChanged(val username: String) : SignUpEvent() | ||
data class PasswordChanged(val password: String) : SignUpEvent() | ||
data class HobbyChanged(val hobby: String) : SignUpEvent() | ||
object SignUpClicked : SignUpEvent() | ||
} | ||
|
||
// SideEffect 정의 | ||
sealed class SignUpSideEffect : UiSideEffect { | ||
data class ShowToast(val message: String) : SignUpSideEffect() | ||
object NavigateToLogin : SignUpSideEffect() | ||
} |
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.