Android 圆角进度条RoundCornerProgressBar
来源:互联网 发布:如何手机秒杀淘宝商品 编辑:程序博客网 时间:2024/06/03 15:58
转自:http://www.jcodecraeer.com/a/opensource/2015/0115/2313.html
介绍:
圆角矩形进度条,包含带图标和不带图标两种形式
运行效果:
使用说明:
布局文件中添加roundcornerprogressbar控件
<com.akexorcist.roundcornerprogressbar.RoundCornerProgressBar android:layout_width="dimension" android:layout_height="dimension" app:backgroundPadding="dimension" app:backgroundRadius="dimension" app:backgroundColor="color" app:progressColor="color" app:progress="integer" app:max="integer" />属性说明:
添加iconroundcornerprogressbar
<com.akexorcist.roundcornerprogressbar.IconRoundCornerProgressBar android:layout_width="dimension" android:layout_height="dimension" app:iconPadding="dimension" app:iconSize="dimension" app:iconSrc="drawable" app:backgroundPadding="dimension" app:backgroundRadius="dimension" app:backgroundColor="color" app:headerColor="color" app:progressColor="color" app:progress="integer" app:max="integer" />属性说明:
RoundCornerProgressBar的公共方法:
void setProgressColor(int color)int getProgressColor()void setBackgroundColor(int color)int getBackgroundColor() void setMax(float max)int getMax()void setProgress(float progress)int getProgress()IconRoundCornerProgressBar的公共方法:
void setProgressColor(int color)int getProgressColor()void setBackgroundColor(int color)int getBackgroundColor()void setHeaderColor(int color)int getHeaderColor() void setMax(float max)int getMax()void setProgress(float progress)int getProgress() void setIconImageResource(int resource)void setIconImageBitmap(Bitmap bitmap)void setIconImageDrawable(Drawable drawable)例子:
xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_height="match_parent" android:layout_width="match_parent" > <com.akexorcist.roundcornerprogressbar.RoundCornerProgressBar android:id="@+id/progress_1" android:layout_height="320dp" android:layout_width="40dp" app:backgroundPadding="5dp" /> <com.akexorcist.roundcornerprogressbar.IconRoundCornerProgressBar android:id="@+id/progress_2" android:layout_height="320dp" android:layout_width="wrap_content" app:backgroundPadding="10dp" app:iconSize="50dp" app:iconPadding="5dp" /> </RelativeLayout>java代码
RoundCornerProgressBar progress1 = (RoundCornerProgressBar) findViewById(R.id.progress_1);progress1.setProgressColor(Color.parseColor("#ed3b27"));progress1.setBackgroundColor(Color.parseColor("#808080"));progress1.setMax(70);progress1.setProgress(15); int progressColor1 = progress1.getProgressColor();int backgroundColor1 = progress1.getBackgroundColor();int max1 = progress1.etMax();int progress1 = progress1.getProgress(); RoundCornerProgressBar progress2 = (RoundCornerProgressBar) findViewById(R.id.progress_1);progress2.setProgressColor(Color.parseColor("#56d2c2"));progress2.setBackgroundColor(Color.parseColor("#757575"));progress2.setHeaderColor(Color.parseColor("#38c0ae"));progress2.setMax(550);progress2.setProgress(147);progress2.setIconImageResource(anyResource);progress2.setIconImageBitmap(anyBitmap);progress2.setIconImageDrawable(anyDrawable); int progressColor2 = progress2.getProgressColor();int backgroundColor2 = progress2.getBackgroundColor();int headerColor2 = progress2.getHeaderColor();int max2 = progress2.getMax();int progress2 = progress2.getProgress();
源码下载
26 0
- Android 圆角进度条RoundCornerProgressBar
- Android-RoundCornerProgressBar——Android圆角进度条(Progress Bar)类库
- 很强势的进度条表现方式RoundCornerProgressBar,(圆角,倾斜度,颜色,开关)
- android圆角矩形进度条
- Android自定义进度条——圆角横向进度条
- 自定义进度条之圆角进度条问题
- android之自定义带文本的圆角进度条
- Android 自定义水平进度条的圆角进度
- android进度条
- android 进度条
- android 进度条
- Android进度条
- android 进度条
- Android 进度条
- android-----进度条
- android进度条
- Android:进度条
- android 进度条
- 欢迎使用CSDN-markdown编辑器
- 手机制式
- Hard 146题 LRU Cache
- 详解<meta>标签
- 读取网络获得的输入流输出String工具类
- Android 圆角进度条RoundCornerProgressBar
- 数据库系统概论第五版学习笔记数据查询 第三章(二)
- GSM
- 长连接和短链接的解析
- Linux驱动的两种安装方式
- Android 数字进度条NumberProgressBar
- Codeforces Round #365 (Div. 2) B
- 求出三个数字中的最大值和最小值
- String , StringBuilder StringBuffer 的区别