Commit b58d779f71edd5f37f65d8c23dfff63574fd9531

Authored by 杨帅
1 parent cdf2ad10

1 针对find x优化历史轨迹查询精度

config.gradle
... ... @@ -21,7 +21,7 @@ ext {
21 21 //编译方式
22 22 debug : false,
23 23 //版本号
24   - version: "0.8.7",
  24 + version: "0.8.9",
25 25 //Lib库前缀
26 26 packeg : "com.cnlive.module",
27 27 //Lib库名称
... ...
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/frame/view/CollRunRaceDetailFragmentView.java
... ... @@ -158,8 +158,6 @@ public class CollRunRaceDetailFragmentView implements MvpView, SensorEventListen
158 158 this.runRaceDetailInfo = runRaceDetailInfo;
159 159 //显示地图
160 160 fragment.binding.mapView.setVisibility(View.VISIBLE);
161   - //隐藏底部滑动卡片
162   - fragment.binding.slidingLayout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
163 161 //隐藏空视图
164 162 fragment.binding.emptyLayout.setVisibility(View.GONE);
165 163 //设置底部卡片第一次可滑动的位置
... ... @@ -218,6 +216,10 @@ public class CollRunRaceDetailFragmentView implements MvpView, SensorEventListen
218 216 fragment.binding.includeStreet.tvSecondTitle.setVisibility(View.VISIBLE);
219 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 224 if (runRaceDetailInfo.isTrackButton()) {
223 225 //显示
... ... @@ -238,9 +240,7 @@ public class CollRunRaceDetailFragmentView implements MvpView, SensorEventListen
238 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 244 if (!TextUtils.isEmpty(runRaceDetailInfo.getE_subtitle())) {
245 245 fragment.binding.slidingLayout.setPanelHeight(ScreenUtil.dip2px(getContext(), 170));
246 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 227 fragment.binding.slidingLayout.addPanelSlideListener(new SlidingUpPanelLayout.PanelSlideListener() {
228 228 @Override
229 229 public void onPanelSlide(View panel, float slideOffset) {
230   - Log.e(TAG, "onPanelSlide: ");
231 230 //设置顶层卡片特效
232 231 if (slideOffset > 0.7) {
233 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 51 import com.cnlive.moudle.pedometer.utils.ChineseToSpeechUtil;
52 52 import com.cnlive.moudle.pedometer.utils.GsonUtil;
53 53 import com.cnlive.moudle.pedometer.utils.MyMapUtil;
  54 +import com.cnlive.moudle.pedometer.utils.PhoneUtil;
54 55 import com.cnlive.moudle.pedometer.utils.StepUtil;
55 56 import com.example.moudle_pedometer.R;
56 57 import com.hannesdorfmann.mosby3.mvp.MvpView;
... ... @@ -325,9 +326,17 @@ public class RunningMapFragmentView implements MvpView, SensorEventListener {
325 326  
326 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 37 /*****************************************运营工具其他值,非标志位****************************************************/
38 38 public static final double PASS_RATE = 0.7;//通过率70%
39 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 41 public static final int LOCA_END_POINT_ACCURACY = 20;//终点位置比较精度
42 42 public static final int LOCA_START_POINT_ACCURACY = 20;//起点位置比较精度
43 43 public static final int FENCE_OFFSET = 50;//围栏偏离距离
... ... @@ -45,4 +45,5 @@ public class Constant {
45 45 public static final int TAKE_POINT_MAX_SIZE = 100;//最大打点数量
46 46 public static final int COLL_GEORESULT_RADIUS = 20;//打点逆地理半径
47 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 501 //自动判断交通方式
502 502 processOption.setTransportMode(TransportMode.walking);
503 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 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 +}
... ...