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.
- Loading branch information
Showing
4 changed files
with
121 additions
and
83 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
app/src/main/java/org/sopt/and/presentation/login/LogInContract.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,29 @@ | ||
package org.sopt.and.presentation.login | ||
|
||
import androidx.annotation.StringRes | ||
import org.sopt.and.presentation.util.base.UiEvent | ||
import org.sopt.and.presentation.util.base.UiSideEffect | ||
import org.sopt.and.presentation.util.base.UiState | ||
|
||
class LogInContract { | ||
data class LoginUiState( | ||
val isPasswordVisible: Boolean = false, | ||
val emailValue: String = "", | ||
val passwordValue: String = "" | ||
) : UiState | ||
|
||
sealed interface LogInSideEffect : UiSideEffect { | ||
data object NavigateToHome : LogInSideEffect | ||
data object NavigateToSignUp : LogInSideEffect | ||
data class ShowToast(@StringRes val message: Int) : LogInSideEffect | ||
data class ShowSnackBar(@StringRes val message: Int) : LogInSideEffect | ||
} | ||
|
||
sealed class LogInEvent : UiEvent { | ||
data class OnEmailValueChanged(val emailValue: String) : LogInEvent() | ||
data class OnPasswordValueChanged(val passwordValue: String) : LogInEvent() | ||
data class OnPasswordVisibleButtonClicked(val isPasswordVisible: Boolean) : LogInEvent() | ||
data object OnLogInButtonClicked : LogInEvent() | ||
data object OnSignUpButtonClicked : LogInEvent() | ||
} | ||
} |
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
82 changes: 30 additions & 52 deletions
82
app/src/main/java/org/sopt/and/presentation/login/LogInViewModel.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
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