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
class SomeViewModel(private val getUserUseCase: GetUserUseCase) : ViewModel() { | |
// Only your viewmodel should update the value. | |
private val _user: MutableLiveData<User> = MutableLiveData() | |
val userName: LiveData<String> = _user.map { | |
resultUser -> "${resultUser.name} + ${resultUser.lastName}" | |
} | |
... | |
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
class SomeViewModel(private val getUserUseCase: GetUserUseCase) : ViewModel() { | |
// Only your viewmodel should update the value. | |
private val _userName: MutableLiveData<String> = MutableLiveData() | |
val userName: LiveData<String> | |
get() = _userName | |
... | |
private fun executeUseCase() { |
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
import android.content.ContentUris | |
import android.content.Context | |
import android.database.Cursor | |
import android.net.Uri | |
import android.os.Build | |
import android.os.Environment | |
import android.provider.DocumentsContract | |
import android.provider.MediaStore | |
import android.util.Log | |
import java.io.* |
NewerOlder