mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-24 10:35:26 +00:00
Added install fragment
This commit is contained in:
parent
93edf72993
commit
e50094af80
@ -11,6 +11,7 @@ import com.topjohnwu.magisk.redesign.safetynet.SafetynetViewModel
|
|||||||
import com.topjohnwu.magisk.redesign.settings.SettingsViewModel
|
import com.topjohnwu.magisk.redesign.settings.SettingsViewModel
|
||||||
import com.topjohnwu.magisk.redesign.superuser.SuperuserViewModel
|
import com.topjohnwu.magisk.redesign.superuser.SuperuserViewModel
|
||||||
import com.topjohnwu.magisk.redesign.theme.ThemeViewModel
|
import com.topjohnwu.magisk.redesign.theme.ThemeViewModel
|
||||||
|
import com.topjohnwu.magisk.ui.install.InstallViewModel
|
||||||
import org.koin.androidx.viewmodel.dsl.viewModel
|
import org.koin.androidx.viewmodel.dsl.viewModel
|
||||||
import org.koin.dsl.module
|
import org.koin.dsl.module
|
||||||
|
|
||||||
@ -25,6 +26,7 @@ val redesignModule = module {
|
|||||||
viewModel { SettingsViewModel() }
|
viewModel { SettingsViewModel() }
|
||||||
viewModel { SuperuserViewModel(get(), get(), get(), get()) }
|
viewModel { SuperuserViewModel(get(), get(), get(), get()) }
|
||||||
viewModel { ThemeViewModel() }
|
viewModel { ThemeViewModel() }
|
||||||
|
viewModel { InstallViewModel() }
|
||||||
|
|
||||||
viewModel { MainViewModel() }
|
viewModel { MainViewModel() }
|
||||||
}
|
}
|
@ -10,6 +10,7 @@ import com.topjohnwu.magisk.redesign.safetynet.SafetynetFragment
|
|||||||
import com.topjohnwu.magisk.ui.MainActivity
|
import com.topjohnwu.magisk.ui.MainActivity
|
||||||
import com.topjohnwu.magisk.ui.hide.MagiskHideFragment
|
import com.topjohnwu.magisk.ui.hide.MagiskHideFragment
|
||||||
import com.topjohnwu.magisk.ui.home.HomeFragment
|
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.log.LogFragment
|
||||||
import com.topjohnwu.magisk.ui.module.ModulesFragment
|
import com.topjohnwu.magisk.ui.module.ModulesFragment
|
||||||
import com.topjohnwu.magisk.ui.module.ReposFragment
|
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) {
|
fun fromSection(section: String) = when (section) {
|
||||||
"superuser" -> superuser()
|
"superuser" -> superuser()
|
||||||
"modules" -> modules()
|
"modules" -> modules()
|
||||||
|
@ -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<InstallViewModel, FragmentInstallMd2Binding>() {
|
||||||
|
|
||||||
|
override val layoutRes = R.layout.fragment_install_md2
|
||||||
|
override val viewModel by viewModel<InstallViewModel>()
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
package com.topjohnwu.magisk.ui.install
|
||||||
|
|
||||||
|
import com.topjohnwu.magisk.redesign.compat.CompatViewModel
|
||||||
|
|
||||||
|
class InstallViewModel : CompatViewModel()
|
23
app/src/main/res/layout/fragment_install_md2.xml
Normal file
23
app/src/main/res/layout/fragment_install_md2.xml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
|
||||||
|
<variable
|
||||||
|
name="viewModel"
|
||||||
|
type="com.topjohnwu.magisk.ui.install.InstallViewModel" />
|
||||||
|
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<androidx.core.widget.NestedScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:fillViewport="true">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
|
||||||
|
</layout>
|
Loading…
Reference in New Issue
Block a user