Disable hide/restore when no remote info

This commit is contained in:
vvb2060 2020-10-20 03:01:02 +08:00 committed by John Wu
parent da93bbc1fe
commit 4a7c3c06bc

View File

@ -99,11 +99,17 @@ object Hide : BaseSettingsItem.Input() {
override fun getView(context: Context) = DialogSettingsAppNameBinding override fun getView(context: Context) = DialogSettingsAppNameBinding
.inflate(LayoutInflater.from(context)).also { it.data = this }.root .inflate(LayoutInflater.from(context)).also { it.data = this }.root
override fun refresh() {
isEnabled = Info.remote.stub.versionCode > 0
}
} }
object Restore : BaseSettingsItem.Blank() { object Restore : BaseSettingsItem.Blank() {
override val title = R.string.settings_restore_manager_title.asTransitive() override val title = R.string.settings_restore_manager_title.asTransitive()
override val description = R.string.settings_restore_manager_summary.asTransitive() override val description = R.string.settings_restore_manager_summary.asTransitive()
override fun refresh() {
isEnabled = Info.remote.app.versionCode > 0
}
} }
object AddShortcut : BaseSettingsItem.Blank() { object AddShortcut : BaseSettingsItem.Blank() {