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
b2fa5b55
Commit
b2fa5b55
authored
Apr 14, 2019
by
Viktor De Pasquale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added hiding of UI elements when no root access is detected
parent
36e83edd
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
9 deletions
+10
-9
HomeViewModel.kt
...c/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt
+4
-0
MagiskFragment.kt
.../main/java/com/topjohnwu/magisk/ui/home/MagiskFragment.kt
+0
-9
fragment_magisk.xml
app/src/main/res/layout/fragment_magisk.xml
+6
-0
No files found.
app/src/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt
View file @
b2fa5b55
...
@@ -66,6 +66,8 @@ class HomeViewModel(
...
@@ -66,6 +66,8 @@ class HomeViewModel(
""
""
}
}
val
hasRoot
=
KObservableField
(
false
)
private
var
shownDialog
=
false
private
var
shownDialog
=
false
private
val
current
=
resources
.
getString
(
R
.
string
.
current_installed
)
private
val
current
=
resources
.
getString
(
R
.
string
.
current_installed
)
private
val
latest
=
resources
.
getString
(
R
.
string
.
latest_version
)
private
val
latest
=
resources
.
getString
(
R
.
string
.
latest_version
)
...
@@ -110,6 +112,8 @@ class HomeViewModel(
...
@@ -110,6 +112,8 @@ class HomeViewModel(
Config
.
remoteMagiskVersionString
=
null
Config
.
remoteMagiskVersionString
=
null
Config
.
remoteMagiskVersionCode
=
-
1
Config
.
remoteMagiskVersionCode
=
-
1
hasRoot
.
value
=
Shell
.
rootAccess
()
if
(
Networking
.
checkNetworkStatus
(
app
))
{
if
(
Networking
.
checkNetworkStatus
(
app
))
{
CheckUpdates
.
check
()
CheckUpdates
.
check
()
}
else
{
}
else
{
...
...
app/src/main/java/com/topjohnwu/magisk/ui/home/MagiskFragment.kt
View file @
b2fa5b55
...
@@ -5,7 +5,6 @@ import com.topjohnwu.magisk.BuildConfig
...
@@ -5,7 +5,6 @@ import com.topjohnwu.magisk.BuildConfig
import
com.topjohnwu.magisk.Config
import
com.topjohnwu.magisk.Config
import
com.topjohnwu.magisk.R
import
com.topjohnwu.magisk.R
import
com.topjohnwu.magisk.model.events.*
import
com.topjohnwu.magisk.model.events.*
import
com.topjohnwu.magisk.utils.Event
import
com.topjohnwu.magisk.view.MarkDownWindow
import
com.topjohnwu.magisk.view.MarkDownWindow
import
com.topjohnwu.magisk.view.dialogs.EnvFixDialog
import
com.topjohnwu.magisk.view.dialogs.EnvFixDialog
import
com.topjohnwu.magisk.view.dialogs.ManagerInstallDialog
import
com.topjohnwu.magisk.view.dialogs.ManagerInstallDialog
...
@@ -125,14 +124,6 @@ class MagiskFragment : NewMagiskFragment<HomeViewModel, com.topjohnwu.magisk.dat
...
@@ -125,14 +124,6 @@ class MagiskFragment : NewMagiskFragment<HomeViewModel, com.topjohnwu.magisk.dat
}*/
}*/
}
}
private
fun
getListeningEvents
():
IntArray
{
return
intArrayOf
(
Event
.
UPDATE_CHECK_DONE
)
}
private
fun
onEvent
(
event
:
Int
)
{
updateCheckUI
()
}
private
fun
updateUI
()
{
private
fun
updateUI
()
{
/*(requireActivity() as MainActivity).checkHideSection()
/*(requireActivity() as MainActivity).checkHideSection()
val image: Int
val image: Int
...
...
app/src/main/res/layout/fragment_magisk.xml
View file @
b2fa5b55
...
@@ -103,10 +103,12 @@
...
@@ -103,10 +103,12 @@
<View
<View
style=
"@style/Widget.Divider.Horizontal"
style=
"@style/Widget.Divider.Horizontal"
gone=
"@{!viewModel.hasRoot}"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_margin=
"@dimen/margin_generic"
/>
android:layout_margin=
"@dimen/margin_generic"
/>
<LinearLayout
<LinearLayout
gone=
"@{!viewModel.hasRoot}"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:animateLayoutChanges=
"true"
android:animateLayoutChanges=
"true"
...
@@ -184,10 +186,12 @@
...
@@ -184,10 +186,12 @@
<View
<View
style=
"@style/Widget.Divider.Horizontal"
style=
"@style/Widget.Divider.Horizontal"
gone=
"@{!viewModel.hasRoot}"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_margin=
"@dimen/margin_generic"
/>
android:layout_margin=
"@dimen/margin_generic"
/>
<LinearLayout
<LinearLayout
gone=
"@{!viewModel.hasRoot}"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
...
@@ -460,11 +464,13 @@
...
@@ -460,11 +464,13 @@
<View
<View
style=
"@style/Widget.Divider.Horizontal"
style=
"@style/Widget.Divider.Horizontal"
gone=
"@{!viewModel.hasRoot}"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_margin=
"@dimen/margin_generic"
/>
android:layout_margin=
"@dimen/margin_generic"
/>
<com.google.android.material.button.MaterialButton
<com.google.android.material.button.MaterialButton
style=
"@style/Widget.Button.Text"
style=
"@style/Widget.Button.Text"
gone=
"@{!viewModel.hasRoot}"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:onClick=
"@{() -> viewModel.uninstallPressed()}"
android:onClick=
"@{() -> viewModel.uninstallPressed()}"
...
...
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