File tree Expand file tree Collapse file tree 4 files changed +4
-11
lines changed
app/src/main/java/com/dylanc/loadingstateview/sample Expand file tree Collapse file tree 4 files changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,6 @@ public void onCreate() {
3737 pool .register (ViewType .LOADING , new LoadingViewDelegate ());
3838 pool .register (ViewType .ERROR , new ErrorViewDelegate ());
3939 pool .register (ViewType .EMPTY , new EmptyViewDelegate ());
40- return Unit .INSTANCE ;
4140 });
4241 }
4342}
Original file line number Diff line number Diff line change 2828 */
2929public class LoadingViewDelegate extends LoadingStateView .ViewDelegate <LoadingStateView .ViewHolder > {
3030
31- private int height = ViewGroup .LayoutParams .MATCH_PARENT ;
32-
33- public LoadingViewDelegate () {
34- }
35-
36- public LoadingViewDelegate (int height ) {
37- this .height = height ;
38- }
31+ public int height = ViewGroup .LayoutParams .MATCH_PARENT ;
3932
4033 @ NonNull
4134 @ Override
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ public void onReload() {
6464 HttpUtils .requestSuccess (new HttpUtils .Callback () {
6565 @ Override
6666 public void onSuccess () {
67- loadingStateView .showContentView (new FadeAnimation ());
67+ loadingStateView .showContentView (new FadeAnimation ());
6868 }
6969
7070 @ Override
Original file line number Diff line number Diff line change @@ -41,7 +41,8 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
4141 super .onCreate (savedInstanceState );
4242 setContentView (R .layout .activity_scrolling );
4343 loadingStateView = ToolbarUtils .setScrollingToolbar (this , "SpecialDecorView(scrolling)" );
44- loadingStateView .register (ViewType .LOADING , new LoadingViewDelegate (ViewGroup .LayoutParams .WRAP_CONTENT ));
44+ LoadingViewDelegate viewDelegate = loadingStateView .getViewDelegate (ViewType .LOADING );
45+ viewDelegate .height = ViewGroup .LayoutParams .WRAP_CONTENT ;
4546 loadData ();
4647 }
4748
You can’t perform that action at this time.
0 commit comments