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,8 +303,8 @@ public class CollRunningMapFragmentView implements MvpView, SensorEventListener | ||
| 303 | public void onClick(View view) { | 303 | public void onClick(View view) { |
| 304 | //先获取打点数量 | 304 | //先获取打点数量 |
| 305 | int canTakePointCount = CollStepUtil.getCollImportPointSize(getContext(), CollCommonInfo.getUserId(getContext())); | 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 | } else { | 308 | } else { |
| 309 | if (null != followMyLocation) { | 309 | if (null != followMyLocation) { |
| 310 | currentImportLatLng = new LatLng(followMyLocation.latitude, followMyLocation.longitude); | 310 | currentImportLatLng = new LatLng(followMyLocation.latitude, followMyLocation.longitude); |
| @@ -653,7 +653,10 @@ public class CollRunningMapFragmentView implements MvpView, SensorEventListener | @@ -653,7 +653,10 @@ public class CollRunningMapFragmentView implements MvpView, SensorEventListener | ||
| 653 | fragment.binding.ivGpsState.setBackground(getContext().getResources().getDrawable(R.drawable.rt_training_gps_3)); | 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 | if (isFirstLoc) { | 661 | if (isFirstLoc) { |
| 659 | isFirstLoc = false; | 662 | isFirstLoc = false; |
| @@ -669,10 +672,6 @@ public class CollRunningMapFragmentView implements MvpView, SensorEventListener | @@ -669,10 +672,6 @@ public class CollRunningMapFragmentView implements MvpView, SensorEventListener | ||
| 669 | baiduMap.animateMapStatus(MapStatusUpdateFactory.newMapStatus(builder.build())); | 672 | baiduMap.animateMapStatus(MapStatusUpdateFactory.newMapStatus(builder.build())); |
| 670 | } else { | 673 | } else { |
| 671 | //不是第一次定位状态 | 674 | //不是第一次定位状态 |
| 672 | - //过滤定位精度 | ||
| 673 | - if (location.getRadius() > Constant.LOCA_ACCURACY) { | ||
| 674 | - return; | ||
| 675 | - } | ||
| 676 | mCurrentAccracy = location.getRadius(); | 675 | mCurrentAccracy = location.getRadius(); |
| 677 | followMyLocation = new MyLocationData.Builder() | 676 | followMyLocation = new MyLocationData.Builder() |
| 678 | .accuracy(location.getRadius()) | 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,7 +204,7 @@ public class CollTraceListDetailFragmentView implements MvpView, OnFenceListener | ||
| 204 | startLocation.setPointName(eventShoeLinesBean.getStartLocation()); | 204 | startLocation.setPointName(eventShoeLinesBean.getStartLocation()); |
| 205 | startLocation.setLatitude(0); | 205 | startLocation.setLatitude(0); |
| 206 | startLocation.setLongitude(0); | 206 | startLocation.setLongitude(0); |
| 207 | - }else { | 207 | + } else { |
| 208 | startLocation = new CollectPoint(); | 208 | startLocation = new CollectPoint(); |
| 209 | startLocation.setPointName(""); | 209 | startLocation.setPointName(""); |
| 210 | startLocation.setLatitude(0); | 210 | startLocation.setLatitude(0); |
| @@ -217,7 +217,7 @@ public class CollTraceListDetailFragmentView implements MvpView, OnFenceListener | @@ -217,7 +217,7 @@ public class CollTraceListDetailFragmentView implements MvpView, OnFenceListener | ||
| 217 | endLocation.setPointName(eventShoeLinesBean.getEndLocation()); | 217 | endLocation.setPointName(eventShoeLinesBean.getEndLocation()); |
| 218 | endLocation.setLatitude(0); | 218 | endLocation.setLatitude(0); |
| 219 | endLocation.setLongitude(0); | 219 | endLocation.setLongitude(0); |
| 220 | - }else { | 220 | + } else { |
| 221 | endLocation = new CollectPoint(); | 221 | endLocation = new CollectPoint(); |
| 222 | endLocation.setPointName(""); | 222 | endLocation.setPointName(""); |
| 223 | endLocation.setLatitude(0); | 223 | endLocation.setLatitude(0); |
| @@ -253,7 +253,7 @@ public class CollTraceListDetailFragmentView implements MvpView, OnFenceListener | @@ -253,7 +253,7 @@ public class CollTraceListDetailFragmentView implements MvpView, OnFenceListener | ||
| 253 | //设置用户头像 | 253 | //设置用户头像 |
| 254 | if (!TextUtils.isEmpty(eventShoeLinesBean.getUserMsg().getImage())) { | 254 | if (!TextUtils.isEmpty(eventShoeLinesBean.getUserMsg().getImage())) { |
| 255 | GlideApp.with(getContext()).load(eventShoeLinesBean.getUserMsg().getImage()).into(fragment.binding.includeFinishUserInfo.qmIvIcon); | 255 | GlideApp.with(getContext()).load(eventShoeLinesBean.getUserMsg().getImage()).into(fragment.binding.includeFinishUserInfo.qmIvIcon); |
| 256 | - }else { | 256 | + } else { |
| 257 | GlideApp.with(getContext()).load(getContext().getResources().getString(R.string.default_face_url)).into(fragment.binding.includeFinishUserInfo.qmIvIcon); | 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,7 +414,7 @@ public class CollTraceListDetailFragmentView implements MvpView, OnFenceListener | ||
| 414 | if (5102 == createFenceResponse.getStatus()) { | 414 | if (5102 == createFenceResponse.getStatus()) { |
| 415 | QMUITipDialogUtil.dismessDialog(); | 415 | QMUITipDialogUtil.dismessDialog(); |
| 416 | QMUITipDialogUtil.failedDialog(fragment.getActivity(), createFenceResponse.getMessage(), 1); | 416 | QMUITipDialogUtil.failedDialog(fragment.getActivity(), createFenceResponse.getMessage(), 1); |
| 417 | - } else { | 417 | + } else if (0 == createFenceResponse.getStatus()) { |
| 418 | if (null != eventShoeLinesBean) { | 418 | if (null != eventShoeLinesBean) { |
| 419 | QMUITipDialogUtil.dismessDialog(); | 419 | QMUITipDialogUtil.dismessDialog(); |
| 420 | if (null == fragment.getPresenter() || null == getContext()) { | 420 | if (null == fragment.getPresenter() || null == getContext()) { |
| @@ -422,6 +422,9 @@ public class CollTraceListDetailFragmentView implements MvpView, OnFenceListener | @@ -422,6 +422,9 @@ public class CollTraceListDetailFragmentView implements MvpView, OnFenceListener | ||
| 422 | } | 422 | } |
| 423 | fragment.getPresenter().bindingShoeLine(getContext(), eventShoeLinesBean.getId(), eventShoeLinesBean.getEventId(), createFenceResponse.getFenceId() + "", eventShoeLinesBean.getEventName(), position); | 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 |