From e50094af80db2b11cd96e5d2bd9347b2310db5f4 Mon Sep 17 00:00:00 2001 From: Viktor De Pasquale Date: Tue, 22 Oct 2019 16:29:01 +0200 Subject: [PATCH] Added install fragment --- .../com/topjohnwu/magisk/di/RedesignModule.kt | 2 ++ .../magisk/model/navigation/Navigation.kt | 5 ++++ .../magisk/ui/install/InstallFragment.kt | 13 +++++++++++ .../magisk/ui/install/InstallViewModel.kt | 5 ++++ .../main/res/layout/fragment_install_md2.xml | 23 +++++++++++++++++++ 5 files changed, 48 insertions(+) create mode 100644 app/src/main/java/com/topjohnwu/magisk/ui/install/InstallFragment.kt create mode 100644 app/src/main/java/com/topjohnwu/magisk/ui/install/InstallViewModel.kt create mode 100644 app/src/main/res/layout/fragment_install_md2.xml 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 dd233e7a0..d7367373b 100644 --- a/app/src/main/java/com/topjohnwu/magisk/di/RedesignModule.kt +++ b/app/src/main/java/com/topjohnwu/magisk/di/RedesignModule.kt @@ -11,6 +11,7 @@ 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.install.InstallViewModel import org.koin.androidx.viewmodel.dsl.viewModel import org.koin.dsl.module @@ -25,6 +26,7 @@ val redesignModule = module { viewModel { SettingsViewModel() } viewModel { SuperuserViewModel(get(), get(), get(), get()) } viewModel { ThemeViewModel() } + viewModel { InstallViewModel() } viewModel { MainViewModel() } } \ No newline at end of file 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 6e2b76aba..5099a6b7f 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 @@ -10,6 +10,7 @@ import com.topjohnwu.magisk.redesign.safetynet.SafetynetFragment import com.topjohnwu.magisk.ui.MainActivity import com.topjohnwu.magisk.ui.hide.MagiskHideFragment 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.ModulesFragment import com.topjohnwu.magisk.ui.module.ReposFragment @@ -93,6 +94,10 @@ object Navigation { } } + fun install() = MagiskNavigationEvent { + navDirections { destination = InstallFragment::class } + } + fun fromSection(section: String) = when (section) { "superuser" -> superuser() "modules" -> modules() diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/install/InstallFragment.kt b/app/src/main/java/com/topjohnwu/magisk/ui/install/InstallFragment.kt new file mode 100644 index 000000000..9bb4675f7 --- /dev/null +++ b/app/src/main/java/com/topjohnwu/magisk/ui/install/InstallFragment.kt @@ -0,0 +1,13 @@ +package com.topjohnwu.magisk.ui.install + +import com.topjohnwu.magisk.R +import com.topjohnwu.magisk.databinding.FragmentInstallMd2Binding +import com.topjohnwu.magisk.redesign.compat.CompatFragment +import org.koin.androidx.viewmodel.ext.android.viewModel + +class InstallFragment : CompatFragment() { + + override val layoutRes = R.layout.fragment_install_md2 + override val viewModel by viewModel() + +} \ No newline at end of file diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/install/InstallViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/ui/install/InstallViewModel.kt new file mode 100644 index 000000000..e694204ae --- /dev/null +++ b/app/src/main/java/com/topjohnwu/magisk/ui/install/InstallViewModel.kt @@ -0,0 +1,5 @@ +package com.topjohnwu.magisk.ui.install + +import com.topjohnwu.magisk.redesign.compat.CompatViewModel + +class InstallViewModel : CompatViewModel() \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_install_md2.xml b/app/src/main/res/layout/fragment_install_md2.xml new file mode 100644 index 000000000..473dcc6b0 --- /dev/null +++ b/app/src/main/res/layout/fragment_install_md2.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + \ No newline at end of file