StrengthMeter.java 文件源码

java
阅读 41 收藏 0 点赞 0 评论 0

项目:Nird2 作者:
public StrengthMeter(Context context, AttributeSet attrs) {
    super(context, attrs, android.R.attr.progressBarStyleHorizontal);
    bar = new ShapeDrawable();
    bar.getPaint().setColor(RED);
    ClipDrawable clip = new ClipDrawable(bar, LEFT, HORIZONTAL);
    ShapeDrawable background = new ShapeDrawable();
    Paint p = background.getPaint();
    p.setStyle(FILL);
    p.setColor(getResources().getColor(android.R.color.transparent));
    p.setStyle(STROKE);
    p.setStrokeWidth(1);
    p.setColor(BLACK);
    Drawable[] layers = new Drawable[] { clip, background };
    setProgressDrawable(new LayerDrawable(layers));
    setIndeterminate(false);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号