Android按钮样式(dmytrodanylyk)使用
16lz
2022-05-25
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
更多相关文章
- android表格效果--ListView隔行变色
- android 显示时间格式24小时或12小时
- Android学习札记48:将TextView中的指定文字转换为表情显示
- Android(安卓)布局 优先显示右侧的控件
- Android开发EditText属性
- QMUI Android
- Android如何截取当前View 为图片
- Android(安卓)动画1--View控件的显示和隐藏效果
- Android之修改部分字体颜色