1.添加依赖

dependencies {
compile ‘com.github.dmytrodanylyk.android-process-button:library:1.0.4’
}
项目地址
https://github.com/dmytrodanylyk/android-process-button

2.Action Process Button

操作指南
https://github.com/dmytrodanylyk/android-process-button/wiki/User-Guide#action-process-button
xml布局:

custom:pb_colorComplete="@color/green_complete"会报错的话参考
xmlns:custom=“http://schemas.android.com/apk/res-auto”
例如:

                custom:pb_colorComplete                custom:pb_textComplete                custom:pb_colorProgress                custom:pb_textProgress                custom:pb_textError="Error"                custom:pb_colorComplete

通过Java代码控制它

ActionProcessButton btnSignIn = (ActionProcessButton) findViewById(R.id.btnSignIn);btnSignIn.setMode(ActionProcessButton.Mode.PROGRESS);//有进度的进度条// no progressbutton.setProgress(0);// progressDrawable cover 50% of button width, progressText is shownbutton.setProgress(50);// progressDrawable cover 75% of button width, progressText is shownbutton.setProgress(75);// completeColor & completeText is shownbutton.setProgress(100);//显示无尽进度条btnSignIn.setMode(ActionProcessButton.Mode.ENDLESS);// 设置进度> 0以启动进度指示器动画button.setProgress(1);

还有更多参考用户指南(转)
https://github.com/dmytrodanylyk/android-process-button/wiki/User-Guide#action-process-button

更多相关文章

  1. android表格效果--ListView隔行变色
  2. android 显示时间格式24小时或12小时
  3. Android学习札记48:将TextView中的指定文字转换为表情显示
  4. Android(安卓)布局 优先显示右侧的控件
  5. Android开发EditText属性
  6. QMUI Android
  7. Android如何截取当前View 为图片
  8. Android(安卓)动画1--View控件的显示和隐藏效果
  9. Android之修改部分字体颜色

随机推荐

  1. 解决 Android(安卓)java.lang.RuntimeExc
  2. android java复制和压缩文件或文件夹
  3. Android(安卓)TXT文件读写
  4. SQlite Android(安卓)数据库应用程序系统
  5. android 自定义toggle Button按钮
  6. Android: android.content.res.Resources
  7. 初学Android的surfaceView
  8. android SQLite
  9. 开源项目Universal Image Loader for And
  10. android dialog