A tiny Android library makes very easier count animation of TextView.
Include the CounterAnimationTextView widget in your layout.
<com.github.hamzaahmedkhan.counteranimationtextview.CountAnimationTextView
android:id="@+id/moneyPositive"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textColor="@color/black"
android:textSize="20sp" />
Animate Count with Duration
counterAnimationTextView
.setAnimationDuration(5000)
.countAnimation(0, 99999)
Animate Count with DecimalFormat
counterAnimationTextView
.setDecimalFormat(new DecimalFormat("###,###,###"))
.setAnimationDuration(10000)
.countAnimation(0, 9999999)
Animate Count with interPolator
counterAnimationTextView
.setInterpolator(AccelerateInterpolator())
.countAnimation(0, 9999999)
Add the dependency to your build.gradle.
dependencies {
implementation 'com.github.hamzaahmedkhan:CounterAnimationTextView:1.0.1'
}