ComposeAdvancedShadow
is a powerful Android Compose library that enables developers to easily create
and customize stunning, high-quality shadows for their UI elements.
Features
- Create custom shadows with
offset
,color
,spread
andblur
support using Android Compose. - Shadows implemented using View.LAYER_TYPE_SOFTWARE to render correctly in android api < 28
- Highly customizable
To view sample app just download apk from releases, or clone this repository to discover
Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Then add the dependency
dependencies {
implementation 'com.github.alibardide5124:ComposeAdvancedShadow:{latest-version}'
}
ComposeAdvancedShadow
gives you a custom Modifier
named advancedShadow
. It has following params:
Param | Description |
---|---|
color |
Color of the shadow |
borderRadius |
Border radius for rounded layout |
blurRadius |
Amount of shadow blur |
offsetY |
Set offsetY of shadow |
offsetX |
Set offsetX of shadow |
spread |
Amount of shadow spread |
alpha |
Shadow Color Alpha. Its recommended to use alpha for better shadows |
Use Modifier.advancedShadow(...)
inside a layout with View.LAYER_TYPE_SOFTWARE
enabled to prevent render issues
in api < 28. For that you can use AdvancedShadowContainer
or just set it manualy in your layout
If you like this application, just support it by joining stargazers for this repository
And follow me for my next creations
ComposeAdvancedShadow by Ali Bardide is licensed under a Apache License 2.0.
Special thanks to the GoDaddy for color picker library.