Android 进度条 ProgressBarWithText
- 授权协议: Apache
- 开发语言: Java
- 操作系统: Android
- 软件首页: http://git.oschina.net/qibin/ProgressBarWithText
- 软件文档: http://git.oschina.net/qibin/ProgressBarWithText/blob/master/README.md
软件介绍
ProgressBarWithText 是 Android 上带文本的进度条。
效果演示:
使用方法: 在布局文件配置:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:progress="http://schemas.android.com/apk/res/org.loader.progressbarwithtext" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context=".MainActivity" > <org.loader.progressbarwithtext.ProgressBarWithText android:id="@+id/progress" style="?android:attr/progressBarStyleHorizontal" android:layout_width="match_parent" android:layout_height="wrap_content" android: layout _marginTop="50dip" progress:textColor="#FFFF0000" /> </RelativeLayout>
只有一个属性:progress:textColor 指定文本颜色
在Activity中:
public class MainActivity extends Activity {
private ProgressBarWithText mProgress;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mProgress = (ProgressBarWithText) findViewById(R.id.progress);
mProgress.setMax(100);
new MyAsyncTask().execute();
}
class MyAsyncTask extends AsyncTask<Void, Integer, Void> {
@Override
protected Void doInBackground(Void... params) {
for(int i=0;i<101;i++) {
try {
Thread.sleep(200);
} catch (InterruptedException e) {
e.printStackTrace();
}
publishProgress(i);
}
return null;
}
@Override
protected void onProgressUpdate(Integer... values) {
mProgress.setProgress(values[0]);
}
}}
Refactoring
Martin Fowler、Kent Beck、John Brant、William Opdyke、Don Roberts / Addison-Wesley Professional / 1999-7-8 / USD 64.99
Refactoring is about improving the design of existing code. It is the process of changing a software system in such a way that it does not alter the external behavior of the code, yet improves its int......一起来看看 《Refactoring》 这本书的介绍吧!
