Skip to content

Commit

Permalink
update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
boyang committed Jun 22, 2020
1 parent 13f4258 commit 2e38600
Showing 1 changed file with 41 additions and 8 deletions.
49 changes: 41 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,11 @@ a background util that can easily create corner、stroke、shadow and the backgr
<center>

<figure>
<img src="screenshot/screen-one.png" width="48%"/>
<img src="screenshot/screen-gif.gif" width="48%"/>
<img src="screenshot/screen-two.png" width="48%"/>
</figure>
</center>

preview real-time when editing layout file

<figure>
<img src="screenshot/screen-two.png" width="60%"/>
</figure>


## Usage

### Step 1
Expand All @@ -42,3 +35,43 @@ dependencies {
implementation 'com.github.yangbo001:android-multibackground:1.0.0'
}
```

### Step 2

**set corner**

1、by layout xml
```xml
<support.background.extension.*View
...
app:background_corner_radius="4dp" />
<support.background.extension.*View
...
app:background_corner_radius=""
app:background_corner_radius_tl="4dp"
app:background_corner_radius_tr="4dp"
app:background_corner_radius_bl="4dp"
app:background_corner_radius_br="4dp"/>
```

2、by java code
```java
Drawable drawable = new BackgroundBuilder()
.setBackground(Color.WHITE)
.setCornerRadius(4)
// .setCornerRadii(4, 4, 4, 4)
.buildDrawable();
```

**set stroke**

```xml
<support.background.extension.*View
...
app:background_stroke_color="@color/colorAccent" <!--stroke color-->
app:background_stroke_width="2dp" /> <!--stroke width-->
<support.background.extension.*View
...
app:background_stroke_dash_width="4dp" <!--if dash_width large than zero, the stroke style is dashed-->
app:background_stroke_dash_gap="4dp"/> <!--the gap between dashed-->
```

0 comments on commit 2e38600

Please sign in to comment.