Commit 16b86181db382eb34e4412a0ced1d5b6e4caf5dd
Merge branch 'master' of bj.gitlab.cnlive.com:cnlive-team/ModulePedometer
Showing
8 changed files
with
394 additions
and
99 deletions
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/presenter/OnGoingFragmentPresenter.java
| 1 | 1 | package com.cnlive.moudle.pedometer.frame.presenter; |
| 2 | 2 | |
| 3 | +import android.content.Context; | |
| 4 | +import android.view.View; | |
| 5 | + | |
| 6 | +import com.cnlive.libs.base.logic.Logic; | |
| 7 | +import com.cnlive.libs.base.logic.callback.DataCallback; | |
| 8 | +import com.cnlive.libs.base.logic.callback.FailureCallback; | |
| 9 | +import com.cnlive.libs.base.logic.callback.StateCallback; | |
| 10 | +import com.cnlive.libs.base.logic.callback.SuccessCallback; | |
| 3 | 11 | import com.cnlive.moudle.pedometer.frame.view.OnGoingFragmentView; |
| 12 | +import com.cnlive.moudle.pedometer.net.ApiServiceRunLin; | |
| 13 | +import com.cnlive.moudle.pedometer.net.SubscriptionRequest; | |
| 14 | +import com.cnlive.moudle.pedometer.net.bean.BaseInfo; | |
| 15 | +import com.cnlive.moudle.pedometer.net.bean.RunRaceDetailInfo; | |
| 4 | 16 | import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter; |
| 5 | 17 | |
| 18 | +import java.util.HashMap; | |
| 19 | +import java.util.Map; | |
| 20 | + | |
| 21 | +import io.reactivex.disposables.Disposable; | |
| 22 | + | |
| 23 | +import static com.cnlive.libs.base.logic.Config.STATE_IDLE; | |
| 24 | +import static com.cnlive.libs.base.logic.Config.STATE_LOAD; | |
| 25 | + | |
| 6 | 26 | public class OnGoingFragmentPresenter extends MvpBasePresenter<OnGoingFragmentView> { |
| 27 | + public void getRunRaceDetailInfo(Context context, String id, String userId, String state) { | |
| 28 | + //设置请求参数 | |
| 29 | + Map<String, String> paramsMap = new HashMap<>(); | |
| 30 | + //赛事id | |
| 31 | + paramsMap.put("id", id); | |
| 32 | + paramsMap.put("sid", userId); | |
| 33 | +// 0-用户使用 1-运营使用 | |
| 34 | + paramsMap.put("state", state); | |
| 35 | + Logic.create(paramsMap).action(new Logic.Action<Map<String, String>, BaseInfo<RunRaceDetailInfo>>() { | |
| 36 | + @Override | |
| 37 | + public Disposable action(Map<String, String> stringStringMap, DataCallback<BaseInfo<RunRaceDetailInfo>> dataCallback) { | |
| 38 | + return SubscriptionRequest.service(ApiServiceRunLin.class, api -> api.getRunRaceDetail(stringStringMap)).subscribe(context, dataCallback); | |
| 39 | + } | |
| 40 | + }).<BaseInfo<RunRaceDetailInfo>>event() | |
| 41 | + .setStateCallback(new StateCallback() { | |
| 42 | + @Override | |
| 43 | + public void onState(int i) { | |
| 44 | + if (getView() == null) { | |
| 45 | + return; | |
| 46 | + } | |
| 47 | + if (i == STATE_LOAD) { | |
| 48 | + getView().showLoadingView(); | |
| 49 | + } else if (i == STATE_IDLE) { | |
| 50 | + getView().hideLoadingView(); | |
| 51 | + } | |
| 52 | + } | |
| 53 | + }) | |
| 54 | + .setFailureCallback(new FailureCallback() { | |
| 55 | + @Override | |
| 56 | + public void onFailure(int code, String message) { | |
| 57 | + if (getView() == null) { | |
| 58 | + return; | |
| 59 | + } | |
| 60 | + getView().hideLoadingView(); | |
| 61 | + getView().showRetryView(code, new View.OnClickListener() { | |
| 62 | + @Override | |
| 63 | + public void onClick(View view) { | |
| 64 | + getRunRaceDetailInfo(context, id, userId,state); | |
| 65 | + } | |
| 66 | + }); | |
| 67 | + } | |
| 68 | + }).setSuccessCallback(new SuccessCallback<BaseInfo<RunRaceDetailInfo>>() { | |
| 69 | + @Override | |
| 70 | + public void onSuccess(BaseInfo<RunRaceDetailInfo> baseInfo) { | |
| 71 | + if (getView() == null) { | |
| 72 | + return; | |
| 73 | + } | |
| 74 | + if (baseInfo.getData() != null) { | |
| 75 | + getView().initView(baseInfo.getData()); | |
| 76 | + } | |
| 77 | + } | |
| 78 | + }).start(); | |
| 79 | + | |
| 80 | + } | |
| 7 | 81 | } | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/presenter/RunningFinishFragmetPresenter.java
| ... | ... | @@ -2,24 +2,17 @@ package com.cnlive.moudle.pedometer.frame.presenter; |
| 2 | 2 | |
| 3 | 3 | import android.app.Activity; |
| 4 | 4 | import android.content.Context; |
| 5 | -import android.graphics.Bitmap; | |
| 6 | -import android.os.Handler; | |
| 7 | 5 | import android.text.TextUtils; |
| 8 | 6 | import android.util.Log; |
| 9 | -import android.view.View; | |
| 10 | 7 | import android.widget.Toast; |
| 11 | 8 | |
| 12 | -import com.baidu.mapapi.map.BaiduMap; | |
| 13 | 9 | import com.baidu.mapapi.model.LatLng; |
| 14 | 10 | import com.baidu.trace.LBSTraceClient; |
| 15 | 11 | import com.baidu.trace.model.SortType; |
| 16 | -import com.cnlive.libs.base.logic.Event; | |
| 17 | 12 | import com.cnlive.libs.base.logic.Logic; |
| 18 | 13 | import com.cnlive.libs.base.logic.callback.DataCallback; |
| 19 | 14 | import com.cnlive.libs.base.logic.callback.FailureCallback; |
| 20 | -import com.cnlive.libs.base.logic.callback.StateCallback; | |
| 21 | 15 | import com.cnlive.libs.base.logic.callback.SuccessCallback; |
| 22 | -import com.cnlive.libs.base.util.ToastUtil; | |
| 23 | 16 | import com.cnlive.moudle.pedometer.commonInfo.CommonInfo; |
| 24 | 17 | import com.cnlive.moudle.pedometer.frame.view.RunningFinishFragmentView; |
| 25 | 18 | import com.cnlive.moudle.pedometer.model.Constant; |
| ... | ... | @@ -27,36 +20,24 @@ import com.cnlive.moudle.pedometer.model.RunningFinishBean; |
| 27 | 20 | import com.cnlive.moudle.pedometer.net.ApiServiceRunLin; |
| 28 | 21 | import com.cnlive.moudle.pedometer.net.SubscriptionRequest; |
| 29 | 22 | import com.cnlive.moudle.pedometer.net.bean.BaseInfo; |
| 30 | -import com.cnlive.moudle.pedometer.net.bean.RunRaceDetailInfo; | |
| 31 | -import com.cnlive.moudle.pedometer.service.StepService; | |
| 32 | 23 | import com.cnlive.moudle.pedometer.sql.entity.FailedEntity; |
| 33 | 24 | import com.cnlive.moudle.pedometer.sql.entity.UserStepEntity; |
| 34 | 25 | import com.cnlive.moudle.pedometer.ui.activity.LineUpAgainActivity; |
| 35 | 26 | import com.cnlive.moudle.pedometer.ui.widget.SelectDialog; |
| 36 | -import com.cnlive.moudle.pedometer.ui.widget.TipDialog; | |
| 37 | -import com.cnlive.moudle.pedometer.upload.UploadLogic; | |
| 38 | 27 | import com.cnlive.moudle.pedometer.utils.GsonUtil; |
| 39 | 28 | import com.cnlive.moudle.pedometer.utils.MyMapUtil; |
| 40 | 29 | import com.cnlive.moudle.pedometer.utils.QMUITipDialogUtil; |
| 41 | 30 | import com.cnlive.moudle.pedometer.utils.StepUtil; |
| 42 | -import com.cnlive.moudle.pedometer.utils.TimeUtil; | |
| 43 | 31 | import com.example.moudle_pedometer.R; |
| 44 | 32 | import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter; |
| 45 | 33 | |
| 46 | -import java.io.File; | |
| 47 | -import java.io.FileOutputStream; | |
| 48 | -import java.text.SimpleDateFormat; | |
| 49 | 34 | import java.util.ArrayList; |
| 50 | -import java.util.Date; | |
| 51 | 35 | import java.util.HashMap; |
| 52 | 36 | import java.util.List; |
| 53 | 37 | import java.util.Map; |
| 54 | 38 | |
| 55 | 39 | import io.reactivex.disposables.Disposable; |
| 56 | 40 | |
| 57 | -import static com.cnlive.libs.base.logic.Config.STATE_IDLE; | |
| 58 | -import static com.cnlive.libs.base.logic.Config.STATE_LOAD; | |
| 59 | - | |
| 60 | 41 | public class RunningFinishFragmetPresenter extends MvpBasePresenter<RunningFinishFragmentView> { |
| 61 | 42 | private LBSTraceClient mClient = null; |
| 62 | 43 | private List<LatLng> importPoints; |
| ... | ... | @@ -88,8 +69,7 @@ public class RunningFinishFragmetPresenter extends MvpBasePresenter<RunningFinis |
| 88 | 69 | pace = runningFinishBean.getSpeed(); |
| 89 | 70 | } |
| 90 | 71 | // 路线图 |
| 91 | - String roadmap = runningFinishBean.getRoadmap(); | |
| 92 | - roadmap = ""; | |
| 72 | + String roadmap = ""; | |
| 93 | 73 | //经纬度 |
| 94 | 74 | String latLongitude = ""; |
| 95 | 75 | // 开始时间 |
| ... | ... | @@ -104,7 +84,7 @@ public class RunningFinishFragmetPresenter extends MvpBasePresenter<RunningFinis |
| 104 | 84 | isPause = "1"; |
| 105 | 85 | } |
| 106 | 86 | //继续时间 |
| 107 | - String continueTime = ""; | |
| 87 | + String continueTime = userStepEntity.getContinueTime() + ""; | |
| 108 | 88 | //是否完成 |
| 109 | 89 | String completeStatus = runningFinishBean.getIsFinish(); |
| 110 | 90 | //设置步数 |
| ... | ... | @@ -202,7 +182,14 @@ public class RunningFinishFragmetPresenter extends MvpBasePresenter<RunningFinis |
| 202 | 182 | //查询当前用户的历史轨迹 |
| 203 | 183 | long startTime = userStepEntity.getStartTimeStamp(); |
| 204 | 184 | //获取当前的时间戳(秒) |
| 205 | - long endTime = userStepEntity.getFinishTimeStamp(); | |
| 185 | + long endTime = 0; | |
| 186 | + if (userStepEntity.getPauseCount() == 0) { | |
| 187 | + //没有暂停 | |
| 188 | + endTime = userStepEntity.getFinishTimeStamp(); | |
| 189 | + } else { | |
| 190 | + //暂停了 | |
| 191 | + endTime = userStepEntity.getUserPauseTimeStamp(); | |
| 192 | + } | |
| 206 | 193 | //获取当前的实体名称 |
| 207 | 194 | String entityName = CommonInfo.getUserId(context); |
| 208 | 195 | //打的重要点 |
| ... | ... | @@ -213,71 +200,128 @@ public class RunningFinishFragmetPresenter extends MvpBasePresenter<RunningFinis |
| 213 | 200 | if (mClient == null) { |
| 214 | 201 | mClient = new LBSTraceClient(context); |
| 215 | 202 | } |
| 203 | + List<LatLng> allResults = new ArrayList<>(); | |
| 216 | 204 | MyMapUtil.queryHistoryTrace(context, mClient, entityName, startTime, endTime, new MyMapUtil.CallBack() { |
| 217 | 205 | @Override |
| 218 | 206 | public void success(List<LatLng> resultPoints) { |
| 219 | 207 | if (resultPoints != null) { |
| 220 | 208 | if (getView() != null) { |
| 209 | + allResults.addAll(resultPoints); | |
| 221 | 210 | QMUITipDialogUtil.dismessDialog(); |
| 222 | - MyMapUtil.drawHistoryTrack(context, getView().baiduMap, resultPoints, SortType.asc, R.color.red, R.drawable.icon_start, R.drawable.icon_end); | |
| 223 | - //先判断是否到达终点 | |
| 224 | - if (!userStepEntity.getIsArriveEndPoint()) { | |
| 225 | - runningFinishBean.setIsFinish("0"); | |
| 211 | + //判断用户是否点击暂停按钮 | |
| 212 | + if (userStepEntity.getPauseCount() == 0) { | |
| 213 | + MyMapUtil.drawHistoryTrack(context, getView().baiduMap, resultPoints, SortType.asc, R.color.red, R.drawable.icon_start, R.drawable.icon_end); | |
| 214 | + //没有点击暂停 | |
| 215 | + //先判断是否到达终点 | |
| 216 | + checkUserIsFinish(resultPoints, userStepEntity, runningFinishBean, context); | |
| 217 | + saveRouteData(context, userStepEntity, runningFinishBean); | |
| 226 | 218 | } else { |
| 227 | - if (importPoints != null) { | |
| 228 | - //判断是否完成 | |
| 229 | - boolean isFinish = MyMapUtil.checkIsFinishTrace(importPoints, resultPoints, Constant.PASS_RATE); | |
| 230 | - if (isFinish) { | |
| 231 | - Toast.makeText(context, "完成", Toast.LENGTH_LONG).show(); | |
| 232 | - runningFinishBean.setIsFinish("1"); | |
| 233 | - } else { | |
| 234 | - Toast.makeText(context, "没有完成", Toast.LENGTH_LONG).show(); | |
| 235 | - runningFinishBean.setIsFinish("0"); | |
| 236 | - } | |
| 237 | - } | |
| 219 | + MyMapUtil.drawHistoryTrack(context, getView().baiduMap, resultPoints, SortType.asc, R.color.red, R.drawable.icon_start, 0); | |
| 238 | 220 | } |
| 239 | - saveRouteData(context, userStepEntity, runningFinishBean); | |
| 240 | 221 | |
| 222 | + //如果点击暂停 | |
| 223 | + if (userStepEntity.getPauseCount() != 0) { | |
| 224 | + long contineTime = userStepEntity.getContinueTime(); | |
| 225 | + long finishTime = userStepEntity.getFinishTimeStamp(); | |
| 226 | + //开始查询 | |
| 227 | + MyMapUtil.queryHistoryTrace(context, mClient, entityName, contineTime, finishTime, new MyMapUtil.CallBack() { | |
| 228 | + @Override | |
| 229 | + public void success(List<LatLng> resultPoints) { | |
| 230 | + if (null != resultPoints) { | |
| 231 | + allResults.addAll(resultPoints); | |
| 232 | + //判断用户是否完成 | |
| 233 | + if (importPoints != null) { | |
| 234 | + //先判断是否到达终点 | |
| 235 | + checkUserIsFinish(resultPoints, userStepEntity, runningFinishBean, context); | |
| 236 | + saveRouteData(context, userStepEntity, runningFinishBean); | |
| 237 | + } | |
| 238 | + | |
| 239 | + } else { | |
| 240 | + //查询失败 | |
| 241 | + QMUITipDialogUtil.dismessDialog(); | |
| 242 | + queryTraceFaile(context, userStepEntity, runningFinishBean); | |
| 243 | + // | |
| 244 | + } | |
| 245 | + } | |
| 246 | + }); | |
| 247 | + } | |
| 241 | 248 | } |
| 242 | 249 | } |
| 243 | 250 | //查询失败 |
| 244 | 251 | else { |
| 245 | 252 | QMUITipDialogUtil.dismessDialog(); |
| 246 | - if (failTraceDialog == null) { | |
| 247 | - failTraceDialog = new SelectDialog(context, "获取轨迹失败,是否重试?", "重试", new SelectDialog.DialogInterface() { | |
| 248 | - @Override | |
| 249 | - public void onClick(SelectDialog dialog) { | |
| 250 | - dialog.dismiss(); | |
| 251 | - queryHistoryTrace(context, userStepEntity, runningFinishBean); | |
| 252 | - } | |
| 253 | - }, "暂存", new SelectDialog.DialogInterface() { | |
| 254 | - @Override | |
| 255 | - public void onClick(SelectDialog dialog) { | |
| 256 | - dialog.dismiss(); | |
| 257 | - StepUtil.clearRunData(context, CommonInfo.getUserId(context)); | |
| 258 | - CommonInfo.reset(context); | |
| 259 | - //跳转到上传失败列表 | |
| 260 | - LineUpAgainActivity.newInstance(context); | |
| 261 | - //关闭当前窗口 | |
| 262 | - context.finish(); | |
| 253 | + queryTraceFaile(context, userStepEntity, runningFinishBean); | |
| 254 | + } | |
| 255 | + } | |
| 256 | + }); | |
| 263 | 257 | |
| 264 | - } | |
| 265 | - }); | |
| 266 | - failTraceDialog.setCanceledOnTouchOutside(false); | |
| 267 | - failTraceDialog.setCancelable(false); | |
| 268 | - if (!failTraceDialog.isShowing()) { | |
| 269 | - failTraceDialog.show(); | |
| 270 | - } | |
| 258 | + } | |
| 271 | 259 | |
| 272 | - } else { | |
| 273 | - if (!failTraceDialog.isShowing()) { | |
| 274 | - failTraceDialog.show(); | |
| 275 | - } | |
| 276 | - } | |
| 260 | + /** | |
| 261 | + * 判断用户是否完成 | |
| 262 | + * | |
| 263 | + * @param resultPoints | |
| 264 | + * @param userStepEntity | |
| 265 | + * @param runningFinishBean | |
| 266 | + * @param context | |
| 267 | + */ | |
| 268 | + public void checkUserIsFinish(List<LatLng> resultPoints, UserStepEntity userStepEntity, RunningFinishBean runningFinishBean, Activity context) { | |
| 269 | + if (!userStepEntity.getIsArriveEndPoint()) { | |
| 270 | + runningFinishBean.setIsFinish("0"); | |
| 271 | + } else { | |
| 272 | + if (importPoints != null) { | |
| 273 | + //判断是否完成 | |
| 274 | + boolean isFinish = MyMapUtil.checkIsFinishTrace(importPoints, resultPoints, Constant.PASS_RATE); | |
| 275 | + if (isFinish) { | |
| 276 | + Toast.makeText(context, "完成", Toast.LENGTH_LONG).show(); | |
| 277 | + runningFinishBean.setIsFinish("1"); | |
| 278 | + } else { | |
| 279 | + Toast.makeText(context, "没有完成", Toast.LENGTH_LONG).show(); | |
| 280 | + runningFinishBean.setIsFinish("0"); | |
| 277 | 281 | } |
| 278 | 282 | } |
| 279 | - }); | |
| 283 | + } | |
| 284 | + } | |
| 280 | 285 | |
| 286 | + /** | |
| 287 | + * 查询历史轨迹失败 | |
| 288 | + * | |
| 289 | + * @param context | |
| 290 | + * @param userStepEntity | |
| 291 | + * @param runningFinishBean | |
| 292 | + */ | |
| 293 | + public void queryTraceFaile(Activity context, UserStepEntity userStepEntity, RunningFinishBean runningFinishBean) { | |
| 294 | + if (failTraceDialog == null) { | |
| 295 | + failTraceDialog = new SelectDialog(context, "获取轨迹失败,是否重试?", "重试", new SelectDialog.DialogInterface() { | |
| 296 | + @Override | |
| 297 | + public void onClick(SelectDialog dialog) { | |
| 298 | + dialog.dismiss(); | |
| 299 | + queryHistoryTrace(context, userStepEntity, runningFinishBean); | |
| 300 | + } | |
| 301 | + }, "暂存", new SelectDialog.DialogInterface() { | |
| 302 | + @Override | |
| 303 | + public void onClick(SelectDialog dialog) { | |
| 304 | + dialog.dismiss(); | |
| 305 | + StepUtil.clearRunData(context, CommonInfo.getUserId(context)); | |
| 306 | + CommonInfo.reset(context); | |
| 307 | + //跳转到上传失败列表 | |
| 308 | + LineUpAgainActivity.newInstance(context); | |
| 309 | + //关闭当前窗口 | |
| 310 | + context.finish(); | |
| 311 | + | |
| 312 | + } | |
| 313 | + }); | |
| 314 | + failTraceDialog.setCanceledOnTouchOutside(false); | |
| 315 | + failTraceDialog.setCancelable(false); | |
| 316 | + if (!failTraceDialog.isShowing()) { | |
| 317 | + failTraceDialog.show(); | |
| 318 | + } | |
| 319 | + | |
| 320 | + } else { | |
| 321 | + if (!failTraceDialog.isShowing()) { | |
| 322 | + failTraceDialog.show(); | |
| 323 | + } | |
| 324 | + } | |
| 281 | 325 | } |
| 282 | 326 | |
| 283 | 327 | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/MyRecordView.java
| ... | ... | @@ -7,6 +7,7 @@ import com.cnlive.libs.base.util.AlertUtil; |
| 7 | 7 | import com.cnlive.moudle.pedometer.commonInfo.CommonInfo; |
| 8 | 8 | import com.cnlive.moudle.pedometer.net.bean.BaseInfo; |
| 9 | 9 | import com.cnlive.moudle.pedometer.net.bean.MyRecordInfo; |
| 10 | +import com.cnlive.moudle.pedometer.ui.activity.OnGoingActivity; | |
| 10 | 11 | import com.cnlive.moudle.pedometer.ui.activity.RunRaceDetailActivity; |
| 11 | 12 | import com.cnlive.moudle.pedometer.ui.adapter.MyRecordAdapter; |
| 12 | 13 | import com.cnlive.moudle.pedometer.ui.fragment.MyRecordFragment; |
| ... | ... | @@ -28,6 +29,7 @@ public class MyRecordView implements MvpView { |
| 28 | 29 | public QMUITipDialog loadingDiaog; |
| 29 | 30 | private List<MyRecordInfo.ListBean> list = new ArrayList<>(); |
| 30 | 31 | private MyRecordAdapter adapter; |
| 32 | + | |
| 31 | 33 | public MyRecordView(MyRecordFragment fragment) { |
| 32 | 34 | this.fragment = fragment; |
| 33 | 35 | loadingDiaog = new QMUITipDialog.Builder(fragment.getActivity()) |
| ... | ... | @@ -37,39 +39,44 @@ public class MyRecordView implements MvpView { |
| 37 | 39 | } |
| 38 | 40 | |
| 39 | 41 | |
| 40 | - public void onSuccess(BaseInfo<MyRecordInfo> myRecordInfoBaseInfo){ | |
| 42 | + public void onSuccess(BaseInfo<MyRecordInfo> myRecordInfoBaseInfo) { | |
| 41 | 43 | hideLoading(); |
| 42 | - if(fragment.currentPage == 1){ | |
| 44 | + if (fragment.currentPage == 1) { | |
| 43 | 45 | list.clear(); |
| 44 | 46 | list.addAll(myRecordInfoBaseInfo.getData().getList()); |
| 45 | - if(adapter == null){ | |
| 46 | - adapter = new MyRecordAdapter(list,fragment.state,fragment.getActivity()); | |
| 47 | + if (adapter == null) { | |
| 48 | + adapter = new MyRecordAdapter(list, fragment.state, fragment.getActivity()); | |
| 47 | 49 | fragment.binding.myRecordRecy.setAdapter(adapter); |
| 48 | 50 | adapter.setClickListener(new MyRecordAdapter.OnClickListener() { |
| 49 | 51 | @Override |
| 50 | 52 | public void onClickListener(MyRecordInfo.ListBean bean, int position) { |
| 51 | - RunRaceDetailActivity.startActivity(fragment.getActivity(),bean.getId()+"",null,null,null,null); | |
| 53 | + if ("0".equals(fragment.state)) { | |
| 54 | + RunRaceDetailActivity.startActivity(fragment.getActivity(), bean.getId() + "", null, null, null, null); | |
| 55 | + } else { | |
| 56 | + OnGoingActivity.startActivity(fragment.getActivity(), bean.getId() + "", null, null, null, null); | |
| 57 | + | |
| 58 | + } | |
| 52 | 59 | } |
| 53 | 60 | }); |
| 54 | - }else { | |
| 61 | + } else { | |
| 55 | 62 | adapter.notifyDataSetChanged(); |
| 56 | 63 | } |
| 57 | 64 | } |
| 58 | 65 | |
| 59 | - if(list.size() != 0){ | |
| 66 | + if (list.size() != 0) { | |
| 60 | 67 | fragment.binding.empty.setVisibility(View.GONE); |
| 61 | 68 | fragment.binding.emptyRy.setVisibility(View.GONE); |
| 62 | 69 | fragment.binding.refreshLayout.setVisibility(View.VISIBLE); |
| 63 | - }else { | |
| 70 | + } else { | |
| 64 | 71 | showEmpty(); |
| 65 | 72 | } |
| 66 | 73 | |
| 67 | - if(myRecordInfoBaseInfo.getData().getList().size() < fragment.pageSize){ | |
| 74 | + if (myRecordInfoBaseInfo.getData().getList().size() < fragment.pageSize) { | |
| 68 | 75 | fragment.binding.refreshLayout.setEnableLoadMore(false); |
| 69 | - }else { | |
| 76 | + } else { | |
| 70 | 77 | fragment.binding.refreshLayout.setEnableLoadMore(true); |
| 71 | 78 | } |
| 72 | - if(fragment.currentPage > 1){ | |
| 79 | + if (fragment.currentPage > 1) { | |
| 73 | 80 | list.addAll(myRecordInfoBaseInfo.getData().getList()); |
| 74 | 81 | adapter.notifyDataSetChanged(); |
| 75 | 82 | } |
| ... | ... | @@ -77,13 +84,13 @@ public class MyRecordView implements MvpView { |
| 77 | 84 | fragment.binding.refreshLayout.finishLoadMore(); |
| 78 | 85 | } |
| 79 | 86 | |
| 80 | - public void initView(){ | |
| 87 | + public void initView() { | |
| 81 | 88 | fragment.binding.refreshLayout.setRefreshHeader(new ClassicsHeader(fragment.getActivity())); |
| 82 | 89 | fragment.binding.refreshLayout.setRefreshFooter(new ClassicsFooter(fragment.getActivity())); |
| 83 | 90 | fragment.binding.myRecordRecy.setLayoutManager(new LinearLayoutManager(fragment.getActivity())); |
| 84 | 91 | } |
| 85 | 92 | |
| 86 | - public void showErr(String msg){ | |
| 93 | + public void showErr(String msg) { | |
| 87 | 94 | fragment.binding.refreshLayout.finishRefresh(); |
| 88 | 95 | fragment.binding.refreshLayout.finishLoadMore(); |
| 89 | 96 | if (list.size() == 0) { |
| ... | ... | @@ -96,7 +103,7 @@ public class MyRecordView implements MvpView { |
| 96 | 103 | @Override |
| 97 | 104 | public void onClick(View v) { |
| 98 | 105 | fragment.currentPage = 1; |
| 99 | - fragment.getPresenter().setData(fragment.getActivity(), CommonInfo.getUserId(fragment.getActivity()),fragment.state,fragment.currentPage,fragment.pageSize); | |
| 106 | + fragment.getPresenter().setData(fragment.getActivity(), CommonInfo.getUserId(fragment.getActivity()), fragment.state, fragment.currentPage, fragment.pageSize); | |
| 100 | 107 | } |
| 101 | 108 | }); |
| 102 | 109 | fragment.binding.empty.setLoadingShowing(false); |
| ... | ... | @@ -114,7 +121,7 @@ public class MyRecordView implements MvpView { |
| 114 | 121 | AlertUtil.showDeftToast(fragment.getActivity(), message); |
| 115 | 122 | } |
| 116 | 123 | |
| 117 | - public void showEmpty(){ | |
| 124 | + public void showEmpty() { | |
| 118 | 125 | fragment.binding.empty.setVisibility(View.GONE); |
| 119 | 126 | fragment.binding.refreshLayout.setVisibility(View.GONE); |
| 120 | 127 | fragment.binding.emptyRy.setVisibility(View.VISIBLE); | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/OnGoingFragmentView.java
| ... | ... | @@ -2,16 +2,23 @@ package com.cnlive.moudle.pedometer.frame.view; |
| 2 | 2 | |
| 3 | 3 | import android.app.Activity; |
| 4 | 4 | import android.content.Context; |
| 5 | +import android.graphics.Bitmap; | |
| 6 | +import android.graphics.BitmapFactory; | |
| 5 | 7 | import android.text.TextUtils; |
| 6 | 8 | import android.util.Log; |
| 7 | 9 | import android.view.View; |
| 8 | 10 | import android.widget.LinearLayout; |
| 9 | 11 | |
| 10 | 12 | import com.alibaba.android.arouter.launcher.ARouter; |
| 13 | +import com.baidu.location.LocationClient; | |
| 14 | +import com.baidu.location.LocationClientOption; | |
| 11 | 15 | import com.baidu.mapapi.map.BaiduMap; |
| 16 | +import com.baidu.mapapi.map.BitmapDescriptorFactory; | |
| 12 | 17 | import com.baidu.mapapi.map.MapView; |
| 18 | +import com.baidu.mapapi.map.MyLocationConfiguration; | |
| 13 | 19 | import com.baidu.mapapi.map.UiSettings; |
| 14 | 20 | import com.baidu.mapapi.model.LatLng; |
| 21 | +import com.baidu.mapapi.search.route.RoutePlanSearch; | |
| 15 | 22 | import com.baidu.mapapi.utils.DistanceUtil; |
| 16 | 23 | import com.baidu.trace.LBSTraceClient; |
| 17 | 24 | import com.baidu.trace.model.SortType; |
| ... | ... | @@ -25,6 +32,7 @@ import com.cnlive.moudle.pedometer.ui.activity.TakePartActivity; |
| 25 | 32 | import com.cnlive.moudle.pedometer.ui.fragment.OnGoingFragment; |
| 26 | 33 | import com.cnlive.moudle.pedometer.ui.widget.SelectDialog; |
| 27 | 34 | import com.cnlive.moudle.pedometer.ui.widget.TipDialog; |
| 35 | +import com.cnlive.moudle.pedometer.utils.BitmapUtil; | |
| 28 | 36 | import com.cnlive.moudle.pedometer.utils.GsonUtil; |
| 29 | 37 | import com.cnlive.moudle.pedometer.utils.MyMapUtil; |
| 30 | 38 | import com.cnlive.moudle.pedometer.utils.QMUITipDialogUtil; |
| ... | ... | @@ -45,6 +53,7 @@ public class OnGoingFragmentView implements MvpView { |
| 45 | 53 | private MapView mMapView; |
| 46 | 54 | private UiSettings mUiSettings; |
| 47 | 55 | public RunRaceDetailInfo runRaceDetailInfo; |
| 56 | + private LBSTraceClient mClient = null; | |
| 48 | 57 | |
| 49 | 58 | public OnGoingFragmentView(OnGoingFragment fragment) { |
| 50 | 59 | this.fragment = fragment; |
| ... | ... | @@ -68,7 +77,22 @@ public class OnGoingFragmentView implements MvpView { |
| 68 | 77 | startTime = Long.parseLong(runRaceDetailInfo.getStartTime()); |
| 69 | 78 | endTime = Long.parseLong(runRaceDetailInfo.getEndTime()); |
| 70 | 79 | //todo 注意后续查询历史轨迹的时候,必须查数据库中的时间,因为涉及到历史运动恢复,所以不能用这个sp文件中的,这里设置,只是为了在服务启动成功后, |
| 80 | + mClient = new LBSTraceClient(getContext()); | |
| 81 | + //获取轨迹 | |
| 82 | + if (mClient != null) { | |
| 83 | + MyMapUtil.queryHistoryTrace(getContext(), mClient, runRaceDetailInfo.getEntityName(), startTime, endTime, new MyMapUtil.CallBack() { | |
| 84 | + @Override | |
| 85 | + public void success(List<LatLng> resultPoints) { | |
| 86 | + if (resultPoints != null && resultPoints.size() > 1) { | |
| 87 | + MyMapUtil.drawServerLineTrack(getContext(), baiduMap, resultPoints, SortType.asc, R.color.green_round, R.drawable.icon_start, R.drawable.icon_end); | |
| 88 | + //设置地图自动缩放 | |
| 89 | + MyMapUtil.setMapAutoZoom(baiduMap, resultPoints, -1.5f); | |
| 71 | 90 | |
| 91 | + } | |
| 92 | + } | |
| 93 | + }); | |
| 94 | + | |
| 95 | + } | |
| 72 | 96 | //显示地图 |
| 73 | 97 | fragment.binding.mapView.setVisibility(View.VISIBLE); |
| 74 | 98 | //显示底部滑动卡片 |
| ... | ... | @@ -83,15 +107,16 @@ public class OnGoingFragmentView implements MvpView { |
| 83 | 107 | @Override |
| 84 | 108 | public void onPanelSlide(View panel, float slideOffset) { |
| 85 | 109 | //设置顶层卡片特效 |
| 86 | -// if (slideOffset > 0.6) { | |
| 87 | -// fragment.binding.llTop.setVisibility(View.VISIBLE); | |
| 88 | -//// ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) fragment.binding.scrollView.getLayoutParams(); | |
| 89 | -//// params.topMargin = ScreenUtil.dip2px(getContext(), 50); | |
| 90 | -//// fragment.binding.scrollView.setLayoutParams(params); | |
| 91 | -// } else { | |
| 92 | -// fragment.binding.llTop.setVisibility(View.GONE); | |
| 93 | -// } | |
| 94 | - if (slideOffset <= 0.6) { | |
| 110 | + if (slideOffset > 0.7) { | |
| 111 | + double alpha = (255 / (1 - 0.6)) * (slideOffset - 0.6); | |
| 112 | + if (alpha > 60) { | |
| 113 | + fragment.binding.flTop.getBackground().setAlpha((int) alpha); | |
| 114 | + fragment.binding.flTop.setVisibility(View.VISIBLE); | |
| 115 | + QMUIStatusBarHelper.setStatusBarDarkMode(fragment.getActivity()); | |
| 116 | + StatusBarUtil2.setColor(fragment.getActivity(), getContext().getResources().getColor(R.color.run_main_bg), 0); | |
| 117 | + | |
| 118 | + } | |
| 119 | + } else { | |
| 95 | 120 | if (fragment.binding.flTop.getVisibility() == View.VISIBLE) { |
| 96 | 121 | QMUIStatusBarHelper.setStatusBarLightMode(fragment.getActivity()); |
| 97 | 122 | StatusBarUtil2.setColor(fragment.getActivity(), getContext().getResources().getColor(R.color.white), 0); |
| ... | ... | @@ -147,6 +172,7 @@ public class OnGoingFragmentView implements MvpView { |
| 147 | 172 | |
| 148 | 173 | } |
| 149 | 174 | } else if (previousState == SlidingUpPanelLayout.PanelState.DRAGGING && newState == SlidingUpPanelLayout.PanelState.EXPANDED) { |
| 175 | + | |
| 150 | 176 | if (fragment.binding.flTop.getVisibility() != View.VISIBLE) { |
| 151 | 177 | QMUIStatusBarHelper.setStatusBarDarkMode(fragment.getActivity()); |
| 152 | 178 | StatusBarUtil2.setColor(fragment.getActivity(), getContext().getResources().getColor(R.color.run_main_bg), 0); |
| ... | ... | @@ -156,14 +182,12 @@ public class OnGoingFragmentView implements MvpView { |
| 156 | 182 | } else if (previousState == SlidingUpPanelLayout.PanelState.EXPANDED && newState == SlidingUpPanelLayout.PanelState.DRAGGING) { |
| 157 | 183 | QMUIStatusBarHelper.setStatusBarLightMode(fragment.getActivity()); |
| 158 | 184 | StatusBarUtil2.setColor(fragment.getActivity(), getContext().getResources().getColor(R.color.white), 0); |
| 159 | - | |
| 160 | 185 | if (fragment.binding.flTop.getVisibility() != View.GONE) { |
| 161 | 186 | fragment.binding.flTop.setVisibility(View.GONE); |
| 162 | 187 | } |
| 163 | 188 | } else if (previousState == SlidingUpPanelLayout.PanelState.DRAGGING && newState == SlidingUpPanelLayout.PanelState.ANCHORED) { |
| 164 | 189 | QMUIStatusBarHelper.setStatusBarLightMode(fragment.getActivity()); |
| 165 | 190 | StatusBarUtil2.setColor(fragment.getActivity(), getContext().getResources().getColor(R.color.white), 0); |
| 166 | - | |
| 167 | 191 | if (fragment.binding.flTop.getVisibility() != View.GONE) { |
| 168 | 192 | fragment.binding.flTop.setVisibility(View.GONE); |
| 169 | 193 | } |
| ... | ... | @@ -191,9 +215,9 @@ public class OnGoingFragmentView implements MvpView { |
| 191 | 215 | fragment.binding.includeStreet.tvRaceTitle.setText(runRaceDetailInfo.getTitle()); |
| 192 | 216 | //根据标题字数动态设置卡片高度 |
| 193 | 217 | if (runRaceDetailInfo.getTitle().length() > 19) { |
| 194 | - fragment.binding.slidingLayout.setPanelHeight(ScreenUtil.dip2px(getContext(), 200)); | |
| 218 | + fragment.binding.slidingLayout.setPanelHeight(ScreenUtil.dip2px(getContext(), 162)); | |
| 195 | 219 | } else { |
| 196 | - fragment.binding.slidingLayout.setPanelHeight(ScreenUtil.dip2px(getContext(), 181)); | |
| 220 | + fragment.binding.slidingLayout.setPanelHeight(ScreenUtil.dip2px(getContext(), 140)); | |
| 197 | 221 | } |
| 198 | 222 | fragment.binding.slidingLayout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED); |
| 199 | 223 | } |
| ... | ... | @@ -336,4 +360,75 @@ public class OnGoingFragmentView implements MvpView { |
| 336 | 360 | }); |
| 337 | 361 | } |
| 338 | 362 | } |
| 363 | + | |
| 364 | + public void initMap() { | |
| 365 | + //隐藏底部滑动卡片 | |
| 366 | + fragment.binding.slidingLayout.setPanelState(SlidingUpPanelLayout.PanelState.HIDDEN); | |
| 367 | + this.mMapView = fragment.binding.mapView; | |
| 368 | + if (baiduMap == null) { | |
| 369 | + baiduMap = mMapView.getMap(); | |
| 370 | + } | |
| 371 | + if (mUiSettings == null) { | |
| 372 | + mUiSettings = baiduMap.getUiSettings(); | |
| 373 | + } | |
| 374 | + //启动所有手势 | |
| 375 | + mUiSettings.setAllGesturesEnabled(true); | |
| 376 | + //通过设置enable为true或false 选择是否显示缩放按钮 | |
| 377 | + mMapView.showZoomControls(false); | |
| 378 | + mUiSettings.setEnlargeCenterWithDoubleClickEnable(true); | |
| 379 | + //隐藏自带的指南针,改用自定义指南针 杨帅 | |
| 380 | + baiduMap.getUiSettings().setCompassEnabled(true); | |
| 381 | + //显示定位图层 | |
| 382 | + baiduMap.setMyLocationEnabled(false); | |
| 383 | + } | |
| 384 | + | |
| 385 | + /** | |
| 386 | + * 显示loading | |
| 387 | + */ | |
| 388 | + public void showLoadingView() { | |
| 389 | + if (fragment.binding.emptyLayout == null) { | |
| 390 | + return; | |
| 391 | + } | |
| 392 | + fragment.binding.emptyLayout.show(true); | |
| 393 | + } | |
| 394 | + | |
| 395 | + /** | |
| 396 | + * 隐藏loading | |
| 397 | + */ | |
| 398 | + public void hideLoadingView() { | |
| 399 | + if (fragment.binding.emptyLayout == null) { | |
| 400 | + return; | |
| 401 | + } | |
| 402 | + fragment.binding.emptyLayout.hide(); | |
| 403 | + } | |
| 404 | + | |
| 405 | + /** | |
| 406 | + * 显示重试页面 | |
| 407 | + * | |
| 408 | + * @param errorCode | |
| 409 | + * @param listener | |
| 410 | + */ | |
| 411 | + public void showRetryView(int errorCode, View.OnClickListener listener) { | |
| 412 | + if (getContext() == null) { | |
| 413 | + return; | |
| 414 | + } | |
| 415 | + //隐藏地图 | |
| 416 | + fragment.binding.mapView.setVisibility(View.GONE); | |
| 417 | + //显示空视图 | |
| 418 | + fragment.binding.emptyLayout.setVisibility(View.VISIBLE); | |
| 419 | + //隐藏底部卡片 | |
| 420 | + fragment.binding.slidingLayout.setPanelState(SlidingUpPanelLayout.PanelState.HIDDEN); | |
| 421 | + if (fragment.binding.emptyLayout == null) return; | |
| 422 | + String titleText = ""; | |
| 423 | + String detailText = ""; | |
| 424 | + if (errorCode == -3) { | |
| 425 | + titleText = getContext().getString(R.string.msg_failed_network_title); | |
| 426 | + detailText = getContext().getString(R.string.msg_failed_network_detail); | |
| 427 | + } else { | |
| 428 | + titleText = getContext().getString(R.string.msg_failed_other_title); | |
| 429 | + detailText = getContext().getString(R.string.msg_failed_other_detail); | |
| 430 | + } | |
| 431 | + fragment.binding.emptyLayout.show(false, titleText, detailText, getContext().getString(R.string.retry), R.drawable.wufalianjie, listener); | |
| 432 | + } | |
| 433 | + | |
| 339 | 434 | } |
| 340 | 435 | \ No newline at end of file | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RunRaceDetailFragmentView.java
| ... | ... | @@ -15,6 +15,7 @@ import android.text.TextUtils; |
| 15 | 15 | import android.util.Log; |
| 16 | 16 | import android.view.View; |
| 17 | 17 | import android.view.ViewGroup; |
| 18 | +import android.view.ViewTreeObserver; | |
| 18 | 19 | import android.widget.LinearLayout; |
| 19 | 20 | import android.widget.Toast; |
| 20 | 21 | |
| ... | ... | @@ -353,6 +354,14 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { |
| 353 | 354 | //设置标题 |
| 354 | 355 | if (!TextUtils.isEmpty(runRaceDetailInfo.getTitle())) { |
| 355 | 356 | fragment.binding.includeStreet.tvRaceTitle.setText(runRaceDetailInfo.getTitle()); |
| 357 | + fragment.binding.includeStreet.tvRaceTitle.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() { | |
| 358 | + @Override | |
| 359 | + public boolean onPreDraw() { | |
| 360 | + Log.e(TAG, "initView: "+ fragment.binding.includeStreet.tvRaceTitle.getLineCount() ); | |
| 361 | + fragment.binding.includeStreet.tvRaceTitle.getViewTreeObserver().removeOnPreDrawListener(this); | |
| 362 | + return false; | |
| 363 | + } | |
| 364 | + }); | |
| 356 | 365 | //根据标题字数动态设置卡片高度 |
| 357 | 366 | if (runRaceDetailInfo.getTitle().length() > 19) { |
| 358 | 367 | fragment.binding.slidingLayout.setPanelHeight(ScreenUtil.dip2px(getContext(), 200)); | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/activity/OnGoingActivity.java
| 1 | 1 | package com.cnlive.moudle.pedometer.ui.activity; |
| 2 | 2 | |
| 3 | +import android.app.Activity; | |
| 4 | +import android.content.Intent; | |
| 5 | +import android.os.Bundle; | |
| 6 | + | |
| 7 | +import com.cnlive.libs.base.ui.QMUIFragment; | |
| 3 | 8 | import com.cnlive.libs.base.ui.QMUIFragmentActivity; |
| 9 | +import com.cnlive.moudle.pedometer.ui.fragment.OnGoingFragment; | |
| 10 | +import com.cnlive.moudle.pedometer.ui.fragment.RunRaceDetailFragment; | |
| 4 | 11 | import com.example.moudle_pedometer.R; |
| 5 | 12 | |
| 6 | 13 | /** |
| ... | ... | @@ -11,4 +18,32 @@ public class OnGoingActivity extends QMUIFragmentActivity { |
| 11 | 18 | protected int getContextViewId() { |
| 12 | 19 | return R.id.fragment_ongoing; |
| 13 | 20 | } |
| 21 | + | |
| 22 | + @Override | |
| 23 | + protected void onCreate(Bundle savedInstanceState) { | |
| 24 | + super.onCreate(savedInstanceState); | |
| 25 | + String eventId = getIntent().getExtras().getString("eventId"); | |
| 26 | + if (null != eventId) { | |
| 27 | + addFragment(OnGoingFragment.newInstance(eventId)); | |
| 28 | + } | |
| 29 | + } | |
| 30 | + | |
| 31 | + public static void startActivity(Activity activity, String eventId, String userId, String userIcon, String userName, String userPhone) { | |
| 32 | + Intent intent = new Intent(activity, OnGoingActivity.class); | |
| 33 | + intent.putExtra("eventId", eventId); | |
| 34 | + intent.putExtra("userId", userId); | |
| 35 | + intent.putExtra("userIcon", userIcon); | |
| 36 | + intent.putExtra("userName", userName); | |
| 37 | + intent.putExtra("userPhone", userPhone); | |
| 38 | + activity.startActivity(intent); | |
| 39 | + } | |
| 40 | + | |
| 41 | + private void addFragment(QMUIFragment fragment) { | |
| 42 | + getSupportFragmentManager().beginTransaction() | |
| 43 | + .add(getContextViewId(), fragment, fragment.getClass().getSimpleName()) | |
| 44 | + .addToBackStack(fragment.getClass().getSimpleName()) | |
| 45 | + .commit(); | |
| 46 | + } | |
| 47 | + | |
| 48 | + | |
| 14 | 49 | } | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/fragment/OnGoingFragment.java
| ... | ... | @@ -2,14 +2,29 @@ package com.cnlive.moudle.pedometer.ui.fragment; |
| 2 | 2 | |
| 3 | 3 | import android.os.Bundle; |
| 4 | 4 | import android.support.annotation.Nullable; |
| 5 | +import android.text.TextUtils; | |
| 5 | 6 | import android.view.View; |
| 6 | 7 | |
| 7 | 8 | import com.cnlive.libs.base.ui.QMUIFragment; |
| 9 | +import com.cnlive.libs.base.util.StatusBarUtil2; | |
| 10 | +import com.cnlive.moudle.pedometer.commonInfo.CommonInfo; | |
| 8 | 11 | import com.cnlive.moudle.pedometer.frame.presenter.OnGoingFragmentPresenter; |
| 9 | 12 | import com.cnlive.moudle.pedometer.frame.view.OnGoingFragmentView; |
| 13 | +import com.example.moudle_pedometer.R; | |
| 10 | 14 | import com.example.moudle_pedometer.databinding.FragmentRunRaceDetailBinding; |
| 15 | +import com.qmuiteam.qmui.util.QMUIStatusBarHelper; | |
| 11 | 16 | |
| 12 | 17 | public class OnGoingFragment extends QMUIFragment<OnGoingFragmentView, OnGoingFragmentPresenter, FragmentRunRaceDetailBinding> { |
| 18 | + private String eventId; | |
| 19 | + | |
| 20 | + public static OnGoingFragment newInstance(String eventId) { | |
| 21 | + OnGoingFragment fragment = new OnGoingFragment(); | |
| 22 | + Bundle bundle = new Bundle(); | |
| 23 | + bundle.putString("eventId", eventId); | |
| 24 | + fragment.setArguments(bundle); | |
| 25 | + return fragment; | |
| 26 | + } | |
| 27 | + | |
| 13 | 28 | @Override |
| 14 | 29 | protected int getToolbarId() { |
| 15 | 30 | return 0; |
| ... | ... | @@ -22,11 +37,27 @@ public class OnGoingFragment extends QMUIFragment<OnGoingFragmentView, OnGoingFr |
| 22 | 37 | |
| 23 | 38 | @Override |
| 24 | 39 | protected int getLayoutId() { |
| 25 | - return 0; | |
| 40 | + return R.layout.fragment_run_race_detail; | |
| 26 | 41 | } |
| 27 | 42 | |
| 28 | 43 | @Override |
| 29 | 44 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { |
| 30 | 45 | super.onViewCreated(view, savedInstanceState); |
| 46 | + QMUIStatusBarHelper.setStatusBarLightMode(getActivity()); | |
| 47 | + StatusBarUtil2.setColor(getActivity(), getResources().getColor(R.color.white), 0); | |
| 48 | + if (getMvpView() != null) { | |
| 49 | + getMvpView().initMap(); | |
| 50 | + } | |
| 51 | + if (null!=getArguments()){ | |
| 52 | + eventId=getArguments().getString("eventId"); | |
| 53 | + if (!TextUtils.isEmpty(eventId)){ | |
| 54 | + if (getPresenter() != null) { | |
| 55 | + if (!TextUtils.isEmpty(CommonInfo.getStreetId(getActivity()))) { | |
| 56 | + getPresenter().getRunRaceDetailInfo(getActivity(), eventId, CommonInfo.getUserId(getActivity()), "0"); | |
| 57 | + } | |
| 58 | + } | |
| 59 | + } | |
| 60 | + } | |
| 61 | + | |
| 31 | 62 | } |
| 32 | 63 | } | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/utils/StepUtil.java