I want my countdown text animate up to down when counting like GIF file attached bellow. currently it animate like normal fade. I use CountDownTimer class to count and a TextView for timer. Here is code below:
//somecode
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
CountText=(TextView)findViewById(R.id.countText);
CounterClass timer = new CounterClass(15000,1000);
timer.start();
}
CounterClass.java
public class CounterClass extends CountDownTimer {
public CounterClass(long millisInFuture, long countDownInterval) {
super(millisInFuture, countDownInterval);
}
@Override
public void onTick(long millisUntilFinished) {
millis = millisUntilFinished;
String hms = String.format("%02d:%02d",
TimeUnit.MILLISECONDS.toMinutes(millis) - TimeUnit.HOURS.toMinutes(TimeUnit.MILLISECONDS.toHours(millis)),
TimeUnit.MILLISECONDS.toSeconds(millis) - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(millis)));
System.out.println(hms);
CountText.setText(hms);
}
@Override
public void onFinish() {
}
}
Is there any way i can achieve this? Been trying to get past 2 days. I know there is solution by creating 4 different text and animate but i cant use it because of some reason. so Any help would be appreciated. Thanks!

If anyone still looking for answer to this.
Try this Library
You can get the desired animation using this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With