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
016e2838
Commit
016e2838
authored
Nov 04, 2019
by
Viktor De Pasquale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added animated progressbar
parent
f1427e92
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
2 deletions
+20
-2
HideRvItem.kt
.../com/topjohnwu/magisk/model/entity/recycler/HideRvItem.kt
+5
-0
DataBindingAdapters.kt
...in/java/com/topjohnwu/magisk/utils/DataBindingAdapters.kt
+14
-0
item_hide_md2.xml
app/src/main/res/layout/item_hide_md2.xml
+1
-2
No files found.
app/src/main/java/com/topjohnwu/magisk/model/entity/recycler/HideRvItem.kt
View file @
016e2838
...
@@ -14,10 +14,12 @@ import com.topjohnwu.magisk.model.entity.ProcessHideApp
...
@@ -14,10 +14,12 @@ import com.topjohnwu.magisk.model.entity.ProcessHideApp
import
com.topjohnwu.magisk.model.entity.StatefulProcess
import
com.topjohnwu.magisk.model.entity.StatefulProcess
import
com.topjohnwu.magisk.model.entity.state.IndeterminateState
import
com.topjohnwu.magisk.model.entity.state.IndeterminateState
import
com.topjohnwu.magisk.model.events.HideProcessEvent
import
com.topjohnwu.magisk.model.events.HideProcessEvent
import
com.topjohnwu.magisk.model.observer.Observer
import
com.topjohnwu.magisk.redesign.hide.HideViewModel
import
com.topjohnwu.magisk.redesign.hide.HideViewModel
import
com.topjohnwu.magisk.utils.DiffObservableList
import
com.topjohnwu.magisk.utils.DiffObservableList
import
com.topjohnwu.magisk.utils.KObservableField
import
com.topjohnwu.magisk.utils.KObservableField
import
com.topjohnwu.magisk.utils.RxBus
import
com.topjohnwu.magisk.utils.RxBus
import
kotlin.math.roundToInt
class
HideItem
(
val
item
:
ProcessHideApp
)
:
ComparableRvItem
<
HideItem
>()
{
class
HideItem
(
val
item
:
ProcessHideApp
)
:
ComparableRvItem
<
HideItem
>()
{
...
@@ -28,6 +30,9 @@ class HideItem(val item: ProcessHideApp) : ComparableRvItem<HideItem>() {
...
@@ -28,6 +30,9 @@ class HideItem(val item: ProcessHideApp) : ComparableRvItem<HideItem>() {
val
isExpanded
=
KObservableField
(
false
)
val
isExpanded
=
KObservableField
(
false
)
val
itemsChecked
=
KObservableField
(
0
)
val
itemsChecked
=
KObservableField
(
0
)
val
itemsCheckedPercent
=
Observer
(
itemsChecked
)
{
(
itemsChecked
.
value
.
toFloat
()
/
items
.
size
*
100
).
roundToInt
()
}
/** [toggle] depends on this functionality */
/** [toggle] depends on this functionality */
private
val
isHidden
get
()
=
itemsChecked
.
value
==
items
.
size
private
val
isHidden
get
()
=
itemsChecked
.
value
==
items
.
size
...
...
app/src/main/java/com/topjohnwu/magisk/utils/DataBindingAdapters.kt
View file @
016e2838
package
com.topjohnwu.magisk.utils
package
com.topjohnwu.magisk.utils
import
android.animation.Animator
import
android.animation.Animator
import
android.animation.ValueAnimator
import
android.graphics.drawable.Drawable
import
android.graphics.drawable.Drawable
import
android.os.Build
import
android.os.Build
import
android.view.View
import
android.view.View
import
android.view.ViewAnimationUtils
import
android.view.ViewAnimationUtils
import
android.view.ViewGroup
import
android.view.ViewGroup
import
android.widget.ProgressBar
import
android.widget.TextSwitcher
import
android.widget.TextSwitcher
import
android.widget.TextView
import
android.widget.TextView
import
android.widget.ViewSwitcher
import
android.widget.ViewSwitcher
...
@@ -429,4 +431,16 @@ fun NestedScrollView.setOnScrollStateChangeListener(listener: Runnable) {
...
@@ -429,4 +431,16 @@ fun NestedScrollView.setOnScrollStateChangeListener(listener: Runnable) {
}
}
handler
.
postDelayed
(
listener
,
1000
)
handler
.
postDelayed
(
listener
,
1000
)
}
}
}
@BindingAdapter
(
"progressAnimated"
)
fun
ProgressBar
.
setProgressAnimated
(
newProgress
:
Int
)
{
val
animator
=
tag
as
?
ValueAnimator
animator
?.
cancel
()
ValueAnimator
.
ofInt
(
progress
,
newProgress
).
apply
{
interpolator
=
FastOutSlowInInterpolator
()
addUpdateListener
{
progress
=
it
.
animatedValue
as
Int
}
tag
=
this
}.
start
()
}
}
\ No newline at end of file
app/src/main/res/layout/item_hide_md2.xml
View file @
016e2838
...
@@ -124,8 +124,7 @@
...
@@ -124,8 +124,7 @@
style=
"?styleProgressDeterminate"
style=
"?styleProgressDeterminate"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_gravity=
"top"
android:layout_gravity=
"top"
android:max=
"@{item.items.size()}"
progressAnimated=
"@{item.itemsCheckedPercent}"
/>
android:progress=
"@{item.itemsChecked}"
/>
</com.google.android.material.card.MaterialCardView>
</com.google.android.material.card.MaterialCardView>
...
...
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