思路:
首先经常用到倒计时操作,
增加的数字和间隔!你懂。继续。。然后让他快速从一定数字跳动到具体的总额数字,无废话了。。看Demo看效果
代码:
直接调用执行:
private void initAllViews() {
myDanceTimer = new DanceWageTimer(DanceWageTimer.getTotalExecuteTime(myMoney, 100), 100, tvMoney, myMoney);
myDanceTimer.start();
}
/**
* @Title getTotalExecuteTime
* @Description 得到总共执行的时间
* @param totalWage
* @return
*/
public static int getTotalExecuteTime(float totalWage, int interval) {
int wage = getIntegerOfWage(totalWage);
int startNum = getStartNum(totalWage);
int increased = getIncreased(startNum);
int result = (wage - startNum) / increased * interval;
return result;
}