Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengcx authored May 2, 2018
1 parent 67afd21 commit c5452f0
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,35 @@
A library to add shadows for the Android View.(一个方便为Android View添加自然的阴影的库)

![demo.gif](https://github.com/zhengcx/ShadowHelper/blob/master/shadowhelper.gif)

#How to use
1.**Step 1:** Add the JitPack repository to your build file
```gradle
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```

2.**Step 2:** Add the dependency
```gradle
dependencies {
compile 'com.github.zhengcx:ShadowHelper:v1.0'
}
```

3.Use in Java code like this:
```java
TextView textView1 = findViewById(R.id.tv_1);
ShadowConfig.Builder config = new ShadowConfig.Builder()
.setColor(mColor[0])//View颜色
.setShadowColor(mShadowColor)//阴影颜色
.setGradientColorArray(mColor)//如果View是渐变色,则设置color数组
.setRadius(mRadius)//圆角
.setOffsetX(mOffsetX)//横向偏移
.setOffsetY(mOffsetY);//纵向偏移

ShadowHelper.setShadowBgForView(textView1, config);
```

0 comments on commit c5452f0

Please sign in to comment.