Skip to content

Commit 9d265b0

Browse files
committed
1,修改属性名
1 parent cfe58da commit 9d265b0

File tree

4 files changed

+140
-140
lines changed

4 files changed

+140
-140
lines changed

README.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ShapeImageView
2-
## 支持圆图或圆角图,可绘制圆环背景或圆角框背景,除ImageView自带属性外新增4中显示模式,本库中的ShapeImageView没有操作Bitmap,可以放心使用!!!
2+
## 支持圆图或圆角图,可绘制圆环背景边框或圆角框背景边框,除ImageView自带属性外新增4中显示模式,本库中的ShapeImageView没有操作Bitmap,可以放心使用!!!
33

44
[![](https://jitpack.io/v/FlyJingFish/ShapeImageView.svg)](https://jitpack.io/#FlyJingFish/ShapeImageView)
55

@@ -56,24 +56,24 @@
5656
|shape_end_top_radius|dimension|图片右上(Rtl:左上)角圆角|
5757
|shape_end_bottom_radius|dimension|图片右下(Rtl:左下)角圆角|
5858
|shape_start_bottom_radius|dimension|图片左下(Rtl:右下)角圆角|
59-
|shape_bg|enum|背景绘制形状是 none不绘制/rectangle矩形/oval圆形|
60-
|shape_bg_radius|dimension|背景四个角圆角|
61-
|shape_bg_left_top_radius|dimension|背景左上角圆角|
62-
|shape_bg_right_top_radius|dimension|背景右上角圆角|
63-
|shape_bg_right_bottom_radius|dimension|背景右下角圆角|
64-
|shape_bg_left_bottom_radius|dimension|背景左下角圆角|
65-
|shape_bg_start_top_radius|dimension|背景左上(Rtl:右上)角圆角|
66-
|shape_bg_end_top_radius|dimension|背景右上(Rtl:左上)角圆角|
67-
|shape_bg_end_bottom_radius|dimension|背景右下(Rtl:左下)角圆角|
68-
|shape_bg_start_bottom_radius|dimension|背景左下(Rtl:右下)角圆角|
69-
|shape_bg_color|color|背景绘制颜色|
70-
|shape_bg_gradient|boolean|背景绘制是否渐变色|
71-
|shape_bg_startColor|color|背景绘制渐变色开始颜色|
72-
|shape_bg_centerColor|color|背景绘制渐变色中间颜色|
73-
|shape_bg_endColor|color|背景绘制渐变色结束颜色|
74-
|shape_bg_angle|float|背景绘制渐变色开始角度|
75-
|shape_bg_rtl_angle|boolean|背景绘制渐变色开始角度是否支持镜像Rtl适配|
76-
|shape_bg_strokeWidth|dimension|背景绘制画笔宽度|
59+
|shape_border|enum|背景边框绘制形状是 none不绘制/rectangle矩形/oval圆形|
60+
|shape_border_radius|dimension|背景边框四个角圆角|
61+
|shape_border_left_top_radius|dimension|背景边框左上角圆角|
62+
|shape_border_right_top_radius|dimension|背景边框右上角圆角|
63+
|shape_border_right_bottom_radius|dimension|背景边框右下角圆角|
64+
|shape_border_left_bottom_radius|dimension|背景边框左下角圆角|
65+
|shape_border_start_top_radius|dimension|背景边框左上(Rtl:右上)角圆角|
66+
|shape_border_end_top_radius|dimension|背景边框右上(Rtl:左上)角圆角|
67+
|shape_border_end_bottom_radius|dimension|背景边框右下(Rtl:左下)角圆角|
68+
|shape_border_start_bottom_radius|dimension|背景边框左下(Rtl:右下)角圆角|
69+
|shape_border_color|color|背景边框绘制颜色|
70+
|shape_border_gradient|boolean|背景边框绘制是否渐变色|
71+
|shape_border_startColor|color|背景边框绘制渐变色开始颜色|
72+
|shape_border_centerColor|color|背景边框绘制渐变色中间颜色|
73+
|shape_border_endColor|color|背景边框绘制渐变色结束颜色|
74+
|shape_border_angle|float|背景边框绘制渐变色开始角度|
75+
|shape_border_rtl_angle|boolean|背景边框绘制渐变色开始角度是否支持镜像Rtl适配|
76+
|shape_border_strokeWidth|dimension|背景边框绘制画笔宽度|
7777
|autoCrop_height_width_ratio|float|图像高宽比是View高宽比的倍数|
7878
|shapeScaleType|enum|如果设置新增显示模式设置这个,详情如下:|
7979

app/src/main/res/layout/activity_scale_type.xml

Lines changed: 73 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,14 @@
8484
android:layout_marginStart="5dp"
8585
app:shape_radius="6dp"
8686
app:shape="rectangle"
87-
app:shape_bg="rectangle"
87+
app:shape_border="rectangle"
8888
android:padding="10dp"
89-
app:shape_bg_strokeWidth="3dp"
90-
app:shape_bg_angle="45"
91-
app:shape_bg_radius="10dp"
92-
app:shape_bg_gradient="true"
93-
app:shape_bg_startColor="@color/purple_200"
94-
app:shape_bg_endColor="@color/teal_700"
89+
app:shape_border_width="3dp"
90+
app:shape_border_angle="45"
91+
app:shape_border_radius="10dp"
92+
app:shape_border_gradient="true"
93+
app:shape_border_startColor="@color/purple_200"
94+
app:shape_border_endColor="@color/teal_700"
9595
android:scaleType="center" />
9696

9797
<com.flyjingfish.shapeimageviewlib.ShapeImageView
@@ -101,20 +101,20 @@
101101
android:layout_marginStart="10dp"
102102
android:padding="10dp"
103103
app:shape="rectangle"
104-
app:shape_bg="rectangle"
105-
app:shape_bg_strokeWidth="3dp"
106-
app:shape_bg_angle="45"
104+
app:shape_border="rectangle"
105+
app:shape_border_width="3dp"
106+
app:shape_border_angle="45"
107107
app:shape_left_top_radius="8dp"
108108
app:shape_right_top_radius="12dp"
109109
app:shape_right_bottom_radius="16dp"
110110
app:shape_left_bottom_radius="20dp"
111-
app:shape_bg_left_top_radius="10dp"
112-
app:shape_bg_right_top_radius="15dp"
113-
app:shape_bg_right_bottom_radius="20dp"
114-
app:shape_bg_left_bottom_radius="25dp"
115-
app:shape_bg_gradient="true"
116-
app:shape_bg_startColor="@color/purple_200"
117-
app:shape_bg_endColor="@color/teal_700"
111+
app:shape_border_left_top_radius="10dp"
112+
app:shape_border_right_top_radius="15dp"
113+
app:shape_border_right_bottom_radius="20dp"
114+
app:shape_border_left_bottom_radius="25dp"
115+
app:shape_border_gradient="true"
116+
app:shape_border_startColor="@color/purple_200"
117+
app:shape_border_endColor="@color/teal_700"
118118
android:scaleType="centerCrop" />
119119

120120
<com.flyjingfish.shapeimageviewlib.ShapeImageView
@@ -124,14 +124,14 @@
124124
android:layout_marginStart="10dp"
125125
app:shape_radius="6dp"
126126
app:shape="oval"
127-
app:shape_bg="oval"
127+
app:shape_border="oval"
128128
android:padding="10dp"
129-
app:shape_bg_strokeWidth="3dp"
130-
app:shape_bg_angle="45"
131-
app:shape_bg_radius="10dp"
132-
app:shape_bg_gradient="true"
133-
app:shape_bg_startColor="@color/purple_200"
134-
app:shape_bg_endColor="@color/teal_700"
129+
app:shape_border_width="3dp"
130+
app:shape_border_angle="45"
131+
app:shape_border_radius="10dp"
132+
app:shape_border_gradient="true"
133+
app:shape_border_startColor="@color/purple_200"
134+
app:shape_border_endColor="@color/teal_700"
135135
android:scaleType="centerInside" />
136136
</LinearLayout>
137137

@@ -176,12 +176,12 @@
176176
android:padding="10dp"
177177
app:shape_radius="8dp"
178178
app:shape="oval"
179-
app:shape_bg="oval"
180-
app:shape_bg_strokeWidth="3dp"
181-
app:shape_bg_radius="10dp"
182-
app:shape_bg_gradient="true"
183-
app:shape_bg_startColor="@color/purple_200"
184-
app:shape_bg_endColor="@color/teal_700"
179+
app:shape_border="oval"
180+
app:shape_border_width="3dp"
181+
app:shape_border_radius="10dp"
182+
app:shape_border_gradient="true"
183+
app:shape_border_startColor="@color/purple_200"
184+
app:shape_border_endColor="@color/teal_700"
185185
android:scaleType="fitStart" />
186186

187187
<com.flyjingfish.shapeimageviewlib.ShapeImageView
@@ -192,12 +192,12 @@
192192
android:padding="10dp"
193193
app:shape_radius="8dp"
194194
app:shape="oval"
195-
app:shape_bg="oval"
196-
app:shape_bg_strokeWidth="3dp"
197-
app:shape_bg_radius="10dp"
198-
app:shape_bg_gradient="true"
199-
app:shape_bg_startColor="@color/purple_200"
200-
app:shape_bg_endColor="@color/teal_700"
195+
app:shape_border="oval"
196+
app:shape_border_width="3dp"
197+
app:shape_border_radius="10dp"
198+
app:shape_border_gradient="true"
199+
app:shape_border_startColor="@color/purple_200"
200+
app:shape_border_endColor="@color/teal_700"
201201
android:scaleType="fitCenter" />
202202

203203
<com.flyjingfish.shapeimageviewlib.ShapeImageView
@@ -208,12 +208,12 @@
208208
android:padding="8dp"
209209
app:shape_radius="8dp"
210210
app:shape="oval"
211-
app:shape_bg="oval"
212-
app:shape_bg_strokeWidth="3dp"
213-
app:shape_bg_radius="10dp"
214-
app:shape_bg_gradient="true"
215-
app:shape_bg_startColor="@color/purple_200"
216-
app:shape_bg_endColor="@color/teal_700"
211+
app:shape_border="oval"
212+
app:shape_border_width="3dp"
213+
app:shape_border_radius="10dp"
214+
app:shape_border_gradient="true"
215+
app:shape_border_startColor="@color/purple_200"
216+
app:shape_border_endColor="@color/teal_700"
217217
android:scaleType="fitEnd" />
218218
</LinearLayout>
219219

@@ -259,21 +259,21 @@
259259
android:layout_marginStart="5dp"
260260
android:padding="10dp"
261261
app:shape="rectangle"
262-
app:shape_bg="rectangle"
263-
app:shape_bg_strokeWidth="3dp"
264-
app:shape_bg_angle="45"
262+
app:shape_border="rectangle"
263+
app:shape_border_width="3dp"
264+
app:shape_border_angle="45"
265265
app:shape_start_top_radius="8dp"
266266
app:shape_end_top_radius="12dp"
267267
app:shape_end_bottom_radius="16dp"
268268
app:shape_start_bottom_radius="20dp"
269-
app:shape_bg_start_top_radius="10dp"
270-
app:shape_bg_end_top_radius="15dp"
271-
app:shape_bg_end_bottom_radius="20dp"
272-
app:shape_bg_start_bottom_radius="25dp"
273-
app:shape_bg_gradient="true"
274-
app:shape_bg_rtl_angle="true"
275-
app:shape_bg_startColor="@color/purple_200"
276-
app:shape_bg_endColor="@color/teal_700"
269+
app:shape_border_start_top_radius="10dp"
270+
app:shape_border_end_top_radius="15dp"
271+
app:shape_border_end_bottom_radius="20dp"
272+
app:shape_border_start_bottom_radius="25dp"
273+
app:shape_border_gradient="true"
274+
app:shape_border_rtl_angle="true"
275+
app:shape_border_startColor="@color/purple_200"
276+
app:shape_border_endColor="@color/teal_700"
277277
android:scaleType="fitXY" />
278278

279279
<com.flyjingfish.shapeimageviewlib.ShapeImageView
@@ -284,13 +284,13 @@
284284
android:padding="8dp"
285285
app:shape_radius="6dp"
286286
app:shape="rectangle"
287-
app:shape_bg="rectangle"
288-
app:shape_bg_strokeWidth="3dp"
289-
app:shape_bg_angle="45"
290-
app:shape_bg_radius="10dp"
291-
app:shape_bg_gradient="true"
292-
app:shape_bg_startColor="@color/purple_200"
293-
app:shape_bg_endColor="@color/teal_700"
287+
app:shape_border="rectangle"
288+
app:shape_border_width="3dp"
289+
app:shape_border_angle="45"
290+
app:shape_border_radius="10dp"
291+
app:shape_border_gradient="true"
292+
app:shape_border_startColor="@color/purple_200"
293+
app:shape_border_endColor="@color/teal_700"
294294
app:shapeScaleType="startCrop" />
295295

296296
<com.flyjingfish.shapeimageviewlib.ShapeImageView
@@ -301,12 +301,12 @@
301301
android:padding="6dp"
302302
app:shape_radius="8dp"
303303
app:shape="oval"
304-
app:shape_bg="oval"
305-
app:shape_bg_strokeWidth="3dp"
306-
app:shape_bg_radius="10dp"
307-
app:shape_bg_gradient="true"
308-
app:shape_bg_startColor="@color/purple_200"
309-
app:shape_bg_endColor="@color/teal_700"
304+
app:shape_border="oval"
305+
app:shape_border_width="3dp"
306+
app:shape_border_radius="10dp"
307+
app:shape_border_gradient="true"
308+
app:shape_border_startColor="@color/purple_200"
309+
app:shape_border_endColor="@color/teal_700"
310310
app:shapeScaleType="endCrop" />
311311
</LinearLayout>
312312

@@ -346,11 +346,11 @@
346346
android:padding="6dp"
347347
app:shape_radius="6dp"
348348
app:shape="rectangle"
349-
app:shape_bg="rectangle"
350-
app:shape_bg_strokeWidth="2dp"
349+
app:shape_border="rectangle"
350+
app:shape_border_width="2dp"
351351
app:autoCrop_height_width_ratio="2"
352-
app:shape_bg_radius="10dp"
353-
app:shape_bg_color="@color/teal_200"
352+
app:shape_border_radius="10dp"
353+
app:shape_border_color="@color/teal_200"
354354
app:shapeScaleType="autoStartCenterCrop" />
355355

356356
<com.flyjingfish.shapeimageviewlib.ShapeImageView
@@ -360,10 +360,10 @@
360360
android:layout_marginStart="10dp"
361361
android:padding="6dp"
362362
app:shape="oval"
363-
app:shape_bg="oval"
364-
app:shape_bg_strokeWidth="2dp"
363+
app:shape_border="oval"
364+
app:shape_border_width="2dp"
365365
app:autoCrop_height_width_ratio="2"
366-
app:shape_bg_color="@color/teal_200"
366+
app:shape_border_color="@color/teal_200"
367367
app:shapeScaleType="autoEndCenterCrop" />
368368
</LinearLayout>
369369

library/src/main/java/com/flyjingfish/shapeimageviewlib/ShapeImageView.java

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -90,25 +90,25 @@ public ShapeImageView(Context context, AttributeSet attr, int defStyle) {
9090
endBottomRadius = a.getDimension(R.styleable.ShapeImageView_shape_end_bottom_radius, radius);
9191

9292
shapeType = ShapeType.getType(a.getInt(R.styleable.ShapeImageView_shape, 1));
93-
bgShapeType = ShapeType.getType(a.getInt(R.styleable.ShapeImageView_shape_bg, 0));
94-
int startColor = a.getColor(R.styleable.ShapeImageView_shape_bg_startColor, Color.TRANSPARENT);
95-
int centerColor = a.getColor(R.styleable.ShapeImageView_shape_bg_centerColor, 0);
96-
int endColor = a.getColor(R.styleable.ShapeImageView_shape_bg_endColor, Color.TRANSPARENT);
97-
bgShapeColor = a.getColor(R.styleable.ShapeImageView_shape_bg_color, Color.BLACK);
98-
gradientAngle = a.getFloat(R.styleable.ShapeImageView_shape_bg_angle, 0);
99-
gradientRtlAngle = a.getBoolean(R.styleable.ShapeImageView_shape_bg_rtl_angle, false);
100-
isGradient = a.getBoolean(R.styleable.ShapeImageView_shape_bg_gradient, false);
101-
mBgPaintWidth = a.getDimension(R.styleable.ShapeImageView_shape_bg_strokeWidth, 1);
102-
float bgRadius = a.getDimension(R.styleable.ShapeImageView_shape_bg_radius, 0);
103-
bgLeftTopRadius = a.getDimension(R.styleable.ShapeImageView_shape_bg_left_top_radius, bgRadius);
104-
bgLeftBottomRadius = a.getDimension(R.styleable.ShapeImageView_shape_bg_left_bottom_radius, bgRadius);
105-
bgRightTopRadius = a.getDimension(R.styleable.ShapeImageView_shape_bg_right_top_radius, bgRadius);
106-
bgRightBottomRadius = a.getDimension(R.styleable.ShapeImageView_shape_bg_right_bottom_radius, bgRadius);
107-
108-
bgStartTopRadius = a.getDimension(R.styleable.ShapeImageView_shape_bg_start_top_radius, bgRadius);
109-
bgStartBottomRadius = a.getDimension(R.styleable.ShapeImageView_shape_bg_start_bottom_radius, bgRadius);
110-
bgEndTopRadius = a.getDimension(R.styleable.ShapeImageView_shape_bg_end_top_radius, bgRadius);
111-
bgEndBottomRadius = a.getDimension(R.styleable.ShapeImageView_shape_bg_end_bottom_radius, bgRadius);
93+
bgShapeType = ShapeType.getType(a.getInt(R.styleable.ShapeImageView_shape_border, 0));
94+
int startColor = a.getColor(R.styleable.ShapeImageView_shape_border_startColor, Color.TRANSPARENT);
95+
int centerColor = a.getColor(R.styleable.ShapeImageView_shape_border_centerColor, 0);
96+
int endColor = a.getColor(R.styleable.ShapeImageView_shape_border_endColor, Color.TRANSPARENT);
97+
bgShapeColor = a.getColor(R.styleable.ShapeImageView_shape_border_color, Color.BLACK);
98+
gradientAngle = a.getFloat(R.styleable.ShapeImageView_shape_border_angle, 0);
99+
gradientRtlAngle = a.getBoolean(R.styleable.ShapeImageView_shape_border_rtl_angle, false);
100+
isGradient = a.getBoolean(R.styleable.ShapeImageView_shape_border_gradient, false);
101+
mBgPaintWidth = a.getDimension(R.styleable.ShapeImageView_shape_border_width, 1);
102+
float bgRadius = a.getDimension(R.styleable.ShapeImageView_shape_border_radius, 0);
103+
bgLeftTopRadius = a.getDimension(R.styleable.ShapeImageView_shape_border_left_top_radius, bgRadius);
104+
bgLeftBottomRadius = a.getDimension(R.styleable.ShapeImageView_shape_border_left_bottom_radius, bgRadius);
105+
bgRightTopRadius = a.getDimension(R.styleable.ShapeImageView_shape_border_right_top_radius, bgRadius);
106+
bgRightBottomRadius = a.getDimension(R.styleable.ShapeImageView_shape_border_right_bottom_radius, bgRadius);
107+
108+
bgStartTopRadius = a.getDimension(R.styleable.ShapeImageView_shape_border_start_top_radius, bgRadius);
109+
bgStartBottomRadius = a.getDimension(R.styleable.ShapeImageView_shape_border_start_bottom_radius, bgRadius);
110+
bgEndTopRadius = a.getDimension(R.styleable.ShapeImageView_shape_border_end_top_radius, bgRadius);
111+
bgEndBottomRadius = a.getDimension(R.styleable.ShapeImageView_shape_border_end_bottom_radius, bgRadius);
112112

113113
a.recycle();
114114

0 commit comments

Comments
 (0)