ElectricView.java 文件源码

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

项目:SphereLayout 作者:
public ElectricView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    mPath = new Path();
    mRandom = new Random();
    mPaint = new Paint();
    mPaint.setColor(0xffffff8e);
    mPaint.setStrokeWidth(3);
    mPaint.setStyle(Paint.Style.STROKE);
    mMaxOffset = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 8,
            getContext().getResources().getDisplayMetrics());
    mStartMargin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 2,
            getContext().getResources().getDisplayMetrics());

    TypedArray typedArray = getContext().obtainStyledAttributes(attrs, R.styleable.ElectricView);
    mElectricCount = typedArray.getInt(R.styleable.ElectricView_electricCount, 1);
    mStartFromRight = typedArray.getInt(R.styleable.ElectricView_startFrom, 0) == 1;
    mDegree = typedArray.getInt(R.styleable.ElectricView_degree, 0);
    typedArray.recycle();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号