-
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.
[MIN-22] feature : MainViewModel 프래그먼트 전환에 따른 툴바 텍스트 옵저빙 구현(#10)
- Loading branch information
KDW03
committed
Dec 31, 2022
1 parent
65f7ce5
commit b5fc0b9
Showing
3 changed files
with
65 additions
and
9 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
13 changes: 13 additions & 0 deletions
13
app/src/main/java/com/najudoryeong/mineme/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 |
---|---|---|
@@ -1,7 +1,20 @@ | ||
package com.najudoryeong.mineme | ||
|
||
import androidx.lifecycle.LiveData | ||
import androidx.lifecycle.MutableLiveData | ||
import androidx.lifecycle.ViewModel | ||
import com.najudoryeong.mineme.common_ui.MainViewModelUtil | ||
|
||
|
||
class MainViewModel : ViewModel() { | ||
|
||
private val _toolbarTitle = MutableLiveData<String>() | ||
|
||
val toolbarTitle: LiveData<String> | ||
get() = _toolbarTitle | ||
|
||
fun updateToolbarTitle(newTitle: String) { | ||
_toolbarTitle.value = newTitle | ||
} | ||
|
||
} |
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