CompositionAvatarView.java 文件源码

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

项目:CompositionAvatar 作者:
private void init(AttributeSet attrs, int defStyle) {
    final TypedArray a = getContext().obtainStyledAttributes(attrs,
            R.styleable.CompositionAvatarView, defStyle, 0);

    int index = a.getInt(R.styleable.CompositionAvatarView_fitType, -1);
    if (index >= 0) {
        setDrawableFitType(sFitTypeArray[index]);
    }

    float gap = a.getFloat(R.styleable.CompositionAvatarView_gap, DEFAULT_GAP);
    mGap = Math.max(0f, Math.min(gap, 1f));
    a.recycle();

    setLayerType(LAYER_TYPE_SOFTWARE, null);

    mPaint.setColor(Color.BLACK);
    mPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR));

    initForEditMode();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号