diff --git a/app/src/main/java/a/b.kt b/app/src/main/java/a/b.kt index 150f876fc..918eeeadf 100644 --- a/app/src/main/java/a/b.kt +++ b/app/src/main/java/a/b.kt @@ -1,5 +1,5 @@ package a -import com.topjohnwu.magisk.redesign.MainActivity +import com.topjohnwu.magisk.ui.MainActivity class b : MainActivity() diff --git a/app/src/main/java/a/f.java b/app/src/main/java/a/f.java index 08d136b28..204920535 100644 --- a/app/src/main/java/a/f.java +++ b/app/src/main/java/a/f.java @@ -1,6 +1,6 @@ package a; -import com.topjohnwu.magisk.ui.flash.FlashActivity; +import com.topjohnwu.magisk.legacy.flash.FlashActivity; public class f extends FlashActivity { /* stub */ diff --git a/app/src/main/java/a/m.java b/app/src/main/java/a/m.java index 3d727085d..195a6127c 100644 --- a/app/src/main/java/a/m.java +++ b/app/src/main/java/a/m.java @@ -1,6 +1,6 @@ package a; -import com.topjohnwu.magisk.ui.surequest.SuRequestActivity; +import com.topjohnwu.magisk.legacy.surequest.SuRequestActivity; public class m extends SuRequestActivity { /* stub */ diff --git a/app/src/main/java/com/topjohnwu/magisk/Config.kt b/app/src/main/java/com/topjohnwu/magisk/Config.kt index 6134b4b45..632bb2f75 100644 --- a/app/src/main/java/com/topjohnwu/magisk/Config.kt +++ b/app/src/main/java/com/topjohnwu/magisk/Config.kt @@ -13,7 +13,7 @@ import com.topjohnwu.magisk.di.Protected import com.topjohnwu.magisk.extensions.get import com.topjohnwu.magisk.extensions.inject import com.topjohnwu.magisk.model.preference.PreferenceModel -import com.topjohnwu.magisk.redesign.theme.Theme +import com.topjohnwu.magisk.ui.theme.Theme import com.topjohnwu.magisk.utils.BiometricHelper import com.topjohnwu.magisk.utils.Utils import com.topjohnwu.superuser.Shell diff --git a/app/src/main/java/com/topjohnwu/magisk/Hacks.kt b/app/src/main/java/com/topjohnwu/magisk/Hacks.kt index df21b4d2c..a316acc8a 100644 --- a/app/src/main/java/com/topjohnwu/magisk/Hacks.kt +++ b/app/src/main/java/com/topjohnwu/magisk/Hacks.kt @@ -18,10 +18,10 @@ import com.topjohnwu.magisk.extensions.forceGetDeclaredField import com.topjohnwu.magisk.model.download.DownloadService import com.topjohnwu.magisk.model.receiver.GeneralReceiver import com.topjohnwu.magisk.model.update.UpdateCheckService -import com.topjohnwu.magisk.redesign.MainActivity +import com.topjohnwu.magisk.ui.MainActivity import com.topjohnwu.magisk.ui.SplashActivity -import com.topjohnwu.magisk.ui.flash.FlashActivity -import com.topjohnwu.magisk.ui.surequest.SuRequestActivity +import com.topjohnwu.magisk.legacy.flash.FlashActivity +import com.topjohnwu.magisk.legacy.surequest.SuRequestActivity import com.topjohnwu.magisk.utils.refreshLocale import com.topjohnwu.magisk.utils.updateConfig diff --git a/app/src/main/java/com/topjohnwu/magisk/di/RedesignModule.kt b/app/src/main/java/com/topjohnwu/magisk/di/RedesignModule.kt index c5d93ac71..a79c9a980 100644 --- a/app/src/main/java/com/topjohnwu/magisk/di/RedesignModule.kt +++ b/app/src/main/java/com/topjohnwu/magisk/di/RedesignModule.kt @@ -1,17 +1,17 @@ package com.topjohnwu.magisk.di -import com.topjohnwu.magisk.redesign.MainViewModel -import com.topjohnwu.magisk.redesign.flash.FlashViewModel -import com.topjohnwu.magisk.redesign.hide.HideViewModel -import com.topjohnwu.magisk.redesign.home.HomeViewModel -import com.topjohnwu.magisk.redesign.install.InstallViewModel -import com.topjohnwu.magisk.redesign.log.LogViewModel -import com.topjohnwu.magisk.redesign.module.ModuleViewModel -import com.topjohnwu.magisk.redesign.request.RequestViewModel -import com.topjohnwu.magisk.redesign.safetynet.SafetynetViewModel -import com.topjohnwu.magisk.redesign.settings.SettingsViewModel -import com.topjohnwu.magisk.redesign.superuser.SuperuserViewModel -import com.topjohnwu.magisk.redesign.theme.ThemeViewModel +import com.topjohnwu.magisk.ui.MainViewModel +import com.topjohnwu.magisk.ui.flash.FlashViewModel +import com.topjohnwu.magisk.ui.hide.HideViewModel +import com.topjohnwu.magisk.ui.home.HomeViewModel +import com.topjohnwu.magisk.ui.install.InstallViewModel +import com.topjohnwu.magisk.ui.log.LogViewModel +import com.topjohnwu.magisk.ui.module.ModuleViewModel +import com.topjohnwu.magisk.ui.request.RequestViewModel +import com.topjohnwu.magisk.ui.safetynet.SafetynetViewModel +import com.topjohnwu.magisk.ui.settings.SettingsViewModel +import com.topjohnwu.magisk.ui.superuser.SuperuserViewModel +import com.topjohnwu.magisk.ui.theme.ThemeViewModel import org.koin.androidx.viewmodel.dsl.viewModel import org.koin.dsl.module @@ -29,4 +29,4 @@ val redesignModule = module { viewModel { InstallViewModel() } viewModel { MainViewModel() } -} \ No newline at end of file +} diff --git a/app/src/main/java/com/topjohnwu/magisk/di/ViewModelsModule.kt b/app/src/main/java/com/topjohnwu/magisk/di/ViewModelsModule.kt index 8df400983..547068331 100644 --- a/app/src/main/java/com/topjohnwu/magisk/di/ViewModelsModule.kt +++ b/app/src/main/java/com/topjohnwu/magisk/di/ViewModelsModule.kt @@ -1,8 +1,8 @@ package com.topjohnwu.magisk.di import android.net.Uri -import com.topjohnwu.magisk.ui.flash.FlashViewModel -import com.topjohnwu.magisk.ui.surequest.SuRequestViewModel +import com.topjohnwu.magisk.legacy.flash.FlashViewModel +import com.topjohnwu.magisk.legacy.surequest.SuRequestViewModel import org.koin.androidx.viewmodel.dsl.viewModel import org.koin.dsl.module diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/flash/FlashActivity.kt b/app/src/main/java/com/topjohnwu/magisk/legacy/flash/FlashActivity.kt similarity index 99% rename from app/src/main/java/com/topjohnwu/magisk/ui/flash/FlashActivity.kt rename to app/src/main/java/com/topjohnwu/magisk/legacy/flash/FlashActivity.kt index 73609318a..6e2761636 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/flash/FlashActivity.kt +++ b/app/src/main/java/com/topjohnwu/magisk/legacy/flash/FlashActivity.kt @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.ui.flash +package com.topjohnwu.magisk.legacy.flash import android.content.Context import android.content.Intent diff --git a/app/src/main/java/com/topjohnwu/magisk/legacy/flash/FlashViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/legacy/flash/FlashViewModel.kt new file mode 100644 index 000000000..ca68bfa55 --- /dev/null +++ b/app/src/main/java/com/topjohnwu/magisk/legacy/flash/FlashViewModel.kt @@ -0,0 +1,110 @@ +package com.topjohnwu.magisk.legacy.flash + +import android.Manifest.permission.READ_EXTERNAL_STORAGE +import android.Manifest.permission.WRITE_EXTERNAL_STORAGE +import android.content.res.Resources +import android.net.Uri +import android.os.Handler +import androidx.core.os.postDelayed +import androidx.databinding.ObservableArrayList +import com.topjohnwu.magisk.BR +import com.topjohnwu.magisk.Config +import com.topjohnwu.magisk.Const +import com.topjohnwu.magisk.R +import com.topjohnwu.magisk.base.viewmodel.BaseViewModel +import com.topjohnwu.magisk.databinding.ComparableRvItem +import com.topjohnwu.magisk.extensions.* +import com.topjohnwu.magisk.model.entity.recycler.ConsoleRvItem +import com.topjohnwu.magisk.model.events.SnackbarEvent +import com.topjohnwu.magisk.model.flash.FlashResultListener +import com.topjohnwu.magisk.model.flash.Flashing +import com.topjohnwu.magisk.model.flash.Patching +import com.topjohnwu.magisk.utils.DiffObservableList +import com.topjohnwu.magisk.utils.KObservableField +import com.topjohnwu.superuser.Shell +import me.tatarka.bindingcollectionadapter2.ItemBinding +import java.io.File +import java.util.* + +class FlashViewModel( + action: String, + installer: Uri, + uri: Uri, + private val resources: Resources +) : BaseViewModel(), FlashResultListener { + + val canShowReboot = Shell.rootAccess() + val showRestartTitle = KObservableField(false) + + val behaviorText = KObservableField(resources.getString(R.string.flashing)) + + val items = DiffObservableList(ComparableRvItem.callback) + val itemBinding = ItemBinding.of> { itemBinding, _, item -> + item.bind(itemBinding) + itemBinding.bindExtra(BR.viewModel, this@FlashViewModel) + } + + private val outItems = ObservableArrayList() + private val logItems = Collections.synchronizedList(mutableListOf()) + + init { + outItems.sendUpdatesTo(items) { it.map { ConsoleRvItem(it) } } + outItems.copyNewInputInto(logItems) + + state = State.LOADING + + when (action) { + Const.Value.FLASH_ZIP -> Flashing + .Install(installer, outItems, logItems, this) + .exec() + Const.Value.UNINSTALL -> Flashing + .Uninstall(installer, outItems, logItems, this) + .exec() + Const.Value.FLASH_MAGISK -> Patching + .Direct(installer, outItems, logItems, this) + .exec() + Const.Value.FLASH_INACTIVE_SLOT -> Patching + .SecondSlot(installer, outItems, logItems, this) + .exec() + Const.Value.PATCH_FILE -> Patching + .File(installer, uri, outItems, logItems, this) + .exec() + } + } + + override fun onResult(isSuccess: Boolean) { + state = if (isSuccess) State.LOADED else State.LOADING_FAILED + behaviorText.value = when { + isSuccess -> resources.getString(R.string.done) + else -> resources.getString(R.string.failure) + } + + if (isSuccess) { + Handler().postDelayed(500) { + showRestartTitle.value = true + } + } + } + + fun savePressed() = withPermissions(READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE) + .map { now } + .map { it.toTime(timeFormatStandard) } + .map { Const.MAGISK_INSTALL_LOG_FILENAME.format(it) } + .map { File(Config.downloadDirectory, it) } + .map { file -> + file.bufferedWriter().use { writer -> + logItems.forEach { + writer.write(it) + writer.newLine() + } + } + file.path + } + .subscribeK { SnackbarEvent(it).publish() } + .add() + + fun restartPressed() = reboot() + + fun backPressed() = back() + +} diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/surequest/SuRequestActivity.kt b/app/src/main/java/com/topjohnwu/magisk/legacy/surequest/SuRequestActivity.kt similarity index 97% rename from app/src/main/java/com/topjohnwu/magisk/ui/surequest/SuRequestActivity.kt rename to app/src/main/java/com/topjohnwu/magisk/legacy/surequest/SuRequestActivity.kt index 2fdac91ab..df7542c68 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/surequest/SuRequestActivity.kt +++ b/app/src/main/java/com/topjohnwu/magisk/legacy/surequest/SuRequestActivity.kt @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.ui.surequest +package com.topjohnwu.magisk.legacy.surequest import android.content.Intent import android.content.pm.ActivityInfo diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/surequest/SuRequestViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/legacy/surequest/SuRequestViewModel.kt similarity index 99% rename from app/src/main/java/com/topjohnwu/magisk/ui/surequest/SuRequestViewModel.kt rename to app/src/main/java/com/topjohnwu/magisk/legacy/surequest/SuRequestViewModel.kt index c9971d738..363b0c471 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/surequest/SuRequestViewModel.kt +++ b/app/src/main/java/com/topjohnwu/magisk/legacy/surequest/SuRequestViewModel.kt @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.ui.surequest +package com.topjohnwu.magisk.legacy.surequest import android.content.Intent import android.content.SharedPreferences diff --git a/app/src/main/java/com/topjohnwu/magisk/model/download/DownloadService.kt b/app/src/main/java/com/topjohnwu/magisk/model/download/DownloadService.kt index b39909bb8..64c568ad7 100644 --- a/app/src/main/java/com/topjohnwu/magisk/model/download/DownloadService.kt +++ b/app/src/main/java/com/topjohnwu/magisk/model/download/DownloadService.kt @@ -16,7 +16,7 @@ import com.topjohnwu.magisk.model.entity.internal.Configuration.* import com.topjohnwu.magisk.model.entity.internal.Configuration.Flash.Secondary import com.topjohnwu.magisk.model.entity.internal.DownloadSubject import com.topjohnwu.magisk.model.entity.internal.DownloadSubject.* -import com.topjohnwu.magisk.ui.flash.FlashActivity +import com.topjohnwu.magisk.legacy.flash.FlashActivity import com.topjohnwu.magisk.utils.APKInstall import org.koin.core.get import java.io.File diff --git a/app/src/main/java/com/topjohnwu/magisk/model/entity/recycler/HideRvItem.kt b/app/src/main/java/com/topjohnwu/magisk/model/entity/recycler/HideRvItem.kt index 30befa36e..c6be0412e 100644 --- a/app/src/main/java/com/topjohnwu/magisk/model/entity/recycler/HideRvItem.kt +++ b/app/src/main/java/com/topjohnwu/magisk/model/entity/recycler/HideRvItem.kt @@ -10,7 +10,7 @@ import com.topjohnwu.magisk.extensions.toggle import com.topjohnwu.magisk.model.entity.ProcessHideApp import com.topjohnwu.magisk.model.entity.StatefulProcess import com.topjohnwu.magisk.model.observer.Observer -import com.topjohnwu.magisk.redesign.hide.HideViewModel +import com.topjohnwu.magisk.ui.hide.HideViewModel import com.topjohnwu.magisk.utils.KObservableField import kotlin.math.roundToInt diff --git a/app/src/main/java/com/topjohnwu/magisk/model/entity/recycler/ModuleRvItem.kt b/app/src/main/java/com/topjohnwu/magisk/model/entity/recycler/ModuleRvItem.kt index 1a8a2f2c3..bf35d15e4 100644 --- a/app/src/main/java/com/topjohnwu/magisk/model/entity/recycler/ModuleRvItem.kt +++ b/app/src/main/java/com/topjohnwu/magisk/model/entity/recycler/ModuleRvItem.kt @@ -10,7 +10,7 @@ import com.topjohnwu.magisk.R import com.topjohnwu.magisk.databinding.ComparableRvItem import com.topjohnwu.magisk.model.entity.module.Module import com.topjohnwu.magisk.model.entity.module.Repo -import com.topjohnwu.magisk.redesign.module.ModuleViewModel +import com.topjohnwu.magisk.ui.module.ModuleViewModel import com.topjohnwu.magisk.utils.KObservableField object SafeModeNotice : ComparableRvItem() { diff --git a/app/src/main/java/com/topjohnwu/magisk/model/entity/recycler/PolicyRvItem.kt b/app/src/main/java/com/topjohnwu/magisk/model/entity/recycler/PolicyRvItem.kt index 6d12c729e..910c67b3d 100644 --- a/app/src/main/java/com/topjohnwu/magisk/model/entity/recycler/PolicyRvItem.kt +++ b/app/src/main/java/com/topjohnwu/magisk/model/entity/recycler/PolicyRvItem.kt @@ -6,7 +6,7 @@ import com.topjohnwu.magisk.databinding.ComparableRvItem import com.topjohnwu.magisk.extensions.toggle import com.topjohnwu.magisk.model.entity.MagiskPolicy import com.topjohnwu.magisk.model.events.PolicyUpdateEvent -import com.topjohnwu.magisk.redesign.superuser.SuperuserViewModel +import com.topjohnwu.magisk.ui.superuser.SuperuserViewModel import com.topjohnwu.magisk.utils.KObservableField class PolicyItem(val item: MagiskPolicy, val icon: Drawable) : ComparableRvItem() { diff --git a/app/src/main/java/com/topjohnwu/magisk/model/entity/recycler/ThemeItem.kt b/app/src/main/java/com/topjohnwu/magisk/model/entity/recycler/ThemeItem.kt index c9e44f6fb..4997269e7 100644 --- a/app/src/main/java/com/topjohnwu/magisk/model/entity/recycler/ThemeItem.kt +++ b/app/src/main/java/com/topjohnwu/magisk/model/entity/recycler/ThemeItem.kt @@ -2,7 +2,7 @@ package com.topjohnwu.magisk.model.entity.recycler import com.topjohnwu.magisk.R import com.topjohnwu.magisk.databinding.ComparableRvItem -import com.topjohnwu.magisk.redesign.theme.Theme +import com.topjohnwu.magisk.ui.theme.Theme class ThemeItem(val theme: Theme) : ComparableRvItem() { @@ -11,4 +11,4 @@ class ThemeItem(val theme: Theme) : ComparableRvItem() { override fun contentSameAs(other: ThemeItem) = itemSameAs(other) override fun itemSameAs(other: ThemeItem) = theme == other.theme -} \ No newline at end of file +} diff --git a/app/src/main/java/com/topjohnwu/magisk/model/events/InstallExternalModuleEvent.kt b/app/src/main/java/com/topjohnwu/magisk/model/events/InstallExternalModuleEvent.kt index 0c7c603d8..1e891912f 100644 --- a/app/src/main/java/com/topjohnwu/magisk/model/events/InstallExternalModuleEvent.kt +++ b/app/src/main/java/com/topjohnwu/magisk/model/events/InstallExternalModuleEvent.kt @@ -6,7 +6,7 @@ import android.content.Intent import com.topjohnwu.magisk.Const import com.topjohnwu.magisk.base.BaseActivity import com.topjohnwu.magisk.intent -import com.topjohnwu.magisk.ui.flash.FlashActivity +import com.topjohnwu.magisk.legacy.flash.FlashActivity class InstallExternalModuleEvent : ViewEvent(), ActivityExecutor { diff --git a/app/src/main/java/com/topjohnwu/magisk/model/navigation/MagiskNavigationEvent.kt b/app/src/main/java/com/topjohnwu/magisk/model/navigation/MagiskNavigationEvent.kt index c5df8ee47..9dea56b0d 100644 --- a/app/src/main/java/com/topjohnwu/magisk/model/navigation/MagiskNavigationEvent.kt +++ b/app/src/main/java/com/topjohnwu/magisk/model/navigation/MagiskNavigationEvent.kt @@ -7,7 +7,7 @@ import androidx.fragment.app.Fragment import com.topjohnwu.magisk.base.BaseActivity import com.topjohnwu.magisk.model.events.ActivityExecutor import com.topjohnwu.magisk.model.events.ViewEvent -import com.topjohnwu.magisk.redesign.compat.CompatActivity +import com.topjohnwu.magisk.ui.compat.CompatActivity import kotlin.reflect.KClass @DslMarker diff --git a/app/src/main/java/com/topjohnwu/magisk/model/navigation/Navigation.kt b/app/src/main/java/com/topjohnwu/magisk/model/navigation/Navigation.kt index 1675df86b..69cd99127 100644 --- a/app/src/main/java/com/topjohnwu/magisk/model/navigation/Navigation.kt +++ b/app/src/main/java/com/topjohnwu/magisk/model/navigation/Navigation.kt @@ -5,16 +5,16 @@ import android.content.Intent import android.os.Build import com.topjohnwu.magisk.Const import com.topjohnwu.magisk.intent -import com.topjohnwu.magisk.redesign.MainActivity -import com.topjohnwu.magisk.redesign.hide.HideFragment -import com.topjohnwu.magisk.redesign.home.HomeFragment -import com.topjohnwu.magisk.redesign.install.InstallFragment -import com.topjohnwu.magisk.redesign.log.LogFragment -import com.topjohnwu.magisk.redesign.module.ModuleFragment -import com.topjohnwu.magisk.redesign.safetynet.SafetynetFragment -import com.topjohnwu.magisk.redesign.settings.SettingsFragment -import com.topjohnwu.magisk.redesign.superuser.SuperuserFragment -import com.topjohnwu.magisk.redesign.theme.ThemeFragment +import com.topjohnwu.magisk.ui.MainActivity +import com.topjohnwu.magisk.ui.hide.HideFragment +import com.topjohnwu.magisk.ui.home.HomeFragment +import com.topjohnwu.magisk.ui.install.InstallFragment +import com.topjohnwu.magisk.ui.log.LogFragment +import com.topjohnwu.magisk.ui.module.ModuleFragment +import com.topjohnwu.magisk.ui.safetynet.SafetynetFragment +import com.topjohnwu.magisk.ui.settings.SettingsFragment +import com.topjohnwu.magisk.ui.superuser.SuperuserFragment +import com.topjohnwu.magisk.ui.theme.ThemeFragment object Navigation { diff --git a/app/src/main/java/com/topjohnwu/magisk/redesign/MainViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/redesign/MainViewModel.kt deleted file mode 100644 index 41edb6da4..000000000 --- a/app/src/main/java/com/topjohnwu/magisk/redesign/MainViewModel.kt +++ /dev/null @@ -1,5 +0,0 @@ -package com.topjohnwu.magisk.redesign - -import com.topjohnwu.magisk.redesign.compat.CompatViewModel - -class MainViewModel : CompatViewModel() \ No newline at end of file diff --git a/app/src/main/java/com/topjohnwu/magisk/redesign/flash/FlashViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/redesign/flash/FlashViewModel.kt deleted file mode 100644 index ff0fbc1cf..000000000 --- a/app/src/main/java/com/topjohnwu/magisk/redesign/flash/FlashViewModel.kt +++ /dev/null @@ -1,5 +0,0 @@ -package com.topjohnwu.magisk.redesign.flash - -import com.topjohnwu.magisk.redesign.compat.CompatViewModel - -class FlashViewModel : CompatViewModel() \ No newline at end of file diff --git a/app/src/main/java/com/topjohnwu/magisk/redesign/request/RequestViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/redesign/request/RequestViewModel.kt deleted file mode 100644 index 92920eea8..000000000 --- a/app/src/main/java/com/topjohnwu/magisk/redesign/request/RequestViewModel.kt +++ /dev/null @@ -1,5 +0,0 @@ -package com.topjohnwu.magisk.redesign.request - -import com.topjohnwu.magisk.redesign.compat.CompatViewModel - -class RequestViewModel : CompatViewModel() \ No newline at end of file diff --git a/app/src/main/java/com/topjohnwu/magisk/redesign/MainActivity.kt b/app/src/main/java/com/topjohnwu/magisk/ui/MainActivity.kt similarity index 94% rename from app/src/main/java/com/topjohnwu/magisk/redesign/MainActivity.kt rename to app/src/main/java/com/topjohnwu/magisk/ui/MainActivity.kt index fb4057ef3..9f54ffcd9 100644 --- a/app/src/main/java/com/topjohnwu/magisk/redesign/MainActivity.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/MainActivity.kt @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.redesign +package com.topjohnwu.magisk.ui import android.os.Bundle import android.view.MenuItem @@ -17,11 +17,11 @@ import com.topjohnwu.magisk.R import com.topjohnwu.magisk.databinding.ActivityMainMd2Binding import com.topjohnwu.magisk.extensions.startAnimations import com.topjohnwu.magisk.model.navigation.Navigation -import com.topjohnwu.magisk.redesign.compat.CompatActivity -import com.topjohnwu.magisk.redesign.compat.CompatNavigationDelegate -import com.topjohnwu.magisk.redesign.home.HomeFragment -import com.topjohnwu.magisk.redesign.module.ModuleFragment -import com.topjohnwu.magisk.redesign.superuser.SuperuserFragment +import com.topjohnwu.magisk.ui.compat.CompatActivity +import com.topjohnwu.magisk.ui.compat.CompatNavigationDelegate +import com.topjohnwu.magisk.ui.home.HomeFragment +import com.topjohnwu.magisk.ui.module.ModuleFragment +import com.topjohnwu.magisk.ui.superuser.SuperuserFragment import com.topjohnwu.magisk.utils.HideBottomViewOnScrollBehavior import com.topjohnwu.magisk.utils.HideTopViewOnScrollBehavior import com.topjohnwu.magisk.utils.HideableBehavior diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/MainViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/ui/MainViewModel.kt new file mode 100644 index 000000000..63104cbd5 --- /dev/null +++ b/app/src/main/java/com/topjohnwu/magisk/ui/MainViewModel.kt @@ -0,0 +1,5 @@ +package com.topjohnwu.magisk.ui + +import com.topjohnwu.magisk.ui.compat.CompatViewModel + +class MainViewModel : CompatViewModel() diff --git a/app/src/main/java/com/topjohnwu/magisk/redesign/ReselectionTarget.kt b/app/src/main/java/com/topjohnwu/magisk/ui/ReselectionTarget.kt similarity index 58% rename from app/src/main/java/com/topjohnwu/magisk/redesign/ReselectionTarget.kt rename to app/src/main/java/com/topjohnwu/magisk/ui/ReselectionTarget.kt index e7d44d8ef..2134ecc1b 100644 --- a/app/src/main/java/com/topjohnwu/magisk/redesign/ReselectionTarget.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/ReselectionTarget.kt @@ -1,7 +1,7 @@ -package com.topjohnwu.magisk.redesign +package com.topjohnwu.magisk.ui interface ReselectionTarget { fun onReselected() -} \ No newline at end of file +} diff --git a/app/src/main/java/com/topjohnwu/magisk/redesign/compat/CompatActivity.kt b/app/src/main/java/com/topjohnwu/magisk/ui/compat/CompatActivity.kt similarity index 97% rename from app/src/main/java/com/topjohnwu/magisk/redesign/compat/CompatActivity.kt rename to app/src/main/java/com/topjohnwu/magisk/ui/compat/CompatActivity.kt index 647c4ba07..66229faa8 100644 --- a/app/src/main/java/com/topjohnwu/magisk/redesign/compat/CompatActivity.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/compat/CompatActivity.kt @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.redesign.compat +package com.topjohnwu.magisk.ui.compat import android.app.Activity import android.content.Intent @@ -17,7 +17,7 @@ import com.topjohnwu.magisk.model.events.SnackbarEvent import com.topjohnwu.magisk.model.events.ViewEvent import com.topjohnwu.magisk.model.navigation.MagiskNavigationEvent import com.topjohnwu.magisk.model.navigation.Navigator -import com.topjohnwu.magisk.redesign.theme.Theme +import com.topjohnwu.magisk.ui.theme.Theme import kotlin.reflect.KClass @@ -89,4 +89,4 @@ fun Activity.hideKeyboard() { getSystemService() ?.hideSoftInputFromWindow(view.windowToken, 0) view.clearFocus() -} \ No newline at end of file +} diff --git a/app/src/main/java/com/topjohnwu/magisk/redesign/compat/CompatDelegate.kt b/app/src/main/java/com/topjohnwu/magisk/ui/compat/CompatDelegate.kt similarity index 98% rename from app/src/main/java/com/topjohnwu/magisk/redesign/compat/CompatDelegate.kt rename to app/src/main/java/com/topjohnwu/magisk/ui/compat/CompatDelegate.kt index d5e97b299..783cfd1c2 100644 --- a/app/src/main/java/com/topjohnwu/magisk/redesign/compat/CompatDelegate.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/compat/CompatDelegate.kt @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.redesign.compat +package com.topjohnwu.magisk.ui.compat import android.view.View import androidx.core.graphics.Insets diff --git a/app/src/main/java/com/topjohnwu/magisk/redesign/compat/CompatFragment.kt b/app/src/main/java/com/topjohnwu/magisk/ui/compat/CompatFragment.kt similarity index 97% rename from app/src/main/java/com/topjohnwu/magisk/redesign/compat/CompatFragment.kt rename to app/src/main/java/com/topjohnwu/magisk/ui/compat/CompatFragment.kt index c4b942736..14e60a9eb 100644 --- a/app/src/main/java/com/topjohnwu/magisk/redesign/compat/CompatFragment.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/compat/CompatFragment.kt @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.redesign.compat +package com.topjohnwu.magisk.ui.compat import android.os.Bundle import android.view.View @@ -53,4 +53,4 @@ abstract class CompatFragment> itemBindingOf( ) = OnItemBind { itemBinding, _, item -> item.bind(itemBinding) body(itemBinding) -} \ No newline at end of file +} diff --git a/app/src/main/java/com/topjohnwu/magisk/redesign/compat/CompatNavigationDelegate.kt b/app/src/main/java/com/topjohnwu/magisk/ui/compat/CompatNavigationDelegate.kt similarity index 97% rename from app/src/main/java/com/topjohnwu/magisk/redesign/compat/CompatNavigationDelegate.kt rename to app/src/main/java/com/topjohnwu/magisk/ui/compat/CompatNavigationDelegate.kt index 5037e6ff3..f1c965c70 100644 --- a/app/src/main/java/com/topjohnwu/magisk/redesign/compat/CompatNavigationDelegate.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/compat/CompatNavigationDelegate.kt @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.redesign.compat +package com.topjohnwu.magisk.ui.compat import android.content.Intent import android.os.Bundle @@ -8,7 +8,7 @@ import com.topjohnwu.magisk.R import com.topjohnwu.magisk.model.navigation.MagiskAnimBuilder import com.topjohnwu.magisk.model.navigation.MagiskNavigationEvent import com.topjohnwu.magisk.model.navigation.Navigator -import com.topjohnwu.magisk.redesign.ReselectionTarget +import com.topjohnwu.magisk.ui.ReselectionTarget import timber.log.Timber class CompatNavigationDelegate( @@ -125,4 +125,4 @@ class CompatNavigationDelegate( ) } -} \ No newline at end of file +} diff --git a/app/src/main/java/com/topjohnwu/magisk/redesign/compat/CompatView.kt b/app/src/main/java/com/topjohnwu/magisk/ui/compat/CompatView.kt similarity index 88% rename from app/src/main/java/com/topjohnwu/magisk/redesign/compat/CompatView.kt rename to app/src/main/java/com/topjohnwu/magisk/ui/compat/CompatView.kt index cfcf4d9f2..919851df6 100644 --- a/app/src/main/java/com/topjohnwu/magisk/redesign/compat/CompatView.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/compat/CompatView.kt @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.redesign.compat +package com.topjohnwu.magisk.ui.compat import android.view.View import androidx.core.graphics.Insets diff --git a/app/src/main/java/com/topjohnwu/magisk/redesign/compat/CompatViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/ui/compat/CompatViewModel.kt similarity index 96% rename from app/src/main/java/com/topjohnwu/magisk/redesign/compat/CompatViewModel.kt rename to app/src/main/java/com/topjohnwu/magisk/ui/compat/CompatViewModel.kt index 7868e6014..c22ae870f 100644 --- a/app/src/main/java/com/topjohnwu/magisk/redesign/compat/CompatViewModel.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/compat/CompatViewModel.kt @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.redesign.compat +package com.topjohnwu.magisk.ui.compat import androidx.annotation.CallSuper import androidx.core.graphics.Insets diff --git a/app/src/main/java/com/topjohnwu/magisk/redesign/compat/Queryable.kt b/app/src/main/java/com/topjohnwu/magisk/ui/compat/Queryable.kt similarity index 91% rename from app/src/main/java/com/topjohnwu/magisk/redesign/compat/Queryable.kt rename to app/src/main/java/com/topjohnwu/magisk/ui/compat/Queryable.kt index 3d6f43661..ff8d5e508 100644 --- a/app/src/main/java/com/topjohnwu/magisk/redesign/compat/Queryable.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/compat/Queryable.kt @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.redesign.compat +package com.topjohnwu.magisk.ui.compat import android.os.Handler import android.os.Looper @@ -20,4 +20,4 @@ interface Queryable { override fun submitQuery() {} } } -} \ No newline at end of file +} diff --git a/app/src/main/java/com/topjohnwu/magisk/redesign/flash/FlashFragment.kt b/app/src/main/java/com/topjohnwu/magisk/ui/flash/FlashFragment.kt similarity index 77% rename from app/src/main/java/com/topjohnwu/magisk/redesign/flash/FlashFragment.kt rename to app/src/main/java/com/topjohnwu/magisk/ui/flash/FlashFragment.kt index 63366c484..b32f65456 100644 --- a/app/src/main/java/com/topjohnwu/magisk/redesign/flash/FlashFragment.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/flash/FlashFragment.kt @@ -1,8 +1,8 @@ -package com.topjohnwu.magisk.redesign.flash +package com.topjohnwu.magisk.ui.flash import com.topjohnwu.magisk.R import com.topjohnwu.magisk.databinding.FragmentFlashMd2Binding -import com.topjohnwu.magisk.redesign.compat.CompatFragment +import com.topjohnwu.magisk.ui.compat.CompatFragment import org.koin.androidx.viewmodel.ext.android.viewModel class FlashFragment : CompatFragment() { @@ -10,4 +10,4 @@ class FlashFragment : CompatFragment() override val layoutRes = R.layout.fragment_flash_md2 override val viewModel by viewModel() -} \ No newline at end of file +} diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/flash/FlashViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/ui/flash/FlashViewModel.kt index e2ead2b3b..a70f2f3df 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/flash/FlashViewModel.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/flash/FlashViewModel.kt @@ -1,110 +1,5 @@ package com.topjohnwu.magisk.ui.flash -import android.Manifest.permission.READ_EXTERNAL_STORAGE -import android.Manifest.permission.WRITE_EXTERNAL_STORAGE -import android.content.res.Resources -import android.net.Uri -import android.os.Handler -import androidx.core.os.postDelayed -import androidx.databinding.ObservableArrayList -import com.topjohnwu.magisk.BR -import com.topjohnwu.magisk.Config -import com.topjohnwu.magisk.Const -import com.topjohnwu.magisk.R -import com.topjohnwu.magisk.base.viewmodel.BaseViewModel -import com.topjohnwu.magisk.databinding.ComparableRvItem -import com.topjohnwu.magisk.extensions.* -import com.topjohnwu.magisk.model.entity.recycler.ConsoleRvItem -import com.topjohnwu.magisk.model.events.SnackbarEvent -import com.topjohnwu.magisk.model.flash.FlashResultListener -import com.topjohnwu.magisk.model.flash.Flashing -import com.topjohnwu.magisk.model.flash.Patching -import com.topjohnwu.magisk.utils.DiffObservableList -import com.topjohnwu.magisk.utils.KObservableField -import com.topjohnwu.superuser.Shell -import me.tatarka.bindingcollectionadapter2.ItemBinding -import java.io.File -import java.util.* +import com.topjohnwu.magisk.ui.compat.CompatViewModel -class FlashViewModel( - action: String, - installer: Uri, - uri: Uri, - private val resources: Resources -) : BaseViewModel(), FlashResultListener { - - val canShowReboot = Shell.rootAccess() - val showRestartTitle = KObservableField(false) - - val behaviorText = KObservableField(resources.getString(R.string.flashing)) - - val items = DiffObservableList(ComparableRvItem.callback) - val itemBinding = ItemBinding.of> { itemBinding, _, item -> - item.bind(itemBinding) - itemBinding.bindExtra(BR.viewModel, this@FlashViewModel) - } - - private val outItems = ObservableArrayList() - private val logItems = Collections.synchronizedList(mutableListOf()) - - init { - outItems.sendUpdatesTo(items) { it.map { ConsoleRvItem(it) } } - outItems.copyNewInputInto(logItems) - - state = State.LOADING - - when (action) { - Const.Value.FLASH_ZIP -> Flashing - .Install(installer, outItems, logItems, this) - .exec() - Const.Value.UNINSTALL -> Flashing - .Uninstall(installer, outItems, logItems, this) - .exec() - Const.Value.FLASH_MAGISK -> Patching - .Direct(installer, outItems, logItems, this) - .exec() - Const.Value.FLASH_INACTIVE_SLOT -> Patching - .SecondSlot(installer, outItems, logItems, this) - .exec() - Const.Value.PATCH_FILE -> Patching - .File(installer, uri, outItems, logItems, this) - .exec() - } - } - - override fun onResult(isSuccess: Boolean) { - state = if (isSuccess) State.LOADED else State.LOADING_FAILED - behaviorText.value = when { - isSuccess -> resources.getString(R.string.done) - else -> resources.getString(R.string.failure) - } - - if (isSuccess) { - Handler().postDelayed(500) { - showRestartTitle.value = true - } - } - } - - fun savePressed() = withPermissions(READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE) - .map { now } - .map { it.toTime(timeFormatStandard) } - .map { Const.MAGISK_INSTALL_LOG_FILENAME.format(it) } - .map { File(Config.downloadDirectory, it) } - .map { file -> - file.bufferedWriter().use { writer -> - logItems.forEach { - writer.write(it) - writer.newLine() - } - } - file.path - } - .subscribeK { SnackbarEvent(it).publish() } - .add() - - fun restartPressed() = reboot() - - fun backPressed() = back() - -} \ No newline at end of file +class FlashViewModel : CompatViewModel() diff --git a/app/src/main/java/com/topjohnwu/magisk/redesign/hide/HideFragment.kt b/app/src/main/java/com/topjohnwu/magisk/ui/hide/HideFragment.kt similarity index 94% rename from app/src/main/java/com/topjohnwu/magisk/redesign/hide/HideFragment.kt rename to app/src/main/java/com/topjohnwu/magisk/ui/hide/HideFragment.kt index da5efff9d..b45a4f5c1 100644 --- a/app/src/main/java/com/topjohnwu/magisk/redesign/hide/HideFragment.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/hide/HideFragment.kt @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.redesign.hide +package com.topjohnwu.magisk.ui.hide import android.content.Context import android.os.Bundle @@ -12,8 +12,8 @@ import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import com.topjohnwu.magisk.R import com.topjohnwu.magisk.databinding.FragmentHideMd2Binding -import com.topjohnwu.magisk.redesign.compat.CompatFragment -import com.topjohnwu.magisk.redesign.compat.hideKeyboard +import com.topjohnwu.magisk.ui.compat.CompatFragment +import com.topjohnwu.magisk.ui.compat.hideKeyboard import com.topjohnwu.magisk.utils.MotionRevealHelper import org.koin.androidx.viewmodel.ext.android.viewModel diff --git a/app/src/main/java/com/topjohnwu/magisk/redesign/hide/HideViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/ui/hide/HideViewModel.kt similarity index 93% rename from app/src/main/java/com/topjohnwu/magisk/redesign/hide/HideViewModel.kt rename to app/src/main/java/com/topjohnwu/magisk/ui/hide/HideViewModel.kt index 13744d4d3..966821f8f 100644 --- a/app/src/main/java/com/topjohnwu/magisk/redesign/hide/HideViewModel.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/hide/HideViewModel.kt @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.redesign.hide +package com.topjohnwu.magisk.ui.hide import android.content.pm.ApplicationInfo import androidx.databinding.Bindable @@ -12,10 +12,10 @@ import com.topjohnwu.magisk.model.entity.ProcessHideApp import com.topjohnwu.magisk.model.entity.StatefulProcess import com.topjohnwu.magisk.model.entity.recycler.HideItem import com.topjohnwu.magisk.model.entity.recycler.HideProcessItem -import com.topjohnwu.magisk.redesign.compat.CompatViewModel -import com.topjohnwu.magisk.redesign.compat.Queryable -import com.topjohnwu.magisk.redesign.compat.filterableListOf -import com.topjohnwu.magisk.redesign.compat.itemBindingOf +import com.topjohnwu.magisk.ui.compat.CompatViewModel +import com.topjohnwu.magisk.ui.compat.Queryable +import com.topjohnwu.magisk.ui.compat.filterableListOf +import com.topjohnwu.magisk.ui.compat.itemBindingOf import com.topjohnwu.magisk.utils.KObservableField import com.topjohnwu.magisk.utils.currentLocale diff --git a/app/src/main/java/com/topjohnwu/magisk/redesign/home/HomeFragment.kt b/app/src/main/java/com/topjohnwu/magisk/ui/home/HomeFragment.kt similarity index 91% rename from app/src/main/java/com/topjohnwu/magisk/redesign/home/HomeFragment.kt rename to app/src/main/java/com/topjohnwu/magisk/ui/home/HomeFragment.kt index ca2ed1fba..e4e8e49a7 100644 --- a/app/src/main/java/com/topjohnwu/magisk/redesign/home/HomeFragment.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/home/HomeFragment.kt @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.redesign.home +package com.topjohnwu.magisk.ui.home import android.view.Menu import android.view.MenuInflater @@ -7,7 +7,7 @@ import androidx.core.graphics.Insets import com.topjohnwu.magisk.R import com.topjohnwu.magisk.databinding.FragmentHomeMd2Binding import com.topjohnwu.magisk.model.navigation.Navigation -import com.topjohnwu.magisk.redesign.compat.CompatFragment +import com.topjohnwu.magisk.ui.compat.CompatFragment import org.koin.androidx.viewmodel.ext.android.viewModel class HomeFragment : CompatFragment() { diff --git a/app/src/main/java/com/topjohnwu/magisk/redesign/home/HomeViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt similarity index 97% rename from app/src/main/java/com/topjohnwu/magisk/redesign/home/HomeViewModel.kt rename to app/src/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt index 07b57f127..52ccc1a71 100644 --- a/app/src/main/java/com/topjohnwu/magisk/redesign/home/HomeViewModel.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.redesign.home +package com.topjohnwu.magisk.ui.home import android.Manifest import android.os.Build @@ -22,8 +22,8 @@ import com.topjohnwu.magisk.model.events.dialog.ManagerInstallDialog import com.topjohnwu.magisk.model.events.dialog.UninstallDialog import com.topjohnwu.magisk.model.navigation.Navigation import com.topjohnwu.magisk.model.observer.Observer -import com.topjohnwu.magisk.redesign.compat.CompatViewModel -import com.topjohnwu.magisk.redesign.compat.itemBindingOf +import com.topjohnwu.magisk.ui.compat.CompatViewModel +import com.topjohnwu.magisk.ui.compat.itemBindingOf import com.topjohnwu.magisk.utils.KObservableField import com.topjohnwu.superuser.Shell import me.tatarka.bindingcollectionadapter2.BR diff --git a/app/src/main/java/com/topjohnwu/magisk/redesign/install/InstallFragment.kt b/app/src/main/java/com/topjohnwu/magisk/ui/install/InstallFragment.kt similarity index 89% rename from app/src/main/java/com/topjohnwu/magisk/redesign/install/InstallFragment.kt rename to app/src/main/java/com/topjohnwu/magisk/ui/install/InstallFragment.kt index 34fd1e0c2..d2e4a5880 100644 --- a/app/src/main/java/com/topjohnwu/magisk/redesign/install/InstallFragment.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/install/InstallFragment.kt @@ -1,11 +1,11 @@ -package com.topjohnwu.magisk.redesign.install +package com.topjohnwu.magisk.ui.install import android.content.Intent import androidx.core.graphics.Insets import com.topjohnwu.magisk.R import com.topjohnwu.magisk.databinding.FragmentInstallMd2Binding import com.topjohnwu.magisk.model.events.RequestFileEvent -import com.topjohnwu.magisk.redesign.compat.CompatFragment +import com.topjohnwu.magisk.ui.compat.CompatFragment import org.koin.androidx.viewmodel.ext.android.viewModel class InstallFragment : CompatFragment() { diff --git a/app/src/main/java/com/topjohnwu/magisk/redesign/install/InstallViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/ui/install/InstallViewModel.kt similarity index 95% rename from app/src/main/java/com/topjohnwu/magisk/redesign/install/InstallViewModel.kt rename to app/src/main/java/com/topjohnwu/magisk/ui/install/InstallViewModel.kt index 25150c36e..58a2da93d 100644 --- a/app/src/main/java/com/topjohnwu/magisk/redesign/install/InstallViewModel.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/install/InstallViewModel.kt @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.redesign.install +package com.topjohnwu.magisk.ui.install import android.net.Uri import com.topjohnwu.magisk.R @@ -8,7 +8,7 @@ import com.topjohnwu.magisk.model.download.RemoteFileService import com.topjohnwu.magisk.model.entity.internal.Configuration import com.topjohnwu.magisk.model.entity.internal.DownloadSubject import com.topjohnwu.magisk.model.events.RequestFileEvent -import com.topjohnwu.magisk.redesign.compat.CompatViewModel +import com.topjohnwu.magisk.ui.compat.CompatViewModel import com.topjohnwu.magisk.utils.KObservableField import com.topjohnwu.superuser.Shell import com.topjohnwu.superuser.ShellUtils @@ -69,4 +69,4 @@ class InstallViewModel : CompatViewModel(State.LOADED) { .fastCmd("grep_prop ro.build.ab_update") .let { it.isNotEmpty() && it.toBoolean() } -} \ No newline at end of file +} diff --git a/app/src/main/java/com/topjohnwu/magisk/redesign/log/LogFragment.kt b/app/src/main/java/com/topjohnwu/magisk/ui/log/LogFragment.kt similarity index 93% rename from app/src/main/java/com/topjohnwu/magisk/redesign/log/LogFragment.kt rename to app/src/main/java/com/topjohnwu/magisk/ui/log/LogFragment.kt index 274de9352..e4a25c4aa 100644 --- a/app/src/main/java/com/topjohnwu/magisk/redesign/log/LogFragment.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/log/LogFragment.kt @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.redesign.log +package com.topjohnwu.magisk.ui.log import android.os.Bundle import android.view.Menu @@ -9,8 +9,8 @@ import androidx.core.graphics.Insets import androidx.core.view.isVisible import com.topjohnwu.magisk.R import com.topjohnwu.magisk.databinding.FragmentLogMd2Binding -import com.topjohnwu.magisk.redesign.MainActivity -import com.topjohnwu.magisk.redesign.compat.CompatFragment +import com.topjohnwu.magisk.ui.MainActivity +import com.topjohnwu.magisk.ui.compat.CompatFragment import com.topjohnwu.magisk.utils.MotionRevealHelper import org.koin.androidx.viewmodel.ext.android.viewModel diff --git a/app/src/main/java/com/topjohnwu/magisk/redesign/log/LogViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/ui/log/LogViewModel.kt similarity index 94% rename from app/src/main/java/com/topjohnwu/magisk/redesign/log/LogViewModel.kt rename to app/src/main/java/com/topjohnwu/magisk/ui/log/LogViewModel.kt index 36134093b..c88ebb873 100644 --- a/app/src/main/java/com/topjohnwu/magisk/redesign/log/LogViewModel.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/log/LogViewModel.kt @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.redesign.log +package com.topjohnwu.magisk.ui.log import com.topjohnwu.magisk.BR import com.topjohnwu.magisk.Config @@ -12,9 +12,9 @@ import com.topjohnwu.magisk.model.entity.recycler.ConsoleItem import com.topjohnwu.magisk.model.entity.recycler.LogItem import com.topjohnwu.magisk.model.entity.recycler.TextItem import com.topjohnwu.magisk.model.events.SnackbarEvent -import com.topjohnwu.magisk.redesign.compat.CompatViewModel -import com.topjohnwu.magisk.redesign.compat.diffListOf -import com.topjohnwu.magisk.redesign.compat.itemBindingOf +import com.topjohnwu.magisk.ui.compat.CompatViewModel +import com.topjohnwu.magisk.ui.compat.diffListOf +import com.topjohnwu.magisk.ui.compat.itemBindingOf import com.topjohnwu.superuser.Shell import io.reactivex.Completable import io.reactivex.android.schedulers.AndroidSchedulers diff --git a/app/src/main/java/com/topjohnwu/magisk/redesign/module/ModuleFragment.kt b/app/src/main/java/com/topjohnwu/magisk/ui/module/ModuleFragment.kt similarity index 95% rename from app/src/main/java/com/topjohnwu/magisk/redesign/module/ModuleFragment.kt rename to app/src/main/java/com/topjohnwu/magisk/ui/module/ModuleFragment.kt index bb33a86f9..ac1008ff6 100644 --- a/app/src/main/java/com/topjohnwu/magisk/redesign/module/ModuleFragment.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/module/ModuleFragment.kt @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.redesign.module +package com.topjohnwu.magisk.ui.module import android.content.Intent import android.os.Bundle @@ -14,10 +14,10 @@ import com.topjohnwu.magisk.R import com.topjohnwu.magisk.databinding.FragmentModuleMd2Binding import com.topjohnwu.magisk.model.events.InstallExternalModuleEvent import com.topjohnwu.magisk.model.events.ViewEvent -import com.topjohnwu.magisk.redesign.MainActivity -import com.topjohnwu.magisk.redesign.ReselectionTarget -import com.topjohnwu.magisk.redesign.compat.CompatFragment -import com.topjohnwu.magisk.redesign.compat.hideKeyboard +import com.topjohnwu.magisk.ui.MainActivity +import com.topjohnwu.magisk.ui.ReselectionTarget +import com.topjohnwu.magisk.ui.compat.CompatFragment +import com.topjohnwu.magisk.ui.compat.hideKeyboard import com.topjohnwu.magisk.utils.EndlessRecyclerScrollListener import com.topjohnwu.magisk.utils.MotionRevealHelper import com.topjohnwu.magisk.utils.PinchZoomTouchListener diff --git a/app/src/main/java/com/topjohnwu/magisk/redesign/module/ModuleViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/ui/module/ModuleViewModel.kt similarity index 99% rename from app/src/main/java/com/topjohnwu/magisk/redesign/module/ModuleViewModel.kt rename to app/src/main/java/com/topjohnwu/magisk/ui/module/ModuleViewModel.kt index 0c01db6f9..40421f29d 100644 --- a/app/src/main/java/com/topjohnwu/magisk/redesign/module/ModuleViewModel.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/module/ModuleViewModel.kt @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.redesign.module +package com.topjohnwu.magisk.ui.module import androidx.annotation.WorkerThread import androidx.databinding.Bindable @@ -19,8 +19,8 @@ import com.topjohnwu.magisk.model.entity.recycler.* import com.topjohnwu.magisk.model.events.InstallExternalModuleEvent import com.topjohnwu.magisk.model.events.OpenChangelogEvent import com.topjohnwu.magisk.model.events.dialog.ModuleInstallDialog -import com.topjohnwu.magisk.redesign.compat.* import com.topjohnwu.magisk.tasks.RepoUpdater +import com.topjohnwu.magisk.ui.compat.* import com.topjohnwu.magisk.utils.EndlessRecyclerScrollListener import com.topjohnwu.magisk.utils.KObservableField import com.topjohnwu.magisk.utils.currentLocale @@ -310,4 +310,4 @@ class ModuleViewModel( OpenChangelogEvent(item.repo ?: return).publish() } -} \ No newline at end of file +} diff --git a/app/src/main/java/com/topjohnwu/magisk/redesign/request/RequestActivity.kt b/app/src/main/java/com/topjohnwu/magisk/ui/request/RequestActivity.kt similarity index 78% rename from app/src/main/java/com/topjohnwu/magisk/redesign/request/RequestActivity.kt rename to app/src/main/java/com/topjohnwu/magisk/ui/request/RequestActivity.kt index 8e8303bfb..814d0f312 100644 --- a/app/src/main/java/com/topjohnwu/magisk/redesign/request/RequestActivity.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/request/RequestActivity.kt @@ -1,8 +1,8 @@ -package com.topjohnwu.magisk.redesign.request +package com.topjohnwu.magisk.ui.request import com.topjohnwu.magisk.R import com.topjohnwu.magisk.databinding.ActivityRequestMd2Binding -import com.topjohnwu.magisk.redesign.compat.CompatActivity +import com.topjohnwu.magisk.ui.compat.CompatActivity import org.koin.androidx.viewmodel.ext.android.viewModel class RequestActivity : CompatActivity() { @@ -11,4 +11,4 @@ class RequestActivity : CompatActivity() -} \ No newline at end of file +} diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/request/RequestViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/ui/request/RequestViewModel.kt new file mode 100644 index 000000000..52ab65141 --- /dev/null +++ b/app/src/main/java/com/topjohnwu/magisk/ui/request/RequestViewModel.kt @@ -0,0 +1,5 @@ +package com.topjohnwu.magisk.ui.request + +import com.topjohnwu.magisk.ui.compat.CompatViewModel + +class RequestViewModel : CompatViewModel() diff --git a/app/src/main/java/com/topjohnwu/magisk/redesign/safetynet/SafetynetFragment.kt b/app/src/main/java/com/topjohnwu/magisk/ui/safetynet/SafetynetFragment.kt similarity index 81% rename from app/src/main/java/com/topjohnwu/magisk/redesign/safetynet/SafetynetFragment.kt rename to app/src/main/java/com/topjohnwu/magisk/ui/safetynet/SafetynetFragment.kt index 44e83d184..f66663ac9 100644 --- a/app/src/main/java/com/topjohnwu/magisk/redesign/safetynet/SafetynetFragment.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/safetynet/SafetynetFragment.kt @@ -1,8 +1,8 @@ -package com.topjohnwu.magisk.redesign.safetynet +package com.topjohnwu.magisk.ui.safetynet import com.topjohnwu.magisk.R import com.topjohnwu.magisk.databinding.FragmentSafetynetMd2Binding -import com.topjohnwu.magisk.redesign.compat.CompatFragment +import com.topjohnwu.magisk.ui.compat.CompatFragment import org.koin.androidx.viewmodel.ext.android.viewModel class SafetynetFragment : CompatFragment() { @@ -15,4 +15,4 @@ class SafetynetFragment : CompatFragment() { diff --git a/app/src/main/java/com/topjohnwu/magisk/redesign/theme/ThemeViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/ui/theme/ThemeViewModel.kt similarity index 86% rename from app/src/main/java/com/topjohnwu/magisk/redesign/theme/ThemeViewModel.kt rename to app/src/main/java/com/topjohnwu/magisk/ui/theme/ThemeViewModel.kt index 35c9d0876..132b8b7f2 100644 --- a/app/src/main/java/com/topjohnwu/magisk/redesign/theme/ThemeViewModel.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/theme/ThemeViewModel.kt @@ -1,9 +1,9 @@ -package com.topjohnwu.magisk.redesign.theme +package com.topjohnwu.magisk.ui.theme import com.topjohnwu.magisk.model.entity.recycler.TappableHeadlineItem import com.topjohnwu.magisk.model.events.RecreateEvent import com.topjohnwu.magisk.model.events.dialog.DarkThemeDialog -import com.topjohnwu.magisk.redesign.compat.CompatViewModel +import com.topjohnwu.magisk.ui.compat.CompatViewModel class ThemeViewModel : CompatViewModel(), TappableHeadlineItem.Listener { @@ -21,4 +21,4 @@ class ThemeViewModel : CompatViewModel(), TappableHeadlineItem.Listener { private fun darkModePressed() = DarkThemeDialog().publish() -} \ No newline at end of file +} diff --git a/app/src/main/java/com/topjohnwu/magisk/utils/SuHandler.kt b/app/src/main/java/com/topjohnwu/magisk/utils/SuHandler.kt index c009b2445..3afee48a6 100644 --- a/app/src/main/java/com/topjohnwu/magisk/utils/SuHandler.kt +++ b/app/src/main/java/com/topjohnwu/magisk/utils/SuHandler.kt @@ -15,7 +15,7 @@ import com.topjohnwu.magisk.extensions.subscribeK import com.topjohnwu.magisk.model.entity.MagiskPolicy import com.topjohnwu.magisk.model.entity.toLog import com.topjohnwu.magisk.model.entity.toPolicy -import com.topjohnwu.magisk.ui.surequest.SuRequestActivity +import com.topjohnwu.magisk.legacy.surequest.SuRequestActivity import com.topjohnwu.superuser.Shell import timber.log.Timber diff --git a/app/src/main/java/com/topjohnwu/magisk/view/MagiskDialog.kt b/app/src/main/java/com/topjohnwu/magisk/view/MagiskDialog.kt index 3fba7938d..ec98b0631 100644 --- a/app/src/main/java/com/topjohnwu/magisk/view/MagiskDialog.kt +++ b/app/src/main/java/com/topjohnwu/magisk/view/MagiskDialog.kt @@ -22,7 +22,7 @@ import com.topjohnwu.magisk.BR import com.topjohnwu.magisk.R import com.topjohnwu.magisk.databinding.ComparableRvItem import com.topjohnwu.magisk.databinding.DialogMagiskBaseBinding -import com.topjohnwu.magisk.redesign.compat.itemBindingOf +import com.topjohnwu.magisk.ui.compat.itemBindingOf import com.topjohnwu.magisk.utils.KObservableField import me.tatarka.bindingcollectionadapter2.BindingRecyclerViewAdapters import me.tatarka.bindingcollectionadapter2.ItemBinding @@ -277,4 +277,4 @@ class MagiskDialog @JvmOverloads constructor( } typealias OnDialogButtonClickListener = (DialogInterface) -> Unit -typealias OnDialogClickListener = (position: Int) -> Unit \ No newline at end of file +typealias OnDialogClickListener = (position: Int) -> Unit diff --git a/app/src/main/res/layout/activity_flash.xml b/app/src/main/res/layout/activity_flash.xml index 81dc153f7..cecf04191 100644 --- a/app/src/main/res/layout/activity_flash.xml +++ b/app/src/main/res/layout/activity_flash.xml @@ -7,7 +7,7 @@ + type="com.topjohnwu.magisk.legacy.flash.FlashViewModel" /> @@ -149,4 +149,4 @@ - \ No newline at end of file + diff --git a/app/src/main/res/layout/activity_main_md2.xml b/app/src/main/res/layout/activity_main_md2.xml index 6f55fa2dc..588b460b5 100644 --- a/app/src/main/res/layout/activity_main_md2.xml +++ b/app/src/main/res/layout/activity_main_md2.xml @@ -7,7 +7,7 @@ + type="com.topjohnwu.magisk.ui.MainViewModel" /> diff --git a/app/src/main/res/layout/activity_request.xml b/app/src/main/res/layout/activity_request.xml index 70af73e7d..6d0ed9652 100644 --- a/app/src/main/res/layout/activity_request.xml +++ b/app/src/main/res/layout/activity_request.xml @@ -7,7 +7,7 @@ + type="com.topjohnwu.magisk.legacy.surequest.SuRequestViewModel" /> diff --git a/app/src/main/res/layout/activity_request_md2.xml b/app/src/main/res/layout/activity_request_md2.xml index 7ab7d92e8..2ac22e2cd 100644 --- a/app/src/main/res/layout/activity_request_md2.xml +++ b/app/src/main/res/layout/activity_request_md2.xml @@ -5,7 +5,7 @@ + type="com.topjohnwu.magisk.ui.request.RequestViewModel" /> @@ -20,4 +20,4 @@ - \ No newline at end of file + diff --git a/app/src/main/res/layout/dialog_settings_app_name.xml b/app/src/main/res/layout/dialog_settings_app_name.xml index f0e325396..cc549a77c 100644 --- a/app/src/main/res/layout/dialog_settings_app_name.xml +++ b/app/src/main/res/layout/dialog_settings_app_name.xml @@ -7,7 +7,7 @@ + type="com.topjohnwu.magisk.ui.settings.Hide" /> diff --git a/app/src/main/res/layout/dialog_settings_download_path.xml b/app/src/main/res/layout/dialog_settings_download_path.xml index d5782a298..f3ea581a1 100644 --- a/app/src/main/res/layout/dialog_settings_download_path.xml +++ b/app/src/main/res/layout/dialog_settings_download_path.xml @@ -7,7 +7,7 @@ + type="com.topjohnwu.magisk.ui.settings.DownloadPath" /> diff --git a/app/src/main/res/layout/dialog_settings_update_channel.xml b/app/src/main/res/layout/dialog_settings_update_channel.xml index 57cb087b4..26095efa2 100644 --- a/app/src/main/res/layout/dialog_settings_update_channel.xml +++ b/app/src/main/res/layout/dialog_settings_update_channel.xml @@ -7,7 +7,7 @@ + type="com.topjohnwu.magisk.ui.settings.UpdateChannelUrl" /> diff --git a/app/src/main/res/layout/fragment_flash_md2.xml b/app/src/main/res/layout/fragment_flash_md2.xml index d7922085b..55900f5c7 100644 --- a/app/src/main/res/layout/fragment_flash_md2.xml +++ b/app/src/main/res/layout/fragment_flash_md2.xml @@ -5,7 +5,7 @@ + type="com.topjohnwu.magisk.ui.flash.FlashViewModel" /> @@ -20,4 +20,4 @@ - \ No newline at end of file + diff --git a/app/src/main/res/layout/fragment_hide_md2.xml b/app/src/main/res/layout/fragment_hide_md2.xml index 1144ba51c..c425ff08d 100644 --- a/app/src/main/res/layout/fragment_hide_md2.xml +++ b/app/src/main/res/layout/fragment_hide_md2.xml @@ -9,7 +9,7 @@ + type="com.topjohnwu.magisk.ui.hide.HideViewModel" /> @@ -89,4 +89,4 @@ - \ No newline at end of file + diff --git a/app/src/main/res/layout/fragment_home_md2.xml b/app/src/main/res/layout/fragment_home_md2.xml index 0c8209012..6cefd97e9 100644 --- a/app/src/main/res/layout/fragment_home_md2.xml +++ b/app/src/main/res/layout/fragment_home_md2.xml @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@ + type="com.topjohnwu.magisk.ui.home.HomeViewModel" /> diff --git a/app/src/main/res/layout/fragment_install_md2.xml b/app/src/main/res/layout/fragment_install_md2.xml index 4ec602d78..50c1c3eb5 100644 --- a/app/src/main/res/layout/fragment_install_md2.xml +++ b/app/src/main/res/layout/fragment_install_md2.xml @@ -7,7 +7,7 @@ + type="com.topjohnwu.magisk.ui.install.InstallViewModel" /> @@ -278,4 +278,4 @@ - \ No newline at end of file + diff --git a/app/src/main/res/layout/fragment_log_md2.xml b/app/src/main/res/layout/fragment_log_md2.xml index 4fa3d9c4e..daebc548c 100644 --- a/app/src/main/res/layout/fragment_log_md2.xml +++ b/app/src/main/res/layout/fragment_log_md2.xml @@ -7,7 +7,7 @@ + type="com.topjohnwu.magisk.ui.log.LogViewModel" /> @@ -77,4 +77,4 @@ - \ No newline at end of file + diff --git a/app/src/main/res/layout/fragment_module_md2.xml b/app/src/main/res/layout/fragment_module_md2.xml index 1d577a1c0..6ad7391b0 100644 --- a/app/src/main/res/layout/fragment_module_md2.xml +++ b/app/src/main/res/layout/fragment_module_md2.xml @@ -11,7 +11,7 @@ + type="com.topjohnwu.magisk.ui.module.ModuleViewModel" /> @@ -94,4 +94,4 @@ - \ No newline at end of file + diff --git a/app/src/main/res/layout/fragment_safetynet_md2.xml b/app/src/main/res/layout/fragment_safetynet_md2.xml index ba39e10cd..7865df4d6 100644 --- a/app/src/main/res/layout/fragment_safetynet_md2.xml +++ b/app/src/main/res/layout/fragment_safetynet_md2.xml @@ -12,7 +12,7 @@ + type="com.topjohnwu.magisk.ui.safetynet.SafetynetViewModel" /> @@ -289,4 +289,4 @@ - \ No newline at end of file + diff --git a/app/src/main/res/layout/fragment_settings_md2.xml b/app/src/main/res/layout/fragment_settings_md2.xml index 2b5569a3b..85a6fab75 100644 --- a/app/src/main/res/layout/fragment_settings_md2.xml +++ b/app/src/main/res/layout/fragment_settings_md2.xml @@ -9,7 +9,7 @@ + type="com.topjohnwu.magisk.ui.settings.SettingsViewModel" /> @@ -35,4 +35,4 @@ tools:listitem="@layout/item_settings_toggle" tools:paddingTop="@dimen/l1" /> - \ No newline at end of file + diff --git a/app/src/main/res/layout/fragment_superuser_md2.xml b/app/src/main/res/layout/fragment_superuser_md2.xml index 08eecdd8e..8d4b7c32d 100644 --- a/app/src/main/res/layout/fragment_superuser_md2.xml +++ b/app/src/main/res/layout/fragment_superuser_md2.xml @@ -9,7 +9,7 @@ + type="com.topjohnwu.magisk.ui.superuser.SuperuserViewModel" /> @@ -62,4 +62,4 @@ - \ No newline at end of file + diff --git a/app/src/main/res/layout/fragment_theme_md2.xml b/app/src/main/res/layout/fragment_theme_md2.xml index 3476daec9..f728b03b7 100644 --- a/app/src/main/res/layout/fragment_theme_md2.xml +++ b/app/src/main/res/layout/fragment_theme_md2.xml @@ -4,11 +4,11 @@ - + + type="com.topjohnwu.magisk.ui.theme.ThemeViewModel" /> @@ -159,4 +159,4 @@ - \ No newline at end of file + diff --git a/app/src/main/res/layout/include_hide_filter.xml b/app/src/main/res/layout/include_hide_filter.xml index bf9acad8c..705ca9d2c 100644 --- a/app/src/main/res/layout/include_hide_filter.xml +++ b/app/src/main/res/layout/include_hide_filter.xml @@ -9,7 +9,7 @@ + type="com.topjohnwu.magisk.ui.hide.HideViewModel" /> diff --git a/app/src/main/res/layout/include_log_magisk.xml b/app/src/main/res/layout/include_log_magisk.xml index a7240619c..324f9906b 100644 --- a/app/src/main/res/layout/include_log_magisk.xml +++ b/app/src/main/res/layout/include_log_magisk.xml @@ -7,7 +7,7 @@ + type="com.topjohnwu.magisk.ui.log.LogViewModel" /> @@ -51,4 +51,4 @@ - \ No newline at end of file + diff --git a/app/src/main/res/layout/include_module_filter.xml b/app/src/main/res/layout/include_module_filter.xml index 7f0816fec..080e9fe8f 100644 --- a/app/src/main/res/layout/include_module_filter.xml +++ b/app/src/main/res/layout/include_module_filter.xml @@ -9,7 +9,7 @@ + type="com.topjohnwu.magisk.ui.module.ModuleViewModel" /> diff --git a/app/src/main/res/layout/item_developer.xml b/app/src/main/res/layout/item_developer.xml index 2049ee911..96279abca 100644 --- a/app/src/main/res/layout/item_developer.xml +++ b/app/src/main/res/layout/item_developer.xml @@ -11,7 +11,7 @@ + type="com.topjohnwu.magisk.ui.home.HomeViewModel" /> @@ -66,4 +66,4 @@ - \ No newline at end of file + diff --git a/app/src/main/res/layout/item_developer_link.xml b/app/src/main/res/layout/item_developer_link.xml index eac039e9c..41c6cee0a 100644 --- a/app/src/main/res/layout/item_developer_link.xml +++ b/app/src/main/res/layout/item_developer_link.xml @@ -11,7 +11,7 @@ + type="com.topjohnwu.magisk.ui.home.HomeViewModel" /> @@ -47,4 +47,4 @@ - \ No newline at end of file + diff --git a/app/src/main/res/layout/item_hide_md2.xml b/app/src/main/res/layout/item_hide_md2.xml index cce147289..37a92c37b 100644 --- a/app/src/main/res/layout/item_hide_md2.xml +++ b/app/src/main/res/layout/item_hide_md2.xml @@ -13,7 +13,7 @@ + type="com.topjohnwu.magisk.ui.hide.HideViewModel" /> @@ -129,4 +129,4 @@ - \ No newline at end of file + diff --git a/app/src/main/res/layout/item_hide_process_md2.xml b/app/src/main/res/layout/item_hide_process_md2.xml index f6bf8c7f8..bd0152371 100644 --- a/app/src/main/res/layout/item_hide_process_md2.xml +++ b/app/src/main/res/layout/item_hide_process_md2.xml @@ -11,7 +11,7 @@ + type="com.topjohnwu.magisk.ui.hide.HideViewModel" /> @@ -55,4 +55,4 @@ - \ No newline at end of file + diff --git a/app/src/main/res/layout/item_log_access_md2.xml b/app/src/main/res/layout/item_log_access_md2.xml index 49c78cae6..5a3472f12 100644 --- a/app/src/main/res/layout/item_log_access_md2.xml +++ b/app/src/main/res/layout/item_log_access_md2.xml @@ -13,7 +13,7 @@ + type="com.topjohnwu.magisk.ui.log.LogViewModel" /> @@ -101,4 +101,4 @@ - \ No newline at end of file + diff --git a/app/src/main/res/layout/item_module_download.xml b/app/src/main/res/layout/item_module_download.xml index 8ff316ad4..6f6b4fa4e 100644 --- a/app/src/main/res/layout/item_module_download.xml +++ b/app/src/main/res/layout/item_module_download.xml @@ -10,7 +10,7 @@ + type="com.topjohnwu.magisk.ui.module.ModuleViewModel" /> diff --git a/app/src/main/res/layout/item_module_md2.xml b/app/src/main/res/layout/item_module_md2.xml index 9ebd1c738..db37b46a5 100644 --- a/app/src/main/res/layout/item_module_md2.xml +++ b/app/src/main/res/layout/item_module_md2.xml @@ -15,7 +15,7 @@ + type="com.topjohnwu.magisk.ui.module.ModuleViewModel" /> @@ -133,4 +133,4 @@ - \ No newline at end of file + diff --git a/app/src/main/res/layout/item_policy_md2.xml b/app/src/main/res/layout/item_policy_md2.xml index c5b0b9c62..0383e8684 100644 --- a/app/src/main/res/layout/item_policy_md2.xml +++ b/app/src/main/res/layout/item_policy_md2.xml @@ -11,7 +11,7 @@ + type="com.topjohnwu.magisk.ui.superuser.SuperuserViewModel" /> @@ -180,4 +180,4 @@ - \ No newline at end of file + diff --git a/app/src/main/res/layout/item_repo_md2.xml b/app/src/main/res/layout/item_repo_md2.xml index 7430e1a10..7b05e031a 100644 --- a/app/src/main/res/layout/item_repo_md2.xml +++ b/app/src/main/res/layout/item_repo_md2.xml @@ -13,7 +13,7 @@ + type="com.topjohnwu.magisk.ui.module.ModuleViewModel" /> diff --git a/app/src/main/res/layout/item_section_md2.xml b/app/src/main/res/layout/item_section_md2.xml index be9e8abd2..65568bda5 100644 --- a/app/src/main/res/layout/item_section_md2.xml +++ b/app/src/main/res/layout/item_section_md2.xml @@ -11,7 +11,7 @@ + type="com.topjohnwu.magisk.ui.module.ModuleViewModel" /> @@ -53,4 +53,4 @@ - \ No newline at end of file + diff --git a/app/src/main/res/layout/item_theme.xml b/app/src/main/res/layout/item_theme.xml index 0c36a10f8..97c030bb5 100644 --- a/app/src/main/res/layout/item_theme.xml +++ b/app/src/main/res/layout/item_theme.xml @@ -7,11 +7,11 @@ + type="com.topjohnwu.magisk.ui.theme.ThemeViewModel" /> + type="com.topjohnwu.magisk.ui.theme.Theme" /> @@ -179,4 +179,4 @@ - \ No newline at end of file +