congtaowang / StateLayout

Simple way to change your layout state, like loading, empty, error. Strong customizitaion, written by Kotlin.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

StateLayout

Simple way to change your layout state, like loading, empty, error. Strong customizitaion, written by Kotlin.

Feature

  • simple API to use
  • support Activity, Fragment, View
  • support custom state layout

ScreenShot

StateLayout

Usage

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()

Gradle

Download

compile 'com.lxj:statelayout:latest release'

About

Simple way to change your layout state, like loading, empty, error. Strong customizitaion, written by Kotlin.


Languages

Language:Kotlin 100.0%