You've already forked Magisk
mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-09-06 06:36:58 +00:00
Show unloaded Zygisk modules in UI
This commit is contained in:
@@ -9,6 +9,7 @@ import com.topjohnwu.magisk.databinding.DiffRvItem
|
||||
import com.topjohnwu.magisk.databinding.ObservableDiffRvItem
|
||||
import com.topjohnwu.magisk.databinding.RvContainer
|
||||
import com.topjohnwu.magisk.databinding.set
|
||||
import com.topjohnwu.magisk.utils.TextHolder
|
||||
import com.topjohnwu.magisk.utils.asText
|
||||
|
||||
object InstallModule : DiffRvItem<InstallModule>() {
|
||||
@@ -21,6 +22,25 @@ class LocalModuleRvItem(
|
||||
|
||||
override val layoutRes = R.layout.item_module_md2
|
||||
|
||||
val showNotice: Boolean
|
||||
val noticeText: TextHolder
|
||||
|
||||
init {
|
||||
val isZygisk = item.isZygisk
|
||||
val isRiru = item.isRiru
|
||||
val zygiskUnloaded = isZygisk && item.zygiskUnloaded
|
||||
|
||||
showNotice = zygiskUnloaded ||
|
||||
(Info.isZygiskEnabled && isRiru) ||
|
||||
(!Info.isZygiskEnabled && isZygisk)
|
||||
noticeText =
|
||||
when {
|
||||
zygiskUnloaded -> R.string.zygisk_module_unloaded.asText()
|
||||
isRiru -> R.string.suspend_text_riru.asText(R.string.zygisk.asText())
|
||||
else -> R.string.suspend_text_zygisk.asText(R.string.zygisk.asText())
|
||||
}
|
||||
}
|
||||
|
||||
@get:Bindable
|
||||
var isEnabled = item.enable
|
||||
set(value) = set(value, field, { field = it }, BR.enabled, BR.updateReady) {
|
||||
@@ -38,14 +58,7 @@ class LocalModuleRvItem(
|
||||
get() = item.updateInfo != null && !isRemoved && isEnabled
|
||||
set(_) = notifyPropertyChanged(BR.updateReady)
|
||||
|
||||
val isSuspended =
|
||||
(Info.isZygiskEnabled && item.isRiru) || (!Info.isZygiskEnabled && item.isZygisk)
|
||||
|
||||
val suspendText =
|
||||
if (item.isRiru) R.string.suspend_text_riru.asText(R.string.zygisk.asText())
|
||||
else R.string.suspend_text_zygisk.asText(R.string.zygisk.asText())
|
||||
|
||||
val isUpdated get() = item.updated
|
||||
val isUpdated = item.updated
|
||||
|
||||
fun delete() {
|
||||
isRemoved = !isRemoved
|
||||
|
||||
Reference in New Issue
Block a user