StateRelativeLayout helps you to manage between various UI states, for example, loading state, data state, error state, finish state. In architectural patterns such as the MVI pattern in android, you can use the StateRelativeLayout to maintain the state of the model by simply selecting the current state. This works perfectly with RxJava implemented in MVI pattern.
dependencies {
implementation 'com.github.tizisdeepan:staterelativelayout:1.0.0'
}
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
<com.deepan.staterelativelayout.StateRelativeLayout
android:id="@+id/stateManager"
android:layout_width="match_parent"
android:layout_height="match_parent">
</com.deepan.staterelativelayout.StateRelativeLayout>
stateManager.setState(R.id.redState)
Voila! You have implemented an awesome State Manager for your Android Project now!
- Deepan Elango - tizisdeepan@gmail.com