MCPcopy
hub / github.com/razerdp/BasePopup / init

Method init

app/src/main/java/razerdp/demo/widget/DPImageView.java:80–101  ·  view source on GitHub ↗
(Context context, AttributeSet attrs)

Source from the content-addressed store, hash-verified

78 }
79
80 private void init(Context context, AttributeSet attrs) {
81 TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.DPImageView);
82 mBorderWidth = a.getDimensionPixelSize(R.styleable.DPImageView_biv_border_width, mBorderWidth);
83 mBorderColor = a.getColor(R.styleable.DPImageView_biv_border_color, mBorderColor);
84 isOverLay = a.getBoolean(R.styleable.DPImageView_biv_border_overlay, isOverLay);
85 mBorderIgnorePadding = a.getBoolean(R.styleable.DPImageView_biv_border_ignore_padding, mBorderIgnorePadding);
86
87 shape = a.getInt(R.styleable.DPImageView_biv_shape, shape);
88
89 radius = a.getDimensionPixelOffset(R.styleable.DPImageView_biv_corner_radius, radius);
90 topLeftRadius = a.getDimensionPixelOffset(R.styleable.DPImageView_biv_corner_topLeftRadius, topLeftRadius);
91 topRightRadius = a.getDimensionPixelOffset(R.styleable.DPImageView_biv_corner_topRightRadius, topRightRadius);
92 bottomLeftRadius = a.getDimensionPixelOffset(R.styleable.DPImageView_biv_corner_bottomLeftRadius, bottomLeftRadius);
93 bottomRightRadius = a.getDimensionPixelOffset(R.styleable.DPImageView_biv_corner_bottomRightRadius, bottomRightRadius);
94
95 a.recycle();
96
97 mBorderPaint.setStyle(Paint.Style.STROKE);
98 mBorderPaint.setAntiAlias(true);
99 mBorderPaint.setColor(mBorderColor);
100 mBorderPaint.setStrokeWidth(mBorderWidth);
101 }
102
103 @Override
104 public void setPressed(boolean pressed) {

Callers 1

DPImageViewMethod · 0.95

Calls 4

getColorMethod · 0.80
getIntMethod · 0.80
recycleMethod · 0.80
setStrokeWidthMethod · 0.45

Tested by

no test coverage detected