Commit c5cbdffa4028f681c60fb90bbd44bf3c8d796bda
1 parent
d8755a36
数据加载弹窗问题,日期选择问题
Showing
16 changed files
with
44 additions
and
128 deletions
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/frame/presenter/RaceListPresenter.java
| ... | ... | @@ -11,6 +11,7 @@ import com.cnlive.moudle.pedometer.net.ApiServiceRunLin; |
| 11 | 11 | import com.cnlive.moudle.pedometer.net.SubscriptionRequest; |
| 12 | 12 | import com.cnlive.moudle.pedometer.net.bean.BaseInfo; |
| 13 | 13 | import com.cnlive.moudle.pedometer.net.bean.RunLineInfo; |
| 14 | +import com.cnlive.moudle.pedometer.utils.QMUITipDialogUtil; | |
| 14 | 15 | import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter; |
| 15 | 16 | |
| 16 | 17 | import java.util.HashMap; |
| ... | ... | @@ -29,7 +30,7 @@ public class RaceListPresenter extends MvpBasePresenter<RaceListView> { |
| 29 | 30 | map.put("pageNo", pageNo+""); |
| 30 | 31 | map.put("state","1"); |
| 31 | 32 | map.put("pageSize", pageSize+""); |
| 32 | - getView().showLoading(); | |
| 33 | + QMUITipDialogUtil.loadingDialog(context, "正在加载数据", true); | |
| 33 | 34 | Logic.create(map).action(new Logic.Action<Map<String, String>, BaseInfo<RunLineInfo>>() { |
| 34 | 35 | @Override |
| 35 | 36 | public Disposable action(Map<String, String> stringStringMap, DataCallback<BaseInfo<RunLineInfo>> dataCallback) { |
| ... | ... | @@ -40,7 +41,7 @@ public class RaceListPresenter extends MvpBasePresenter<RaceListView> { |
| 40 | 41 | public void onFailure(int code, String message) { |
| 41 | 42 | if (getView() != null) { |
| 42 | 43 | getView().showErr(message); |
| 43 | - getView().hideLoading(); | |
| 44 | + QMUITipDialogUtil.dismessDialog(); | |
| 44 | 45 | } |
| 45 | 46 | } |
| 46 | 47 | }).setSuccessCallback(new SuccessCallback<BaseInfo<RunLineInfo>>() { |
| ... | ... | @@ -48,6 +49,7 @@ public class RaceListPresenter extends MvpBasePresenter<RaceListView> { |
| 48 | 49 | public void onSuccess(BaseInfo<RunLineInfo> registerInfo) { |
| 49 | 50 | if (getView() != null){ |
| 50 | 51 | getView().onSuccess(registerInfo); |
| 52 | + QMUITipDialogUtil.dismessDialog(); | |
| 51 | 53 | } |
| 52 | 54 | } |
| 53 | 55 | }).start(); | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/frame/presenter/RaceNameListPresenter.java
| ... | ... | @@ -38,7 +38,7 @@ public class RaceNameListPresenter extends MvpBasePresenter<RaceNameListView> { |
| 38 | 38 | map.put("eventId", eventId); |
| 39 | 39 | map.put("pageNo", pageNo + ""); |
| 40 | 40 | map.put("pageSize", pageSize + ""); |
| 41 | - getView().showLoading(); | |
| 41 | + QMUITipDialogUtil.loadingDialog(context, "正在加载数据", true); | |
| 42 | 42 | Logic.create(map).action(new Logic.Action<Map<String, String>, BaseInfo<RaceNameListInfo>>() { |
| 43 | 43 | @Override |
| 44 | 44 | public Disposable action(Map<String, String> stringStringMap, DataCallback<BaseInfo<RaceNameListInfo>> dataCallback) { |
| ... | ... | @@ -49,7 +49,7 @@ public class RaceNameListPresenter extends MvpBasePresenter<RaceNameListView> { |
| 49 | 49 | public void onFailure(int code, String message) { |
| 50 | 50 | if (getView() != null) { |
| 51 | 51 | getView().showErr(message); |
| 52 | - getView().hideLoading(); | |
| 52 | + QMUITipDialogUtil.dismessDialog(); | |
| 53 | 53 | } |
| 54 | 54 | } |
| 55 | 55 | }).setSuccessCallback(new SuccessCallback<BaseInfo<RaceNameListInfo>>() { |
| ... | ... | @@ -57,6 +57,7 @@ public class RaceNameListPresenter extends MvpBasePresenter<RaceNameListView> { |
| 57 | 57 | public void onSuccess(BaseInfo<RaceNameListInfo> registerInfo) { |
| 58 | 58 | if (getView() != null) { |
| 59 | 59 | getView().onSuccess(registerInfo); |
| 60 | + QMUITipDialogUtil.dismessDialog(); | |
| 60 | 61 | } |
| 61 | 62 | } |
| 62 | 63 | }).start(); |
| ... | ... | @@ -71,6 +72,7 @@ public class RaceNameListPresenter extends MvpBasePresenter<RaceNameListView> { |
| 71 | 72 | public void delectShoeLine(Context context, int id, int position) { |
| 72 | 73 | Map<String, String> map = new HashMap<>(); |
| 73 | 74 | map.put("id", id + ""); |
| 75 | + QMUITipDialogUtil.loadingDialog(context, "正在删除", false); | |
| 74 | 76 | Logic.create(map).action(new Logic.Action<Map<String, String>, BaseInfo<ShoeDelectInfo>>() { |
| 75 | 77 | @Override |
| 76 | 78 | public Disposable action(Map<String, String> stringStringMap, DataCallback<BaseInfo<ShoeDelectInfo>> dataCallback) { |
| ... | ... | @@ -81,14 +83,14 @@ public class RaceNameListPresenter extends MvpBasePresenter<RaceNameListView> { |
| 81 | 83 | public void onFailure(int code, String message) { |
| 82 | 84 | if (getView() != null) { |
| 83 | 85 | getView().showToast(message); |
| 84 | - getView().hideLoading(); | |
| 86 | + QMUITipDialogUtil.dismessDialog(); | |
| 85 | 87 | } |
| 86 | 88 | } |
| 87 | 89 | }).setSuccessCallback(new SuccessCallback<BaseInfo<ShoeDelectInfo>>() { |
| 88 | 90 | @Override |
| 89 | 91 | public void onSuccess(BaseInfo<ShoeDelectInfo> baseInfo) { |
| 90 | 92 | if (getView() != null) { |
| 91 | - getView().hideLoading(); | |
| 93 | + QMUITipDialogUtil.dismessDialog(); | |
| 92 | 94 | if(baseInfo.getData().getIsBind() != null && baseInfo.getData().getIsBind().equals("1")){ |
| 93 | 95 | getView().delectShoeLine(position); |
| 94 | 96 | }else if(baseInfo.getData().getIsBind() != null && baseInfo.getData().getIsBind().equals("-1")){ |
| ... | ... | @@ -110,13 +112,12 @@ public class RaceNameListPresenter extends MvpBasePresenter<RaceNameListView> { |
| 110 | 112 | * @param eventId 赛事id |
| 111 | 113 | */ |
| 112 | 114 | public void bindingShoeLine(Context context, int id, String eventId, String fenceId, String fenceName, int position) { |
| 113 | - QMUITipDialogUtil.loadingDialog(context, "正在绑定轨迹...", false); | |
| 114 | 115 | Map<String, String> map = new HashMap<>(); |
| 115 | 116 | map.put("id", id + ""); |
| 116 | 117 | map.put("eventId", eventId); |
| 117 | 118 | map.put("fenceId", fenceId); |
| 118 | 119 | map.put("fenceName", fenceName); |
| 119 | - | |
| 120 | + QMUITipDialogUtil.loadingDialog(context, "正在绑定轨迹...", false); | |
| 120 | 121 | Logic.create(map).action(new Logic.Action<Map<String, String>, BaseInfo<BindingShoeInfo>>() { |
| 121 | 122 | @Override |
| 122 | 123 | public Disposable action(Map<String, String> stringStringMap, DataCallback<BaseInfo<BindingShoeInfo>> dataCallback) { |
| ... | ... | @@ -128,7 +129,7 @@ public class RaceNameListPresenter extends MvpBasePresenter<RaceNameListView> { |
| 128 | 129 | if (getView() != null) { |
| 129 | 130 | QMUITipDialogUtil.dismessDialog(); |
| 130 | 131 | getView().showToast(message); |
| 131 | - getView().hideLoading(); | |
| 132 | + QMUITipDialogUtil.dismessDialog(); | |
| 132 | 133 | } |
| 133 | 134 | } |
| 134 | 135 | }).setSuccessCallback(new SuccessCallback<BaseInfo<BindingShoeInfo>>() { | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/frame/view/RaceListView.java
| ... | ... | @@ -24,16 +24,11 @@ import java.util.List; |
| 24 | 24 | public class RaceListView implements MvpView { |
| 25 | 25 | |
| 26 | 26 | private RaceListFragment fragment; |
| 27 | - public QMUITipDialog loadingDiaog; | |
| 28 | 27 | private List<RunLineInfo.ListBean> list = new ArrayList<>(); |
| 29 | 28 | private RunListAdapter adapter; |
| 30 | 29 | |
| 31 | 30 | public RaceListView(RaceListFragment fragment) { |
| 32 | 31 | this.fragment = fragment; |
| 33 | - loadingDiaog = new QMUITipDialog.Builder(fragment.getActivity()) | |
| 34 | - .setIconType(QMUITipDialog.Builder.ICON_TYPE_LOADING) | |
| 35 | - .setTipWord("请稍后") | |
| 36 | - .create(); | |
| 37 | 32 | } |
| 38 | 33 | |
| 39 | 34 | public void initView(){ |
| ... | ... | @@ -47,7 +42,6 @@ public class RaceListView implements MvpView { |
| 47 | 42 | } |
| 48 | 43 | |
| 49 | 44 | public void onSuccess(BaseInfo<RunLineInfo> runLineInfoBaseInfo){ |
| 50 | - hideLoading(); | |
| 51 | 45 | if(fragment.currentPage == 1){ |
| 52 | 46 | list.clear(); |
| 53 | 47 | list.addAll(runLineInfoBaseInfo.getData().getList()); |
| ... | ... | @@ -120,13 +114,4 @@ public class RaceListView implements MvpView { |
| 120 | 114 | fragment.binding.empty.show("没有相关数据", "", R.drawable.zhuangtai_kong); |
| 121 | 115 | } |
| 122 | 116 | |
| 123 | - | |
| 124 | - public void showLoading() { | |
| 125 | - if (loadingDiaog != null) loadingDiaog.show(); | |
| 126 | - } | |
| 127 | - | |
| 128 | - public void hideLoading() { | |
| 129 | - if (loadingDiaog != null) loadingDiaog.dismiss(); | |
| 130 | - } | |
| 131 | - | |
| 132 | 117 | } | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/frame/view/RaceNameListView.java
| ... | ... | @@ -59,7 +59,6 @@ import java.util.List; |
| 59 | 59 | public class RaceNameListView implements MvpView, OnFenceListener { |
| 60 | 60 | private final String TAG = "RaceNameListView"; |
| 61 | 61 | RaceNameListFragment fragment; |
| 62 | - public QMUITipDialog loadingDiaog; | |
| 63 | 62 | List<RaceNameListInfo.EventShoeLinesBean> list = new ArrayList<>(); |
| 64 | 63 | private RaceNameListAdapter adapter; |
| 65 | 64 | private LBSTraceClient mClient = null; |
| ... | ... | @@ -69,10 +68,6 @@ public class RaceNameListView implements MvpView, OnFenceListener { |
| 69 | 68 | |
| 70 | 69 | public RaceNameListView(RaceNameListFragment fragment) { |
| 71 | 70 | this.fragment = fragment; |
| 72 | - loadingDiaog = new QMUITipDialog.Builder(fragment.getActivity()) | |
| 73 | - .setIconType(QMUITipDialog.Builder.ICON_TYPE_LOADING) | |
| 74 | - .setTipWord("请稍后") | |
| 75 | - .create(); | |
| 76 | 71 | } |
| 77 | 72 | |
| 78 | 73 | |
| ... | ... | @@ -118,7 +113,6 @@ public class RaceNameListView implements MvpView, OnFenceListener { |
| 118 | 113 | } |
| 119 | 114 | |
| 120 | 115 | public void onSuccess(BaseInfo<RaceNameListInfo> raceNameListInfoBaseInfo) { |
| 121 | - hideLoading(); | |
| 122 | 116 | if (fragment.currentPage == 1) { |
| 123 | 117 | list.clear(); |
| 124 | 118 | list.addAll(raceNameListInfoBaseInfo.getData().getEventShoeLines()); |
| ... | ... | @@ -313,19 +307,6 @@ public class RaceNameListView implements MvpView, OnFenceListener { |
| 313 | 307 | } |
| 314 | 308 | |
| 315 | 309 | |
| 316 | - public void showLoading() { | |
| 317 | - if (loadingDiaog != null) { | |
| 318 | - loadingDiaog.show(); | |
| 319 | - } | |
| 320 | - } | |
| 321 | - | |
| 322 | - public void hideLoading() { | |
| 323 | - if (loadingDiaog != null) { | |
| 324 | - loadingDiaog.dismiss(); | |
| 325 | - } | |
| 326 | - } | |
| 327 | - | |
| 328 | - | |
| 329 | 310 | /** |
| 330 | 311 | * 查询地理围栏 |
| 331 | 312 | */ | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/presenter/MyRecordPresenter.java
| ... | ... | @@ -11,6 +11,7 @@ import com.cnlive.moudle.pedometer.net.ApiServiceRunLin; |
| 11 | 11 | import com.cnlive.moudle.pedometer.net.SubscriptionRequest; |
| 12 | 12 | import com.cnlive.moudle.pedometer.net.bean.BaseInfo; |
| 13 | 13 | import com.cnlive.moudle.pedometer.net.bean.MyRecordInfo; |
| 14 | +import com.cnlive.moudle.pedometer.utils.QMUITipDialogUtil; | |
| 14 | 15 | import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter; |
| 15 | 16 | |
| 16 | 17 | import java.util.HashMap; |
| ... | ... | @@ -29,7 +30,7 @@ public class MyRecordPresenter extends MvpBasePresenter<MyRecordView> { |
| 29 | 30 | map.put("pageNo", pageNo + ""); |
| 30 | 31 | map.put("state", state); |
| 31 | 32 | map.put("pageSize", pageSize + ""); |
| 32 | - getView().showLoading(); | |
| 33 | + QMUITipDialogUtil.loadingDialog(context, "正在加载数据", true); | |
| 33 | 34 | Logic.create(map).action(new Logic.Action<Map<String, String>, BaseInfo<MyRecordInfo>>() { |
| 34 | 35 | @Override |
| 35 | 36 | public Disposable action(Map<String, String> stringStringMap, DataCallback<BaseInfo<MyRecordInfo>> dataCallback) { |
| ... | ... | @@ -40,7 +41,7 @@ public class MyRecordPresenter extends MvpBasePresenter<MyRecordView> { |
| 40 | 41 | public void onFailure(int code, String message) { |
| 41 | 42 | if (getView() != null) { |
| 42 | 43 | getView().showErr(message); |
| 43 | - getView().hideLoading(); | |
| 44 | + QMUITipDialogUtil.dismessDialog(); | |
| 44 | 45 | } |
| 45 | 46 | } |
| 46 | 47 | }).setSuccessCallback(new SuccessCallback<BaseInfo<MyRecordInfo>>() { |
| ... | ... | @@ -48,6 +49,7 @@ public class MyRecordPresenter extends MvpBasePresenter<MyRecordView> { |
| 48 | 49 | public void onSuccess(BaseInfo<MyRecordInfo> registerInfo) { |
| 49 | 50 | if (getView() != null) { |
| 50 | 51 | getView().onSuccess(registerInfo); |
| 52 | + QMUITipDialogUtil.dismessDialog(); | |
| 51 | 53 | } |
| 52 | 54 | } |
| 53 | 55 | }).start(); | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/presenter/RaceRecorPresenter.java
| ... | ... | @@ -12,6 +12,7 @@ import com.cnlive.moudle.pedometer.net.SubscriptionRequest; |
| 12 | 12 | import com.cnlive.moudle.pedometer.net.bean.BaseInfo; |
| 13 | 13 | import com.cnlive.moudle.pedometer.net.bean.EventRouteRecordBeanVoListBean; |
| 14 | 14 | import com.cnlive.moudle.pedometer.net.bean.RaceRecordInfo; |
| 15 | +import com.cnlive.moudle.pedometer.utils.QMUITipDialogUtil; | |
| 15 | 16 | import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter; |
| 16 | 17 | |
| 17 | 18 | import java.util.ArrayList; |
| ... | ... | @@ -32,7 +33,7 @@ public class RaceRecorPresenter extends MvpBasePresenter<RaceRecorView> { |
| 32 | 33 | map.put("sid", sid); |
| 33 | 34 | map.put("pageNo", pageNo+""); |
| 34 | 35 | map.put("pageSize", pageSize+""); |
| 35 | - getView().showLoading(); | |
| 36 | + QMUITipDialogUtil.loadingDialog(context, "正在加载数据", true); | |
| 36 | 37 | Logic.create(map).action(new Logic.Action<Map<String, String>, BaseInfo<RaceRecordInfo>>() { |
| 37 | 38 | @Override |
| 38 | 39 | public Disposable action(Map<String, String> stringStringMap, DataCallback<BaseInfo<RaceRecordInfo>> dataCallback) { |
| ... | ... | @@ -43,7 +44,7 @@ public class RaceRecorPresenter extends MvpBasePresenter<RaceRecorView> { |
| 43 | 44 | public void onFailure(int code, String message) { |
| 44 | 45 | if (getView() != null) { |
| 45 | 46 | getView().showError(message); |
| 46 | - getView().hideLoading(); | |
| 47 | + QMUITipDialogUtil.dismessDialog(); | |
| 47 | 48 | } |
| 48 | 49 | } |
| 49 | 50 | }).setSuccessCallback(new SuccessCallback<BaseInfo<RaceRecordInfo>>() { |
| ... | ... | @@ -51,6 +52,7 @@ public class RaceRecorPresenter extends MvpBasePresenter<RaceRecorView> { |
| 51 | 52 | public void onSuccess(BaseInfo<RaceRecordInfo> registerInfo) { |
| 52 | 53 | if (getView() != null){ |
| 53 | 54 | getView().setData(registerInfo); |
| 55 | + QMUITipDialogUtil.dismessDialog(); | |
| 54 | 56 | } |
| 55 | 57 | } |
| 56 | 58 | }).start(); | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/presenter/RunLinePresenter.java
| 1 | 1 | package com.cnlive.moudle.pedometer.frame.presenter; |
| 2 | 2 | |
| 3 | 3 | import android.content.Context; |
| 4 | +import android.util.Log; | |
| 4 | 5 | |
| 5 | 6 | import com.cnlive.libs.base.logic.Logic; |
| 6 | 7 | import com.cnlive.libs.base.logic.callback.DataCallback; |
| ... | ... | @@ -11,6 +12,7 @@ import com.cnlive.moudle.pedometer.net.ApiServiceRunLin; |
| 11 | 12 | import com.cnlive.moudle.pedometer.net.SubscriptionRequest; |
| 12 | 13 | import com.cnlive.moudle.pedometer.net.bean.BaseInfo; |
| 13 | 14 | import com.cnlive.moudle.pedometer.net.bean.RunLineInfo; |
| 15 | +import com.cnlive.moudle.pedometer.utils.QMUITipDialogUtil; | |
| 14 | 16 | import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter; |
| 15 | 17 | |
| 16 | 18 | import java.util.HashMap; |
| ... | ... | @@ -29,7 +31,7 @@ public class RunLinePresenter extends MvpBasePresenter<RunLineView> { |
| 29 | 31 | map.put("pageNo", pageNo+""); |
| 30 | 32 | map.put("state","0"); |
| 31 | 33 | map.put("pageSize", pageSize+""); |
| 32 | - getView().showLoading(); | |
| 34 | + QMUITipDialogUtil.loadingDialog(context, "正在加载数据", true); | |
| 33 | 35 | Logic.create(map).action(new Logic.Action<Map<String, String>, BaseInfo<RunLineInfo>>() { |
| 34 | 36 | @Override |
| 35 | 37 | public Disposable action(Map<String, String> stringStringMap, DataCallback<BaseInfo<RunLineInfo>> dataCallback) { |
| ... | ... | @@ -40,7 +42,7 @@ public class RunLinePresenter extends MvpBasePresenter<RunLineView> { |
| 40 | 42 | public void onFailure(int code, String message) { |
| 41 | 43 | if (getView() != null) { |
| 42 | 44 | getView().showErr(message); |
| 43 | - getView().hideLoading(); | |
| 45 | + QMUITipDialogUtil.dismessDialog(); | |
| 44 | 46 | } |
| 45 | 47 | } |
| 46 | 48 | }).setSuccessCallback(new SuccessCallback<BaseInfo<RunLineInfo>>() { |
| ... | ... | @@ -48,6 +50,7 @@ public class RunLinePresenter extends MvpBasePresenter<RunLineView> { |
| 48 | 50 | public void onSuccess(BaseInfo<RunLineInfo> registerInfo) { |
| 49 | 51 | if (getView() != null){ |
| 50 | 52 | getView().onSuccess(registerInfo); |
| 53 | + QMUITipDialogUtil.dismessDialog(); | |
| 51 | 54 | } |
| 52 | 55 | } |
| 53 | 56 | }).start(); | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/presenter/SelfRecordPresenter.java
| ... | ... | @@ -11,6 +11,7 @@ import com.cnlive.moudle.pedometer.net.ApiServiceRunLin; |
| 11 | 11 | import com.cnlive.moudle.pedometer.net.SubscriptionRequest; |
| 12 | 12 | import com.cnlive.moudle.pedometer.net.bean.BaseInfo; |
| 13 | 13 | import com.cnlive.moudle.pedometer.net.bean.SelfRecordInfo; |
| 14 | +import com.cnlive.moudle.pedometer.utils.QMUITipDialogUtil; | |
| 14 | 15 | import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter; |
| 15 | 16 | |
| 16 | 17 | import java.util.HashMap; |
| ... | ... | @@ -30,7 +31,7 @@ public class SelfRecordPresenter extends MvpBasePresenter<SelfRecordView> { |
| 30 | 31 | map.put("completeStatus",completeStatus+""); |
| 31 | 32 | map.put("pageNo", pageNo+""); |
| 32 | 33 | map.put("pageSize",pageSize+""); |
| 33 | - getView().showLoading(); | |
| 34 | + QMUITipDialogUtil.loadingDialog(context, "正在加载数据", true); | |
| 34 | 35 | Logic.create(map).action(new Logic.Action<Map<String, String>, BaseInfo<SelfRecordInfo>>() { |
| 35 | 36 | @Override |
| 36 | 37 | public Disposable action(Map<String, String> stringStringMap, DataCallback<BaseInfo<SelfRecordInfo>> dataCallback) { |
| ... | ... | @@ -41,7 +42,7 @@ public class SelfRecordPresenter extends MvpBasePresenter<SelfRecordView> { |
| 41 | 42 | public void onFailure(int code, String message) { |
| 42 | 43 | if (getView() != null) { |
| 43 | 44 | getView().showError(message); |
| 44 | - getView().hideLoading(); | |
| 45 | + QMUITipDialogUtil.dismessDialog(); | |
| 45 | 46 | } |
| 46 | 47 | } |
| 47 | 48 | }).setSuccessCallback(new SuccessCallback<BaseInfo<SelfRecordInfo>>() { |
| ... | ... | @@ -49,6 +50,7 @@ public class SelfRecordPresenter extends MvpBasePresenter<SelfRecordView> { |
| 49 | 50 | public void onSuccess(BaseInfo<SelfRecordInfo> selfRecordInfoBaseInfo) { |
| 50 | 51 | if (getView() != null){ |
| 51 | 52 | getView().setData(selfRecordInfoBaseInfo); |
| 53 | + QMUITipDialogUtil.dismessDialog(); | |
| 52 | 54 | } |
| 53 | 55 | } |
| 54 | 56 | }).start(); | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/presenter/TakePartPresenter.java
| ... | ... | @@ -11,6 +11,7 @@ import com.cnlive.moudle.pedometer.net.ApiServiceRunLin; |
| 11 | 11 | import com.cnlive.moudle.pedometer.net.SubscriptionRequest; |
| 12 | 12 | import com.cnlive.moudle.pedometer.net.bean.BaseInfo; |
| 13 | 13 | import com.cnlive.moudle.pedometer.net.bean.TakePartPeopleInfo; |
| 14 | +import com.cnlive.moudle.pedometer.utils.QMUITipDialogUtil; | |
| 14 | 15 | import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter; |
| 15 | 16 | |
| 16 | 17 | import java.util.HashMap; |
| ... | ... | @@ -28,7 +29,7 @@ public class TakePartPresenter extends MvpBasePresenter<TakePartView> { |
| 28 | 29 | map.put("eventId", eventId); |
| 29 | 30 | map.put("pageNo", pageNo+""); |
| 30 | 31 | map.put("pageSize", pageSize+""); |
| 31 | - if (getView() != null && pageNo ==1) getView().showLoading(); | |
| 32 | + QMUITipDialogUtil.loadingDialog(context, "正在加载数据", true); | |
| 32 | 33 | Logic.create(map).action(new Logic.Action<Map<String, String>, BaseInfo<TakePartPeopleInfo>>() { |
| 33 | 34 | @Override |
| 34 | 35 | public Disposable action(Map<String, String> stringStringMap, DataCallback<BaseInfo<TakePartPeopleInfo>> dataCallback) { |
| ... | ... | @@ -39,13 +40,16 @@ public class TakePartPresenter extends MvpBasePresenter<TakePartView> { |
| 39 | 40 | public void onFailure(int code, String message) { |
| 40 | 41 | if (getView() != null) { |
| 41 | 42 | getView().showErr(message); |
| 42 | - getView().hideLoading(); | |
| 43 | + QMUITipDialogUtil.dismessDialog(); | |
| 43 | 44 | } |
| 44 | 45 | } |
| 45 | 46 | }).setSuccessCallback(new SuccessCallback<BaseInfo<TakePartPeopleInfo>>() { |
| 46 | 47 | @Override |
| 47 | 48 | public void onSuccess(BaseInfo<TakePartPeopleInfo> takePartPeopleInfoBaseInfo) { |
| 48 | - if (getView() != null) getView().onSuccess(takePartPeopleInfoBaseInfo); | |
| 49 | + if (getView() != null) { | |
| 50 | + getView().onSuccess(takePartPeopleInfoBaseInfo); | |
| 51 | + QMUITipDialogUtil.dismessDialog(); | |
| 52 | + } | |
| 49 | 53 | } |
| 50 | 54 | }).start(); |
| 51 | 55 | } | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/MyRecordView.java
| ... | ... | @@ -26,21 +26,15 @@ import java.util.List; |
| 26 | 26 | public class MyRecordView implements MvpView { |
| 27 | 27 | |
| 28 | 28 | private MyRecordFragment fragment; |
| 29 | - public QMUITipDialog loadingDiaog; | |
| 30 | 29 | private List<MyRecordInfo.ListBean> list = new ArrayList<>(); |
| 31 | 30 | private MyRecordAdapter adapter; |
| 32 | 31 | |
| 33 | 32 | public MyRecordView(MyRecordFragment fragment) { |
| 34 | 33 | this.fragment = fragment; |
| 35 | - loadingDiaog = new QMUITipDialog.Builder(fragment.getActivity()) | |
| 36 | - .setIconType(QMUITipDialog.Builder.ICON_TYPE_LOADING) | |
| 37 | - .setTipWord("请稍后") | |
| 38 | - .create(); | |
| 39 | 34 | } |
| 40 | 35 | |
| 41 | 36 | |
| 42 | 37 | public void onSuccess(BaseInfo<MyRecordInfo> myRecordInfoBaseInfo) { |
| 43 | - hideLoading(); | |
| 44 | 38 | if (fragment.currentPage == 1) { |
| 45 | 39 | list.clear(); |
| 46 | 40 | list.addAll(myRecordInfoBaseInfo.getData().getList()); |
| ... | ... | @@ -126,13 +120,4 @@ public class MyRecordView implements MvpView { |
| 126 | 120 | fragment.binding.refreshLayout.setVisibility(View.GONE); |
| 127 | 121 | fragment.binding.emptyRy.setVisibility(View.VISIBLE); |
| 128 | 122 | } |
| 129 | - | |
| 130 | - | |
| 131 | - public void showLoading() { | |
| 132 | - if (loadingDiaog != null) loadingDiaog.show(); | |
| 133 | - } | |
| 134 | - | |
| 135 | - public void hideLoading() { | |
| 136 | - if (loadingDiaog != null) loadingDiaog.dismiss(); | |
| 137 | - } | |
| 138 | 123 | } | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RaceRecorView.java
| ... | ... | @@ -30,17 +30,12 @@ import java.util.List; |
| 30 | 30 | */ |
| 31 | 31 | public class RaceRecorView implements MvpView { |
| 32 | 32 | private RaceRecorFragment fragment; |
| 33 | - public QMUITipDialog loadingDiaog; | |
| 34 | 33 | private List<EventRouteRecordBeanVoListBean> list = new ArrayList<>(); |
| 35 | 34 | private RaceRecordAdapter adapter; |
| 36 | 35 | |
| 37 | 36 | |
| 38 | 37 | public RaceRecorView(RaceRecorFragment fragment) { |
| 39 | 38 | this.fragment = fragment; |
| 40 | - loadingDiaog = new QMUITipDialog.Builder(fragment.getActivity()) | |
| 41 | - .setIconType(QMUITipDialog.Builder.ICON_TYPE_LOADING) | |
| 42 | - .setTipWord("请稍后") | |
| 43 | - .create(); | |
| 44 | 39 | } |
| 45 | 40 | |
| 46 | 41 | public void initView() { |
| ... | ... | @@ -53,7 +48,6 @@ public class RaceRecorView implements MvpView { |
| 53 | 48 | } |
| 54 | 49 | |
| 55 | 50 | public void setData(BaseInfo<RaceRecordInfo> raceRecordInfoBaseInfo) { |
| 56 | - hideLoading(); | |
| 57 | 51 | fragment.binding.ryRecord.setVisibility(View.VISIBLE); |
| 58 | 52 | fragment.binding.txAll.setVisibility(View.VISIBLE); |
| 59 | 53 | if (raceRecordInfoBaseInfo.getData().getBestResult() == null) { |
| ... | ... | @@ -185,12 +179,4 @@ public class RaceRecorView implements MvpView { |
| 185 | 179 | AlertUtil.showDeftToast(fragment.getActivity(), msg); |
| 186 | 180 | } |
| 187 | 181 | } |
| 188 | - | |
| 189 | - public void showLoading() { | |
| 190 | - if (loadingDiaog != null) loadingDiaog.show(); | |
| 191 | - } | |
| 192 | - | |
| 193 | - public void hideLoading() { | |
| 194 | - if (loadingDiaog != null) loadingDiaog.dismiss(); | |
| 195 | - } | |
| 196 | 182 | } | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RegistrationInfoView.java
| ... | ... | @@ -6,6 +6,7 @@ import com.bumptech.glide.Glide; |
| 6 | 6 | import com.bumptech.glide.load.resource.bitmap.CircleCrop; |
| 7 | 7 | import com.bumptech.glide.request.RequestOptions; |
| 8 | 8 | import com.cnlive.libs.base.util.AlertUtil; |
| 9 | +import com.cnlive.media.picker.utils.AlertDialogUtils; | |
| 9 | 10 | import com.cnlive.moudle.pedometer.commonInfo.CommonInfo; |
| 10 | 11 | import com.cnlive.moudle.pedometer.model.Constant; |
| 11 | 12 | import com.cnlive.moudle.pedometer.model.MessageEvent; |
| ... | ... | @@ -119,6 +120,10 @@ public class RegistrationInfoView implements MvpView, OnDateSetListener { |
| 119 | 120 | @Override |
| 120 | 121 | public void onDateSet(TimePickerDialog timePickerView, long millseconds) { |
| 121 | 122 | // 生日(非必填) 未选择 |
| 122 | - fragment.binding.birthday.setText(DateTimeUtil.formatDateTime(millseconds, "yyyy年MM月dd日")); | |
| 123 | + if(millseconds < System.currentTimeMillis()){ | |
| 124 | + fragment.binding.birthday.setText(DateTimeUtil.formatDateTime(millseconds, "yyyy年MM月dd日")); | |
| 125 | + }else { | |
| 126 | + AlertUtil.showDeftToast(fragment.getActivity(),"无法选择该日期"); | |
| 127 | + } | |
| 123 | 128 | } |
| 124 | 129 | } | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RunLineView.java
| ... | ... | @@ -26,16 +26,11 @@ import java.util.List; |
| 26 | 26 | public class RunLineView implements MvpView { |
| 27 | 27 | |
| 28 | 28 | private RunLineFragment fragment; |
| 29 | - public QMUITipDialog loadingDiaog; | |
| 30 | 29 | private RunLineAdapter adapter; |
| 31 | 30 | private List<RunLineInfo.ListBean> list = new ArrayList<>(); |
| 32 | 31 | |
| 33 | 32 | public RunLineView(RunLineFragment fragment) { |
| 34 | 33 | this.fragment = fragment; |
| 35 | - loadingDiaog = new QMUITipDialog.Builder(fragment.getActivity()) | |
| 36 | - .setIconType(QMUITipDialog.Builder.ICON_TYPE_LOADING) | |
| 37 | - .setTipWord("请稍后") | |
| 38 | - .create(); | |
| 39 | 34 | } |
| 40 | 35 | |
| 41 | 36 | public void initView(){ |
| ... | ... | @@ -48,7 +43,6 @@ public class RunLineView implements MvpView { |
| 48 | 43 | } |
| 49 | 44 | |
| 50 | 45 | public void onSuccess(BaseInfo<RunLineInfo> runLineInfoBaseInfo){ |
| 51 | - hideLoading(); | |
| 52 | 46 | if(fragment.currentPage == 1){ |
| 53 | 47 | list.clear(); |
| 54 | 48 | list.addAll(runLineInfoBaseInfo.getData().getList()); |
| ... | ... | @@ -121,12 +115,4 @@ public class RunLineView implements MvpView { |
| 121 | 115 | fragment.binding.empty.show("没有相关数据", "", R.drawable.zhuangtai_kong); |
| 122 | 116 | } |
| 123 | 117 | |
| 124 | - | |
| 125 | - public void showLoading() { | |
| 126 | - if (loadingDiaog != null) loadingDiaog.show(); | |
| 127 | - } | |
| 128 | - | |
| 129 | - public void hideLoading() { | |
| 130 | - if (loadingDiaog != null) loadingDiaog.dismiss(); | |
| 131 | - } | |
| 132 | 118 | } | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/SelfRecordView.java
| ... | ... | @@ -35,21 +35,15 @@ import q.rorbin.badgeview.QBadgeView; |
| 35 | 35 | public class SelfRecordView implements MvpView { |
| 36 | 36 | |
| 37 | 37 | private SelfRecordFragment fragment; |
| 38 | - public QMUITipDialog loadingDiaog; | |
| 39 | 38 | private List<EventRouteRecordBeanVoListBean> list = new ArrayList<>(); |
| 40 | 39 | private RaceRecordAdapter adapter; |
| 41 | 40 | |
| 42 | 41 | |
| 43 | 42 | public SelfRecordView(SelfRecordFragment fragment) { |
| 44 | 43 | this.fragment = fragment; |
| 45 | - loadingDiaog = new QMUITipDialog.Builder(fragment.getActivity()) | |
| 46 | - .setIconType(QMUITipDialog.Builder.ICON_TYPE_LOADING) | |
| 47 | - .setTipWord("请稍后") | |
| 48 | - .create(); | |
| 49 | 44 | } |
| 50 | 45 | |
| 51 | 46 | public void setData(BaseInfo<SelfRecordInfo> selfRecordInfoBaseInfo) { |
| 52 | - hideLoading(); | |
| 53 | 47 | fragment.binding.ryRecord.setVisibility(View.VISIBLE); |
| 54 | 48 | fragment.binding.txAll.setVisibility(View.VISIBLE); |
| 55 | 49 | if (selfRecordInfoBaseInfo.getData().getRecordSum() == null) { |
| ... | ... | @@ -204,13 +198,4 @@ public class SelfRecordView implements MvpView { |
| 204 | 198 | } |
| 205 | 199 | } |
| 206 | 200 | |
| 207 | - public void showLoading() { | |
| 208 | - if (loadingDiaog != null) loadingDiaog.show(); | |
| 209 | - } | |
| 210 | - | |
| 211 | - public void hideLoading() { | |
| 212 | - if (loadingDiaog != null) loadingDiaog.dismiss(); | |
| 213 | - } | |
| 214 | - | |
| 215 | - | |
| 216 | 201 | } | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/TakePartView.java
| ... | ... | @@ -24,16 +24,11 @@ import java.util.List; |
| 24 | 24 | public class TakePartView implements MvpView { |
| 25 | 25 | |
| 26 | 26 | private TakePartFragment fragment; |
| 27 | - public QMUITipDialog loadingDiaog; | |
| 28 | 27 | private TakePartAdapter adapter; |
| 29 | 28 | private List<TakePartPeopleInfo.UserMsgsBean> list = new ArrayList<>(); |
| 30 | 29 | |
| 31 | 30 | public TakePartView(TakePartFragment fragment) { |
| 32 | 31 | this.fragment = fragment; |
| 33 | - loadingDiaog = new QMUITipDialog.Builder(fragment.getActivity()) | |
| 34 | - .setIconType(QMUITipDialog.Builder.ICON_TYPE_LOADING) | |
| 35 | - .setTipWord("请稍后") | |
| 36 | - .create(); | |
| 37 | 32 | } |
| 38 | 33 | |
| 39 | 34 | public void initView(){ |
| ... | ... | @@ -47,7 +42,6 @@ public class TakePartView implements MvpView { |
| 47 | 42 | } |
| 48 | 43 | |
| 49 | 44 | public void onSuccess(BaseInfo<TakePartPeopleInfo> partPeopleInfoBaseInfo){ |
| 50 | - hideLoading(); | |
| 51 | 45 | if(fragment.currentPage == 1){ |
| 52 | 46 | list.clear(); |
| 53 | 47 | list.addAll(partPeopleInfoBaseInfo.getData().getUserMsgs()); |
| ... | ... | @@ -114,13 +108,4 @@ public class TakePartView implements MvpView { |
| 114 | 108 | fragment.binding.empty.show("暂无参与", "", R.drawable.bmcg_tak); |
| 115 | 109 | } |
| 116 | 110 | |
| 117 | - | |
| 118 | - public void showLoading() { | |
| 119 | - if (loadingDiaog != null) loadingDiaog.show(); | |
| 120 | - } | |
| 121 | - | |
| 122 | - public void hideLoading() { | |
| 123 | - if (loadingDiaog != null) loadingDiaog.dismiss(); | |
| 124 | - } | |
| 125 | - | |
| 126 | 111 | } | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/fragment/RunLineFragment.java
| ... | ... | @@ -4,6 +4,7 @@ package com.cnlive.moudle.pedometer.ui.fragment; |
| 4 | 4 | import android.os.Bundle; |
| 5 | 5 | import android.support.annotation.NonNull; |
| 6 | 6 | import android.support.annotation.Nullable; |
| 7 | +import android.util.Log; | |
| 7 | 8 | import android.view.View; |
| 8 | 9 | |
| 9 | 10 | import com.cnlive.libs.base.frame.fragment.MvpBindingFragment; |
| ... | ... | @@ -43,6 +44,7 @@ public class RunLineFragment extends MvpBindingFragment<RunLineView, RunLinePres |
| 43 | 44 | super.onViewCreated(view, savedInstanceState); |
| 44 | 45 | if (getMvpView() != null) getMvpView().initView(); |
| 45 | 46 | EventBus.getDefault().register(this); |
| 47 | + Log.e("ssssss", "onViewCreated: "); | |
| 46 | 48 | getPresenter().setData(getActivity(), CommonInfo.getUserId(getActivity()), currentPage, pageSize); |
| 47 | 49 | |
| 48 | 50 | binding.refreshLayout.setOnRefreshListener(v -> { | ... | ... |