Commit 402c6b91c2369afdf5e7fe0e2d67de716a18d7b2
1 parent
f4614666
1 轨迹工具恢复过滤精度
Showing
4 changed files
with
27 additions
and
16 deletions
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/frame/view/StartTraceFragmentView.java
| ... | ... | @@ -426,19 +426,27 @@ public class StartTraceFragmentView implements MvpView, SensorEventListener { |
| 426 | 426 | if (isFirstLoc) { |
| 427 | 427 | isFirstLoc = false; |
| 428 | 428 | Toast.makeText(getContext(), "当前定位误差为:" + location.getRadius() + "米,请您移动至空旷地带!", Toast.LENGTH_SHORT).show(); |
| 429 | + //过滤定位精度 | |
| 430 | + if (location.getRadius() > Constant.LOCA_ACCURACY) { | |
| 431 | + return; | |
| 432 | + } | |
| 433 | + } else { | |
| 434 | + //过滤定位精度 | |
| 435 | + if (location.getRadius() > Constant.LOCA_ACCURACY) { | |
| 436 | + return; | |
| 437 | + } | |
| 438 | + currentLatLng = new LatLng(location.getLatitude(), | |
| 439 | + location.getLongitude()); | |
| 440 | + followMyLocation = new MyLocationData.Builder() | |
| 441 | + .accuracy(location.getRadius()) | |
| 442 | + // 此处设置开发者获取到的方向信息,顺时针0-360 | |
| 443 | + .direction(location.getDirection()).latitude(location.getLatitude()) | |
| 444 | + .longitude(location.getLongitude()).build(); | |
| 445 | + baiduMap.setMyLocationData(followMyLocation); | |
| 446 | + MapStatus.Builder builder = new MapStatus.Builder(); | |
| 447 | + builder.target(new LatLng(followMyLocation.latitude, followMyLocation.longitude)).zoom(DEFULT_ZOOM); | |
| 448 | + baiduMap.animateMapStatus(MapStatusUpdateFactory.newMapStatus(builder.build())); | |
| 429 | 449 | } |
| 430 | - //过滤定位精度 | |
| 431 | - if (location.getRadius() > Constant.LOCA_ACCURACY) { | |
| 432 | - return; | |
| 433 | - } | |
| 434 | - currentLatLng = new LatLng(location.getLatitude(), | |
| 435 | - location.getLongitude()); | |
| 436 | - followMyLocation = new MyLocationData.Builder() | |
| 437 | - .accuracy(location.getRadius()) | |
| 438 | - // 此处设置开发者获取到的方向信息,顺时针0-360 | |
| 439 | - .direction(location.getDirection()).latitude(location.getLatitude()) | |
| 440 | - .longitude(location.getLongitude()).build(); | |
| 441 | - | |
| 442 | 450 | // if (location.hasAddr()) { |
| 443 | 451 | // if (!TextUtils.isEmpty(location.getAddress().address)) { |
| 444 | 452 | // currentAddress = location.getAddress().address; | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/service/CollStepService.java
| ... | ... | @@ -60,8 +60,8 @@ public class CollStepService extends Service implements SensorEventListener { |
| 60 | 60 | /** |
| 61 | 61 | * 通知栏相关 |
| 62 | 62 | */ |
| 63 | - private String CHANNEL_ONE_ID = "com.cnlive.step"; | |
| 64 | - private String CHANNEL_ONE_NAME = "Step"; | |
| 63 | + private String CHANNEL_ONE_ID = "com.cnlive.collstep"; | |
| 64 | + private String CHANNEL_ONE_NAME = "collStep"; | |
| 65 | 65 | private NotificationManager mNM; |
| 66 | 66 | private Notification notification = null; |
| 67 | 67 | private RemoteViews remoteViews; | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RunRaceDetailFragmentView.java
| ... | ... | @@ -421,7 +421,7 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { |
| 421 | 421 | } |
| 422 | 422 | //设置配速 |
| 423 | 423 | if (!TextUtils.isEmpty(runRaceDetailInfo.getPace())) { |
| 424 | - fragment.binding.includePersonScore.tvSpeed.setText(runRaceDetailInfo.getPace()); | |
| 424 | + fragment.binding.includePersonScore.tvSpeed.setText(runRaceDetailInfo.getPace().trim()); | |
| 425 | 425 | } |
| 426 | 426 | } else { |
| 427 | 427 | //隐藏 | ... | ... |
moudle_pedometer/src/main/res/layout/layout_run_detail_rank.xml
| ... | ... | @@ -59,8 +59,11 @@ |
| 59 | 59 | |
| 60 | 60 | <com.cnlive.moudle.pedometer.ui.widget.FivePersonIconView |
| 61 | 61 | android:id="@+id/five_rank_person" |
| 62 | - android:layout_width="wrap_content" | |
| 62 | + android:layout_width="150dp" | |
| 63 | 63 | android:layout_height="35dp" |
| 64 | + android:layout_marginLeft="1dp" | |
| 65 | + android:layout_marginRight="1dp" | |
| 66 | + android:gravity="center" | |
| 64 | 67 | FivePersonIconView:showRightFlag="false"></com.cnlive.moudle.pedometer.ui.widget.FivePersonIconView> |
| 65 | 68 | |
| 66 | 69 | <LinearLayout | ... | ... |