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
da2b00de
Commit
da2b00de
authored
Aug 09, 2020
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Several home screen changes
parent
1276c28e
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
57 additions
and
37 deletions
+57
-37
TappableHeadlineItem.kt
...hnwu/magisk/model/entity/recycler/TappableHeadlineItem.kt
+0
-5
HomeViewModel.kt
...c/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt
+3
-0
SuperuserViewModel.kt
...a/com/topjohnwu/magisk/ui/superuser/SuperuserViewModel.kt
+0
-5
fragment_home_md2.xml
app/src/main/res/layout/fragment_home_md2.xml
+33
-0
include_home_magisk.xml
app/src/main/res/layout/include_home_magisk.xml
+1
-15
item_tappable_headline.xml
app/src/main/res/layout/item_tappable_headline.xml
+2
-2
main.xml
app/src/main/res/navigation/main.xml
+9
-9
strings.xml
app/src/main/res/values/strings.xml
+1
-0
styles_md2_impl.xml
app/src/main/res/values/styles_md2_impl.xml
+8
-1
No files found.
app/src/main/java/com/topjohnwu/magisk/model/entity/recycler/TappableHeadlineItem.kt
View file @
da2b00de
...
...
@@ -31,11 +31,6 @@ sealed class TappableHeadlineItem : ComparableRvItem<TappableHeadlineItem>() {
override
val
icon
=
R
.
drawable
.
ic_hide_md2
}
object
Safetynet
:
TappableHeadlineItem
()
{
override
val
title
=
R
.
string
.
safetynet
override
val
icon
=
R
.
drawable
.
ic_safetynet_md2
}
object
ThemeMode
:
TappableHeadlineItem
()
{
override
val
title
=
R
.
string
.
settings_dark_mode_title
override
val
icon
=
R
.
drawable
.
ic_day_night
...
...
app/src/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt
View file @
da2b00de
...
...
@@ -134,6 +134,9 @@ class HomeViewModel(
HomeFragmentDirections
.
actionHomeFragmentToInstallFragment
().
publish
()
}
fun
onSafetyNetPressed
()
=
HomeFragmentDirections
.
actionHomeFragmentToSafetynetFragment
().
publish
()
fun
hideNotice
()
{
Config
.
safetyNotice
=
false
isNoticeVisible
=
false
...
...
app/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserViewModel.kt
View file @
da2b00de
...
...
@@ -42,7 +42,6 @@ class SuperuserViewModel(
val
adapter
=
adapterOf
<
ComparableRvItem
<*>>()
val
items
=
MergeObservableList
<
ComparableRvItem
<*>>()
.
insertItem
(
TappableHeadlineItem
.
Hide
)
.
insertItem
(
TappableHeadlineItem
.
Safetynet
)
.
insertList
(
itemsHelpers
)
.
insertList
(
itemsPolicies
)
val
itemBinding
=
itemBindingOf
<
ComparableRvItem
<*>>
{
...
...
@@ -75,13 +74,9 @@ class SuperuserViewModel(
@Suppress
(
"REDUNDANT_ELSE_IN_WHEN"
)
override
fun
onItemPressed
(
item
:
TappableHeadlineItem
)
=
when
(
item
)
{
TappableHeadlineItem
.
Hide
->
hidePressed
()
TappableHeadlineItem
.
Safetynet
->
safetynetPressed
()
else
->
Unit
}
private
fun
safetynetPressed
()
=
SuperuserFragmentDirections
.
actionSuperuserFragmentToSafetynetFragment
().
publish
()
private
fun
hidePressed
()
=
SuperuserFragmentDirections
.
actionSuperuserFragmentToHideFragment
().
publish
()
...
...
app/src/main/res/layout/fragment_home_md2.xml
View file @
da2b00de
...
...
@@ -5,6 +5,10 @@
<data>
<import
type=
"com.topjohnwu.magisk.core.Info"
/>
<import
type=
"com.topjohnwu.magisk.ui.home.MagiskState"
/>
<variable
name=
"viewModel"
type=
"com.topjohnwu.magisk.ui.home.HomeViewModel"
/>
...
...
@@ -99,6 +103,35 @@
android:layout_marginTop=
"@dimen/l1"
app:layout_constraintTop_toBottomOf=
"@+id/home_magisk_wrapper"
/>
<com.google.android.material.button.MaterialButton
style=
"@style/WidgetFoundation.Button.Outlined"
android:layout_marginStart=
"@dimen/l1"
android:layout_marginEnd=
"@dimen/l1"
android:layout_marginTop=
"@dimen/l1"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/home_check_safetynet"
android:textAllCaps=
"false"
android:textSize=
"12sp"
android:onClick=
"@{() -> viewModel.onSafetyNetPressed()}"
app:cornerRadius=
"@dimen/r1"
app:icon=
"@drawable/ic_safetynet_md2"
/>
<com.google.android.material.button.MaterialButton
style=
"@style/WidgetFoundation.Button.Outlined.Error"
android:layout_marginStart=
"@dimen/l1"
android:layout_marginEnd=
"@dimen/l1"
android:layout_marginTop=
"@dimen/l_125"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/uninstall_magisk_title"
android:textAllCaps=
"false"
android:textSize=
"12sp"
android:onClick=
"@{() -> viewModel.onDeletePressed()}"
gone=
"@{Info.env.magiskVersionCode < 0 || viewModel.stateMagisk == MagiskState.LOADING || !viewModel.isConnected}"
app:cornerRadius=
"@dimen/r1"
app:icon=
"@drawable/ic_delete_md2"
/>
<com.google.android.material.card.MaterialCardView
style=
"@style/WidgetFoundation.Card"
android:layout_width=
"match_parent"
...
...
app/src/main/res/layout/include_home_magisk.xml
View file @
da2b00de
...
...
@@ -7,8 +7,6 @@
<import
type=
"com.topjohnwu.magisk.core.Info"
/>
<import
type=
"com.topjohnwu.magisk.core.InfoKt"
/>
<import
type=
"com.topjohnwu.magisk.ui.home.MagiskState"
/>
<variable
...
...
@@ -48,22 +46,10 @@
android:textAppearance=
"@style/AppearanceFoundation.Title"
android:textColor=
"?colorPrimary"
app:layout_constraintBottom_toBottomOf=
"@+id/home_magisk_icon"
app:layout_constraintEnd_toStartOf=
"@+id/home_magisk_
uninstall
"
app:layout_constraintEnd_toStartOf=
"@+id/home_magisk_
action
"
app:layout_constraintStart_toEndOf=
"@+id/home_magisk_icon"
app:layout_constraintTop_toTopOf=
"@+id/home_magisk_icon"
/>
<ImageView
android:id=
"@+id/home_magisk_uninstall"
style=
"@style/WidgetFoundation.Icon.Error"
android:background=
"?attr/selectableItemBackground"
android:clickable=
"true"
gone=
"@{Info.env.magiskVersionCode < 0 || viewModel.stateMagisk == MagiskState.LOADING || !viewModel.isConnected}"
android:onClick=
"@{() -> viewModel.onDeletePressed()}"
app:layout_constraintBottom_toBottomOf=
"@+id/home_magisk_title"
app:layout_constraintEnd_toStartOf=
"@+id/home_magisk_action"
app:layout_constraintTop_toTopOf=
"@+id/home_magisk_title"
app:srcCompat=
"@drawable/ic_delete_md2"
/>
<FrameLayout
android:id=
"@+id/home_magisk_action"
invisible=
"@{viewModel.stateMagisk == MagiskState.LOADING || !viewModel.isConnected}"
...
...
app/src/main/res/layout/item_tappable_headline.xml
View file @
da2b00de
...
...
@@ -48,7 +48,7 @@
app:layout_constraintEnd_toStartOf=
"@+id/headline_icon_pointer"
app:layout_constraintStart_toEndOf=
"@+id/tappable_icon"
app:layout_constraintTop_toTopOf=
"parent"
tools:text=
"@string/magisk
_hide_md2
"
/>
tools:text=
"@string/magisk
hide
"
/>
<androidx.appcompat.widget.AppCompatImageView
android:id=
"@+id/headline_icon_pointer"
...
...
app/src/main/res/navigation/main.xml
View file @
da2b00de
...
...
@@ -33,6 +33,14 @@
app:popEnterAnim=
"@anim/fragment_enter_pop"
app:popExitAnim=
"@anim/fragment_exit_pop"
/>
<action
android:id=
"@+id/action_homeFragment_to_safetynetFragment"
app:destination=
"@id/safetynetFragment"
app:enterAnim=
"@anim/fragment_enter"
app:exitAnim=
"@anim/fragment_exit"
app:popEnterAnim=
"@anim/fragment_enter_pop"
app:popExitAnim=
"@anim/fragment_exit_pop"
/>
</fragment>
<fragment
...
...
@@ -108,14 +116,6 @@
android:label=
"SuperuserFragment"
tools:layout=
"@layout/fragment_superuser_md2"
>
<action
android:id=
"@+id/action_superuserFragment_to_safetynetFragment"
app:destination=
"@id/safetynetFragment"
app:enterAnim=
"@anim/fragment_enter"
app:exitAnim=
"@anim/fragment_exit"
app:popEnterAnim=
"@anim/fragment_enter_pop"
app:popExitAnim=
"@anim/fragment_exit_pop"
/>
<action
android:id=
"@+id/action_superuserFragment_to_hideFragment"
app:destination=
"@id/hideFragment"
...
...
app/src/main/res/values/strings.xml
View file @
da2b00de
...
...
@@ -43,6 +43,7 @@
<string
name=
"invalid_update_channel"
>
Invalid Update Channel
</string>
<string
name=
"uninstall_magisk_title"
>
Uninstall Magisk
</string>
<string
name=
"uninstall_magisk_msg"
>
All modules will be disabled/removed!\nRoot will be removed!\nYour data potentially encrypted if not already!
</string>
<string
name=
"home_check_safetynet"
>
Check SafetyNet
</string>
<!--Install-->
<string
name=
"keep_force_encryption"
>
Preserve force encryption
</string>
...
...
app/src/main/res/values/styles_md2_impl.xml
View file @
da2b00de
...
...
@@ -87,6 +87,13 @@
<item
name=
"iconTint"
>
?colorOnPrimary
</item>
</style>
<style
name=
"WidgetFoundation.Button.Outlined.Error"
>
<item
name=
"strokeColor"
>
@color/color_error_transient
</item>
<item
name=
"rippleColor"
>
@color/color_error_transient
</item>
<item
name=
"android:textColor"
>
@color/color_error_transient
</item>
<item
name=
"iconTint"
>
@color/color_error_transient
</item>
</style>
<style
name=
"WidgetFoundation.Button.Flat"
parent=
"Widget.MaterialComponents.Button.UnelevatedButton"
>
<item
name=
"android:textStyle"
>
bold
</item>
<item
name=
"iconGravity"
>
textStart
</item>
...
...
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