Last active
May 31, 2022 12:27
-
-
Save manuelvicnt/98162c0e30c6b26f4fc0a44126770f78 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/* Copyright 2022 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 */ | |
class AddEditTaskViewModel( | |
private val tasksRepository: TasksRepository | |
) : ViewModel() { | |
- private val _snackbarText = MutableLiveData<Event<Int>>() | |
- val snackbarText: LiveData<Event<Int>> = _snackbarText | |
+ private val _snackbarText = MutableLiveData<Int?>() | |
+ val snackbarText: LiveData<Int?> = _snackbarText | |
+ fun snackbarMessageShown() { | |
+ _snackbarText.value = null | |
+ } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment