侧边栏数据请求前移
This commit is contained in:
@@ -59,7 +59,7 @@ public class CustomDrawerPopupView extends DrawerPopupView {
|
||||
Bus.getOn(this);
|
||||
super.onCreate();
|
||||
initView();
|
||||
initData();
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -148,19 +148,24 @@ public class CustomDrawerPopupView extends DrawerPopupView {
|
||||
});
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
LiveNetManager.get(mContext)
|
||||
.getCustomSidebarInfo(new com.yunbao.common.http.base.HttpCallback<List<CustomSidebarInfoModel>>() {
|
||||
@Override
|
||||
public void onSuccess(List<CustomSidebarInfoModel> data) {
|
||||
adapter.updateData(data);
|
||||
}
|
||||
public void initData(List<CustomSidebarInfoModel> data) {
|
||||
if (data != null) {
|
||||
adapter.updateData(data);
|
||||
} else {
|
||||
LiveNetManager.get(mContext)
|
||||
.getCustomSidebarInfo(new com.yunbao.common.http.base.HttpCallback<List<CustomSidebarInfoModel>>() {
|
||||
@Override
|
||||
public void onSuccess(List<CustomSidebarInfoModel> data) {
|
||||
adapter.updateData(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private CustomDrawerPopupCallBack callBack;
|
||||
@@ -226,7 +231,7 @@ public class CustomDrawerPopupView extends DrawerPopupView {
|
||||
|
||||
}
|
||||
if (event.isRefresh()) {
|
||||
initData();
|
||||
initData(null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user