/**
* Create the progress bar with a custom height.
* @param context An Android context.
* @param height The height in px of the progress bar.
*/
public ClipDrawableProgressBar(Context context, int height) {
super(context);
mDesiredVisibility = getVisibility();
int foregroundColor =
ApiCompatibilityUtils.getColor(getResources(), R.color.progress_bar_foreground);
mBackgroundColor =
ApiCompatibilityUtils.getColor(getResources(), R.color.progress_bar_background);
mForegroundDrawable = new ColorDrawable(foregroundColor);
setImageDrawable(
new ClipDrawable(mForegroundDrawable, Gravity.START, ClipDrawable.HORIZONTAL));
setBackgroundColor(mBackgroundColor);
setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, height));
}
ClipDrawableProgressBar.java 文件源码
java
阅读 19
收藏 0
点赞 0
评论 0
项目:365browser
作者:
评论列表
文章目录