-
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.
Merge pull request #44 from meongmory/refactor/mypage
[refactor/mypage] 마이페이지 화면 뷰모델로 리팩토링
- Loading branch information
Showing
20 changed files
with
876 additions
and
351 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
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
21 changes: 21 additions & 0 deletions
21
presentation/src/main/java/com/meongmoryteam/presentation/ui/main/MainContract.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,21 @@ | ||
package com.meongmoryteam.presentation.ui.main | ||
|
||
import com.meongmoryteam.presentation.base.ViewEvent | ||
import com.meongmoryteam.presentation.base.ViewSideEffect | ||
import com.meongmoryteam.presentation.base.ViewState | ||
|
||
class MainContract { | ||
data class MainViewState( | ||
val loginState: LoginState = LoginState.NONE, | ||
) : ViewState | ||
|
||
sealed class MainSideEffect : ViewSideEffect { | ||
} | ||
|
||
sealed class MainEvent : ViewEvent { | ||
} | ||
|
||
enum class LoginState { | ||
NONE | ||
} | ||
} |
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
15 changes: 15 additions & 0 deletions
15
presentation/src/main/java/com/meongmoryteam/presentation/ui/main/MainViewModel.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,15 @@ | ||
package com.meongmoryteam.presentation.ui.main | ||
|
||
import com.meongmoryteam.presentation.base.BaseViewModel | ||
import dagger.hilt.android.lifecycle.HiltViewModel | ||
import javax.inject.Inject | ||
import com.meongmoryteam.presentation.ui.main.MainContract.* | ||
|
||
@HiltViewModel | ||
class MainViewModel @Inject constructor( | ||
) : BaseViewModel<MainViewState, MainSideEffect, MainEvent>( | ||
MainViewState() | ||
) { | ||
override fun handleEvents(event: MainEvent) { | ||
} | ||
} |
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
25 changes: 25 additions & 0 deletions
25
presentation/src/main/java/com/meongmoryteam/presentation/ui/myPage/MyPageContract.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,25 @@ | ||
package com.meongmoryteam.presentation.ui.myPage | ||
|
||
import com.meongmoryteam.presentation.base.LoadState | ||
import com.meongmoryteam.presentation.base.ViewEvent | ||
import com.meongmoryteam.presentation.base.ViewSideEffect | ||
import com.meongmoryteam.presentation.base.ViewState | ||
|
||
class MyPageContract { | ||
data class MyPageViewState( | ||
val loadState: LoadState = LoadState.SUCCESS, | ||
val nickName: String = "", | ||
val isDialogVisible: Boolean = false | ||
) : ViewState | ||
|
||
sealed class MyPageSideEffect : ViewSideEffect { | ||
object NavigateToEditProfile : MyPageSideEffect() | ||
object NavigateToQuestion : MyPageSideEffect() | ||
} | ||
|
||
sealed class MyPageEvent : ViewEvent { | ||
object InitMyPageScreen : MyPageEvent() | ||
object OnClickProfileEditButtonClicked : MyPageEvent() | ||
object OnQuestionClicked : MyPageEvent() | ||
} | ||
} |
Oops, something went wrong.