-
You can have the presenter be a subclass of the ViewModel class and update data on the ui with the help of LiveData.
If you think it's a good idea I'd like to work on it.
-
so I set my build.gradle.kts file and settings.gradle.kts files like this
**build.gradle.kts(app) file:**
```
plugins {
id("com.android.application")
}
android {
namespace = "--my…
-
## Possible implementation
```kotlin
// StorageRepository.kt
interface StorageRepository {
suspend fun uploadFile(uri: Uri, path: String): Result
suspend fun deleteFile(path: String): R…
-
Your Turn: The DetailActivityViewModel
4. Open ui.detail.DetailActivity. Have DetailActivity extend LifecycleActivity instead of AppCompatActivity.
is there any activity name LifecycleActivity?
-
Inregrating ViewModel with Activities/Fragments.
The Screens need to be configuration aware before getting destroyed. ViewModel and LiveData need to be integrated.
-
[Project Files](https://github.com/eucalypto/learn/tree/main/android%20codelabs/kotlin-unscramble-app)
[Architecture Components Pathway](https://developer.android.com/courses/pathways/android-basic…
-
As documented here: https://developer.android.com/topic/libraries/architecture/viewmodel.html
> [...] However ViewModel objects must never observe changes to lifecycle-aware observables, such as Li…
-
LifecycleActivity has been deprecated since `android.arch.lifecycle` libs are stable version.
Fourth step in introduction to ViewModels can be removed
-
Hi,
I've been trying to access viewmodel and livedata in my views using Magellan but it don't work.
Am I missing something?
I tryed to access the ViewModel this way
`MyViewModel = ViewModel…
-
如果数据源的LiveData不在ViewModel里, 那么configChange以后, Activity重建后, 也无法从ViewModel里获取到数据, 还要重新请求. 直接通过ViewModel来调用Repository通过LiveDataBus发送数据感觉和MVP的思想是一样的. ViewModel里并没有保存数据啊
ukyo6 updated
3 years ago