Skip to content

Commit 18eaea4

Browse files
author
miaoyongjun
committed
modify
1 parent 3a4bc94 commit 18eaea4

1 file changed

Lines changed: 60 additions & 2 deletions

File tree

README.md

Lines changed: 60 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,60 @@
1-
# Sticker
2-
贴纸 Sticker
1+
# Sticker [![](https://jitpack.io/v/miaoyongjun/Sticker.svg)](https://jitpack.io/#miaoyongjun/Sticker)
2+
3+
贴纸¸ Sticker
4+
5+
> 感谢好友 **Vincent** 提供的思路以及关键代码!
6+
7+
### 依赖
8+
9+
```
10+
allprojects {
11+
repositories {
12+
...
13+
maven { url 'https://jitpack.io' }
14+
}
15+
}
16+
17+
dependencies {
18+
compile 'com.github.miaoyongjun:Sticker:1.0'
19+
}
20+
```
21+
22+
### 使用
23+
24+
25+
26+
```java
27+
<miaoyongjun.stickerview.StickerView
28+
android:id="@+id/stickerView"
29+
android:layout_width="match_parent"
30+
android:layout_height="match_parent"
31+
android:scaleType="centerCrop"
32+
android:src="@drawable/bg"/>
33+
```
34+
35+
### 自定义属性
36+
37+
```java
38+
<!--初始图片大小缩放比例 默认为0.5f 相对于view的宽度-->
39+
<attr name="m_image_init_scale" format="float"/>
40+
<!--贴纸的最大数量 默认为20-->
41+
<attr name="m_max_count" format="integer"/>
42+
<!--贴纸最小值的缩放比例 默认初始图片斜边的二分之一 根据宽度来定制-->
43+
<attr name="m_image_min_size_scale" format="float"/>
44+
<!--关闭按钮图标-->
45+
<attr name="m_close_icon" format="reference"/>
46+
<!--旋转按钮图标-->
47+
<attr name="m_rotate_icon" format="reference"/>
48+
<!--关闭按钮图标大小 默认15dp-->
49+
<attr name="m_close_icon_size" format="dimension"/>
50+
<!--旋转按钮图标大小 默认15dp-->
51+
<attr name="m_rotate_icon_size" format="dimension"/>
52+
<!--边框宽度 默认1dp-->
53+
<attr name="m_outline_width" format="dimension"/>
54+
<!--边框颜色 默认白色-->
55+
<attr name="m_outline_color" format="color"/>
56+
```
57+
58+
### 后续计划
59+
60+
- 文字水印和标签

0 commit comments

Comments
 (0)