Improvements to the installation UI

- No longer show irrelevant options to the user
- No longer require an additional button press to start installation
This commit is contained in:
topjohnwu
2020-08-24 04:04:52 -07:00
parent ccde8b73a2
commit e437ffdbae
8 changed files with 44 additions and 40 deletions
@@ -7,6 +7,7 @@ import com.topjohnwu.magisk.arch.BaseUIFragment
import com.topjohnwu.magisk.core.download.BaseDownloadService
import com.topjohnwu.magisk.databinding.FragmentInstallMd2Binding
import com.topjohnwu.magisk.events.RequestFileEvent
import com.topjohnwu.magisk.ktx.coroutineScope
import org.koin.androidx.viewmodel.ext.android.viewModel
class InstallFragment : BaseUIFragment<InstallViewModel, FragmentInstallMd2Binding>() {
@@ -24,7 +25,7 @@ class InstallFragment : BaseUIFragment<InstallViewModel, FragmentInstallMd2Bindi
requireActivity().setTitle(R.string.install)
// Allow markwon to run in viewmodel scope
binding.releaseNotes.tag = viewModel.viewModelScope
binding.releaseNotes.coroutineScope = viewModel.viewModelScope
BaseDownloadService.observeProgress(this, viewModel::onProgressUpdate)
}
@@ -25,11 +25,11 @@ class InstallViewModel(
stringRepo: StringRepository
) : BaseViewModel(State.LOADED) {
val isRooted get() = Shell.rootAccess()
val isAB get() = Info.isAB
val isRooted = Shell.rootAccess()
val skipOptions = Info.ramdisk && Info.isFBE && Info.isSAR
@get:Bindable
var step = 0
var step = if (skipOptions) 1 else 0
set(value) = set(value, field, { field = it }, BR.step)
@get:Bindable