Commit a4ea768ed3eb59e8f2c9c0f51b0d13254cbf0591

Authored by 杨帅
1 parent bcd74012

1 修复在无网络切换到有网时,赛事详情页小概率消失问题

2 修复部分机型在赛事结束页中相关提示标签遮挡问题
3 修复当字体调到最大时,赛事结束页UI显示异常问题
4 优化起点终点相同时,点击开始会提示结束弹框的问题
config.gradle
... ... @@ -21,7 +21,7 @@ ext {
21 21 //编译方式
22 22 debug : false,
23 23 //版本号
24   - version: "0.7.26",
  24 + version: "0.8.0",
25 25 //Lib库前缀
26 26 packeg : "com.cnlive.module",
27 27 //Lib库名称
... ...
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/OnGoingFragmentView.java
... ... @@ -231,7 +231,7 @@ public class OnGoingFragmentView implements MvpView {
231 231 return false;
232 232 }
233 233 });
234   - fragment.binding.slidingLayout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
  234 +// fragment.binding.slidingLayout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
235 235 }
236 236 //设置活动地点
237 237 if (!TextUtils.isEmpty(runRaceDetailInfo.getAddress())) {
... ... @@ -376,7 +376,7 @@ public class OnGoingFragmentView implements MvpView {
376 376  
377 377 public void initMap() {
378 378 //隐藏底部滑动卡片
379   - fragment.binding.slidingLayout.setPanelState(SlidingUpPanelLayout.PanelState.HIDDEN);
  379 +// fragment.binding.slidingLayout.setPanelState(SlidingUpPanelLayout.PanelState.HIDDEN);
380 380 this.mMapView = fragment.binding.mapView;
381 381 if (baiduMap == null) {
382 382 baiduMap = mMapView.getMap();
... ... @@ -430,7 +430,7 @@ public class OnGoingFragmentView implements MvpView {
430 430 //显示空视图
431 431 fragment.binding.emptyLayout.setVisibility(View.VISIBLE);
432 432 //隐藏底部卡片
433   - fragment.binding.slidingLayout.setPanelState(SlidingUpPanelLayout.PanelState.HIDDEN);
  433 +// fragment.binding.slidingLayout.setPanelState(SlidingUpPanelLayout.PanelState.HIDDEN);
434 434 if (fragment.binding.emptyLayout == null) return;
435 435 String titleText = "";
436 436 String detailText = "";
... ...
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RunMainFragmentView.java
... ... @@ -796,6 +796,13 @@ public class RunMainFragmentView implements MvpView {
796 796 if (!TextUtils.isEmpty(userStepEntity.getEndLatLng())) {
797 797 endLatLng = GsonUtil.GsonToBean(userStepEntity.getEndLatLng(), LatLng.class);
798 798 }
  799 + if (null == userStepEntity.getStepCount() || TextUtils.isEmpty(userStepEntity.getStepCount())) {
  800 + return;
  801 + } else {
  802 + if (Integer.parseInt(userStepEntity.getStepCount()) <= 100) {
  803 + return;
  804 + }
  805 + }
799 806 }
800 807 }
801 808 //开始比较
... ...
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RunRaceDetailFragmentView.java
... ... @@ -348,7 +348,7 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener {
348 348 return false;
349 349 }
350 350 });
351   - fragment.binding.slidingLayout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
  351 +
352 352 }
353 353 //设置活动地点
354 354 if (!TextUtils.isEmpty(runRaceDetailInfo.getAddress())) {
... ... @@ -758,7 +758,7 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener {
758 758  
759 759 public void initMap() {
760 760 //隐藏底部滑动卡片
761   - fragment.binding.slidingLayout.setPanelState(SlidingUpPanelLayout.PanelState.HIDDEN);
  761 +// fragment.binding.slidingLayout.setPanelState(SlidingUpPanelLayout.PanelState.HIDDEN);
762 762 this.mMapView = fragment.binding.mapView;
763 763 if (baiduMap == null) {
764 764 baiduMap = mMapView.getMap();
... ... @@ -1208,15 +1208,6 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener {
1208 1208 if (location == null || mMapView == null) {
1209 1209 return;
1210 1210 }
1211   -// if (null != baiduMap && null != startLatLng) {
1212   -// int currentDiatance = (int) DistanceUtil.getDistance(new LatLng(location.getLatitude(), location.getLongitude()), startLatLng);
1213   -// MyMapUtil.setStartInfoWindow(getContext(), baiduMap, new LatLng(location.getLatitude(), location.getLongitude()), currentDiatance + "", new InfoWindow.OnInfoWindowClickListener() {
1214   -// @Override
1215   -// public void onInfoWindowClick() {
1216   -//
1217   -// }
1218   -// });
1219   -// }
1220 1211 if (isFirstLoc) {
1221 1212 isFirstLoc = false;
1222 1213 if (location.getRadius() > Constant.LOCA_ACCURACY) {
... ... @@ -1310,7 +1301,7 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener {
1310 1301 //显示空视图
1311 1302 fragment.binding.emptyLayout.setVisibility(View.VISIBLE);
1312 1303 //隐藏底部卡片
1313   - fragment.binding.slidingLayout.setPanelState(SlidingUpPanelLayout.PanelState.HIDDEN);
  1304 +// fragment.binding.slidingLayout.setPanelState(SlidingUpPanelLayout.PanelState.HIDDEN);
1314 1305 if (fragment.binding.emptyLayout == null) return;
1315 1306 String titleText = "";
1316 1307 String detailText = "";
... ...
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RunningMapFragmentView.java
... ... @@ -319,7 +319,7 @@ public class RunningMapFragmentView implements MvpView, SensorEventListener {
319 319 if (isFirstLoc) {
320 320 isFirstLoc = false;
321 321 if (location.getRadius() > Constant.LOCA_ACCURACY) {
322   - Toast.makeText(getContext(), "当前定位误差为:" + (int)location.getRadius() + "米,请您移动至空旷地带!", Toast.LENGTH_SHORT).show();
  322 + Toast.makeText(getContext(), "当前定位误差为:" + (int) location.getRadius() + "米,请您移动至空旷地带!", Toast.LENGTH_SHORT).show();
323 323 }
324 324  
325 325  
... ... @@ -330,42 +330,6 @@ public class RunningMapFragmentView implements MvpView, SensorEventListener {
330 330 }
331 331 }
332 332  
333   - //进行数据比较(先看看数据库是否有数据)
334   - if (null == endLatLng) {
335   - if (null == userStepEntity) {
336   - userStepEntity = StepUtil.getUserStepData(getContext(), CommonInfo.getUserId(getContext()));
337   - }
338   - if (null != userStepEntity) {
339   - if (!TextUtils.isEmpty(userStepEntity.getEndLatLng())) {
340   - endLatLng = GsonUtil.GsonToBean(userStepEntity.getEndLatLng(), LatLng.class);
341   - }
342   - }
343   - }
344   - //开始比较
345   - if (null != endLatLng) {
346   - LatLng current = new LatLng(location.getLatitude(), location.getLongitude());
347   - if (null != current) {
348   - //开始比较数据
349   - int distance = (int) DistanceUtil.getDistance(current, endLatLng);
350   - if (distance < Constant.LOCA_END_POINT_ACCURACY) {
351   - //设置数据
352   - if (userStepEntity != null) {
353   - userStepEntity.setIsArriveEndPoint(true);
354   - //更新数据
355   - StepUtil.updateStepData(getContext(), userStepEntity);
356   - }
357   -
358   - if (!isfirstEndTip) {
359   - return;
360   - }
361   - if (isfirstEndTip) {
362   - isfirstEndTip = false;
363   - }
364   - //进行提示
365   - showEndTipDialog();
366   - }
367   - }
368   - }
369 333  
370 334 mCurrentAccracy = location.getRadius();
371 335 mylocation = new MyLocationData.Builder()
... ... @@ -409,6 +373,51 @@ public class RunningMapFragmentView implements MvpView, SensorEventListener {
409 373 myCurLatLng = new LatLng(location.getLatitude(),
410 374 location.getLongitude());
411 375 baiduMap.setMyLocationData(mylocation);
  376 +
  377 + //进行数据比较(先看看数据库是否有数据)
  378 + if (null == endLatLng) {
  379 + if (null == userStepEntity) {
  380 + userStepEntity = StepUtil.getUserStepData(getContext(), CommonInfo.getUserId(getContext()));
  381 + }
  382 + if (null != userStepEntity) {
  383 + if (!TextUtils.isEmpty(userStepEntity.getEndLatLng())) {
  384 + endLatLng = GsonUtil.GsonToBean(userStepEntity.getEndLatLng(), LatLng.class);
  385 + }
  386 + if (null == userStepEntity.getStepCount() || TextUtils.isEmpty(userStepEntity.getStepCount())) {
  387 + return;
  388 + } else {
  389 + if (Integer.parseInt(userStepEntity.getStepCount()) <= 100) {
  390 + return;
  391 + }
  392 + }
  393 + }
  394 + }
  395 +
  396 + //开始比较
  397 + if (null != endLatLng) {
  398 + LatLng current = new LatLng(location.getLatitude(), location.getLongitude());
  399 + if (null != current) {
  400 + //开始比较数据
  401 + int distance = (int) DistanceUtil.getDistance(current, endLatLng);
  402 + if (distance < Constant.LOCA_END_POINT_ACCURACY) {
  403 + //设置数据
  404 + if (userStepEntity != null) {
  405 + userStepEntity.setIsArriveEndPoint(true);
  406 + //更新数据
  407 + StepUtil.updateStepData(getContext(), userStepEntity);
  408 + }
  409 +
  410 + if (!isfirstEndTip) {
  411 + return;
  412 + }
  413 + if (isfirstEndTip) {
  414 + isfirstEndTip = false;
  415 + }
  416 + //进行提示
  417 + showEndTipDialog();
  418 + }
  419 + }
  420 + }
412 421 }
413 422 }
414 423  
... ...
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/service/StepService.java
... ... @@ -1288,8 +1288,16 @@ public class StepService extends Service implements SensorEventListener {
1288 1288 if (!TextUtils.isEmpty(userStepEntity.getEndLatLng())) {
1289 1289 endLatLng = GsonUtil.GsonToBean(userStepEntity.getEndLatLng(), LatLng.class);
1290 1290 }
  1291 + if (null == userStepEntity.getStepCount() || TextUtils.isEmpty(userStepEntity.getStepCount())) {
  1292 + return;
  1293 + } else {
  1294 + if (Integer.parseInt(userStepEntity.getStepCount()) <= 100) {
  1295 + return;
  1296 + }
  1297 + }
1291 1298 }
1292 1299 }
  1300 +
1293 1301 //开始比较数据
1294 1302 if (null != endLatLng) {
1295 1303 LatLng current = new LatLng(location.getLatitude(), location.getLongitude());
... ... @@ -1299,7 +1307,7 @@ public class StepService extends Service implements SensorEventListener {
1299 1307 if (distance < Constant.LOCA_END_POINT_ACCURACY) {
1300 1308 if (isHasSendEndTip) {
1301 1309 isHasSendEndTip = false;
1302   - Log.e(TAG, "onReceiveLocation: 到达" );
  1310 + Log.e(TAG, "onReceiveLocation: 到达");
1303 1311 //发送到达终点通知
1304 1312 EventBus.getDefault().post(new MessageEvent(Constant.ARRIVE_END_POINT, ""));
1305 1313 }
... ...
moudle_pedometer/src/main/res/layout/fragment_run_race_detail.xml
... ... @@ -181,6 +181,7 @@
181 181 android:layout_width="match_parent"
182 182 android:layout_height="match_parent"
183 183 android:background="@color/color_fff"
  184 + android:clickable="true"
184 185 android:focusable="true"
185 186 android:focusableInTouchMode="true"
186 187 android:visibility="gone" />
... ...
moudle_pedometer/src/main/res/layout/layout_finish_running_route.xml
... ... @@ -31,7 +31,7 @@
31 31 android:gravity="bottom"
32 32 android:text="跑步路线"
33 33 android:textColor="@color/text_black"
34   - android:textSize="12sp" />
  34 + android:textSize="12dp" />
35 35 </LinearLayout>
36 36 <!--起点-->
37 37 <LinearLayout
... ... @@ -52,7 +52,7 @@
52 52 android:layout_marginLeft="10dp"
53 53 android:text="@string/layout_street_start_point"
54 54 android:textColor="@color/text_gray"
55   - android:textSize="12sp" />
  55 + android:textSize="12dp" />
56 56  
57 57 <TextView
58 58 android:id="@+id/tv_start_point"
... ... @@ -61,7 +61,7 @@
61 61 android:layout_marginLeft="10dp"
62 62 android:text="--"
63 63 android:textColor="@color/black"
64   - android:textSize="12sp" />
  64 + android:textSize="12dp" />
65 65 </LinearLayout>
66 66 <!--竖线-->
67 67 <View
... ... @@ -89,7 +89,7 @@
89 89 android:layout_marginLeft="10dp"
90 90 android:text="@string/layout_street_end_point"
91 91 android:textColor="@color/text_gray"
92   - android:textSize="12sp" />
  92 + android:textSize="12dp" />
93 93  
94 94 <TextView
95 95 android:id="@+id/tv_end_point"
... ... @@ -98,7 +98,7 @@
98 98 android:layout_marginLeft="10dp"
99 99 android:text="--"
100 100 android:textColor="@color/black"
101   - android:textSize="12sp" />
  101 + android:textSize="12dp" />
102 102 </LinearLayout>
103 103 <!--竖线-->
104 104 <View
... ... @@ -133,7 +133,7 @@
133 133 android:layout_marginTop="5dp"
134 134 android:text="--"
135 135 android:textColor="@color/text_black"
136   - android:textSize="18sp"
  136 + android:textSize="18dp"
137 137 android:textStyle="bold" />
138 138  
139 139 <TextView
... ... @@ -142,7 +142,7 @@
142 142 android:layout_marginLeft="11dp"
143 143 android:text="跑步记录时长"
144 144 android:textColor="@color/text_gray"
145   - android:textSize="11sp" />
  145 + android:textSize="11dp" />
146 146 <!---->
147 147 </LinearLayout>
148 148 </LinearLayout>
... ... @@ -176,7 +176,7 @@
176 176 android:text="--"
177 177 android:textStyle="bold"
178 178 android:textColor="@color/text_gray"
179   - android:textSize="11sp" />
  179 + android:textSize="11dp" />
180 180 </LinearLayout>
181 181 <!---->
182 182 </LinearLayout>
... ...
moudle_pedometer/src/main/res/layout/layout_finish_step.xml
... ... @@ -28,7 +28,7 @@
28 28 android:layout_height="wrap_content"
29 29 android:layout_marginLeft="10dp"
30 30 android:text="总步数"
31   - android:textSize="12sp" />
  31 + android:textSize="12dp" />
32 32 </LinearLayout>
33 33 <!---->
34 34 <LinearLayout
... ... @@ -43,7 +43,7 @@
43 43 android:layout_height="wrap_content"
44 44 android:text="--"
45 45 android:textColor="@color/green_round"
46   - android:textSize="28sp"
  46 + android:textSize="28dp"
47 47 android:textStyle="bold" />
48 48  
49 49 <TextView
... ... @@ -53,7 +53,7 @@
53 53 android:layout_marginTop="4dp"
54 54 android:text="步"
55 55 android:textColor="@color/text_black"
56   - android:textSize="12sp" />
  56 + android:textSize="12dp" />
57 57 </LinearLayout>
58 58 <!---->
59 59 </LinearLayout>
... ...
moudle_pedometer/src/main/res/layout/layout_finish_user_info.xml
... ... @@ -8,7 +8,7 @@
8 8  
9 9 <LinearLayout
10 10 android:layout_width="match_parent"
11   - android:layout_height="195dp"
  11 + android:layout_height="200dp"
12 12 android:layout_marginTop="30dp"
13 13 android:background="@drawable/shape_10dp_white_raduis_bg"
14 14 android:orientation="vertical">
... ... @@ -21,7 +21,7 @@
21 21 android:layout_marginTop="10dp"
22 22 android:text="--"
23 23 android:textColor="@color/text_black"
24   - android:textSize="13sp" />
  24 + android:textSize="13dp" />
25 25 <!---->
26 26 <LinearLayout
27 27 android:layout_width="match_parent"
... ... @@ -42,7 +42,7 @@
42 42 android:layout_marginTop="15dp"
43 43 android:text="--"
44 44 android:textColor="@color/text_black"
45   - android:textSize="15sp" />
  45 + android:textSize="15dp" />
46 46  
47 47 <TextView
48 48 android:id="@+id/tv_date"
... ... @@ -52,7 +52,7 @@
52 52 android:layout_marginTop="5dp"
53 53 android:text="--"
54 54 android:textColor="@color/text_gray"
55   - android:textSize="10sp" />
  55 + android:textSize="10dp" />
56 56 </LinearLayout>
57 57 <!---->
58 58 <LinearLayout
... ... @@ -68,7 +68,7 @@
68 68 android:layout_marginRight="10dp"
69 69 android:text="--"
70 70 android:textColor="@color/text_black"
71   - android:textSize="45sp"
  71 + android:textSize="45dp"
72 72 android:textStyle="bold" />
73 73  
74 74 <TextView
... ... @@ -77,7 +77,7 @@
77 77 android:layout_marginRight="15dp"
78 78 android:text="公里"
79 79 android:textColor="@color/text_black"
80   - android:textSize="15sp" />
  80 + android:textSize="15dp" />
81 81 </LinearLayout>
82 82 <!---->
83 83 </LinearLayout>
... ... @@ -108,7 +108,7 @@
108 108 android:layout_height="wrap_content"
109 109 android:text="--"
110 110 android:textColor="@color/text_black"
111   - android:textSize="20sp"
  111 + android:textSize="20dp"
112 112 android:textStyle="bold" />
113 113  
114 114 <TextView
... ... @@ -118,7 +118,7 @@
118 118 android:layout_marginBottom="10dp"
119 119 android:text="配速"
120 120 android:textColor="@color/text_black"
121   - android:textSize="15sp" />
  121 + android:textSize="15dp" />
122 122 </LinearLayout>
123 123 <!---->
124 124 <LinearLayout
... ... @@ -134,7 +134,7 @@
134 134 android:layout_height="wrap_content"
135 135 android:text="--"
136 136 android:textColor="@color/text_black"
137   - android:textSize="20sp"
  137 + android:textSize="20dp"
138 138 android:textStyle="bold" />
139 139  
140 140 <TextView
... ... @@ -144,7 +144,7 @@
144 144 android:layout_marginBottom="10dp"
145 145 android:text="用时"
146 146 android:textColor="@color/text_black"
147   - android:textSize="15sp" />
  147 + android:textSize="15dp" />
148 148 </LinearLayout>
149 149 <!---->
150 150 </LinearLayout>
... ...