Commit 54780c49 authored by Li's avatar Li

[李俊岐] 优化

parent ea4b9694
......@@ -62,7 +62,7 @@ class WelfareTaskAdpater :
if (data?.buttonSway != null && data?.buttonSway == 1) {
startAnimator(holder?.layoutStatus)
} else {
holder?.layoutStatus.clearAnimation()
resetAnimator(holder?.layoutStatus)
}
if (data?.adMarkImage != null && "" != data?.adMarkImage) {
......@@ -94,7 +94,7 @@ class WelfareTaskAdpater :
holder?.tvStatus.text = "去完成"
}
1 -> {
holder?.layoutStatus?.clearAnimation()
resetAnimator(holder?.layoutStatus)
holder.ivStatus.setImageResource(R.drawable.icon_item_welfare_task_receiveed)
holder?.tvStatus.text = "已领取"
}
......@@ -138,6 +138,19 @@ class WelfareTaskAdpater :
viewList.add(view)
}
private fun resetAnimator(view: View) {
val oa: ObjectAnimator = ObjectAnimator.ofFloat(
view,
View.ROTATION,
0F, 0F
)
oa.repeatCount = ValueAnimator.INFINITE
oa.setDuration(1000).start()
animatorList.add(oa)
viewList.add(view)
}
fun clearAnimation() {
if (animatorList.size > 0) {
for (animator in animatorList) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment