-
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.
[ Feature ] : 팀 선택이 되지 않은 유저인경우 팀 선택하라는 팝업 노출 (#300)
* [ Fix ] : 중복된 when 절 체크 제거 * [ Fix ] : BaseViewModel 접근제한자 추가 * [ Feature ] : 멤버 메인 mvi 구조 변경 및 추가 * [ Feature ] : 메인 멤버 mvi 구조 변경으로 인한 추가 로직 수정 * [ Feature ] : 팀 선택이 되지 않은 유저인경우 팀 선택하라는 팝업 노출 로직 추가 * [ chore ] : 스트링 리소스 추가 * [ Refactor ] : 코드리뷰 반영 ( operator 함수 ) navigateToTeam invoke 문구 제거 * [ Fix ] : Dialog onDismiss 가 발현되지 않던 문제 수정 (#312) * fix: dialog 사이즈가 최대로 측정되어, dimm 영역이 무시되고 있는 상황 수정 * feat: dialog ondismiss에 취소 적용 --------- Co-authored-by: Choi Sang Rok <[email protected]>
- Loading branch information
1 parent
bc9bec8
commit 984740e
Showing
8 changed files
with
62 additions
and
8 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
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
27 changes: 25 additions & 2 deletions
27
presentation/src/main/java/com/yapp/presentation/ui/member/main/MemberMainViewModel.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 |
---|---|---|
@@ -1,24 +1,47 @@ | ||
package com.yapp.presentation.ui.member.main | ||
|
||
import androidx.lifecycle.viewModelScope | ||
import com.yapp.common.base.BaseViewModel | ||
import com.yapp.domain.model.types.TeamType | ||
import com.yapp.domain.usecases.GetCurrentMemberInfoUseCase | ||
import com.yapp.presentation.ui.member.main.MemberMainContract.MemberMainUiEvent | ||
import com.yapp.presentation.ui.member.main.MemberMainContract.MemberMainUiSideEffect | ||
import com.yapp.presentation.ui.member.main.MemberMainContract.MemberMainUiState | ||
import dagger.hilt.android.lifecycle.HiltViewModel | ||
import kotlinx.coroutines.launch | ||
import javax.inject.Inject | ||
|
||
@HiltViewModel | ||
class MemberMainViewModel @Inject constructor() : | ||
class MemberMainViewModel @Inject constructor( | ||
getMemberGetCurrentMemberInfoUseCase: GetCurrentMemberInfoUseCase | ||
) : | ||
BaseViewModel<MemberMainUiState, MemberMainUiSideEffect, MemberMainUiEvent>(MemberMainUiState()) { | ||
|
||
init { | ||
viewModelScope.launch { | ||
val member = getMemberGetCurrentMemberInfoUseCase.invoke().getOrNull() | ||
|
||
if(member != null) { | ||
setState { copy(isShowTeamDialog = member.team.type.value == TeamType.NONE.value) } | ||
} | ||
} | ||
} | ||
|
||
override suspend fun handleEvent(event: MemberMainUiEvent) { | ||
when (event) { | ||
is MemberMainUiEvent.OnClickBottomNavigationTab -> { | ||
setState { copy(selectedTab = event.tab) } | ||
setEffect( MemberMainUiSideEffect.NavigateToRoute(event.tab)) | ||
} | ||
is MemberMainUiEvent.OnNextTime -> { | ||
setState { copy(isShowTeamDialog = false) } | ||
} | ||
is MemberMainUiEvent.OnSelectTeamScreen -> { | ||
setState { copy(isShowTeamDialog = false) } | ||
setEffect(MemberMainUiSideEffect.NavigateToTeam) | ||
} | ||
|
||
} | ||
} | ||
|
||
} | ||
|
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