mirror of
https://github.com/topjohnwu/Magisk.git
synced 2026-01-12 13:05:30 -08:00
Added progressbar indicating content loading on modules screen
This commit is contained in:
committed by
John Wu
parent
6e14a727b1
commit
1920a52829
@@ -85,6 +85,13 @@ class ModuleViewModel(
|
||||
private val itemsUpdatable = diffListOf<RepoItem.Update>()
|
||||
private val itemsRemote = diffListOf<RepoItem.Remote>()
|
||||
|
||||
var isRemoteLoading = false
|
||||
@Bindable get
|
||||
private set(value) {
|
||||
field = value
|
||||
notifyPropertyChanged(BR.remoteLoading)
|
||||
}
|
||||
|
||||
val adapter = adapterOf<ComparableRvItem<*>>()
|
||||
val items = MergeObservableList<ComparableRvItem<*>>()
|
||||
.insertList(itemsCoreOnly)
|
||||
@@ -215,9 +222,13 @@ class ModuleViewModel(
|
||||
repoUpdater(refetch).andThen(loadRemoteDB(0))
|
||||
} else {
|
||||
loadRemoteDB(itemsRemote.size)
|
||||
}.subscribeK(onError = Timber::e) {
|
||||
itemsRemote.addAll(it)
|
||||
}
|
||||
}.observeOn(AndroidSchedulers.mainThread())
|
||||
.doOnSubscribe { isRemoteLoading = true }
|
||||
.doOnSuccess { isRemoteLoading = false }
|
||||
.doOnError { isRemoteLoading = false }
|
||||
.subscribeK(onError = Timber::e) {
|
||||
itemsRemote.addAll(it)
|
||||
}
|
||||
|
||||
refetch = false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user