Skip to content

honglei92/ShadowDrawable

 
 

Repository files navigation

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.

About

Android 阴影的实现

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 97.1%
  • Kotlin 2.9%