You've already forked Magisk
mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-09-06 06:36:58 +00:00
Slightly change update UI logic
This commit is contained in:
@@ -54,12 +54,18 @@ class LocalModuleRvItem(
|
||||
}
|
||||
|
||||
@get:Bindable
|
||||
var updateReady: Boolean
|
||||
get() = item.updateInfo != null && !isRemoved && isEnabled
|
||||
set(_) = notifyPropertyChanged(BR.updateReady)
|
||||
val showUpdate get() = item.updateInfo != null
|
||||
|
||||
@get:Bindable
|
||||
val updateReady get() = item.outdated && !isRemoved && isEnabled
|
||||
|
||||
val isUpdated = item.updated
|
||||
|
||||
fun fetchedUpdateInfo() {
|
||||
notifyPropertyChanged(BR.showUpdate)
|
||||
notifyPropertyChanged(BR.updateReady)
|
||||
}
|
||||
|
||||
fun delete() {
|
||||
isRemoved = !isRemoved
|
||||
}
|
||||
|
||||
@@ -59,7 +59,8 @@ class ModuleViewModel : BaseViewModel() {
|
||||
private suspend fun loadUpdateInfo() {
|
||||
withContext(Dispatchers.IO) {
|
||||
itemsInstalled.forEach {
|
||||
it.updateReady = it.item.load()
|
||||
if (it.item.fetch())
|
||||
it.fetchedUpdateInfo()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user