Commit 99f1762f1822f71478b6a96de89d9940906c7db8
1 parent
884e14b8
1 修改轨迹工具打点判断逻辑
Showing
3 changed files
with
14 additions
and
12 deletions
config.gradle
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/frame/view/CollRunningMapFragmentView.java
| ... | ... | @@ -303,8 +303,8 @@ public class CollRunningMapFragmentView implements MvpView, SensorEventListener |
| 303 | 303 | public void onClick(View view) { |
| 304 | 304 | //先获取打点数量 |
| 305 | 305 | int canTakePointCount = CollStepUtil.getCollImportPointSize(getContext(), CollCommonInfo.getUserId(getContext())); |
| 306 | - if (0 == canTakePointCount) { | |
| 307 | - AlertUtil.showDeftToast(getContext(), "您尚未打点,请打点后结束"); | |
| 306 | + if (canTakePointCount<2) { | |
| 307 | + AlertUtil.showDeftToast(getContext(), "请至少打两个点后结束"); | |
| 308 | 308 | } else { |
| 309 | 309 | if (null != followMyLocation) { |
| 310 | 310 | currentImportLatLng = new LatLng(followMyLocation.latitude, followMyLocation.longitude); |
| ... | ... | @@ -653,7 +653,10 @@ public class CollRunningMapFragmentView implements MvpView, SensorEventListener |
| 653 | 653 | fragment.binding.ivGpsState.setBackground(getContext().getResources().getDrawable(R.drawable.rt_training_gps_3)); |
| 654 | 654 | } |
| 655 | 655 | } |
| 656 | - | |
| 656 | + //过滤定位精度 | |
| 657 | + if (location.getRadius() > Constant.LOCA_ACCURACY) { | |
| 658 | + return; | |
| 659 | + } | |
| 657 | 660 | //第一次定位 |
| 658 | 661 | if (isFirstLoc) { |
| 659 | 662 | isFirstLoc = false; |
| ... | ... | @@ -669,10 +672,6 @@ public class CollRunningMapFragmentView implements MvpView, SensorEventListener |
| 669 | 672 | baiduMap.animateMapStatus(MapStatusUpdateFactory.newMapStatus(builder.build())); |
| 670 | 673 | } else { |
| 671 | 674 | //不是第一次定位状态 |
| 672 | - //过滤定位精度 | |
| 673 | - if (location.getRadius() > Constant.LOCA_ACCURACY) { | |
| 674 | - return; | |
| 675 | - } | |
| 676 | 675 | mCurrentAccracy = location.getRadius(); |
| 677 | 676 | followMyLocation = new MyLocationData.Builder() |
| 678 | 677 | .accuracy(location.getRadius()) | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/frame/view/CollTraceListDetailFragmentView.java
| ... | ... | @@ -204,7 +204,7 @@ public class CollTraceListDetailFragmentView implements MvpView, OnFenceListener |
| 204 | 204 | startLocation.setPointName(eventShoeLinesBean.getStartLocation()); |
| 205 | 205 | startLocation.setLatitude(0); |
| 206 | 206 | startLocation.setLongitude(0); |
| 207 | - }else { | |
| 207 | + } else { | |
| 208 | 208 | startLocation = new CollectPoint(); |
| 209 | 209 | startLocation.setPointName(""); |
| 210 | 210 | startLocation.setLatitude(0); |
| ... | ... | @@ -217,7 +217,7 @@ public class CollTraceListDetailFragmentView implements MvpView, OnFenceListener |
| 217 | 217 | endLocation.setPointName(eventShoeLinesBean.getEndLocation()); |
| 218 | 218 | endLocation.setLatitude(0); |
| 219 | 219 | endLocation.setLongitude(0); |
| 220 | - }else { | |
| 220 | + } else { | |
| 221 | 221 | endLocation = new CollectPoint(); |
| 222 | 222 | endLocation.setPointName(""); |
| 223 | 223 | endLocation.setLatitude(0); |
| ... | ... | @@ -253,7 +253,7 @@ public class CollTraceListDetailFragmentView implements MvpView, OnFenceListener |
| 253 | 253 | //设置用户头像 |
| 254 | 254 | if (!TextUtils.isEmpty(eventShoeLinesBean.getUserMsg().getImage())) { |
| 255 | 255 | GlideApp.with(getContext()).load(eventShoeLinesBean.getUserMsg().getImage()).into(fragment.binding.includeFinishUserInfo.qmIvIcon); |
| 256 | - }else { | |
| 256 | + } else { | |
| 257 | 257 | GlideApp.with(getContext()).load(getContext().getResources().getString(R.string.default_face_url)).into(fragment.binding.includeFinishUserInfo.qmIvIcon); |
| 258 | 258 | } |
| 259 | 259 | //设置用户行走公里 |
| ... | ... | @@ -414,7 +414,7 @@ public class CollTraceListDetailFragmentView implements MvpView, OnFenceListener |
| 414 | 414 | if (5102 == createFenceResponse.getStatus()) { |
| 415 | 415 | QMUITipDialogUtil.dismessDialog(); |
| 416 | 416 | QMUITipDialogUtil.failedDialog(fragment.getActivity(), createFenceResponse.getMessage(), 1); |
| 417 | - } else { | |
| 417 | + } else if (0 == createFenceResponse.getStatus()) { | |
| 418 | 418 | if (null != eventShoeLinesBean) { |
| 419 | 419 | QMUITipDialogUtil.dismessDialog(); |
| 420 | 420 | if (null == fragment.getPresenter() || null == getContext()) { |
| ... | ... | @@ -422,6 +422,9 @@ public class CollTraceListDetailFragmentView implements MvpView, OnFenceListener |
| 422 | 422 | } |
| 423 | 423 | fragment.getPresenter().bindingShoeLine(getContext(), eventShoeLinesBean.getId(), eventShoeLinesBean.getEventId(), createFenceResponse.getFenceId() + "", eventShoeLinesBean.getEventName(), position); |
| 424 | 424 | } |
| 425 | + } else { | |
| 426 | + QMUITipDialogUtil.dismessDialog(); | |
| 427 | + QMUITipDialogUtil.failedDialog(fragment.getActivity(), createFenceResponse.getMessage(), 1); | |
| 425 | 428 | } |
| 426 | 429 | } |
| 427 | 430 | ... | ... |