|
|
@@ -12,6 +12,7 @@ import com.adealink.frame.aab.util.getCompatColor
|
|
|
import com.adealink.frame.aab.util.getCompatDrawable
|
|
|
import com.adealink.frame.base.Rlt
|
|
|
import com.adealink.frame.base.fastLazy
|
|
|
+import com.adealink.frame.ext.launchIfViewLifecycleInitialized
|
|
|
import com.adealink.frame.locale.language.languageManager
|
|
|
import com.adealink.frame.log.Log
|
|
|
import com.adealink.frame.mvvm.view.viewBinding
|
|
|
@@ -230,21 +231,27 @@ class CoinFragment : BaseFragment(R.layout.fragment_coin),
|
|
|
interpolator = DecelerateInterpolator()
|
|
|
addUpdateListener { animation ->
|
|
|
val animatedValue = animation.animatedValue as Float
|
|
|
- binding.tvBalanceValue.text = formatDotNotNull(animatedValue.toLong())
|
|
|
+ updateBalanceValue(animatedValue.toLong())
|
|
|
}
|
|
|
addListener(object : AnimatorListenerAdapter() {
|
|
|
override fun onAnimationEnd(animation: Animator) {
|
|
|
- binding.tvBalanceValue.text = formatDotNotNull(to)
|
|
|
+ updateBalanceValue(to)
|
|
|
}
|
|
|
|
|
|
override fun onAnimationCancel(animation: Animator) {
|
|
|
- binding.tvBalanceValue.text = formatDotNotNull(to)
|
|
|
+ updateBalanceValue(to)
|
|
|
}
|
|
|
})
|
|
|
start()
|
|
|
}
|
|
|
} else {
|
|
|
- binding.tvBalanceValue.text = formatDotNotNull(to)
|
|
|
+ updateBalanceValue(to)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private fun updateBalanceValue(value: Long) {
|
|
|
+ launchIfViewLifecycleInitialized {
|
|
|
+ binding.tvBalanceValue.text = formatDotNotNull(value)
|
|
|
}
|
|
|
}
|
|
|
|