Android 阴影的实现
Switch branches/tags
Nothing to show
Clone or download
juhonggang
juhonggang update readme
Latest commit adaa494 Sep 13, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea update readme Sep 13, 2018
app update readme Sep 13, 2018
gradle/wrapper first commit Apr 26, 2018
shadowdrawable update readme Sep 13, 2018
.gitignore first commit Apr 26, 2018
Readme.md update readme Sep 13, 2018
build.gradle first commit Apr 26, 2018
gradle.properties first commit Apr 26, 2018
gradlew first commit Apr 26, 2018
gradlew.bat first commit Apr 26, 2018
settings.gradle first commit Apr 26, 2018

Readme.md

image image

添加依赖

在项目的build.gradle中添加:

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

在APP模块下的build.gradle中添加依赖:

dependencies {
    implementation 'com.github.JuHonggang:ShadowDrawable:0.1'
}

使用

通过一行代码即可实现阴影效果

ShadowDrawable.setShadowDrawable(textView1, Color.parseColor("#3D5AFE"), dpToPx(8),
    Color.parseColor("#66000000"), dpToPx(10), 0, 0);

详细介绍可参考:Android开发中阴影效果的实现

阴影效果

image

License

Copyright (c) 2018 Freeman

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.