incrementProgressBy函数
来源:互联网 发布:跑步软件修改器 编辑:程序博客网 时间:2024/06/04 00:43
疑问:为什么没有 更新数字和百分比代码
pd.incrementProgressBy(1);
public void incrementProgressBy(int diff) { if (mProgress != null) { mProgress.incrementProgressBy(diff); <span style="color:#FF6666;">onProgressChanged</span>(); } else { mIncrementBy += diff; } }
private void <span style="color:#FF6666;">onProgressChanged</span>() { if (mProgressStyle == STYLE_HORIZONTAL) { if (mViewUpdateHandler != null && !mViewUpdateHandler.hasMessages(0)) { mViewUpdateHandler.sendEmptyMessage(0); } } }
mViewUpdateHandler = new Handler() { @Override public void handleMessage(Message msg) { super.handleMessage(msg); <span style="color:#FF6666;"> /* Update the number and percent */</span> int progress = mProgress.getProgress(); int max = mProgress.getMax(); if (mProgressNumberFormat != null) { String format = mProgressNumberFormat; mProgressNumber.setText(String.format(format, progress, max)); } else { mProgressNumber.setText(""); } if (mProgressPercentFormat != null) { double percent = (double) progress / (double) max; SpannableString tmp = new SpannableString(mProgressPercentFormat.format(percent)); tmp.setSpan(new StyleSpan(android.graphics.Typeface.BOLD), 0, tmp.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); mProgressPercent.setText(tmp); } else { mProgressPercent.setText(""); } } };
最终是在progressDialog中更新数字和百分比的
0 0
- incrementProgressBy函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 使用ssh出现 Could not obtain transaction-synchronized Session for current thre情况
- Laxcus大数据管理系统2.0(10)- 第八章 安全
- ISO C90 forbids mixed declarations and code[-Wdeclaration-after-statement]
- MySQL安装.md
- Laxcus大数据管理系统2.0(11)- 第九章 容错
- incrementProgressBy函数
- 队列实现简单的dfs算法
- Java的数据类型转换
- Laxcus大数据管理系统2.0(12)- 第十章 运行
- Hystrix学习(3)隔离
- Lucene查询结果高亮
- ZOJ - 1048 Financial Management
- 第九周上机实践项目-阅读项目-3
- Android自定义控件之继承ViewGroup创建新容器(四)