Skip to content

Commit 62b5973

Browse files
committed
添加属性 radius
1 parent fe2f65e commit 62b5973

File tree

12 files changed

+307
-327
lines changed

12 files changed

+307
-327
lines changed

.gitignore

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
*.iml
22
.gradle
33
/local.propertie
4-
/.idea/caches
5-
/.idea/libraries
6-
/.idea/modules.xml
7-
/.idea/workspace.xml
8-
/.idea/navEditor.xml
9-
/.idea/assetWizardSettings.xml
104
.DS_Store
115
/build/generated
126
/build/intermediates
137
/captures
148
.externalNativeBuild
159
.cxx
10+
.idea

.idea/codeStyles/Project.xml

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

.idea/gradle.xml

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

README.md

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
## Demo
88
[Download](https://github.com/FlodCoding/DrawableTextView/raw/master/app/build/outputs/apk/debug/app-debug.apk)
99
### 截图
10-
![](/gif/gif1.gif)    ![](/gif/gif2.gif)
10+
![](/gif/gif2.gif)    ![](/gif/gif1.gif)    ![](/gif/gif3.gif)
1111

1212

1313
## 如何导入
@@ -21,10 +21,10 @@
2121
}
2222

2323

24-
App目录下的build.gradle
24+
App目录下的build.gradle
2525

2626
dependencies {
27-
//需要是Androidx
27+
//需要Androidx
2828
implementation 'com.github.FlodCoding:DrawableTextView:1.0.4'
2929

3030
}
@@ -33,15 +33,14 @@
3333
```
3434
drawableTextView.setEnableCenterDrawables(true)
3535
.setEnableTextInCenter(true)
36-
.setDrawableStart(DrawableStart) //单独设置Drawable,以内部大小为准
3736
.setDrawableStart(DrawableStart, width, height) //设置Drawable 并定义其尺寸,单位是DP
38-
.setDrawableTop(DrawableTop)
37+
.setRadiusDP(10) //设置圆角,单位dp
3938
...
40-
41-
```
42-
39+
40+
```
41+
4342
#### 或者
44-
```
43+
```
4544
<com.flod.view.DrawableTextView
4645
android:id="@+id/dtv"
4746
android:layout_width="300dp"
@@ -55,7 +54,16 @@ drawableTextView.setEnableCenterDrawables(true)
5554
android:textSize="20sp"
5655
app:drawableStartHeight="50dp"
5756
app:drawableStartWidth="50dp"
57+
app:radius="10dp"
5858
app:enableCenterDrawables="true"
5959
app:enableTextInCenter="true" />
6060
```
6161

62+
## 属性说明
63+
64+
### XML
65+
属性名 | 类型 | 默认值 | 说明
66+
---|:--:|:--:|--:
67+
enableCenterDrawables | boolean | false | 是否文字与Drawable一起居中显示<br>(仅当gravity水平或垂直居中有效)
68+
enableTextInCenter | boolean | false | 是否文字在中心显示<br>(当enableCenterDrawables=true生效时有效果)
69+
radius|dimension|0|设置四边的圆角
193 KB
Binary file not shown.

0 commit comments

Comments
 (0)