protected void refreshDrawable(final Drawable drawable) {
mDrawable = drawable;
if (mDrawable == null) {
mDrawable = new ColorDrawable(mColor);
}
int gravity = GRAVITY_FILL_VERTICAL | GRAVITY_LEFT;
int orientation = ClipDrawable.HORIZONTAL;
switch (mRotation) {
case 90:
gravity = GRAVITY_FILL_HORIZONTAL | GRAVITY_BOTTOM;
orientation = ClipDrawable.VERTICAL;
break;
case 180:
gravity = GRAVITY_FILL_VERTICAL | GRAVITY_RIGHT;
orientation = ClipDrawable.HORIZONTAL;
break;
case 270:
gravity = GRAVITY_FILL_HORIZONTAL | GRAVITY_TOP;
orientation = ClipDrawable.VERTICAL;
break;
}
mClipDrawable = new ClipDrawable(mDrawable, gravity, orientation);
final Rect outRect = new Rect();
getDrawingRect(outRect);
mClipDrawable.setBounds(outRect);
mClipDrawable.setLevel((int)(mProgress * mScale) + mMin);
postInvalidate();
}
ProgressView.java 文件源码
java
阅读 32
收藏 0
点赞 0
评论 0
项目:libcommon
作者:
评论列表
文章目录