AndroidVeil
A library that let you implement skeletons and shimmer animation for veiling layouts and recyclerView.
Download
Gradle
Add below codes to your root build.gradle
file (not your module build.gradle file).
And add a dependency code to your module's build.gradle
file.
Usage
First, add following XML namespace inside your XML layout file.
VeilLayout in layout
Veil and UnVeil
You can implement veil skeletons using below methods.
Implement veils using layout resource
You can implement veils using the layout resource without any child.
VeilRecyclerFrameView
VeilRecyclerFrameView
lets implement skeletons and shimmer animation about RecyclerView.
VeilRecyclerFrameView in layout
And you should attach your own adapter and LayoutManager.
Veil and UnVeil
You can implement veil skeletons using below methods.
RecyclerView
You can access recyclerview and veiledRecyclerView using below methods.
Shimmer
This library is used shimmer-android by Facebook.
So you can customizing shimmer following by shimmer-instruction or following example.
Attributes
Attributes | Type | Default | Description |
---|---|---|---|
veiled | Boolean | false | shows veils initially. |
layout | Int | -1 | implement veils using the layout resource. |
shimmerEnable | Boolean | true | sets shimmer enable. |
baseColor | ColorInt | Color.LTGRAY | sets shimmer base color. |
highlightColor | ColorInt | Color.DKGRAY | sets shimmer highlight color. |
baseAlpha | Float | 1.0f | sets shimmer base alpha value. |
highlightAlpha | Float | 1.0f | sets shimmer highlight alpha value. |
dropOff | Float | 0.5f | sets how quickly the shimmer's gradient drops-off. |