Commit b58d779f71edd5f37f65d8c23dfff63574fd9531
1 parent
cdf2ad10
1 针对find x优化历史轨迹查询精度
Showing
7 changed files
with
53 additions
and
11 deletions
config.gradle
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/frame/view/CollRunRaceDetailFragmentView.java
| @@ -158,8 +158,6 @@ public class CollRunRaceDetailFragmentView implements MvpView, SensorEventListen | @@ -158,8 +158,6 @@ public class CollRunRaceDetailFragmentView implements MvpView, SensorEventListen | ||
| 158 | this.runRaceDetailInfo = runRaceDetailInfo; | 158 | this.runRaceDetailInfo = runRaceDetailInfo; |
| 159 | //显示地图 | 159 | //显示地图 |
| 160 | fragment.binding.mapView.setVisibility(View.VISIBLE); | 160 | fragment.binding.mapView.setVisibility(View.VISIBLE); |
| 161 | - //隐藏底部滑动卡片 | ||
| 162 | - fragment.binding.slidingLayout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED); | ||
| 163 | //隐藏空视图 | 161 | //隐藏空视图 |
| 164 | fragment.binding.emptyLayout.setVisibility(View.GONE); | 162 | fragment.binding.emptyLayout.setVisibility(View.GONE); |
| 165 | //设置底部卡片第一次可滑动的位置 | 163 | //设置底部卡片第一次可滑动的位置 |
| @@ -218,6 +216,10 @@ public class CollRunRaceDetailFragmentView implements MvpView, SensorEventListen | @@ -218,6 +216,10 @@ public class CollRunRaceDetailFragmentView implements MvpView, SensorEventListen | ||
| 218 | fragment.binding.includeStreet.tvSecondTitle.setVisibility(View.VISIBLE); | 216 | fragment.binding.includeStreet.tvSecondTitle.setVisibility(View.VISIBLE); |
| 219 | fragment.binding.includeStreet.tvSecondTitle.setText(runRaceDetailInfo.getE_subtitle()); | 217 | fragment.binding.includeStreet.tvSecondTitle.setText(runRaceDetailInfo.getE_subtitle()); |
| 220 | } | 218 | } |
| 219 | + | ||
| 220 | + //显示底部滑动卡片 | ||
| 221 | + fragment.binding.slidingLayout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED); | ||
| 222 | + fragment.binding.scrollView.scrollTo(0, 0); | ||
| 221 | //判断是否显示绑定轨迹按钮 | 223 | //判断是否显示绑定轨迹按钮 |
| 222 | if (runRaceDetailInfo.isTrackButton()) { | 224 | if (runRaceDetailInfo.isTrackButton()) { |
| 223 | //显示 | 225 | //显示 |
| @@ -238,9 +240,7 @@ public class CollRunRaceDetailFragmentView implements MvpView, SensorEventListen | @@ -238,9 +240,7 @@ public class CollRunRaceDetailFragmentView implements MvpView, SensorEventListen | ||
| 238 | // return false; | 240 | // return false; |
| 239 | // } | 241 | // } |
| 240 | // }); | 242 | // }); |
| 241 | - //显示底部滑动卡片 | ||
| 242 | - fragment.binding.slidingLayout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED); | ||
| 243 | - fragment.binding.scrollView.scrollTo(0, 0); | 243 | + |
| 244 | if (!TextUtils.isEmpty(runRaceDetailInfo.getE_subtitle())) { | 244 | if (!TextUtils.isEmpty(runRaceDetailInfo.getE_subtitle())) { |
| 245 | fragment.binding.slidingLayout.setPanelHeight(ScreenUtil.dip2px(getContext(), 170)); | 245 | fragment.binding.slidingLayout.setPanelHeight(ScreenUtil.dip2px(getContext(), 170)); |
| 246 | } else { | 246 | } else { |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RunRaceDetailFragmentView.java
| @@ -227,7 +227,6 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { | @@ -227,7 +227,6 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { | ||
| 227 | fragment.binding.slidingLayout.addPanelSlideListener(new SlidingUpPanelLayout.PanelSlideListener() { | 227 | fragment.binding.slidingLayout.addPanelSlideListener(new SlidingUpPanelLayout.PanelSlideListener() { |
| 228 | @Override | 228 | @Override |
| 229 | public void onPanelSlide(View panel, float slideOffset) { | 229 | public void onPanelSlide(View panel, float slideOffset) { |
| 230 | - Log.e(TAG, "onPanelSlide: "); | ||
| 231 | //设置顶层卡片特效 | 230 | //设置顶层卡片特效 |
| 232 | if (slideOffset > 0.7) { | 231 | if (slideOffset > 0.7) { |
| 233 | double alpha = (255 / (1 - 0.6)) * (slideOffset - 0.6); | 232 | double alpha = (255 / (1 - 0.6)) * (slideOffset - 0.6); |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RunningMapFragmentView.java
| @@ -51,6 +51,7 @@ import com.cnlive.moudle.pedometer.utils.ButtonAnimUtil; | @@ -51,6 +51,7 @@ import com.cnlive.moudle.pedometer.utils.ButtonAnimUtil; | ||
| 51 | import com.cnlive.moudle.pedometer.utils.ChineseToSpeechUtil; | 51 | import com.cnlive.moudle.pedometer.utils.ChineseToSpeechUtil; |
| 52 | import com.cnlive.moudle.pedometer.utils.GsonUtil; | 52 | import com.cnlive.moudle.pedometer.utils.GsonUtil; |
| 53 | import com.cnlive.moudle.pedometer.utils.MyMapUtil; | 53 | import com.cnlive.moudle.pedometer.utils.MyMapUtil; |
| 54 | +import com.cnlive.moudle.pedometer.utils.PhoneUtil; | ||
| 54 | import com.cnlive.moudle.pedometer.utils.StepUtil; | 55 | import com.cnlive.moudle.pedometer.utils.StepUtil; |
| 55 | import com.example.moudle_pedometer.R; | 56 | import com.example.moudle_pedometer.R; |
| 56 | import com.hannesdorfmann.mosby3.mvp.MvpView; | 57 | import com.hannesdorfmann.mosby3.mvp.MvpView; |
| @@ -325,9 +326,17 @@ public class RunningMapFragmentView implements MvpView, SensorEventListener { | @@ -325,9 +326,17 @@ public class RunningMapFragmentView implements MvpView, SensorEventListener { | ||
| 325 | 326 | ||
| 326 | } else { | 327 | } else { |
| 327 | //过滤定位精度 | 328 | //过滤定位精度 |
| 328 | - if (location.getRadius() > Constant.LOCA_ACCURACY) { | ||
| 329 | - return; | 329 | + boolean isNeedZoomInRaduis= PhoneUtil.isNeedZoomInLoacRaduis(); |
| 330 | + if (isNeedZoomInRaduis){ | ||
| 331 | + if (location.getRadius() > Constant.Need_ZOOM_IN_RADUIS) { | ||
| 332 | + return; | ||
| 333 | + } | ||
| 334 | + }else { | ||
| 335 | + if (location.getRadius() > Constant.LOCA_ACCURACY) { | ||
| 336 | + return; | ||
| 337 | + } | ||
| 330 | } | 338 | } |
| 339 | + | ||
| 331 | } | 340 | } |
| 332 | 341 | ||
| 333 | 342 |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/model/Constant.java
| @@ -37,7 +37,7 @@ public class Constant { | @@ -37,7 +37,7 @@ public class Constant { | ||
| 37 | /*****************************************运营工具其他值,非标志位****************************************************/ | 37 | /*****************************************运营工具其他值,非标志位****************************************************/ |
| 38 | public static final double PASS_RATE = 0.7;//通过率70% | 38 | public static final double PASS_RATE = 0.7;//通过率70% |
| 39 | public static final int CHECK_ACCURACY = 50;//判断用户是否完成的精度范围 | 39 | public static final int CHECK_ACCURACY = 50;//判断用户是否完成的精度范围 |
| 40 | - public static final int LOCA_ACCURACY = 20;//定位过滤精度 | 40 | + public static final int LOCA_ACCURACY = 30;//定位过滤精度 |
| 41 | public static final int LOCA_END_POINT_ACCURACY = 20;//终点位置比较精度 | 41 | public static final int LOCA_END_POINT_ACCURACY = 20;//终点位置比较精度 |
| 42 | public static final int LOCA_START_POINT_ACCURACY = 20;//起点位置比较精度 | 42 | public static final int LOCA_START_POINT_ACCURACY = 20;//起点位置比较精度 |
| 43 | public static final int FENCE_OFFSET = 50;//围栏偏离距离 | 43 | public static final int FENCE_OFFSET = 50;//围栏偏离距离 |
| @@ -45,4 +45,5 @@ public class Constant { | @@ -45,4 +45,5 @@ public class Constant { | ||
| 45 | public static final int TAKE_POINT_MAX_SIZE = 100;//最大打点数量 | 45 | public static final int TAKE_POINT_MAX_SIZE = 100;//最大打点数量 |
| 46 | public static final int COLL_GEORESULT_RADIUS = 20;//打点逆地理半径 | 46 | public static final int COLL_GEORESULT_RADIUS = 20;//打点逆地理半径 |
| 47 | public static final int WEBVIEW_FONT_SIZE = 40;//webview显示的网页文字大小 | 47 | public static final int WEBVIEW_FONT_SIZE = 40;//webview显示的网页文字大小 |
| 48 | + public static final int Need_ZOOM_IN_RADUIS = 80;//需要扩大精度范围 | ||
| 48 | } | 49 | } |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/utils/MyMapUtil.java
| @@ -501,7 +501,13 @@ public class MyMapUtil { | @@ -501,7 +501,13 @@ public class MyMapUtil { | ||
| 501 | //自动判断交通方式 | 501 | //自动判断交通方式 |
| 502 | processOption.setTransportMode(TransportMode.walking); | 502 | processOption.setTransportMode(TransportMode.walking); |
| 503 | // 设置精度过滤值(定位精度大于100米的过滤掉) | 503 | // 设置精度过滤值(定位精度大于100米的过滤掉) |
| 504 | - processOption.setRadiusThreshold(20); | 504 | + boolean isNeedZoomInRaduis= PhoneUtil.isNeedZoomInLoacRaduis(); |
| 505 | + if (isNeedZoomInRaduis){ | ||
| 506 | + processOption.setRadiusThreshold(Constant.Need_ZOOM_IN_RADUIS); | ||
| 507 | + }else { | ||
| 508 | + processOption.setRadiusThreshold(Constant.LOCA_ACCURACY); | ||
| 509 | + } | ||
| 510 | + | ||
| 505 | // 设置纠偏选项 | 511 | // 设置纠偏选项 |
| 506 | historyTrackRequest.setProcessOption(processOption); | 512 | historyTrackRequest.setProcessOption(processOption); |
| 507 | // 设置里程填充方式为驾车 | 513 | // 设置里程填充方式为驾车 |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/utils/PhoneUtil.java
0 → 100644
| 1 | +package com.cnlive.moudle.pedometer.utils; | ||
| 2 | + | ||
| 3 | +public class PhoneUtil { | ||
| 4 | + | ||
| 5 | + /** | ||
| 6 | + * 是否需要放大定位精度 | ||
| 7 | + * | ||
| 8 | + * @return | ||
| 9 | + */ | ||
| 10 | + public static boolean isNeedZoomInLoacRaduis() { | ||
| 11 | + try { | ||
| 12 | + String carrier = android.os.Build.MANUFACTURER; | ||
| 13 | + String phoneModel = android.os.Build.MODEL; | ||
| 14 | + if ("oppo".equals(carrier) || "OPPO".equals(carrier)) { | ||
| 15 | + //oppo find x | ||
| 16 | + if ("PAFM00".equals(phoneModel)) { | ||
| 17 | + return true; | ||
| 18 | + } | ||
| 19 | + return false; | ||
| 20 | + } else { | ||
| 21 | + return false; | ||
| 22 | + } | ||
| 23 | + } catch (Exception e) { | ||
| 24 | + return false; | ||
| 25 | + } | ||
| 26 | + } | ||
| 27 | +} |