Skip to content
A library to add shadows for the Android View.(一个方便为Android View添加自然的阴影的库)
Java
Branch: master
Clone or download
Latest commit 1d96c39 Oct 5, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea commit vcs May 2, 2018
app
gradle/wrapper first commit May 2, 2018
library first commit May 2, 2018
.gitignore
README.md Update README.md Oct 5, 2019
build.gradle first commit May 2, 2018
gradle.properties first commit May 2, 2018
gradlew first commit May 2, 2018
gradlew.bat first commit May 2, 2018
settings.gradle
shadowhelper.gif first commit May 2, 2018

README.md

ShadowHelper

A library to add shadows for the Android View.(一个方便为Android View添加自然的阴影的库)

demo.gif

How to use

1.Step 1: Add the JitPack repository to your build file

allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

2.Step 2: Add the dependency

dependencies {
	        compile 'com.github.zhengcx:ShadowHelper:v1.0'
	}

3.Step 3: Use in Java code like this:

 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);

End 欢迎Star/Fork/Issue.

License

Apache2.0.

About Me

You can’t perform that action at this time.