Skip to content

Commit 1a7a368

Browse files
committed
Update demo and README.md
1 parent e58cf82 commit 1a7a368

File tree

6 files changed

+258
-190
lines changed

6 files changed

+258
-190
lines changed

README.md

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
[![API](https://img.shields.io/badge/API-9%2B-blue.svg?style=flat)](https://android-arsenal.com/api?level=9)
33
[![License](http://img.shields.io/badge/license-MIT-green.svg?style=flat)]()
44
# 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
77
# 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)
99
## Download
1010
root project:`build.gradle`
1111
```groovy
@@ -19,7 +19,7 @@ root project:`build.gradle`
1919
app:`build.gradle`
2020
```groovy
2121
dependencies {
22-
// e.g. compile 'com.github.woxingxiao:VectorCompatTextView:1.3'
22+
// e.g. compile 'com.github.woxingxiao:VectorCompatTextView:1.5'
2323
compile 'com.github.woxingxiao:VectorCompatTextView:${LATEST_VERSION}'
2424
}
2525
```
@@ -28,35 +28,39 @@ app:`build.gradle`
2828
<com.xw.repo.VectorCompatTextView
2929
android:layout_width="wrap_content"
3030
android:layout_height="wrap_content"
31-
android:drawablePadding="4dp"
32-
android:gravity="center_vertical"
3331
android:text="GitHub"
34-
android:textSize="16sp"
3532
app:drawableLeftCompat="@drawable/svg_ic_github"/>
36-
```
37-
```xml
33+
3834
<com.xw.repo.VectorCompatTextView
3935
android:layout_width="match_parent"
4036
android:layout_height="wrap_content"
41-
android:background="@color/color_gray_light"
42-
android:gravity="center_vertical"
43-
android:padding="16dp"
4437
android:text="Next"
45-
android:textSize="16sp"
4638
app:drawableRightCompat="@drawable/svg_ic_arrow_right"
47-
app:tintDrawableInTextColor="true"/> <!--tint-->
48-
```
49-
```xml
39+
app:tintDrawableInTextColor="true"/>
40+
5041
<com.xw.repo.VectorCompatTextView
5142
android:layout_width="match_parent"
5243
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"/>
6062
```
63+
**Check the Demo for complete usage.**
64+
6165
# LICENSE
6266
[MIT](https://github.com/woxingxiao/VectorCompatTextView/blob/master/LICENSE)

app/src/main/res/drawable/shape_round_stroke_bg_gray.xml

Lines changed: 0 additions & 9 deletions
This file was deleted.

app/src/main/res/drawable/shape_round_stroke_bg_red.xml

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)