仿支付宝金额滚动代码
来源:互联网 发布:公司屏蔽淘宝网 编辑:程序博客网 时间:2024/06/04 17:56
啥也不说了,直接来码
public class TimerTestActivity extends Activity { private TextView txt; private Handler handler = new Handler(); @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); txt = (TextView) findViewById(R.id.txt); txt.setText("0.00"); // txt.setText("0"); startTimer(); } private void startTimer() { handler.removeCallbacks(run); handler.postDelayed(run, 50); } private Runnable run = new Runnable() { @Override public void run() { String str; if (txt.getText().toString().indexOf(",") >= 0) { str = txt.getText().toString().replace(",", ""); } else { str = txt.getText().toString(); } double s = Double.parseDouble(str); double trueS = 7676.87; double i = 0; if (trueS > 99999) { i = s + 42131.12; } else if (trueS > 9999) { i = s + 4213.21; } else if (trueS > 999) { i = s + 402.12; } else if (trueS > 99) { i = s + 41.21; } else { i = s + 4.11; } if (i < (trueS - trueS / 10)) { double d = Double.parseDouble(String.format("%.2f", i)); String strI = String.valueOf(d); if (strI.length() <= 6) { txt.setText(strI); } else if (strI.length() > 6 && strI.length() <= 9) { txt.setText(strI.substring(0, strI.length() - 6) + "," + strI.substring(strI.length() - 6)); } else { txt.setText(strI.substring(0, strI.length() - 9) + "," + strI.substring(strI.length() - 9, strI.length() - 6) + "," + strI.substring(strI.length() - 6)); } } else { String stt = "7676.87"; if (stt.length() <= 6) { txt.setText(stt); } else if (stt.length() > 6 && stt.length() <= 9) { txt.setText(stt.substring(0, stt.length() - 6) + "," + stt.substring(stt.length() - 6)); } else { txt.setText(stt.substring(0, stt.length() - 9) + "," + stt.substring(stt.length() - 9, stt.length() - 6) + "," + stt.substring(stt.length() - 6)); } } if (i < trueS) { handler.postDelayed(run, 50); } } };}
1 1
- 仿支付宝金额滚动代码
- 仿支付宝金额变化
- 仿支付宝、微信EditText金额输入验证
- 一步一步实现高仿支付宝金额圆环图
- 【android】仿支付宝金额千分位格式化
- Android 仿支付宝数字变换,滚动
- 仿支付宝支付键盘
- android开发游记:仿支付宝余额数字累加滚动效果的实现
- android开发游记:仿支付宝余额数字累加滚动效果的实现
- android开发游记:仿支付宝余额数字累加滚动效果的实现
- Android仿余额宝金额动画
- iOS支付宝金额跳动的效果
- 仿支付宝支付密码输入框
- 仿支付宝支付成功动画
- 仿支付宝数字支付键盘
- Android仿支付宝支付验证按钮
- PathMeasure 仿支付宝支付动画
- 仿支付宝支付 密码输入
- source insight 查找功能
- PHP网站redis缓存方式分析
- Delphi XE2 之 FireMonkey 入门(5) - TAlphaColor
- struts2中获取目录的真实路径
- Pacman常用命令
- 仿支付宝金额滚动代码
- mysql解决远程不能访问的二种方法
- 手动编译安装PHP遇到错误以及解决方法记录
- Maven Myeclipse2014配置
- Sql Server中增删查改语句 及 表链接
- Delphi-XE5-手势操作-Gestures-使用方法
- java程序性能优化
- 模糊查询
- (hdu step 3.2.4)FatMouse's Speed(在第一关键字升序的情况下,根据第二关键字来求最长下降子序列)