Skip to content

wthsjy/wtLoadContainer

Repository files navigation

wtLoadContainer

可配置不同状态子布局的( 加载中,没有数据,网络错误) 自定义View

dependencies {
 compile 'com.wt.load.container.core:wtLoadContainerCore:1.0'
}

###Demo [apk demo]

####用法,类似 scrollView

app:childDataViewId:你的真实数据布局
app:dataLoadingView: 加载中布局,默认为progeressbar   @layout/wt_load_detault_data_loading_view
app:networkErrorView: 网络异常布局,默认为imageView   @layout/wt_load_detault_network_error_view
app:noDataView: 没有数据的布局,默认为imageView       @layout/wt_load_detault_no_data_view



            <com.wt.load.container.core.WTLoadContainerView
                android:id="@+id/wt_load_container1"
                android:layout_width="match_parent"
                android:layout_height="100dp"
                app:childDataViewId="@+id/child01"
                app:dataLoadingView="@layout/wt_load_detault_data_loading_view"
                app:networkErrorView="@layout/wt_load_detault_network_error_view"
                app:noDataView="@layout/wt_load_detault_no_data_view"
                app:showLoadingViewInitialize="true">

                <TextView
                    android:id="@+id/child01"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:text="Large Text11"
                    android:textAppearance="?android:attr/textAppearanceLarge"/>

            </com.wt.load.container.core.WTLoadContainerView>
            

####java 监听事件


  ...
  @Bind(R.id.wt_load_container1) WTLoadContainerView wtLoadContainer1;
  ...

     wtLoadContainer1.setLoadContainerActionListener(new WTLoadContainerView.LoadContainerActionListener() {
            @Override public void onNetWorkErrorViewClick(WTLoadContainerView view) {

            }

            @Override public void onNoDataViewClick(WTLoadContainerView view) {

            }
        });

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages