Skip to content

Commit 8cf919f

Browse files
committed
Add loading and error message to base view model
1 parent 600e03c commit 8cf919f

File tree

6 files changed

+8
-16
lines changed

6 files changed

+8
-16
lines changed

.idea/compiler.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations.xml

Lines changed: 0 additions & 12 deletions
This file was deleted.

base/src/main/java/com/enginebai/base/view/BaseViewModel.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@ package com.enginebai.base.view
33
import androidx.lifecycle.ViewModel
44
import io.reactivex.disposables.CompositeDisposable
55
import io.reactivex.disposables.Disposable
6+
import io.reactivex.subjects.PublishSubject
67
import org.koin.core.KoinComponent
78

89
abstract class BaseViewModel : ViewModel(), KoinComponent {
910
private val disposables = CompositeDisposable()
1011

12+
val loading by lazy { PublishSubject.create<Boolean>() }
13+
val errorMessage by lazy { PublishSubject.create<String>() }
14+
1115
override fun onCleared() {
1216
disposables.dispose()
1317
super.onCleared()

buildSrc/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ plugins {
1919

2020
dependencies {
2121
// Depend on the android gradle plugin, since we want to access it in our plugin
22-
implementation("com.android.tools.build:gradle:4.0.0")
22+
implementation("com.android.tools.build:gradle:4.2.2")
2323

2424
// Depend on the kotlin plugin, since we want to access it in our plugin
2525
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.72")

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip

0 commit comments

Comments
 (0)