Simple way to change your layout state, like loading, empty, error. Strong customizitaion, written by Kotlin.
- simple API to use
- support Activity, Fragment, View
- support custom state layout
use in activity/fragment:
val stateLayout = StateLayout(this).wrap(this)
use for custom layout:
val layout2 = StateLayout(this).wrap(fl_custom)
custom default state layout:
StateLayout(this)
.setLoadingRes(R.layout.custom_loading)
.wrap(this)
change state api:
stateLayout.showLoading() //default state
stateLayout.showContent()
stateLayout.showError()
stateLayout.showEmpty()
compile 'com.lxj:statelayout:latest release'