2
2
[ ![ API] ( https://img.shields.io/badge/API-9%2B-blue.svg?style=flat )] ( https://android-arsenal.com/api?level=9 )
3
3
[ ![ License] ( http://img.shields.io/badge/license-MIT-green.svg?style=flat )] ( )
4
4
# VectorCompatTextView
5
- Compatible with vector drawable(svg) usage in TextView.
6
- TextView的CompoundDrawable对vector drawable(svg)矢量图使用的适配 。
5
+ Compatible vector drawable(svg), flexible size setting and tinting color for compound drawables of TextView.
6
+ Compound drawables支持vector drawable(svg)矢量图适配,灵活的尺寸设置以及着色等功能的TextView 。
7
7
# Screenshot
8
- ![ demo1 ] ( https://github.com/woxingxiao/VectorCompatTextView/blob/master/screenshot/demo1 .jpg )
8
+ ![ demo2 ] ( https://github.com/woxingxiao/VectorCompatTextView/blob/master/screenshot/demo2 .jpg )
9
9
## Download
10
10
root project:` build.gradle `
11
11
``` groovy
@@ -19,7 +19,7 @@ root project:`build.gradle`
19
19
app:` build.gradle `
20
20
``` groovy
21
21
dependencies {
22
- // e.g. compile 'com.github.woxingxiao:VectorCompatTextView:1.3 '
22
+ // e.g. compile 'com.github.woxingxiao:VectorCompatTextView:1.5 '
23
23
compile 'com.github.woxingxiao:VectorCompatTextView:${LATEST_VERSION}'
24
24
}
25
25
```
@@ -28,35 +28,39 @@ app:`build.gradle`
28
28
<com .xw.repo.VectorCompatTextView
29
29
android : layout_width =" wrap_content"
30
30
android : layout_height =" wrap_content"
31
- android : drawablePadding =" 4dp"
32
- android : gravity =" center_vertical"
33
31
android : text =" GitHub"
34
- android : textSize =" 16sp"
35
32
app : drawableLeftCompat =" @drawable/svg_ic_github" />
36
- ```
37
- ``` xml
33
+
38
34
<com .xw.repo.VectorCompatTextView
39
35
android : layout_width =" match_parent"
40
36
android : layout_height =" wrap_content"
41
- android : background =" @color/color_gray_light"
42
- android : gravity =" center_vertical"
43
- android : padding =" 16dp"
44
37
android : text =" Next"
45
- android : textSize =" 16sp"
46
38
app : drawableRightCompat =" @drawable/svg_ic_arrow_right"
47
- app : tintDrawableInTextColor =" true" /> <!-- tint-->
48
- ```
49
- ``` xml
39
+ app : tintDrawableInTextColor =" true" />
40
+
50
41
<com .xw.repo.VectorCompatTextView
51
42
android : layout_width =" match_parent"
52
43
android : layout_height =" wrap_content"
53
- android : background =" @color/color_gray_light"
54
- android : gravity =" center_vertical"
55
- android : padding =" 16dp"
56
- android : text =" Next"
57
- android : textSize =" 16sp"
58
- app : drawableCompatColor =" @color/color_red"
59
- app : drawableRightCompat =" @drawable/svg_ic_arrow_right" />
44
+ android : text =" ON"
45
+ app : drawableCompatColor =" #f44336"
46
+ app : drawableBottomCompat =" @drawable/svg_ic_line" />
47
+
48
+ <com .xw.repo.VectorCompatTextView
49
+ android : layout_width =" wrap_content"
50
+ android : layout_height =" wrap_content"
51
+ android : text =" GitHub"
52
+ app : drawableAdjustTextWidth =" true"
53
+ app : drawableTopCompat =" @drawable/svg_ic_github" />
54
+
55
+ <com .xw.repo.VectorCompatTextView
56
+ android : layout_width =" wrap_content"
57
+ android : layout_height =" wrap_content"
58
+ android : text =" GitHub"
59
+ app : drawableWidth =" 24dp"
60
+ app : drawableHeight =" 32dp"
61
+ app : drawableLeftCompat =" @mipmap/ic_launcher" />
60
62
```
63
+ ** Check the Demo for complete usage.**
64
+
61
65
# LICENSE
62
66
[ MIT] ( https://github.com/woxingxiao/VectorCompatTextView/blob/master/LICENSE )
0 commit comments