-
Notifications
You must be signed in to change notification settings - Fork 2
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 #78 from Hyesung82/feature/group
[develop] WriteViewModel 리팩토링
- Loading branch information
Showing
36 changed files
with
132 additions
and
111 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,3 +32,4 @@ coroutineVersion=1.6.3 | |
glideVersion=4.12.0 | ||
pagingVersion=3.2.1 | ||
jvmTarget=17 | ||
roomVersion = 2.6.1 |
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
15 changes: 0 additions & 15 deletions
15
presentation/src/main/java/com/cheocharm/presentation/ui/write/GroupsViewModel.kt
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...presentation/ui/write/WriteFontAdapter.kt → ...tation/ui/write/diary/WriteFontAdapter.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
2 changes: 1 addition & 1 deletion
2
...esentation/ui/write/WriteFontViewModel.kt → ...tion/ui/write/diary/WriteFontViewModel.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
2 changes: 1 addition & 1 deletion
2
...rm/presentation/ui/write/WriteFragment.kt → ...sentation/ui/write/diary/WriteFragment.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
2 changes: 1 addition & 1 deletion
2
...resentation/ui/write/WriteImageAdapter.kt → ...ation/ui/write/diary/WriteImageAdapter.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
2 changes: 1 addition & 1 deletion
2
...tion/ui/write/WriteImageItemDecoration.kt → ...i/write/diary/WriteImageItemDecoration.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
2 changes: 1 addition & 1 deletion
2
...sentation/ui/write/WriteStickerAdapter.kt → ...ion/ui/write/diary/WriteStickerAdapter.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
2 changes: 1 addition & 1 deletion
2
...rm/presentation/ui/write/GroupsAdapter.kt → ...entation/ui/write/groups/GroupsAdapter.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
41 changes: 41 additions & 0 deletions
41
presentation/src/main/java/com/cheocharm/presentation/ui/write/groups/GroupsViewModel.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,41 @@ | ||
package com.cheocharm.presentation.ui.write.groups | ||
|
||
import androidx.lifecycle.LiveData | ||
import androidx.lifecycle.MutableLiveData | ||
import androidx.lifecycle.ViewModel | ||
import androidx.lifecycle.viewModelScope | ||
import com.cheocharm.domain.model.Group | ||
import com.cheocharm.domain.usecase.write.GetMyGroupsUseCase | ||
import com.cheocharm.presentation.common.ErrorMessage | ||
import com.cheocharm.presentation.common.Event | ||
import com.cheocharm.presentation.common.TestValues | ||
import dagger.hilt.android.lifecycle.HiltViewModel | ||
import kotlinx.coroutines.Dispatchers | ||
import kotlinx.coroutines.launch | ||
import javax.inject.Inject | ||
|
||
@HiltViewModel | ||
class GroupsViewModel @Inject constructor( | ||
private val getMyGroupsUseCase: GetMyGroupsUseCase | ||
) : ViewModel() { | ||
private val _groups = MutableLiveData(TestValues.testGroups) | ||
val groups: LiveData<List<Group>> = _groups | ||
|
||
private val _toastText = MutableLiveData<Event<String>>() | ||
val toastText: LiveData<Event<String>> = _toastText | ||
|
||
fun fetchMyGroups() { | ||
viewModelScope.launch(Dispatchers.IO) { | ||
// val result = getMyGroupsUseCase() | ||
// | ||
// result | ||
// .onSuccess { groups -> | ||
// _groups.postValue(groups) | ||
// } | ||
// .onFailure { throwable -> | ||
// _toastText.value = | ||
// Event(throwable.message ?: ErrorMessage.FETCH_MY_GROUPS_FAILED) | ||
// } | ||
} | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...m/presentation/ui/write/MembersAdapter.kt → ...ntation/ui/write/groups/MembersAdapter.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
Oops, something went wrong.