SHARE
TWEET

Untitled

a guest Apr 24th, 2019 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. private void init(Context context, AttributeSet attrs, int defStyle) {
  2.   if (attrs != null) {
  3.     TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.CustomShapeImageView, defStyle, 0);
  4.  
  5.     mBorderWidth = typedArray.getDimensionPixelSize(R.styleable.CustomShapeImageView_civ_borderWidth, DEFAULT_BORDER_WIDTH);
  6.     mBorderColor = typedArray.getColor(R.styleable.CustomShapeImageView_civ_borderColor, DEFAULT_BORDER_COLOR);
  7.     mBorderRadius = typedArray.getDimensionPixelSize(R.styleable.CustomShapeImageView_civ_borderRadius, DEFAULT_BORDER_RADIUS);
  8.     mShape = typedArray.getInt(R.styleable.CustomShapeImageView_civ_shape, DEFAULT_SHAPE);
  9.  
  10.     typedArray.recycle();
  11.   }
  12.  
  13.   mHasBorder = mBorderWidth > 0 && mShape != SHAPE_STAR && mShape != SHAPE_HEART;
  14.  
  15.   mBitmapPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
  16.   mBorderPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
  17.   mBorderPaint.setColor(mBorderColor);
  18. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top