A completely customizable StateLayout.
Step 1. Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Step 2. Add the dependency
dependencies {
implementation 'com.github.eprendre:StateLayout:v0.2'
}
- Extends
StateLayout
. - Make sure each layout returned by
getStateLayouts
has an id. - Change layout by assigning
displayedChildId
with previously defined id.R.id.state_content
is reserved for content. - Add features as you need. See example CustomStateLayout, SimpleStateLayout.
Since this is a subclass of ViewAnimator
, you can set animation directly from layout.
<xxxStateLayout
...
android:inAnimation="@android:anim/fade_in"
android:outAnimation="@android:anim/fade_out"
>
Programmatically: setInAnimation();
setOutAnimation();