Allure0 / AndroidStateLayout

AndroidStateLayout 无侵入式支持任一层级添加Loading Empty Error Content内容

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AndroidStateLayout

无侵入任一层级添加EmptyView,ErrorView,LoadingView,ContentView

效果图

image

引入方式

compile 'com.allure0:AndroidStateLayout:1.0.0'

使用方式

Config in xml:

  <com.allure.statelayout.StateLayout
        android:id="@+id/state_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        
    </com.allure.statelayout.StateLayout>

Java调用方法

  • 设置EmptyView,ErrorView,LoadingView,ContentView
        stateLayout.setLoadingView();
        stateLayout.setContentView();
        stateLayout.setErrorView();
        stateLayout.setEmptyView();
  • 切换视图展示View
        stateLayout.showLoading()
        stateLayout.showError();
        stateLayout.showEmpty();
        stateLayout.showContent();
  • 重写切换动画
stateLayout.setStateChangeListener();

License

Copyright 2017 Allure

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

AndroidStateLayout 无侵入式支持任一层级添加Loading Empty Error Content内容


Languages

Language:Java 100.0%