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
85f293a4
Commit
85f293a4
authored
Nov 01, 2019
by
Viktor De Pasquale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated policy colors and internal ids
parent
8e412bee
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
38 deletions
+31
-38
PolicyRvItem.kt
...om/topjohnwu/magisk/model/entity/recycler/PolicyRvItem.kt
+1
-18
color_state_primary_transient.xml
app/src/main/res/color/color_state_primary_transient.xml
+7
-0
item_policy_md2.xml
app/src/main/res/layout/item_policy_md2.xml
+23
-20
No files found.
app/src/main/java/com/topjohnwu/magisk/model/entity/recycler/PolicyRvItem.kt
View file @
85f293a4
...
...
@@ -27,23 +27,6 @@ class PolicyRvItem(val item: MagiskPolicy, val icon: Drawable) : ComparableRvIte
val
shouldLog
=
KObservableField
(
item
.
logging
)
fun
toggle
()
=
isExpanded
.
toggle
()
fun
toggleNotify
()
=
shouldNotify
.
toggle
()
fun
toggleLog
()
=
shouldLog
.
toggle
()
fun
toggleEnabled
()
{
if
(
isExpanded
.
value
)
{
return
}
isEnabled
.
toggle
()
}
fun
toggle
(
view
:
View
)
{
toggle
()
view
.
rotationTo
(
if
(
isExpanded
.
value
)
225
else
180
)
(
view
.
parent
as
ViewGroup
)
.
findViewById
<
View
>(
R
.
id
.
expand_layout
)
.
setRevealed
(
isExpanded
.
value
)
}
private
val
rxBus
:
RxBus
by
inject
()
...
...
@@ -100,7 +83,7 @@ class PolicyItem(val item: MagiskPolicy, val icon: Drawable) : ComparableRvItem<
isExpanded
.
toggle
()
view
.
rotationTo
(
if
(
isExpanded
.
value
)
225
else
180
)
(
view
.
parent
as
ViewGroup
)
.
findViewById
<
View
>(
R
.
id
.
expand_layout
)
.
findViewById
<
View
>(
R
.
id
.
policy_expand_container
)
.
setRevealed
(
isExpanded
.
value
)
}
...
...
app/src/main/res/color/color_state_primary_transient.xml
0 → 100644
View file @
85f293a4
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item
android:color=
"?colorPrimary"
android:state_selected=
"true"
/>
<item
android:color=
"?colorPrimary"
android:state_checked=
"true"
/>
<item
android:color=
"?colorDisabled"
android:state_enabled=
"false"
/>
<item
android:color=
"?colorOnSurfaceVariant"
/>
</selector>
\ No newline at end of file
app/src/main/res/layout/item_policy_md2.xml
View file @
85f293a4
...
...
@@ -33,7 +33,7 @@
android:paddingBottom=
"@dimen/l2"
>
<androidx.appcompat.widget.AppCompatImageView
android:id=
"@+id/app_icon"
android:id=
"@+id/
policy_
app_icon"
style=
"?styleImageBig"
android:src=
"@{item.icon}"
app:layout_constraintEnd_toEndOf=
"parent"
...
...
@@ -42,7 +42,7 @@
tools:srcCompat=
"@drawable/ic_logo"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/app_name"
android:id=
"@+id/
policy_
app_name"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/margin_generic"
...
...
@@ -56,11 +56,11 @@
android:textIsSelectable=
"false"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/app_icon"
app:layout_constraintTop_toBottomOf=
"@+id/
policy_
app_icon"
tools:text=
"@string/app_name"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/package_name"
android:id=
"@+id/p
olicy_p
ackage_name"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:ellipsize=
"middle"
...
...
@@ -71,58 +71,61 @@
android:textColor=
"@android:color/tertiary_text_dark"
android:textIsSelectable=
"false"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"@id/app_name"
app:layout_constraintStart_toStartOf=
"@id/app_name"
app:layout_constraintTop_toBottomOf=
"@id/app_name"
app:layout_constraintEnd_toEndOf=
"@id/
policy_
app_name"
app:layout_constraintStart_toStartOf=
"@id/
policy_
app_name"
app:layout_constraintTop_toBottomOf=
"@id/
policy_
app_name"
tools:text=
"com.topjohnwu.magisk"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id=
"@+id/
expand_layout
"
android:id=
"@+id/
policy_expand_container
"
revealFix=
"@{item.isExpanded()}"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
app:layout_constraintTop_toBottomOf=
"@+id/policy_package_name"
android:background=
"?colorSurfaceVariant"
android:visibility=
"invisible"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/package_name
"
tools:alpha=
"0.9
"
tools:visibility=
"visible"
>
<androidx.appcompat.widget.AppCompatImageView
android:id=
"@+id/
bell
"
android:id=
"@+id/
policy_notify
"
style=
"?styleIconNormal"
android:background=
"?selectableItemBackground"
isSelected=
"@{item.shouldNotify}"
tooltipText=
"@{@string/superuser_toggle_notification}"
android:contentDescription=
"@string/superuser_toggle_notification"
android:onClick=
"@{() -> item.toggleNotify(viewModel)}"
app:layout_constraintBottom_toTopOf=
"@+id/delete"
app:layout_constraintEnd_toStartOf=
"@+id/
bu
g"
app:layout_constraintBottom_toTopOf=
"@+id/
policy_
delete"
app:layout_constraintEnd_toStartOf=
"@+id/
policy_lo
g"
app:layout_constraintHorizontal_chainStyle=
"packed"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_chainStyle=
"packed"
app:srcCompat=
"@drawable/ic_notifications"
app:tint=
"@color/color_
error
_primary_transient"
/>
app:tint=
"@color/color_
state
_primary_transient"
/>
<androidx.appcompat.widget.AppCompatImageView
android:id=
"@+id/
bu
g"
android:id=
"@+id/
policy_lo
g"
style=
"?styleIconNormal"
android:background=
"?selectableItemBackground"
isSelected=
"@{item.shouldLog}"
tooltipText=
"@{@string/superuser_toggle_log}"
android:contentDescription=
"@string/superuser_toggle_log"
android:onClick=
"@{() -> item.toggleLog(viewModel)}"
app:layout_constraintBottom_toBottomOf=
"@+id/
bell
"
app:layout_constraintBottom_toBottomOf=
"@+id/
policy_notify
"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toEndOf=
"@+id/
bell
"
app:layout_constraintTop_toTopOf=
"@+id/
bell
"
app:layout_constraintStart_toEndOf=
"@+id/
policy_notify
"
app:layout_constraintTop_toTopOf=
"@+id/
policy_notify
"
app:srcCompat=
"@drawable/ic_bug_report"
app:tint=
"@color/color_
error
_primary_transient"
/>
app:tint=
"@color/color_
state
_primary_transient"
/>
<com.google.android.material.button.MaterialButton
android:id=
"@+id/delete"
android:id=
"@+id/
policy_
delete"
style=
"?styleButtonText"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
...
...
@@ -137,7 +140,7 @@
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/
bell
"
app:layout_constraintTop_toBottomOf=
"@+id/
policy_notify
"
app:rippleColor=
"?colorError"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
...
...
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