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
6a2acbe9
Commit
6a2acbe9
authored
Jan 06, 2020
by
Viktor De Pasquale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added tiny hint that magisk can be uninstalled using the icon
parent
4cfff404
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
0 deletions
+24
-0
DataBindingAdapters.kt
...in/java/com/topjohnwu/magisk/utils/DataBindingAdapters.kt
+14
-0
fragment_home_md2.xml
app/src/main/res/layout/fragment_home_md2.xml
+9
-0
ids.xml
app/src/main/res/values/ids.xml
+1
-0
No files found.
app/src/main/java/com/topjohnwu/magisk/utils/DataBindingAdapters.kt
View file @
6a2acbe9
...
...
@@ -253,9 +253,21 @@ fun TextInputLayout.setErrorString(error: String) {
@BindingAdapter
(
"onSelectClick"
,
"onSelectReset"
,
requireAll
=
false
)
fun
View
.
setOnSelectClickListener
(
listener
:
View
.
OnClickListener
,
resetTime
:
Long
)
{
fun
getHideTarget
()
=
(
parent
as
?
ViewGroup
)
?.
findViewWithTag
<
View
>(
R
.
id
.
hideWhenSelected
)
fun
animateVisibility
(
hide
:
Boolean
,
target
:
View
?
=
getHideTarget
())
{
target
?:
return
val
targetScale
=
if
(
hide
)
0f
else
1f
target
.
animate
()
.
scaleY
(
targetScale
)
.
scaleX
(
targetScale
)
.
start
()
}
setOnClickListener
{
when
{
it
.
isSelected
->
{
animateVisibility
(
false
)
listener
.
onClick
(
it
)
(
it
.
tag
as
?
Runnable
)
?.
let
{
task
->
it
.
handler
.
removeCallbacks
(
task
)
...
...
@@ -263,8 +275,10 @@ fun View.setOnSelectClickListener(listener: View.OnClickListener, resetTime: Lon
it
.
isSelected
=
false
}
else
->
{
animateVisibility
(
true
)
it
.
isSelected
=
true
it
.
tag
=
it
.
postDelayed
(
resetTime
)
{
animateVisibility
(
false
)
it
.
tag
=
null
it
.
isSelected
=
false
}
...
...
app/src/main/res/layout/fragment_home_md2.xml
View file @
6a2acbe9
...
...
@@ -334,6 +334,15 @@
app:srcCompat=
"@drawable/ic_magisk_delete"
app:tint=
"@color/color_primary_error_transient"
/>
<androidx.appcompat.widget.AppCompatImageView
android:layout_width=
"@dimen/l1"
android:layout_height=
"@dimen/l1"
android:tag=
"@{@id/hideWhenSelected}"
app:layout_constraintEnd_toEndOf=
"@+id/home_magisk_icon"
app:layout_constraintTop_toTopOf=
"@+id/home_magisk_icon"
app:srcCompat=
"@drawable/ic_delete_md2"
app:tint=
"?colorPrimary"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/home_magisk_title"
android:layout_width=
"0dp"
...
...
app/src/main/res/values/ids.xml
View file @
6a2acbe9
<?xml version="1.0" encoding="utf-8"?>
<resources>
<item
name=
"hideWhenSelected"
type=
"id"
/>
<item
name=
"recyclerScrollListener"
type=
"id"
/>
<item
name=
"revealAnim"
type=
"id"
/>
...
...
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