Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
97d24a7d
Commit
97d24a7d
authored
Feb 06, 2020
by
Viktor De Pasquale
Committed by
John Wu
Feb 09, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed single-use reboot menu
This addition will be used in modules as soon as the homepage gets merged
parent
f8bea663
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
10 deletions
+22
-10
RebootEvent.kt
...ain/java/com/topjohnwu/magisk/model/events/RebootEvent.kt
+19
-0
HomeViewModel.kt
...c/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt
+0
-9
include_home_device.xml
app/src/main/res/layout/include_home_device.xml
+3
-1
No files found.
app/src/main/java/com/topjohnwu/magisk/model/events/RebootEvent.kt
0 → 100644
View file @
97d24a7d
package
com.topjohnwu.magisk.model.events
import
com.topjohnwu.magisk.R
import
com.topjohnwu.superuser.Shell
import
com.topjohnwu.magisk.extensions.reboot
as
systemReboot
object
RebootEvent
{
@JvmStatic
fun
reboot
(
menuItemId
:
Int
)
=
when
(
menuItemId
)
{
R
.
id
.
action_reboot_normal
->
systemReboot
()
R
.
id
.
action_reboot_bootloader
->
systemReboot
(
"bootloader"
)
R
.
id
.
action_reboot_download
->
systemReboot
(
"download"
)
R
.
id
.
action_reboot_edl
->
systemReboot
(
"edl"
)
R
.
id
.
action_reboot_recovery
->
Shell
.
su
(
"/system/bin/reboot recovery"
).
submit
()
else
->
Unit
}
}
\ No newline at end of file
app/src/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt
View file @
97d24a7d
...
@@ -136,15 +136,6 @@ class HomeViewModel(
...
@@ -136,15 +136,6 @@ class HomeViewModel(
.
subscribeK
{
Navigation
.
install
().
publish
()
}
.
subscribeK
{
Navigation
.
install
().
publish
()
}
.
add
()
.
add
()
fun
rebootPressed
(
menuItemId
:
Int
)
=
when
(
menuItemId
)
{
R
.
id
.
action_reboot_normal
->
reboot
()
R
.
id
.
action_reboot_bootloader
->
reboot
(
"bootloader"
)
R
.
id
.
action_reboot_download
->
reboot
(
"download"
)
R
.
id
.
action_reboot_edl
->
reboot
(
"edl"
)
R
.
id
.
action_reboot_recovery
->
Shell
.
su
(
"/system/bin/reboot recovery"
).
submit
()
else
->
Unit
}
fun
toggle
(
kof
:
KObservableField
<
Boolean
>)
=
kof
.
toggle
()
fun
toggle
(
kof
:
KObservableField
<
Boolean
>)
=
kof
.
toggle
()
fun
hideNotice
()
{
fun
hideNotice
()
{
...
...
app/src/main/res/layout/include_home_device.xml
View file @
97d24a7d
...
@@ -13,6 +13,8 @@
...
@@ -13,6 +13,8 @@
<import
type=
"com.topjohnwu.magisk.R"
/>
<import
type=
"com.topjohnwu.magisk.R"
/>
<import
type=
"com.topjohnwu.magisk.model.events.RebootEvent"
/>
<variable
<variable
name=
"viewModel"
name=
"viewModel"
type=
"com.topjohnwu.magisk.ui.home.HomeViewModel"
/>
type=
"com.topjohnwu.magisk.ui.home.HomeViewModel"
/>
...
@@ -51,7 +53,7 @@
...
@@ -51,7 +53,7 @@
style=
"@style/WidgetFoundation.Button.Text"
style=
"@style/WidgetFoundation.Button.Text"
invisibleUnless=
"@{XSUKt.hasRoot}"
invisibleUnless=
"@{XSUKt.hasRoot}"
popupMenu=
"@{R.menu.menu_reboot}"
popupMenu=
"@{R.menu.menu_reboot}"
popupMenuOnClickListener=
"@{
(it) -> viewModel.rebootPressed(it)
}"
popupMenuOnClickListener=
"@{
RebootEvent::reboot
}"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginEnd=
"@dimen/l_50"
android:layout_marginEnd=
"@dimen/l_50"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment