Commit ac37058e7749a3cb0ed4145fb1ca78aeae9b0730

Authored by 韩亚云
2 parents 3fb22129 a3662d3e

我的记录接口更新w

Showing 44 changed files with 1059 additions and 487 deletions
.idea/gradle.xml
@@ -3,6 +3,9 @@ @@ -3,6 +3,9 @@
3 <component name="GradleSettings"> 3 <component name="GradleSettings">
4 <option name="linkedExternalProjectsSettings"> 4 <option name="linkedExternalProjectsSettings">
5 <GradleProjectSettings> 5 <GradleProjectSettings>
  6 + <compositeConfiguration>
  7 + <compositeBuild compositeDefinitionSource="SCRIPT" />
  8 + </compositeConfiguration>
6 <option name="distributionType" value="DEFAULT_WRAPPED" /> 9 <option name="distributionType" value="DEFAULT_WRAPPED" />
7 <option name="externalProjectPath" value="$PROJECT_DIR$" /> 10 <option name="externalProjectPath" value="$PROJECT_DIR$" />
8 <option name="modules"> 11 <option name="modules">
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/frame/view/CollRunRaceDetailFragmentView.java
@@ -47,6 +47,7 @@ import com.cnlive.moudle.collectionTrace.service.CollKeepLiveService; @@ -47,6 +47,7 @@ import com.cnlive.moudle.collectionTrace.service.CollKeepLiveService;
47 import com.cnlive.moudle.collectionTrace.ui.activity.StartCollectTraceActivity; 47 import com.cnlive.moudle.collectionTrace.ui.activity.StartCollectTraceActivity;
48 import com.cnlive.moudle.collectionTrace.ui.fragment.CollRunRaceDetailFragment; 48 import com.cnlive.moudle.collectionTrace.ui.fragment.CollRunRaceDetailFragment;
49 import com.cnlive.moudle.pedometer.commonInfo.CollCommonInfo; 49 import com.cnlive.moudle.pedometer.commonInfo.CollCommonInfo;
  50 +import com.cnlive.moudle.pedometer.model.Constant;
50 import com.cnlive.moudle.pedometer.net.bean.RunRaceDetailInfo; 51 import com.cnlive.moudle.pedometer.net.bean.RunRaceDetailInfo;
51 import com.cnlive.moudle.pedometer.utils.BitmapUtil; 52 import com.cnlive.moudle.pedometer.utils.BitmapUtil;
52 import com.cnlive.moudle.pedometer.utils.GsonUtil; 53 import com.cnlive.moudle.pedometer.utils.GsonUtil;
@@ -559,12 +560,12 @@ public class CollRunRaceDetailFragmentView implements MvpView, SensorEventListen @@ -559,12 +560,12 @@ public class CollRunRaceDetailFragmentView implements MvpView, SensorEventListen
559 } 560 }
560 if (isFirstLoc) { 561 if (isFirstLoc) {
561 isFirstLoc = false; 562 isFirstLoc = false;
562 - if (location.getRadius() > 20) { 563 + if (location.getRadius() > Constant.LOCA_ACCURACY) {
563 Toast.makeText(getContext(), "当前定位精度为:" + location.getRadius() + "米,请您移动至空旷地带!", Toast.LENGTH_SHORT).show(); 564 Toast.makeText(getContext(), "当前定位精度为:" + location.getRadius() + "米,请您移动至空旷地带!", Toast.LENGTH_SHORT).show();
564 } 565 }
565 } else { 566 } else {
566 //过滤定位精度 567 //过滤定位精度
567 - if (location.getRadius() > 20) { 568 + if (location.getRadius() > Constant.LOCA_ACCURACY) {
568 return; 569 return;
569 } 570 }
570 } 571 }
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/frame/view/CollRunningMapFragmentView.java
@@ -34,6 +34,7 @@ import com.baidu.mapapi.model.LatLng; @@ -34,6 +34,7 @@ import com.baidu.mapapi.model.LatLng;
34 import com.baidu.mapapi.utils.DistanceUtil; 34 import com.baidu.mapapi.utils.DistanceUtil;
35 import com.baidu.trace.model.SortType; 35 import com.baidu.trace.model.SortType;
36 import com.cnlive.moudle.collectionTrace.ui.fragment.CollRunningMapFragment; 36 import com.cnlive.moudle.collectionTrace.ui.fragment.CollRunningMapFragment;
  37 +import com.cnlive.moudle.pedometer.model.Constant;
37 import com.cnlive.moudle.pedometer.model.RunningMapBean; 38 import com.cnlive.moudle.pedometer.model.RunningMapBean;
38 import com.cnlive.moudle.pedometer.ui.fragment.RunningMapFragment; 39 import com.cnlive.moudle.pedometer.ui.fragment.RunningMapFragment;
39 import com.cnlive.moudle.pedometer.utils.BitmapUtil; 40 import com.cnlive.moudle.pedometer.utils.BitmapUtil;
@@ -298,14 +299,14 @@ public class CollRunningMapFragmentView implements MvpView, SensorEventListener @@ -298,14 +299,14 @@ public class CollRunningMapFragmentView implements MvpView, SensorEventListener
298 299
299 if (isFirstLoc) { 300 if (isFirstLoc) {
300 isFirstLoc = false; 301 isFirstLoc = false;
301 - if (location.getRadius() > 20) { 302 + if (location.getRadius() > Constant.LOCA_ACCURACY) {
302 Toast.makeText(getContext(), "当前定位精度为:" + location.getRadius() + "米,请您移动至空旷地带!", Toast.LENGTH_SHORT).show(); 303 Toast.makeText(getContext(), "当前定位精度为:" + location.getRadius() + "米,请您移动至空旷地带!", Toast.LENGTH_SHORT).show();
303 } 304 }
304 305
305 306
306 } else { 307 } else {
307 //过滤定位精度 308 //过滤定位精度
308 - if (location.getRadius() > 20) { 309 + if (location.getRadius() > Constant.LOCA_ACCURACY) {
309 return; 310 return;
310 } 311 }
311 } 312 }
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/frame/view/StartTraceFragmentView.java
@@ -34,6 +34,7 @@ import com.cnlive.moudle.collectionTrace.ui.activity.CollRunRaceDetailActivity; @@ -34,6 +34,7 @@ import com.cnlive.moudle.collectionTrace.ui.activity.CollRunRaceDetailActivity;
34 import com.cnlive.moudle.collectionTrace.ui.fragment.CollRunRaceDetailFragment; 34 import com.cnlive.moudle.collectionTrace.ui.fragment.CollRunRaceDetailFragment;
35 import com.cnlive.moudle.collectionTrace.ui.fragment.StartTraceFragment; 35 import com.cnlive.moudle.collectionTrace.ui.fragment.StartTraceFragment;
36 import com.cnlive.moudle.pedometer.commonInfo.CollCommonInfo; 36 import com.cnlive.moudle.pedometer.commonInfo.CollCommonInfo;
  37 +import com.cnlive.moudle.pedometer.model.Constant;
37 import com.cnlive.moudle.pedometer.ui.widget.SelectDialog; 38 import com.cnlive.moudle.pedometer.ui.widget.SelectDialog;
38 import com.cnlive.moudle.pedometer.ui.widget.TipDialog; 39 import com.cnlive.moudle.pedometer.ui.widget.TipDialog;
39 import com.cnlive.moudle.pedometer.utils.BitmapUtil; 40 import com.cnlive.moudle.pedometer.utils.BitmapUtil;
@@ -254,12 +255,12 @@ public class StartTraceFragmentView implements MvpView, SensorEventListener { @@ -254,12 +255,12 @@ public class StartTraceFragmentView implements MvpView, SensorEventListener {
254 } 255 }
255 if (isFirstLoc) { 256 if (isFirstLoc) {
256 isFirstLoc = false; 257 isFirstLoc = false;
257 - if (location.getRadius() > 20) { 258 + if (location.getRadius() > Constant.LOCA_ACCURACY) {
258 Toast.makeText(getContext(), "当前定位精度为:" + location.getRadius() + "米,请您移动至空旷地带!", Toast.LENGTH_SHORT).show(); 259 Toast.makeText(getContext(), "当前定位精度为:" + location.getRadius() + "米,请您移动至空旷地带!", Toast.LENGTH_SHORT).show();
259 } 260 }
260 } else { 261 } else {
261 //过滤定位精度 262 //过滤定位精度
262 - if (location.getRadius() > 20) { 263 + if (location.getRadius() > Constant.LOCA_ACCURACY) {
263 return; 264 return;
264 } 265 }
265 } 266 }
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/commonInfo/CommonInfo.java
@@ -279,11 +279,27 @@ public class CommonInfo { @@ -279,11 +279,27 @@ public class CommonInfo {
279 } 279 }
280 280
281 281
282 -  
283 -  
284 -  
285 -  
286 - 282 +// /**
  283 +// * 设置起点经纬度
  284 +// *
  285 +// * @param context
  286 +// * @param startLatLng
  287 +// */
  288 +// public static void setStartLatLng(Context context, String startLatLng) {
  289 +// MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putString("runStartLatLng", startLatLng);
  290 +//
  291 +// }
  292 +//
  293 +// /**
  294 +// * 设置终点经纬度
  295 +// *
  296 +// * @param context
  297 +// * @param endLatLng
  298 +// */
  299 +// public static void setEndLatLng(Context context, String endLatLng) {
  300 +// MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putString("runEndLatLng", endLatLng);
  301 +//
  302 +// }
287 /*重置 303 /*重置
288 * @param context 304 * @param context
289 */ 305 */
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/presenter/ALLScoreDetailFragmentPresenter.java
@@ -38,8 +38,18 @@ public class ALLScoreDetailFragmentPresenter extends MvpBasePresenter&lt;ALLScoreDe @@ -38,8 +38,18 @@ public class ALLScoreDetailFragmentPresenter extends MvpBasePresenter&lt;ALLScoreDe
38 } 38 }
39 //获取当前的时间戳(秒) 39 //获取当前的时间戳(秒)
40 long endTime = 0; 40 long endTime = 0;
41 - if (!TextUtils.isEmpty(runningFinishBean.getUserFinishTime())){  
42 - endTime = Long.parseLong(runningFinishBean.getUserFinishTime()); 41 + //判断当期那用户是否暂停
  42 + if (runningFinishBean.isPause()) {
  43 + //用户暂停了
  44 + if (!TextUtils.isEmpty(runningFinishBean.getUserPauseTime())) {
  45 + endTime = Long.parseLong(runningFinishBean.getUserPauseTime());
  46 + }
  47 + }
  48 + //没有暂停
  49 + else {
  50 + if (!TextUtils.isEmpty(runningFinishBean.getUserFinishTime())) {
  51 + endTime = Long.parseLong(runningFinishBean.getUserFinishTime());
  52 + }
43 } 53 }
44 //获取当前的实体名称 54 //获取当前的实体名称
45 String entityName = CommonInfo.getUserId(context); 55 String entityName = CommonInfo.getUserId(context);
@@ -53,9 +63,16 @@ public class ALLScoreDetailFragmentPresenter extends MvpBasePresenter&lt;ALLScoreDe @@ -53,9 +63,16 @@ public class ALLScoreDetailFragmentPresenter extends MvpBasePresenter&lt;ALLScoreDe
53 if (getView() != null) { 63 if (getView() != null) {
54 QMUITipDialogUtil.dismessDialog(); 64 QMUITipDialogUtil.dismessDialog();
55 if (resultPoints.size() > 1) { 65 if (resultPoints.size() > 1) {
56 - MyMapUtil.drawHistoryTrack(context, getView().baiduMap, resultPoints, SortType.asc, R.color.red, R.drawable.icon_start, R.drawable.icon_end);  
57 - //设置地图自动缩放  
58 - MyMapUtil.setMapAutoZoom(getView().baiduMap, resultPoints, -2f); 66 + //用户暂停了
  67 + if (runningFinishBean.isPause()) {
  68 + MyMapUtil.drawHistoryTrack(context, getView().baiduMap, resultPoints, SortType.asc, R.color.red, R.drawable.icon_start, 0);
  69 + }
  70 + //用户没有暂停
  71 + else {
  72 + MyMapUtil.drawHistoryTrack(context, getView().baiduMap, resultPoints, SortType.asc, R.color.red, R.drawable.icon_start, R.drawable.icon_end);
  73 + //设置地图自动缩放
  74 + MyMapUtil.setMapAutoZoom(getView().baiduMap, resultPoints, -2f);
  75 + }
59 } 76 }
60 77
61 } 78 }
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/presenter/LineUpAgainPresenter.java
@@ -47,7 +47,7 @@ public class LineUpAgainPresenter extends MvpBasePresenter&lt;LineUpAgainView&gt; { @@ -47,7 +47,7 @@ public class LineUpAgainPresenter extends MvpBasePresenter&lt;LineUpAgainView&gt; {
47 /** 47 /**
48 * 查询当前用户历史轨迹(用于重新上传按钮) 48 * 查询当前用户历史轨迹(用于重新上传按钮)
49 */ 49 */
50 - public void queryHistoryTraceNoMap(Activity context, FailedEntity failedEntity,onResultListener onResultListener) { 50 + public void queryHistoryTraceNoMap(Activity context, FailedEntity failedEntity, onResultListener onResultListener) {
51 QMUITipDialogUtil.loadingDialog(context, "正在获取轨迹信息,请稍后", false); 51 QMUITipDialogUtil.loadingDialog(context, "正在获取轨迹信息,请稍后", false);
52 //查询当前用户的历史轨迹 52 //查询当前用户的历史轨迹
53 long startTime = failedEntity.getUserStartTime(); 53 long startTime = failedEntity.getUserStartTime();
@@ -63,58 +63,67 @@ public class LineUpAgainPresenter extends MvpBasePresenter&lt;LineUpAgainView&gt; { @@ -63,58 +63,67 @@ public class LineUpAgainPresenter extends MvpBasePresenter&lt;LineUpAgainView&gt; {
63 if (mClient == null) { 63 if (mClient == null) {
64 mClient = new LBSTraceClient(context); 64 mClient = new LBSTraceClient(context);
65 } 65 }
66 - MyMapUtil.queryHistoryTrace(context, mClient, entityName, startTime, endTime, new MyMapUtil.CallBack() {  
67 - @Override  
68 - public void success(List<LatLng> resultPoints) {  
69 - if (resultPoints != null) {  
70 - if (getView() != null) {  
71 - QMUITipDialogUtil.dismessDialog();  
72 - if (importPoints != null) {  
73 - //判断是否完成  
74 - boolean isFinish = MyMapUtil.checkIsFinishTrace(importPoints, resultPoints, Constant.PASS_RATE);  
75 - if (isFinish) {  
76 - Toast.makeText(context, "完成", Toast.LENGTH_LONG).show();  
77 - failedEntity.setIsFinish("1");  
78 - } else {  
79 - Toast.makeText(context, "没有完成", Toast.LENGTH_LONG).show();  
80 - failedEntity.setIsFinish("0"); 66 + //先判断用户是否到达终点
  67 + if (!failedEntity.getIsArriveEndPoint()) {
  68 + //没有到达终点,默认没有完成
  69 + failedEntity.setIsFinish("0");
  70 + //直接上传数据
  71 + saveRouteData(context, failedEntity, onResultListener);
  72 + }
  73 + //达到终点,则与运营打的点进行比较
  74 + else {
  75 + MyMapUtil.queryHistoryTrace(context, mClient, entityName, startTime, endTime, new MyMapUtil.CallBack() {
  76 + @Override
  77 + public void success(List<LatLng> resultPoints) {
  78 + if (resultPoints != null) {
  79 + if (getView() != null) {
  80 + QMUITipDialogUtil.dismessDialog();
  81 + if (importPoints != null) {
  82 + //判断是否完成
  83 + boolean isFinish = MyMapUtil.checkIsFinishTrace(importPoints, resultPoints, Constant.PASS_RATE);
  84 + if (isFinish) {
  85 + Toast.makeText(context, "完成", Toast.LENGTH_LONG).show();
  86 + failedEntity.setIsFinish("1");
  87 + } else {
  88 + Toast.makeText(context, "没有完成", Toast.LENGTH_LONG).show();
  89 + failedEntity.setIsFinish("0");
  90 + }
  91 + saveRouteData(context, failedEntity, onResultListener);
81 } 92 }
82 - saveRouteData(context, failedEntity,onResultListener);  
83 } 93 }
84 } 94 }
85 - }  
86 - //查询失败  
87 - else {  
88 - QMUITipDialogUtil.dismessDialog();  
89 - if (failTraceDialog == null) {  
90 - failTraceDialog = new SelectDialog(context, "获取轨迹失败,是否重试?", "重试", new SelectDialog.DialogInterface() {  
91 - @Override  
92 - public void onClick(SelectDialog dialog) {  
93 - dialog.dismiss();  
94 - queryHistoryTraceNoMap(context, failedEntity,onResultListener);  
95 - }  
96 - }, "取消", new SelectDialog.DialogInterface() {  
97 - @Override  
98 - public void onClick(SelectDialog dialog) {  
99 - dialog.dismiss(); 95 + //查询失败
  96 + else {
  97 + QMUITipDialogUtil.dismessDialog();
  98 + if (failTraceDialog == null) {
  99 + failTraceDialog = new SelectDialog(context, "获取轨迹失败,是否重试?", "重试", new SelectDialog.DialogInterface() {
  100 + @Override
  101 + public void onClick(SelectDialog dialog) {
  102 + dialog.dismiss();
  103 + queryHistoryTraceNoMap(context, failedEntity, onResultListener);
  104 + }
  105 + }, "取消", new SelectDialog.DialogInterface() {
  106 + @Override
  107 + public void onClick(SelectDialog dialog) {
  108 + dialog.dismiss();
100 109
  110 + }
  111 + });
  112 + failTraceDialog.setCanceledOnTouchOutside(false);
  113 + failTraceDialog.setCancelable(false);
  114 + if (!failTraceDialog.isShowing()) {
  115 + failTraceDialog.show();
101 } 116 }
102 - });  
103 - failTraceDialog.setCanceledOnTouchOutside(false);  
104 - failTraceDialog.setCancelable(false);  
105 - if (!failTraceDialog.isShowing()) {  
106 - failTraceDialog.show();  
107 - }  
108 117
109 - } else {  
110 - if (!failTraceDialog.isShowing()) {  
111 - failTraceDialog.show(); 118 + } else {
  119 + if (!failTraceDialog.isShowing()) {
  120 + failTraceDialog.show();
  121 + }
112 } 122 }
113 } 123 }
114 } 124 }
115 - }  
116 - });  
117 - 125 + });
  126 + }
118 } 127 }
119 128
120 /** 129 /**
@@ -123,7 +132,7 @@ public class LineUpAgainPresenter extends MvpBasePresenter&lt;LineUpAgainView&gt; { @@ -123,7 +132,7 @@ public class LineUpAgainPresenter extends MvpBasePresenter&lt;LineUpAgainView&gt; {
123 * @param context 132 * @param context
124 * @param failedEntity 133 * @param failedEntity
125 */ 134 */
126 - public void saveRouteData(Activity context, FailedEntity failedEntity,onResultListener onResultListener) { 135 + public void saveRouteData(Activity context, FailedEntity failedEntity, onResultListener onResultListener) {
127 QMUITipDialogUtil.loadingDialog(context, "正在上传数据", false); 136 QMUITipDialogUtil.loadingDialog(context, "正在上传数据", false);
128 // 赛事id 137 // 赛事id
129 String eventId = failedEntity.getStreetId(); 138 String eventId = failedEntity.getStreetId();
@@ -194,7 +203,7 @@ public class LineUpAgainPresenter extends MvpBasePresenter&lt;LineUpAgainView&gt; { @@ -194,7 +203,7 @@ public class LineUpAgainPresenter extends MvpBasePresenter&lt;LineUpAgainView&gt; {
194 if (getView() == null) { 203 if (getView() == null) {
195 return; 204 return;
196 } 205 }
197 - if (onResultListener!=null){ 206 + if (onResultListener != null) {
198 onResultListener.onFailed(message); 207 onResultListener.onFailed(message);
199 } 208 }
200 Log.e("saveRouteData", "onFailure: " + message); 209 Log.e("saveRouteData", "onFailure: " + message);
@@ -204,7 +213,7 @@ public class LineUpAgainPresenter extends MvpBasePresenter&lt;LineUpAgainView&gt; { @@ -204,7 +213,7 @@ public class LineUpAgainPresenter extends MvpBasePresenter&lt;LineUpAgainView&gt; {
204 @Override 213 @Override
205 public void onClick(SelectDialog dialog) { 214 public void onClick(SelectDialog dialog) {
206 dialog.dismiss(); 215 dialog.dismiss();
207 - saveRouteData(context, failedEntity,onResultListener); 216 + saveRouteData(context, failedEntity, onResultListener);
208 } 217 }
209 }, "取消", new SelectDialog.DialogInterface() { 218 }, "取消", new SelectDialog.DialogInterface() {
210 @Override 219 @Override
@@ -238,7 +247,7 @@ public class LineUpAgainPresenter extends MvpBasePresenter&lt;LineUpAgainView&gt; { @@ -238,7 +247,7 @@ public class LineUpAgainPresenter extends MvpBasePresenter&lt;LineUpAgainView&gt; {
238 //删除 247 //删除
239 StepUtil.deleteTempSaveFailData(context, entity); 248 StepUtil.deleteTempSaveFailData(context, entity);
240 } 249 }
241 - if (onResultListener!=null){ 250 + if (onResultListener != null) {
242 onResultListener.onSuccess(); 251 onResultListener.onSuccess();
243 } 252 }
244 } 253 }
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/presenter/RunningFinishFragmetPresenter.java
@@ -219,19 +219,25 @@ public class RunningFinishFragmetPresenter extends MvpBasePresenter&lt;RunningFinis @@ -219,19 +219,25 @@ public class RunningFinishFragmetPresenter extends MvpBasePresenter&lt;RunningFinis
219 if (resultPoints != null) { 219 if (resultPoints != null) {
220 if (getView() != null) { 220 if (getView() != null) {
221 QMUITipDialogUtil.dismessDialog(); 221 QMUITipDialogUtil.dismessDialog();
222 - if (importPoints != null) {  
223 - //判断是否完成  
224 - boolean isFinish = MyMapUtil.checkIsFinishTrace(importPoints, resultPoints, Constant.PASS_RATE);  
225 - if (isFinish) {  
226 - Toast.makeText(context, "完成", Toast.LENGTH_LONG).show();  
227 - runningFinishBean.setIsFinish("1");  
228 - } else {  
229 - Toast.makeText(context, "没有完成", Toast.LENGTH_LONG).show();  
230 - runningFinishBean.setIsFinish("0"); 222 + MyMapUtil.drawHistoryTrack(context, getView().baiduMap, resultPoints, SortType.asc, R.color.red, R.drawable.icon_start, R.drawable.icon_end);
  223 + //先判断是否到达终点
  224 + if (!userStepEntity.getIsArriveEndPoint()) {
  225 + runningFinishBean.setIsFinish("0");
  226 + } else {
  227 + if (importPoints != null) {
  228 + //判断是否完成
  229 + boolean isFinish = MyMapUtil.checkIsFinishTrace(importPoints, resultPoints, Constant.PASS_RATE);
  230 + if (isFinish) {
  231 + Toast.makeText(context, "完成", Toast.LENGTH_LONG).show();
  232 + runningFinishBean.setIsFinish("1");
  233 + } else {
  234 + Toast.makeText(context, "没有完成", Toast.LENGTH_LONG).show();
  235 + runningFinishBean.setIsFinish("0");
  236 + }
231 } 237 }
232 - MyMapUtil.drawHistoryTrack(context, getView().baiduMap, resultPoints, SortType.asc, R.color.red, R.drawable.icon_start, R.drawable.icon_end);  
233 - saveRouteData(context, userStepEntity, runningFinishBean);  
234 } 238 }
  239 + saveRouteData(context, userStepEntity, runningFinishBean);
  240 +
235 } 241 }
236 } 242 }
237 //查询失败 243 //查询失败
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/presenter/RunningMapFragmentPresenter.java
@@ -342,11 +342,18 @@ public class RunningMapFragmentPresenter extends MvpBasePresenter&lt;RunningMapFrag @@ -342,11 +342,18 @@ public class RunningMapFragmentPresenter extends MvpBasePresenter&lt;RunningMapFrag
342 /** 342 /**
343 * 查询当前用户历史轨迹 343 * 查询当前用户历史轨迹
344 */ 344 */
345 - public void queryHistoryTrace(Context context, UserStepEntity userStepEntity) { 345 + public void queryHistoryTrace(Context context, UserStepEntity userStepEntity, boolean isPause) {
346 //查询当前用户的历史轨迹 346 //查询当前用户的历史轨迹
347 long startTime = userStepEntity.getStartTimeStamp(); 347 long startTime = userStepEntity.getStartTimeStamp();
348 //获取当前的时间戳(秒) 348 //获取当前的时间戳(秒)
349 - long endTime = TimeUtil.getNowTimeStamp(); 349 + long endTime = 0;
  350 + //如果没有暂停
  351 + if (!isPause) {
  352 + endTime = TimeUtil.getNowTimeStamp();
  353 + } else {
  354 + endTime = userStepEntity.getUserPauseTimeStamp();
  355 + }
  356 + Log.e(TAG, "startTime: " + startTime + ",endTime:" + endTime);
350 //获取当前的实体名称 357 //获取当前的实体名称
351 String entityName = CommonInfo.getUserId(context); 358 String entityName = CommonInfo.getUserId(context);
352 //打的重要点 359 //打的重要点
@@ -356,10 +363,12 @@ public class RunningMapFragmentPresenter extends MvpBasePresenter&lt;RunningMapFrag @@ -356,10 +363,12 @@ public class RunningMapFragmentPresenter extends MvpBasePresenter&lt;RunningMapFrag
356 public void success(List<LatLng> resultPoints) { 363 public void success(List<LatLng> resultPoints) {
357 if (resultPoints != null && resultPoints.size() > 1) { 364 if (resultPoints != null && resultPoints.size() > 1) {
358 if (getView() != null && resultPoints != null) { 365 if (getView() != null && resultPoints != null) {
359 - if (resultPoints.size() == 1) {  
360 - getView().setHistoryLastPoint(resultPoints.get(0));  
361 - } else if (resultPoints.size() > 1) {  
362 - getView().setHistoryLastPoint(resultPoints.get(resultPoints.size() - 1)); 366 + if (!isPause) {
  367 + if (resultPoints.size() == 1) {
  368 + getView().setHistoryLastPoint(resultPoints.get(0));
  369 + } else if (resultPoints.size() > 1) {
  370 + getView().setHistoryLastPoint(resultPoints.get(resultPoints.size() - 1));
  371 + }
363 } 372 }
364 if (importPoints != null && resultPoints != null) { 373 if (importPoints != null && resultPoints != null) {
365 boolean isFinish = MyMapUtil.checkIsFinishTrace(importPoints, resultPoints, 0.6); 374 boolean isFinish = MyMapUtil.checkIsFinishTrace(importPoints, resultPoints, 0.6);
@@ -370,13 +379,44 @@ public class RunningMapFragmentPresenter extends MvpBasePresenter&lt;RunningMapFrag @@ -370,13 +379,44 @@ public class RunningMapFragmentPresenter extends MvpBasePresenter&lt;RunningMapFrag
370 Toast.makeText(context, "没有完成", Toast.LENGTH_LONG).show(); 379 Toast.makeText(context, "没有完成", Toast.LENGTH_LONG).show();
371 380
372 } 381 }
373 - MyMapUtil.drawRealTimeTrack(context, getView().baiduMap, resultPoints, SortType.asc, R.color.red, R.drawable.icon_start); 382 + if (isPause) {
  383 + MyMapUtil.drawRealTimeTrack(context, getView().baiduMap, resultPoints, SortType.asc, R.color.red, R.drawable.icon_start);
  384 + } else {
  385 + MyMapUtil.drawHistoryTrack(context, getView().baiduMap, resultPoints, SortType.asc, R.color.red, R.drawable.icon_start, R.drawable.icon_end);
  386 + }
374 } 387 }
375 } 388 }
376 } 389 }
377 } 390 }
378 }); 391 });
379 392
  393 + //然后查询从暂停到现在的距离
  394 + if (isPause) {
  395 + long continueTime = userStepEntity.getContinueTime();
  396 + long continueEndTime = TimeUtil.getNowTimeStamp();
  397 + Log.e(TAG, "continueTime: " + continueTime + ",continueEndTime:" + continueEndTime);
  398 + MyMapUtil.queryHistoryTrace(context, StepService.mClient, entityName, continueTime, continueEndTime, new MyMapUtil.CallBack() {
  399 + @Override
  400 + public void success(List<LatLng> resultPoints) {
  401 + if (resultPoints != null && resultPoints.size() > 1) {
  402 + if (resultPoints.size() == 1) {
  403 + if (null != resultPoints.get(0)) {
  404 + getView().setHistoryLastPoint(resultPoints.get(0));
  405 + }
  406 + } else if (resultPoints.size() > 1) {
  407 + if (null != resultPoints.get(resultPoints.size() - 1)) {
  408 + getView().setHistoryLastPoint(resultPoints.get(resultPoints.size() - 1));
  409 + }
  410 + }
  411 + //开始划线
  412 + MyMapUtil.drawHistoryTrack(context, getView().baiduMap, resultPoints, SortType.asc, R.color.red, 0, R.drawable.icon_end);
  413 +
  414 + }
  415 + }
  416 + });
  417 +
  418 + }
  419 +
380 } 420 }
381 421
382 422
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/presenter/UploadFailDetailFragmentPresenter.java
@@ -42,16 +42,33 @@ public class UploadFailDetailFragmentPresenter extends MvpBasePresenter&lt;UploadFa @@ -42,16 +42,33 @@ public class UploadFailDetailFragmentPresenter extends MvpBasePresenter&lt;UploadFa
42 private List<LatLng> importPoints; 42 private List<LatLng> importPoints;
43 private SelectDialog uploadFailDialog; 43 private SelectDialog uploadFailDialog;
44 private SelectDialog failTraceDialog; 44 private SelectDialog failTraceDialog;
  45 + private List<LatLng> allResultPoints;
  46 +
  47 +// //判断是否到达终点
  48 +// if (!failedEntity.getIsArriveEndPoint()) {
  49 +// //没有完成
  50 +// failedEntity.setIsFinish("0");
  51 +// getView().updateIsFinish("0");
  52 +// }
45 53
46 /** 54 /**
47 * 查询当前用户历史轨迹 55 * 查询当前用户历史轨迹
48 */ 56 */
49 public void queryHistoryTrace(Activity context, FailedEntity failedEntity) { 57 public void queryHistoryTrace(Activity context, FailedEntity failedEntity) {
50 QMUITipDialogUtil.loadingDialog(context, "正在获取轨迹信息,请稍后", false); 58 QMUITipDialogUtil.loadingDialog(context, "正在获取轨迹信息,请稍后", false);
  59 +
51 //查询当前用户的历史轨迹 60 //查询当前用户的历史轨迹
52 long startTime = failedEntity.getUserStartTime(); 61 long startTime = failedEntity.getUserStartTime();
53 //获取当前的时间戳(秒) 62 //获取当前的时间戳(秒)
54 - long endTime = failedEntity.getUserEndTime(); 63 + long endTime = 0;
  64 + //没有暂停
  65 + if (!failedEntity.getIsPause()) {
  66 + endTime = failedEntity.getUserEndTime();
  67 + }
  68 + //用户暂停了
  69 + else {
  70 + endTime = failedEntity.getUserPauseTime();
  71 + }
55 //获取当前的实体名称 72 //获取当前的实体名称
56 String entityName = CommonInfo.getUserId(context); 73 String entityName = CommonInfo.getUserId(context);
57 //打的重要点 74 //打的重要点
@@ -65,33 +82,101 @@ public class UploadFailDetailFragmentPresenter extends MvpBasePresenter&lt;UploadFa @@ -65,33 +82,101 @@ public class UploadFailDetailFragmentPresenter extends MvpBasePresenter&lt;UploadFa
65 MyMapUtil.queryHistoryTrace(context, mClient, entityName, startTime, endTime, new MyMapUtil.CallBack() { 82 MyMapUtil.queryHistoryTrace(context, mClient, entityName, startTime, endTime, new MyMapUtil.CallBack() {
66 @Override 83 @Override
67 public void success(List<LatLng> resultPoints) { 84 public void success(List<LatLng> resultPoints) {
  85 +
68 if (resultPoints != null) { 86 if (resultPoints != null) {
  87 + allResultPoints = resultPoints;
  88 + //划线
  89 + if (resultPoints.size() > 1) {
  90 + if (!failedEntity.getIsPause()) {
  91 + MyMapUtil.drawHistoryTrack(context, getView().baiduMap, resultPoints, SortType.asc, R.color.red, R.drawable.icon_start, R.drawable.icon_end);
  92 + //设置地图自动缩放
  93 + MyMapUtil.setMapAutoZoom(getView().baiduMap, resultPoints, -2f);
  94 + } else {
  95 + MyMapUtil.drawHistoryTrack(context, getView().baiduMap, resultPoints, SortType.asc, R.color.red, R.drawable.icon_start, 0);
  96 +
  97 + }
  98 + }
  99 +
69 if (getView() != null) { 100 if (getView() != null) {
70 QMUITipDialogUtil.dismessDialog(); 101 QMUITipDialogUtil.dismessDialog();
71 getView().updateStartBtnState(true); 102 getView().updateStartBtnState(true);
72 - if (importPoints != null) {  
73 - //判断是否完成  
74 - boolean isFinish = MyMapUtil.checkIsFinishTrace(importPoints, resultPoints, Constant.PASS_RATE);  
75 - if (isFinish) {  
76 - Toast.makeText(context, "完成", Toast.LENGTH_LONG).show();  
77 - failedEntity.setIsFinish("1");  
78 - if (getView() != null) {  
79 - getView().updateIsFinish("1");  
80 - }  
81 - } else {  
82 - Toast.makeText(context, "没有完成", Toast.LENGTH_LONG).show(); 103 + //如果用户没有暂停
  104 + if (!failedEntity.getIsPause()) {
  105 + //判断用户是否完成
  106 + if (!failedEntity.getIsArriveEndPoint()) {
  107 + //没有完成
83 failedEntity.setIsFinish("0"); 108 failedEntity.setIsFinish("0");
84 - if (getView() != null) {  
85 - getView().updateIsFinish("0"); 109 + getView().updateIsFinish("0");
  110 + } else {
  111 + if (importPoints != null) {
  112 + //判断是否完成
  113 + boolean isFinish = MyMapUtil.checkIsFinishTrace(importPoints, resultPoints, Constant.PASS_RATE);
  114 + if (isFinish) {
  115 + Toast.makeText(context, "完成", Toast.LENGTH_LONG).show();
  116 + failedEntity.setIsFinish("1");
  117 + if (getView() != null) {
  118 + getView().updateIsFinish("1");
  119 + }
  120 + } else {
  121 + Toast.makeText(context, "没有完成", Toast.LENGTH_LONG).show();
  122 + failedEntity.setIsFinish("0");
  123 + if (getView() != null) {
  124 + getView().updateIsFinish("0");
  125 + }
  126 + }
86 } 127 }
87 } 128 }
88 - if (resultPoints.size() > 1) {  
89 - MyMapUtil.drawHistoryTrack(context, getView().baiduMap, resultPoints, SortType.asc, R.color.red, R.drawable.icon_start, R.drawable.icon_end);  
90 - //设置地图自动缩放  
91 - MyMapUtil.setMapAutoZoom(getView().baiduMap, resultPoints, -2f);  
92 - } 129 + }
93 130
  131 + //判断用户是否点击暂存
  132 + if (!failedEntity.getIsPause()) {
  133 + //开始查询
  134 + long continueTime = failedEntity.getUsrContinueTime();
  135 + long finishTime = failedEntity.getUserEndTime();
  136 + MyMapUtil.queryHistoryTrace(context, mClient, entityName, continueTime, finishTime, new MyMapUtil.CallBack() {
  137 + @Override
  138 + public void success(List<LatLng> resultPoints) {
  139 + if (resultPoints != null && resultPoints.size() > 1) {
  140 + //开始画暂停到结束的轨迹
  141 + MyMapUtil.drawHistoryTrack(context, getView().baiduMap, resultPoints, SortType.asc, R.color.red, 0, R.drawable.icon_end);
  142 + //开始合并查出来的数据
  143 + if (allResultPoints != null) {
  144 + allResultPoints.addAll(resultPoints);
  145 + }
  146 + //设置地图自动缩放
  147 + MyMapUtil.setMapAutoZoom(getView().baiduMap, allResultPoints, -2f);
  148 + //判断用户是否完成
  149 + if (!failedEntity.getIsArriveEndPoint()) {
  150 + //没有完成
  151 + failedEntity.setIsFinish("0");
  152 + getView().updateIsFinish("0");
  153 + } else {
  154 + if (importPoints != null) {
  155 + //判断是否完成
  156 + boolean isFinish = MyMapUtil.checkIsFinishTrace(importPoints, allResultPoints, Constant.PASS_RATE);
  157 + if (isFinish) {
  158 + Toast.makeText(context, "完成", Toast.LENGTH_LONG).show();
  159 + failedEntity.setIsFinish("1");
  160 + if (getView() != null) {
  161 + getView().updateIsFinish("1");
  162 + }
  163 + } else {
  164 + Toast.makeText(context, "没有完成", Toast.LENGTH_LONG).show();
  165 + failedEntity.setIsFinish("0");
  166 + if (getView() != null) {
  167 + getView().updateIsFinish("0");
  168 + }
  169 + }
  170 + //
  171 + }
  172 + }
  173 + }
  174 + }
  175 +
  176 + });
  177 + //
94 } 178 }
  179 +
95 } 180 }
96 } 181 }
97 //查询失败 182 //查询失败
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/ALLScoreDetailFragmentView.java
@@ -3,12 +3,15 @@ package com.cnlive.moudle.pedometer.frame.view; @@ -3,12 +3,15 @@ package com.cnlive.moudle.pedometer.frame.view;
3 import android.content.Context; 3 import android.content.Context;
4 import android.text.TextUtils; 4 import android.text.TextUtils;
5 import android.view.View; 5 import android.view.View;
  6 +import android.view.ViewGroup;
  7 +import android.widget.LinearLayout;
6 8
7 import com.baidu.mapapi.map.BaiduMap; 9 import com.baidu.mapapi.map.BaiduMap;
8 import com.baidu.mapapi.map.MapView; 10 import com.baidu.mapapi.map.MapView;
9 import com.baidu.mapapi.map.UiSettings; 11 import com.baidu.mapapi.map.UiSettings;
10 import com.cnlive.moudle.pedometer.model.RunningFinishBean; 12 import com.cnlive.moudle.pedometer.model.RunningFinishBean;
11 import com.cnlive.moudle.pedometer.ui.fragment.ALLScoreDetailFragment; 13 import com.cnlive.moudle.pedometer.ui.fragment.ALLScoreDetailFragment;
  14 +import com.cnlive.moudle.pedometer.utils.ScreenUtil;
12 import com.cnlive.moudle.pedometer.utils.TimeUtil; 15 import com.cnlive.moudle.pedometer.utils.TimeUtil;
13 import com.example.moudle_pedometer.R; 16 import com.example.moudle_pedometer.R;
14 import com.hannesdorfmann.mosby3.mvp.MvpView; 17 import com.hannesdorfmann.mosby3.mvp.MvpView;
@@ -35,6 +38,10 @@ public class ALLScoreDetailFragmentView implements MvpView { @@ -35,6 +38,10 @@ public class ALLScoreDetailFragmentView implements MvpView {
35 38
36 public void initView(RunningFinishBean runningFinishBean) { 39 public void initView(RunningFinishBean runningFinishBean) {
37 this.runningFinishBean = runningFinishBean; 40 this.runningFinishBean = runningFinishBean;
  41 + //设置滚动视图下边距
  42 + ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) fragment.binding.scrollView.getLayoutParams();
  43 + params.bottomMargin = ScreenUtil.dip2px(getContext(), 20);
  44 + fragment.binding.scrollView.setLayoutParams(params);
38 //隐藏开始按钮 45 //隐藏开始按钮
39 fragment.binding.rlScrollViewStartBtn.setVisibility(View.GONE); 46 fragment.binding.rlScrollViewStartBtn.setVisibility(View.GONE);
40 //设置标题 47 //设置标题
@@ -53,7 +60,7 @@ public class ALLScoreDetailFragmentView implements MvpView { @@ -53,7 +60,7 @@ public class ALLScoreDetailFragmentView implements MvpView {
53 } 60 }
54 //设置完成时间 61 //设置完成时间
55 if (!TextUtils.isEmpty(runningFinishBean.getUserFinishTime())) { 62 if (!TextUtils.isEmpty(runningFinishBean.getUserFinishTime())) {
56 - fragment.binding.includeFinishUserInfo.tvDate.setText(TimeUtil.getStampToTime(Long.parseLong(runningFinishBean.getUserFinishTime())*1000, "yyyy/MM/dd HH:mm")); 63 + fragment.binding.includeFinishUserInfo.tvDate.setText(TimeUtil.getStampToTime(Long.parseLong(runningFinishBean.getUserFinishTime()) * 1000, "yyyy/MM/dd HH:mm"));
57 } 64 }
58 //设置起点 65 //设置起点
59 fragment.binding.includeFinishRunRoute.tvStartPoint.setText(runningFinishBean.getStartPoint()); 66 fragment.binding.includeFinishRunRoute.tvStartPoint.setText(runningFinishBean.getStartPoint());
@@ -66,7 +73,7 @@ public class ALLScoreDetailFragmentView implements MvpView { @@ -66,7 +73,7 @@ public class ALLScoreDetailFragmentView implements MvpView {
66 fragment.binding.includeFinishRunRoute.tvFinishState.setTextColor(getContext().getResources().getColor(R.color.green_round)); 73 fragment.binding.includeFinishRunRoute.tvFinishState.setTextColor(getContext().getResources().getColor(R.color.green_round));
67 } 74 }
68 //完成 75 //完成
69 - else if ("0".equals(runningFinishBean.getIsFinish())){ 76 + else if ("0".equals(runningFinishBean.getIsFinish())) {
70 fragment.binding.includeFinishRunRoute.tvFinishState.setText("路线未完成"); 77 fragment.binding.includeFinishRunRoute.tvFinishState.setText("路线未完成");
71 fragment.binding.includeFinishRunRoute.tvFinishState.setTextColor(getContext().getResources().getColor(R.color.red)); 78 fragment.binding.includeFinishRunRoute.tvFinishState.setTextColor(getContext().getResources().getColor(R.color.red));
72 } 79 }
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RaceRecorView.java
1 package com.cnlive.moudle.pedometer.frame.view; 1 package com.cnlive.moudle.pedometer.frame.view;
2 2
3 import android.support.v7.widget.LinearLayoutManager; 3 import android.support.v7.widget.LinearLayoutManager;
  4 +import android.text.TextUtils;
4 import android.view.View; 5 import android.view.View;
5 6
6 import com.cnlive.libs.base.util.AlertUtil; 7 import com.cnlive.libs.base.util.AlertUtil;
@@ -98,7 +99,14 @@ public class RaceRecorView implements MvpView { @@ -98,7 +99,14 @@ public class RaceRecorView implements MvpView {
98 runningFinishBean.setUserFinishTime(bean.getEndTime()); 99 runningFinishBean.setUserFinishTime(bean.getEndTime());
99 //设置用户是否完成 100 //设置用户是否完成
100 runningFinishBean.setIsFinish(bean.getCompleteStatus() + ""); 101 runningFinishBean.setIsFinish(bean.getCompleteStatus() + "");
101 - 102 + //设置是否暂停
  103 + if (!TextUtils.isEmpty(bean.getPauseTime())) {
  104 + runningFinishBean.setPause(true);
  105 + //设置暂停时间
  106 + runningFinishBean.setUserPauseTime(bean.getPauseTime());
  107 + //设置用户继续时间
  108 + runningFinishBean.setUserContinueTime(bean.getContinueTime());
  109 + }
102 //设置起点 110 //设置起点
103 ALLScoreDetailActivity.startActivity(fragment.getActivity(), runningFinishBean); 111 ALLScoreDetailActivity.startActivity(fragment.getActivity(), runningFinishBean);
104 112
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RunMainFragmentView.java
@@ -39,6 +39,7 @@ import com.cnlive.moudle.pedometer.ui.fragment.RunMainFragment; @@ -39,6 +39,7 @@ import com.cnlive.moudle.pedometer.ui.fragment.RunMainFragment;
39 import com.cnlive.moudle.pedometer.ui.widget.SelectDialog; 39 import com.cnlive.moudle.pedometer.ui.widget.SelectDialog;
40 import com.cnlive.moudle.pedometer.ui.widget.TipDialog; 40 import com.cnlive.moudle.pedometer.ui.widget.TipDialog;
41 import com.cnlive.moudle.pedometer.utils.ButtonAnimUtil; 41 import com.cnlive.moudle.pedometer.utils.ButtonAnimUtil;
  42 +import com.cnlive.moudle.pedometer.utils.GsonUtil;
42 import com.cnlive.moudle.pedometer.utils.MyMapUtil; 43 import com.cnlive.moudle.pedometer.utils.MyMapUtil;
43 import com.cnlive.moudle.pedometer.utils.MySpHelper; 44 import com.cnlive.moudle.pedometer.utils.MySpHelper;
44 import com.cnlive.moudle.pedometer.utils.StepUtil; 45 import com.cnlive.moudle.pedometer.utils.StepUtil;
@@ -69,6 +70,8 @@ public class RunMainFragmentView implements MvpView { @@ -69,6 +70,8 @@ public class RunMainFragmentView implements MvpView {
69 private LocationClient mLocClient; 70 private LocationClient mLocClient;
70 public MyLocationListenner myListener = new MyLocationListenner(); 71 public MyLocationListenner myListener = new MyLocationListenner();
71 private String employTime = ""; 72 private String employTime = "";
  73 + private LatLng endLatLng;//终点坐标
  74 + private TipDialog tipDialog;
72 75
73 public RunMainFragmentView(RunMainFragment fragment) { 76 public RunMainFragmentView(RunMainFragment fragment) {
74 this.fragment = fragment; 77 this.fragment = fragment;
@@ -144,6 +147,27 @@ public class RunMainFragmentView implements MvpView { @@ -144,6 +147,27 @@ public class RunMainFragmentView implements MvpView {
144 if (TextUtils.isEmpty(userStepEntity.getStreetId())) { 147 if (TextUtils.isEmpty(userStepEntity.getStreetId())) {
145 StepUtil.setStepStartData(getContext(), uid, TimeUtil.getNowTimeStamp(), CommonInfo.getStreetId(getContext())); 148 StepUtil.setStepStartData(getContext(), uid, TimeUtil.getNowTimeStamp(), CommonInfo.getStreetId(getContext()));
146 } 149 }
  150 + //设置终点经纬度
  151 + if (TextUtils.isEmpty(userStepEntity.getEndLatLng())) {
  152 + if (null != runRaceDetailInfo.getEndLatLng()) {
  153 + //设置终点坐标
  154 + userStepEntity.setEndLatLng(runRaceDetailInfo.getEndLatLng());
  155 + //更新数据
  156 + StepUtil.updateStepData(getContext(), userStepEntity);
  157 + }
  158 + }
  159 + //设置终点经纬度
  160 + if (!TextUtils.isEmpty(userStepEntity.getEndLatLng())) {
  161 + endLatLng = GsonUtil.GsonToBean(userStepEntity.getEndLatLng(), LatLng.class);
  162 + }
  163 + //设置步数
  164 + if (!TextUtils.isEmpty(userStepEntity.getStepCount())){
  165 + //设置行走步数
  166 + fragment.binding.tvStepCount.setText(userStepEntity.getStepCount());
  167 + //设置行走公里
  168 + fragment.binding.tvRunDistance.setText(StepUtil.getWalkDistanceKM(Long.parseLong(userStepEntity.getStepCount())) + "");
  169 + }
  170 +
147 171
148 } 172 }
149 initLocationClient(); 173 initLocationClient();
@@ -231,8 +255,8 @@ public class RunMainFragmentView implements MvpView { @@ -231,8 +255,8 @@ public class RunMainFragmentView implements MvpView {
231 Log.e(TAG, "run: 是否暂停" + isPasue); 255 Log.e(TAG, "run: 是否暂停" + isPasue);
232 //如果暂停则从暂停那一刻开始 256 //如果暂停则从暂停那一刻开始
233 if (isPasue) { 257 if (isPasue) {
234 - if ((userStepEntity.getPauseTimeStamp() != 0) && (userStepEntity.getRecordTime() != 0)) {  
235 - fragment.binding.chronometer.setBase(userStepEntity.getPauseTimeStamp() + (SystemClock.elapsedRealtime() - userStepEntity.getRecordTime())); 258 + if ((userStepEntity.getChronometerBase() != 0) && (userStepEntity.getRecordTime() != 0)) {
  259 + fragment.binding.chronometer.setBase(userStepEntity.getChronometerBase() + (SystemClock.elapsedRealtime() - userStepEntity.getRecordTime()));
236 } else { 260 } else {
237 fragment.binding.chronometer.setFormat("00:00:01"); 261 fragment.binding.chronometer.setFormat("00:00:01");
238 fragment.binding.chronometer.setBase(SystemClock.elapsedRealtime()); 262 fragment.binding.chronometer.setBase(SystemClock.elapsedRealtime());
@@ -375,17 +399,18 @@ public class RunMainFragmentView implements MvpView { @@ -375,17 +399,18 @@ public class RunMainFragmentView implements MvpView {
375 runningFinishBean.setStartPoint(userStepEntity.getStartPoint()); 399 runningFinishBean.setStartPoint(userStepEntity.getStartPoint());
376 runningFinishBean.setEndPoint(userStepEntity.getEndPoint()); 400 runningFinishBean.setEndPoint(userStepEntity.getEndPoint());
377 runningFinishBean.setRunDistance(fragment.binding.tvRunDistance.getText().toString()); 401 runningFinishBean.setRunDistance(fragment.binding.tvRunDistance.getText().toString());
  402 + //必须先设置步数,然后设置配速
  403 + if ("--".equals(fragment.binding.tvStepCount.getText().toString())) {
  404 + runningFinishBean.setStep("0");
  405 + } else {
  406 + runningFinishBean.setStep(fragment.binding.tvStepCount.getText().toString());
  407 + }
378 if ("--".equals(fragment.binding.tvSpeed.getText().toString())) { 408 if ("--".equals(fragment.binding.tvSpeed.getText().toString())) {
379 String speed = StepUtil.getPaceSpeed(Double.parseDouble(employTime), Double.parseDouble(fragment.binding.tvRunDistance.getText().toString())); 409 String speed = StepUtil.getPaceSpeed(Double.parseDouble(employTime), Double.parseDouble(fragment.binding.tvRunDistance.getText().toString()));
380 runningFinishBean.setSpeed(speed); 410 runningFinishBean.setSpeed(speed);
381 } else { 411 } else {
382 runningFinishBean.setSpeed(fragment.binding.tvSpeed.getText().toString()); 412 runningFinishBean.setSpeed(fragment.binding.tvSpeed.getText().toString());
383 } 413 }
384 - if ("--".equals(fragment.binding.tvStepCount.getText().toString())) {  
385 - runningFinishBean.setStep("0");  
386 - } else {  
387 - runningFinishBean.setStep(fragment.binding.tvStepCount.getText().toString());  
388 - }  
389 runningFinishBean.setTime(fragment.binding.chronometer.getText().toString()); 414 runningFinishBean.setTime(fragment.binding.chronometer.getText().toString());
390 runningFinishBean.setDate(TimeUtil.getStampToTime(userStepEntity.getFinishTimeStamp() * 1000, "yyyy/MM/dd HH:mm")); 415 runningFinishBean.setDate(TimeUtil.getStampToTime(userStepEntity.getFinishTimeStamp() * 1000, "yyyy/MM/dd HH:mm"));
391 runningFinishBean.setStreetTitle(userStepEntity.getStreetTitle()); 416 runningFinishBean.setStreetTitle(userStepEntity.getStreetTitle());
@@ -597,7 +622,7 @@ public class RunMainFragmentView implements MvpView { @@ -597,7 +622,7 @@ public class RunMainFragmentView implements MvpView {
597 if (!TextUtils.isEmpty(id)) { 622 if (!TextUtils.isEmpty(id)) {
598 UserStepEntity userStepEntity = StepUtil.getUserStepData(fragment.getActivity(), uid); 623 UserStepEntity userStepEntity = StepUtil.getUserStepData(fragment.getActivity(), uid);
599 if (userStepEntity != null) { 624 if (userStepEntity != null) {
600 - userStepEntity.setPauseTimeStamp(fragment.binding.chronometer.getBase()); 625 + userStepEntity.setChronometerBase(fragment.binding.chronometer.getBase());
601 //设置当前暂停的时间戳 626 //设置当前暂停的时间戳
602 userStepEntity.setRecordTime(SystemClock.elapsedRealtime()); 627 userStepEntity.setRecordTime(SystemClock.elapsedRealtime());
603 //设置当前用户暂停的时间戳 628 //设置当前用户暂停的时间戳
@@ -661,7 +686,8 @@ public class RunMainFragmentView implements MvpView { @@ -661,7 +686,8 @@ public class RunMainFragmentView implements MvpView {
661 686
662 @Override 687 @Override
663 public void onReceiveLocation(BDLocation location) { 688 public void onReceiveLocation(BDLocation location) {
664 - if (location == null) { 689 + // map view 销毁后不在处理新接收的位置
  690 + if (location == null || getContext() == null) {
665 return; 691 return;
666 } 692 }
667 //正在搜索GPS信号 693 //正在搜索GPS信号
@@ -718,6 +744,52 @@ public class RunMainFragmentView implements MvpView { @@ -718,6 +744,52 @@ public class RunMainFragmentView implements MvpView {
718 fragment.binding.ivGps.setBackground(getContext().getResources().getDrawable(R.drawable.rt_training_gps_3)); 744 fragment.binding.ivGps.setBackground(getContext().getResources().getDrawable(R.drawable.rt_training_gps_3));
719 } 745 }
720 } 746 }
  747 +
  748 + //进行精度过滤
  749 + if (location.getRadius() > Constant.LOCA_ACCURACY) {
  750 + return;
  751 + }
  752 + //进行数据比较(先看看数据库是否有数据)
  753 + if (null == endLatLng) {
  754 + if (null == userStepEntity) {
  755 + userStepEntity = StepUtil.getUserStepData(getContext(), CommonInfo.getUserId(getContext()));
  756 + }
  757 + if (null != userStepEntity) {
  758 + if (!TextUtils.isEmpty(userStepEntity.getEndLatLng())) {
  759 + endLatLng = GsonUtil.GsonToBean(userStepEntity.getEndLatLng(), LatLng.class);
  760 + }
  761 + }
  762 + }
  763 + //开始比较
  764 + if (null != endLatLng) {
  765 + LatLng current = new LatLng(location.getLatitude(), location.getLongitude());
  766 + if (null != current) {
  767 + //开始比较数据
  768 + double distance = DistanceUtil.getDistance(current, endLatLng);
  769 + if (distance < Constant.LOCA_END_POINT_ACCURACY) {
  770 + //设置数据
  771 + if (userStepEntity != null) {
  772 + userStepEntity.setIsArriveEndPoint(true);
  773 + //更新数据
  774 + StepUtil.updateStepData(getContext(), userStepEntity);
  775 + }
  776 + //进行提示
  777 + if (null == tipDialog) {
  778 + tipDialog = new TipDialog(getContext(), getContext().getResources().getString(R.string.run_race_arrive_end_tip), "好的", R.color.green_round, new TipDialog.DialogInterface() {
  779 + @Override
  780 + public void onClick(TipDialog dialog) {
  781 + dialog.dismiss();
  782 + }
  783 + });
  784 + tipDialog.setCancelable(false);
  785 + tipDialog.setCanceledOnTouchOutside(false);
  786 + }
  787 + if (!tipDialog.isShowing()) {
  788 + tipDialog.show();
  789 + }
  790 + }
  791 + }
  792 + }
721 } 793 }
722 794
723 } 795 }
@@ -761,7 +833,7 @@ public class RunMainFragmentView implements MvpView { @@ -761,7 +833,7 @@ public class RunMainFragmentView implements MvpView {
761 //设置当前数据创建时间戳 833 //设置当前数据创建时间戳
762 failedEntity.setCreatTimeStamp(TimeUtil.getNowTimeStamp()); 834 failedEntity.setCreatTimeStamp(TimeUtil.getNowTimeStamp());
763 //设置是否暂停 835 //设置是否暂停
764 - if (userStepEntity.getPauseCount() > 1) { 836 + if (userStepEntity.getPauseCount() != 0) {
765 failedEntity.setIsPause(true); 837 failedEntity.setIsPause(true);
766 //设置暂停时间 838 //设置暂停时间
767 failedEntity.setUserPauseTime(userStepEntity.getUserPauseTimeStamp()); 839 failedEntity.setUserPauseTime(userStepEntity.getUserPauseTimeStamp());
@@ -810,6 +882,8 @@ public class RunMainFragmentView implements MvpView { @@ -810,6 +882,8 @@ public class RunMainFragmentView implements MvpView {
810 failedEntity.setStreetId(userStepEntity.getStreetId()); 882 failedEntity.setStreetId(userStepEntity.getStreetId());
811 //设置赛事标题 883 //设置赛事标题
812 failedEntity.setStreetTitle(userStepEntity.getStreetTitle()); 884 failedEntity.setStreetTitle(userStepEntity.getStreetTitle());
  885 + //设置是否完成
  886 + failedEntity.setIsArriveEndPoint(userStepEntity.getIsArriveEndPoint());
813 //设置数据 887 //设置数据
814 StepUtil.setFailData(context, failedEntity); 888 StepUtil.setFailData(context, failedEntity);
815 889
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RunRaceDetailFragmentView.java
@@ -122,21 +122,14 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { @@ -122,21 +122,14 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener {
122 public MyLocationListenner myListener = new MyLocationListenner(); 122 public MyLocationListenner myListener = new MyLocationListenner();
123 private final int DEFULT_ZOOM = 17; 123 private final int DEFULT_ZOOM = 17;
124 private RoutePlanSearch routePlanSearch = null; // 路线规划 124 private RoutePlanSearch routePlanSearch = null; // 路线规划
125 - private LatLng endLatLng;  
126 private final int START_MARK = 0;//起始点 125 private final int START_MARK = 0;//起始点
127 private final int END_MARK = 1;//终止点 126 private final int END_MARK = 1;//终止点
128 -  
129 - private String startPoint = "首都师范大学南门";  
130 - private String endPoint = "首都师范大学篮球场";  
131 - // private String test = "[{\"latitude\":39.933889208848,\"latitudeE6\":3.9933889208848E7,\"longitude\":116.30900265517,\"longitudeE6\":1.1630900265517001E8},{\"latitude\":39.933868507347,\"latitudeE6\":3.9933868507347E7,\"longitude\":116.30865416508,\"longitudeE6\":1.1630865416508E8},{\"latitude\":39.934756505077,\"latitudeE6\":3.9934756505077E7,\"longitude\":116.30860516469,\"longitudeE6\":1.1630860516468999E8},{\"latitude\":39.934781620502,\"latitudeE6\":3.9934781620502E7,\"longitude\":116.30961013007,\"longitudeE6\":1.1630961013007E8},{\"latitude\":39.934881620374,\"latitudeE6\":3.9934881620374E7,\"longitude\":116.30960513008,\"longitudeE6\":1.1630960513008E8},{\"latitude\":39.934077623132,\"latitudeE6\":3.9934077623132E7,\"longitude\":116.30965812942,\"longitudeE6\":1.1630965812942E8},{\"latitude\":39.933972618463,\"latitudeE6\":3.9933972618463E7,\"longitude\":116.30962113087,\"longitudeE6\":1.1630962113087E8},{\"latitude\":39.933932608856,\"latitudeE6\":3.9933932608856E7,\"longitude\":116.30953913383,\"longitudeE6\":1.1630953913383E8}]";  
132 - private LinkedList<LatLng> importLatLngs;//关键点  
133 - private LatLng startLatLng = new LatLng(39.934733, 116.308646);//起始点 127 + private LatLng startLatLng;//起始点
134 public RunRaceDetailInfo runRaceDetailInfo; 128 public RunRaceDetailInfo runRaceDetailInfo;
135 private UserStepEntity userStepEntity; 129 private UserStepEntity userStepEntity;
136 private boolean isDifferentStreet = false; 130 private boolean isDifferentStreet = false;
137 private LBSTraceClient mClient = null; 131 private LBSTraceClient mClient = null;
138 - private List<LatLng> resultStreetPoints;  
139 - public List<LatLng> importStreetPoints;//运营打的重要的点 132 + public LatLng endLatLng;//用于终点判断
140 133
141 public RunRaceDetailFragmentView(RunRaceDetailFragment fragment) { 134 public RunRaceDetailFragmentView(RunRaceDetailFragment fragment) {
142 this.fragment = fragment; 135 this.fragment = fragment;
@@ -200,10 +193,6 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { @@ -200,10 +193,6 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener {
200 return; 193 return;
201 } 194 }
202 this.runRaceDetailInfo = runRaceDetailInfo; 195 this.runRaceDetailInfo = runRaceDetailInfo;
203 -// //初始化地图点位  
204 - if (runRaceDetailInfo.getLatLongitude() != null) {  
205 - importStreetPoints = GsonUtil.jsonToList(runRaceDetailInfo.getLatLongitude().trim(), LatLng.class);  
206 - }  
207 //轨迹开始时间 196 //轨迹开始时间
208 long startTime = 0; 197 long startTime = 0;
209 //轨迹结束时间 198 //轨迹结束时间
@@ -220,8 +209,8 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { @@ -220,8 +209,8 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener {
220 @Override 209 @Override
221 public void success(List<LatLng> resultPoints) { 210 public void success(List<LatLng> resultPoints) {
222 if (resultPoints != null && resultPoints.size() > 1) { 211 if (resultPoints != null && resultPoints.size() > 1) {
223 - resultStreetPoints = resultPoints;  
224 - Log.e(TAG, "resultPoints: " + resultPoints.size()); 212 + startLatLng = resultPoints.get(0);
  213 + endLatLng = resultPoints.get(resultPoints.size() - 1);
225 MyMapUtil.drawServerLineTrack(getContext(), baiduMap, resultPoints, SortType.asc, R.color.green_round, R.drawable.icon_start, R.drawable.icon_end); 214 MyMapUtil.drawServerLineTrack(getContext(), baiduMap, resultPoints, SortType.asc, R.color.green_round, R.drawable.icon_start, R.drawable.icon_end);
226 // //自动计算地图缩放 215 // //自动计算地图缩放
227 // MapStatus.Builder builder = new MapStatus.Builder(); 216 // MapStatus.Builder builder = new MapStatus.Builder();
@@ -486,8 +475,28 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { @@ -486,8 +475,28 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener {
486 //现在开始 475 //现在开始
487 else if ("1".equals(fragment.binding.rlScrollViewStartBtn.getTag())) { 476 else if ("1".equals(fragment.binding.rlScrollViewStartBtn.getTag())) {
488 //先判断是否从百度查询到赛事轨迹 477 //先判断是否从百度查询到赛事轨迹
489 - if (resultStreetPoints != null) {  
490 - startStepService(getContext()); 478 + if (null != endLatLng && null != startLatLng) {
  479 + //开始比较距离
  480 + if (null != firstLatLng) {
  481 + double currentDiatance = DistanceUtil.getDistance(firstLatLng, startLatLng);
  482 + if (currentDiatance < Constant.LOCA_START_POINT_ACCURACY) {
  483 + //设置终点坐标
  484 + runRaceDetailInfo.setEndLatLng(GsonUtil.GsonString(endLatLng));
  485 + startStepService(getContext());
  486 + } else {
  487 + //进行提示
  488 + TipDialog tipDialog = new TipDialog(getContext(), getContext().getResources().getString(R.string.run_race_far_tip), "好的", R.color.green_round, new TipDialog.DialogInterface() {
  489 + @Override
  490 + public void onClick(TipDialog dialog) {
  491 + dialog.dismiss();
  492 + }
  493 + });
  494 + tipDialog.setCancelable(false);
  495 + tipDialog.setCanceledOnTouchOutside(false);
  496 + tipDialog.show();
  497 + }
  498 + }
  499 +
491 } else { 500 } else {
492 QMUITipDialogUtil.textDialog(getContext(), "正在获取轨迹请稍后...", 1); 501 QMUITipDialogUtil.textDialog(getContext(), "正在获取轨迹请稍后...", 1);
493 } 502 }
@@ -495,12 +504,33 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { @@ -495,12 +504,33 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener {
495 //继续运动 504 //继续运动
496 else if ("2".equals(fragment.binding.rlScrollViewStartBtn.getTag())) { 505 else if ("2".equals(fragment.binding.rlScrollViewStartBtn.getTag())) {
497 if (!isDifferentStreet) { 506 if (!isDifferentStreet) {
498 - checkBaiduServiceState(); 507 + SelectDialog continueTipDialog = new SelectDialog(getContext(), "是否继续运动", "否", new SelectDialog.DialogInterface() {
  508 + @Override
  509 + public void onClick(SelectDialog dialog) {
  510 + //清空上次保存数据
  511 + StepUtil.clearRunData(getContext(), CommonInfo.getUserId(getContext()));
  512 + //停止服务
  513 + stopStepService();
  514 + //清除数据
  515 + CommonInfo.resetRace(getContext());
  516 + dialog.dismiss();
  517 + }
  518 + }, "是", new SelectDialog.DialogInterface() {
  519 + @Override
  520 + public void onClick(SelectDialog dialog) {
  521 + dialog.dismiss();
  522 + checkBaiduServiceState();
  523 + }
  524 + });
  525 + continueTipDialog.setCanceledOnTouchOutside(false);
  526 + continueTipDialog.setCancelable(false);
  527 + continueTipDialog.show();
  528 +
499 } 529 }
500 530
501 //赛事id不同 531 //赛事id不同
502 else { 532 else {
503 - SelectDialog selectDialog = new SelectDialog(getContext(), "您正在进行另一赛事,是否回到当前进行赛事?", "否", new SelectDialog.DialogInterface() { 533 + SelectDialog selectDialog = new SelectDialog(getContext(), "您正在参与另一赛事\n是否继续?", "否", new SelectDialog.DialogInterface() {
504 @Override 534 @Override
505 public void onClick(SelectDialog dialog) { 535 public void onClick(SelectDialog dialog) {
506 dialog.dismiss(); 536 dialog.dismiss();
@@ -653,188 +683,188 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { @@ -653,188 +683,188 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener {
653 }); 683 });
654 } 684 }
655 685
656 - /**  
657 - * 开始路线规划  
658 - */  
659 - public void searchRouteResult(LatLng StartPoint, LatLng EndPoint, int index, int listSize) {  
660 -// Log.e(TAG, "searchRouteResult: ");  
661 - float currentZoom = baiduMap.getMapStatus().zoom;  
662 - // 设置起终点信息,对于tranist search 来说,城市名无意义  
663 - PlanNode stNode = PlanNode.withLocation(StartPoint);  
664 - PlanNode enNode = PlanNode.withLocation(EndPoint);  
665 - routePlanSearch.setOnGetRoutePlanResultListener(new OnGetRoutePlanResultListener() {  
666 - @Override  
667 - public void onGetWalkingRouteResult(WalkingRouteResult walkingRouteResult) {  
668 - if (fragment.getActivity() == null) {  
669 - return;  
670 - }  
671 - if (walkingRouteResult == null || walkingRouteResult.error != SearchResult.ERRORNO.NO_ERROR) {  
672 - Toast.makeText(fragment.getActivity(), "抱歉,无法获取路线!", Toast.LENGTH_SHORT).show();  
673 - }  
674 - if (walkingRouteResult.error == SearchResult.ERRORNO.AMBIGUOUS_ROURE_ADDR) {  
675 - // 起终点或途经点地址有岐义,通过以下接口获取建议查询信息  
676 - return;  
677 - }  
678 - List<LatLng> points = new ArrayList<LatLng>();  
679 - if (walkingRouteResult.getRouteLines() != null) {  
680 - if (walkingRouteResult.getRouteLines().get(0).getAllStep().get(0).getWayPoints().size() > 0) {  
681 - //添加起点坐标  
682 - if (index == 0) {  
683 - points.add(StartPoint);  
684 - }  
685 - for (int i = 0; i < walkingRouteResult.getRouteLines().get(0).getAllStep().size(); i++) {  
686 - for (int j = 0; j < walkingRouteResult.getRouteLines().get(0).getAllStep().get(i).getWayPoints().size(); j++) {  
687 - points.add(walkingRouteResult.getRouteLines().get(0).getAllStep().get(i).getWayPoints().get(j));  
688 - }  
689 - }  
690 - }  
691 - //添加终点坐标  
692 - if (endLatLng != null) { 686 +// /**
  687 +// * 开始路线规划
  688 +// */
  689 +// public void searchRouteResult(LatLng StartPoint, LatLng EndPoint, int index, int listSize) {
  690 +//// Log.e(TAG, "searchRouteResult: ");
  691 +// float currentZoom = baiduMap.getMapStatus().zoom;
  692 +// // 设置起终点信息,对于tranist search 来说,城市名无意义
  693 +// PlanNode stNode = PlanNode.withLocation(StartPoint);
  694 +// PlanNode enNode = PlanNode.withLocation(EndPoint);
  695 +// routePlanSearch.setOnGetRoutePlanResultListener(new OnGetRoutePlanResultListener() {
  696 +// @Override
  697 +// public void onGetWalkingRouteResult(WalkingRouteResult walkingRouteResult) {
  698 +// if (fragment.getActivity() == null) {
  699 +// return;
  700 +// }
  701 +// if (walkingRouteResult == null || walkingRouteResult.error != SearchResult.ERRORNO.NO_ERROR) {
  702 +// Toast.makeText(fragment.getActivity(), "抱歉,无法获取路线!", Toast.LENGTH_SHORT).show();
  703 +// }
  704 +// if (walkingRouteResult.error == SearchResult.ERRORNO.AMBIGUOUS_ROURE_ADDR) {
  705 +// // 起终点或途经点地址有岐义,通过以下接口获取建议查询信息
  706 +// return;
  707 +// }
  708 +// List<LatLng> points = new ArrayList<LatLng>();
  709 +// if (walkingRouteResult.getRouteLines() != null) {
  710 +// if (walkingRouteResult.getRouteLines().get(0).getAllStep().get(0).getWayPoints().size() > 0) {
  711 +// //添加起点坐标
  712 +// if (index == 0) {
  713 +// points.add(StartPoint);
  714 +// }
  715 +// for (int i = 0; i < walkingRouteResult.getRouteLines().get(0).getAllStep().size(); i++) {
  716 +// for (int j = 0; j < walkingRouteResult.getRouteLines().get(0).getAllStep().get(i).getWayPoints().size(); j++) {
  717 +// points.add(walkingRouteResult.getRouteLines().get(0).getAllStep().get(i).getWayPoints().get(j));
  718 +// }
  719 +// }
  720 +// }
  721 +// //添加终点坐标
  722 +// if (endLatLng != null) {
  723 +//// points.add(endLatLng);
  724 +// }
  725 +//
  726 +// ArrayList<Integer> traffics = new ArrayList<Integer>();
  727 +// for (int i = 0; i < points.size(); i++) {
  728 +// if (i % 2 == 0) {
  729 +// traffics.add(i);
  730 +// }
  731 +// }
  732 +//
  733 +//
  734 +// if (points.size() > 0) {
  735 +//// if (baiduMap != null) {
  736 +//// baiduMap.clear();
  737 +//// if (endLatLng != null) {
  738 +//// markPoi(endLatLng.latitude, endLatLng.longitude);
  739 +//// }
  740 +//// }
  741 +//
  742 +// //设置折线的属性
  743 +//// OverlayOptions mOverlayOptions = new PolylineOptions()
  744 +//// .width(10)
  745 +//// .color(0xAAFF0000)
  746 +//// .points(points);
  747 +// //设置折线的属性
  748 +// OverlayOptions mOverlayOptions = new PolylineOptions()
  749 +// .width(10)
  750 +// .dottedLine(true)
  751 +// .points(points)
  752 +// .customTextureList(getCustomTextureList())
  753 +// .textureIndex(traffics);//设置纹理列表
  754 +// //在地图上绘制起点
  755 +// if (index == 0) {
  756 +// //显示当前位置图标
  757 +// Bitmap pointBitmap = BitmapUtil.getBitmapFromDp(getContext(), BitmapFactory.decodeResource(getContext().getResources(), R.drawable.icon_start), 30, 30);
  758 +// startMark = new MarkerOptions()
  759 +// .position(StartPoint)
  760 +// .icon(BitmapDescriptorFactory.fromBitmap(pointBitmap));
  761 +//// startMark.anchor(0.5f, 0.55f);
  762 +// baiduMap.addOverlay(startMark);
  763 +// } else if (index == listSize - 1) {
  764 +// //显示当前位置图标
  765 +// Bitmap pointBitmap = BitmapUtil.getBitmapFromDp(getContext(), BitmapFactory.decodeResource(getContext().getResources(), R.drawable.icon_end), 30, 30);
  766 +// endMark = new MarkerOptions()
  767 +// .position(points.get(points.size() - 1))
  768 +// .icon(BitmapDescriptorFactory.fromBitmap(pointBitmap))
  769 +// .perspective(true)
  770 +//// endMark.anchor(0.5f, 0.5f)
  771 +// .perspective(true);
  772 +// baiduMap.addOverlay(endMark);
  773 +// }
  774 +// //mPloyline 折线对象
  775 +// Overlay mPolyline = baiduMap.addOverlay(mOverlayOptions);
  776 +// MapStatus.Builder builder = new MapStatus.Builder();
  777 +// builder.zoom(currentZoom);
  778 +// baiduMap.animateMapStatus(MapStatusUpdateFactory.newMapStatus(builder.build()));
  779 +//
  780 +// }
  781 +// }
  782 +// }
  783 +//
  784 +// @Override
  785 +// public void onGetTransitRouteResult(TransitRouteResult transitRouteResult) {
  786 +//
  787 +// }
  788 +//
  789 +// @Override
  790 +// public void onGetMassTransitRouteResult(MassTransitRouteResult massTransitRouteResult) {
  791 +//
  792 +// }
  793 +//
  794 +// @Override
  795 +// public void onGetDrivingRouteResult(DrivingRouteResult drivingRouteResult) {
  796 +// if (fragment.getActivity() == null) {
  797 +// return;
  798 +// }
  799 +//
  800 +// if (drivingRouteResult == null || drivingRouteResult.error != SearchResult.ERRORNO.NO_ERROR) {
  801 +// Toast.makeText(fragment.getActivity(), "抱歉,无法获取路线!", Toast.LENGTH_SHORT).show();
  802 +// }
  803 +// if (drivingRouteResult.error == SearchResult.ERRORNO.AMBIGUOUS_ROURE_ADDR) {
  804 +// // 起终点或途经点地址有岐义,通过以下接口获取建议查询信息
  805 +// return;
  806 +// }
  807 +// List<LatLng> points = new ArrayList<LatLng>();
  808 +// if (drivingRouteResult.getRouteLines() != null) {
  809 +// if (drivingRouteResult.getRouteLines().get(0).getAllStep().get(0).getWayPoints().size() > 0) {
  810 +// //添加起点坐标
  811 +// if (followMyLocation != null) {
  812 +// points.add(new LatLng(followMyLocation.latitude, followMyLocation.longitude));
  813 +// }
  814 +// for (int i = 0; i < drivingRouteResult.getRouteLines().get(0).getAllStep().size(); i++) {
  815 +// for (int j = 0; j < drivingRouteResult.getRouteLines().get(0).getAllStep().get(i).getWayPoints().size(); j++) {
  816 +// points.add(drivingRouteResult.getRouteLines().get(0).getAllStep().get(i).getWayPoints().get(j));
  817 +// }
  818 +// }
  819 +// }
  820 +// //添加终点坐标
  821 +// if (endLatLng != null) {
693 // points.add(endLatLng); 822 // points.add(endLatLng);
694 - }  
695 -  
696 - ArrayList<Integer> traffics = new ArrayList<Integer>();  
697 - for (int i = 0; i < points.size(); i++) {  
698 - if (i % 2 == 0) {  
699 - traffics.add(i);  
700 - }  
701 - }  
702 -  
703 -  
704 - if (points.size() > 0) {  
705 -// if (baiduMap != null) {  
706 -// baiduMap.clear();  
707 -// if (endLatLng != null) {  
708 -// markPoi(endLatLng.latitude, endLatLng.longitude);  
709 -// } 823 +// }
  824 +// if (points.size() > 0) {
  825 +// if (baiduMap != null) {
  826 +// baiduMap.clear();
  827 +// if (endLatLng != null) {
  828 +// markPoi(endLatLng.latitude, endLatLng.longitude);
710 // } 829 // }
711 -  
712 - //设置折线的属性 830 +// }
  831 +//
  832 +// //设置折线的属性
713 // OverlayOptions mOverlayOptions = new PolylineOptions() 833 // OverlayOptions mOverlayOptions = new PolylineOptions()
714 // .width(10) 834 // .width(10)
715 // .color(0xAAFF0000) 835 // .color(0xAAFF0000)
716 // .points(points); 836 // .points(points);
717 - //设置折线的属性  
718 - OverlayOptions mOverlayOptions = new PolylineOptions()  
719 - .width(10)  
720 - .dottedLine(true)  
721 - .points(points)  
722 - .customTextureList(getCustomTextureList())  
723 - .textureIndex(traffics);//设置纹理列表  
724 - //在地图上绘制起点  
725 - if (index == 0) {  
726 - //显示当前位置图标  
727 - Bitmap pointBitmap = BitmapUtil.getBitmapFromDp(getContext(), BitmapFactory.decodeResource(getContext().getResources(), R.drawable.icon_start), 30, 30);  
728 - startMark = new MarkerOptions()  
729 - .position(StartPoint)  
730 - .icon(BitmapDescriptorFactory.fromBitmap(pointBitmap));  
731 -// startMark.anchor(0.5f, 0.55f);  
732 - baiduMap.addOverlay(startMark);  
733 - } else if (index == listSize - 1) {  
734 - //显示当前位置图标  
735 - Bitmap pointBitmap = BitmapUtil.getBitmapFromDp(getContext(), BitmapFactory.decodeResource(getContext().getResources(), R.drawable.icon_end), 30, 30);  
736 - endMark = new MarkerOptions()  
737 - .position(points.get(points.size() - 1))  
738 - .icon(BitmapDescriptorFactory.fromBitmap(pointBitmap))  
739 - .perspective(true)  
740 -// endMark.anchor(0.5f, 0.5f)  
741 - .perspective(true);  
742 - baiduMap.addOverlay(endMark);  
743 - }  
744 - //mPloyline 折线对象  
745 - Overlay mPolyline = baiduMap.addOverlay(mOverlayOptions);  
746 - MapStatus.Builder builder = new MapStatus.Builder();  
747 - builder.zoom(currentZoom);  
748 - baiduMap.animateMapStatus(MapStatusUpdateFactory.newMapStatus(builder.build()));  
749 -  
750 - }  
751 - }  
752 - }  
753 -  
754 - @Override  
755 - public void onGetTransitRouteResult(TransitRouteResult transitRouteResult) {  
756 -  
757 - }  
758 -  
759 - @Override  
760 - public void onGetMassTransitRouteResult(MassTransitRouteResult massTransitRouteResult) {  
761 -  
762 - }  
763 -  
764 - @Override  
765 - public void onGetDrivingRouteResult(DrivingRouteResult drivingRouteResult) {  
766 - if (fragment.getActivity() == null) {  
767 - return;  
768 - }  
769 -  
770 - if (drivingRouteResult == null || drivingRouteResult.error != SearchResult.ERRORNO.NO_ERROR) {  
771 - Toast.makeText(fragment.getActivity(), "抱歉,无法获取路线!", Toast.LENGTH_SHORT).show();  
772 - }  
773 - if (drivingRouteResult.error == SearchResult.ERRORNO.AMBIGUOUS_ROURE_ADDR) {  
774 - // 起终点或途经点地址有岐义,通过以下接口获取建议查询信息  
775 - return;  
776 - }  
777 - List<LatLng> points = new ArrayList<LatLng>();  
778 - if (drivingRouteResult.getRouteLines() != null) {  
779 - if (drivingRouteResult.getRouteLines().get(0).getAllStep().get(0).getWayPoints().size() > 0) {  
780 - //添加起点坐标  
781 - if (followMyLocation != null) {  
782 - points.add(new LatLng(followMyLocation.latitude, followMyLocation.longitude));  
783 - }  
784 - for (int i = 0; i < drivingRouteResult.getRouteLines().get(0).getAllStep().size(); i++) {  
785 - for (int j = 0; j < drivingRouteResult.getRouteLines().get(0).getAllStep().get(i).getWayPoints().size(); j++) {  
786 - points.add(drivingRouteResult.getRouteLines().get(0).getAllStep().get(i).getWayPoints().get(j));  
787 - }  
788 - }  
789 - }  
790 - //添加终点坐标  
791 - if (endLatLng != null) {  
792 - points.add(endLatLng);  
793 - }  
794 - if (points.size() > 0) {  
795 - if (baiduMap != null) {  
796 - baiduMap.clear();  
797 - if (endLatLng != null) {  
798 - markPoi(endLatLng.latitude, endLatLng.longitude);  
799 - }  
800 - }  
801 -  
802 - //设置折线的属性  
803 - OverlayOptions mOverlayOptions = new PolylineOptions()  
804 - .width(10)  
805 - .color(0xAAFF0000)  
806 - .points(points);  
807 - //在地图上绘制折线  
808 - //mPloyline 折线对象  
809 - Overlay mPolyline = baiduMap.addOverlay(mOverlayOptions);  
810 - MapStatus.Builder builder = new MapStatus.Builder();  
811 - builder.zoom(currentZoom);  
812 - baiduMap.animateMapStatus(MapStatusUpdateFactory.newMapStatus(builder.build()));  
813 -  
814 - }  
815 - }  
816 - }  
817 -  
818 - @Override  
819 - public void onGetIndoorRouteResult(IndoorRouteResult indoorRouteResult) {  
820 -  
821 - }  
822 -  
823 - @Override  
824 - public void onGetBikingRouteResult(BikingRouteResult bikingRouteResult) {  
825 -  
826 - }  
827 - });  
828 - //开始检索 837 +// //在地图上绘制折线
  838 +// //mPloyline 折线对象
  839 +// Overlay mPolyline = baiduMap.addOverlay(mOverlayOptions);
  840 +// MapStatus.Builder builder = new MapStatus.Builder();
  841 +// builder.zoom(currentZoom);
  842 +// baiduMap.animateMapStatus(MapStatusUpdateFactory.newMapStatus(builder.build()));
  843 +//
  844 +// }
  845 +// }
  846 +// }
  847 +//
  848 +// @Override
  849 +// public void onGetIndoorRouteResult(IndoorRouteResult indoorRouteResult) {
  850 +//
  851 +// }
  852 +//
  853 +// @Override
  854 +// public void onGetBikingRouteResult(BikingRouteResult bikingRouteResult) {
  855 +//
  856 +// }
  857 +// });
  858 + //开始检索
829 // routePlanSearch.drivingSearch((new DrivingRoutePlanOption()) 859 // routePlanSearch.drivingSearch((new DrivingRoutePlanOption())
830 // .from(stNode).to(enNode).policy(DrivingRoutePlanOption.DrivingPolicy.ECAR_DIS_FIRST) 860 // .from(stNode).to(enNode).policy(DrivingRoutePlanOption.DrivingPolicy.ECAR_DIS_FIRST)
831 // .trafficPolicy(DrivingRoutePlanOption.DrivingTrafficPolicy.ROUTE_PATH_AND_TRAFFIC)); 861 // .trafficPolicy(DrivingRoutePlanOption.DrivingTrafficPolicy.ROUTE_PATH_AND_TRAFFIC));
832 862
833 - //开始步行检索  
834 - routePlanSearch.walkingSearch((new WalkingRoutePlanOption())  
835 - .from(stNode)  
836 - .to(enNode));  
837 - } 863 + //开始步行检索
  864 +// routePlanSearch.walkingSearch((new WalkingRoutePlanOption())
  865 +// .from(stNode)
  866 +// .to(enNode));
  867 +// }
838 // showProgressDialog(); 868 // showProgressDialog();
839 869
840 /** 870 /**
@@ -989,12 +1019,12 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { @@ -989,12 +1019,12 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener {
989 } 1019 }
990 if (isFirstLoc) { 1020 if (isFirstLoc) {
991 isFirstLoc = false; 1021 isFirstLoc = false;
992 - if (location.getRadius() > 20) { 1022 + if (location.getRadius() > Constant.LOCA_ACCURACY) {
993 Toast.makeText(getContext(), "当前定位精度为:" + location.getRadius() + "米,请您移动至空旷地带!", Toast.LENGTH_SHORT).show(); 1023 Toast.makeText(getContext(), "当前定位精度为:" + location.getRadius() + "米,请您移动至空旷地带!", Toast.LENGTH_SHORT).show();
994 } 1024 }
995 } else { 1025 } else {
996 //过滤定位精度 1026 //过滤定位精度
997 - if (location.getRadius() > 20) { 1027 + if (location.getRadius() > Constant.LOCA_ACCURACY) {
998 return; 1028 return;
999 } 1029 }
1000 } 1030 }
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RunningMapFragmentView.java
@@ -9,6 +9,7 @@ import android.hardware.SensorEventListener; @@ -9,6 +9,7 @@ import android.hardware.SensorEventListener;
9 import android.hardware.SensorManager; 9 import android.hardware.SensorManager;
10 import android.os.Handler; 10 import android.os.Handler;
11 import android.os.SystemClock; 11 import android.os.SystemClock;
  12 +import android.text.TextUtils;
12 import android.util.Log; 13 import android.util.Log;
13 import android.view.MotionEvent; 14 import android.view.MotionEvent;
14 import android.view.View; 15 import android.view.View;
@@ -35,8 +36,12 @@ import com.baidu.mapapi.model.LatLng; @@ -35,8 +36,12 @@ import com.baidu.mapapi.model.LatLng;
35 import com.baidu.mapapi.model.LatLngBounds; 36 import com.baidu.mapapi.model.LatLngBounds;
36 import com.baidu.mapapi.utils.DistanceUtil; 37 import com.baidu.mapapi.utils.DistanceUtil;
37 import com.baidu.trace.model.SortType; 38 import com.baidu.trace.model.SortType;
  39 +import com.cnlive.moudle.pedometer.commonInfo.CommonInfo;
  40 +import com.cnlive.moudle.pedometer.model.Constant;
38 import com.cnlive.moudle.pedometer.model.RunningMapBean; 41 import com.cnlive.moudle.pedometer.model.RunningMapBean;
  42 +import com.cnlive.moudle.pedometer.sql.entity.UserStepEntity;
39 import com.cnlive.moudle.pedometer.ui.fragment.RunningMapFragment; 43 import com.cnlive.moudle.pedometer.ui.fragment.RunningMapFragment;
  44 +import com.cnlive.moudle.pedometer.ui.widget.TipDialog;
40 import com.cnlive.moudle.pedometer.utils.BitmapUtil; 45 import com.cnlive.moudle.pedometer.utils.BitmapUtil;
41 import com.cnlive.moudle.pedometer.utils.ButtonAnimUtil; 46 import com.cnlive.moudle.pedometer.utils.ButtonAnimUtil;
42 import com.cnlive.moudle.pedometer.utils.GsonUtil; 47 import com.cnlive.moudle.pedometer.utils.GsonUtil;
@@ -75,6 +80,9 @@ public class RunningMapFragmentView implements MvpView, SensorEventListener { @@ -75,6 +80,9 @@ public class RunningMapFragmentView implements MvpView, SensorEventListener {
75 private boolean isFirstLoadMap = true; 80 private boolean isFirstLoadMap = true;
76 private Overlay currentLine; 81 private Overlay currentLine;
77 private List<LatLng> currentPoints; 82 private List<LatLng> currentPoints;
  83 + private LatLng endLatLng;//终点坐标
  84 + private UserStepEntity userStepEntity;
  85 + private TipDialog tipDialog;
78 86
79 public RunningMapFragmentView(RunningMapFragment fragment) { 87 public RunningMapFragmentView(RunningMapFragment fragment) {
80 this.fragment = fragment; 88 this.fragment = fragment;
@@ -85,6 +93,10 @@ public class RunningMapFragmentView implements MvpView, SensorEventListener { @@ -85,6 +93,10 @@ public class RunningMapFragmentView implements MvpView, SensorEventListener {
85 } 93 }
86 94
87 public void initView() { 95 public void initView() {
  96 + if (getContext() == null) {
  97 + return;
  98 + }
  99 + userStepEntity = StepUtil.getUserStepData(getContext(), CommonInfo.getUserId(getContext()));
88 currentPoints = new ArrayList<>(); 100 currentPoints = new ArrayList<>();
89 initMap(); 101 initMap();
90 //返回键 102 //返回键
@@ -237,7 +249,7 @@ public class RunningMapFragmentView implements MvpView, SensorEventListener { @@ -237,7 +249,7 @@ public class RunningMapFragmentView implements MvpView, SensorEventListener {
237 @Override 249 @Override
238 public void onReceiveLocation(BDLocation location) { 250 public void onReceiveLocation(BDLocation location) {
239 // map view 销毁后不在处理新接收的位置 251 // map view 销毁后不在处理新接收的位置
240 - if (location == null || mMapView == null) { 252 + if (location == null || mMapView == null || getContext() == null) {
241 return; 253 return;
242 } 254 }
243 255
@@ -293,17 +305,60 @@ public class RunningMapFragmentView implements MvpView, SensorEventListener { @@ -293,17 +305,60 @@ public class RunningMapFragmentView implements MvpView, SensorEventListener {
293 305
294 if (isFirstLoc) { 306 if (isFirstLoc) {
295 isFirstLoc = false; 307 isFirstLoc = false;
296 - if (location.getRadius() > 20) { 308 + if (location.getRadius() > Constant.LOCA_ACCURACY) {
297 Toast.makeText(getContext(), "当前定位精度为:" + location.getRadius() + "米,请您移动至空旷地带!", Toast.LENGTH_SHORT).show(); 309 Toast.makeText(getContext(), "当前定位精度为:" + location.getRadius() + "米,请您移动至空旷地带!", Toast.LENGTH_SHORT).show();
298 } 310 }
299 311
300 312
301 } else { 313 } else {
302 //过滤定位精度 314 //过滤定位精度
303 - if (location.getRadius() > 20) { 315 + if (location.getRadius() > Constant.LOCA_ACCURACY) {
304 return; 316 return;
305 } 317 }
306 } 318 }
  319 +
  320 + //进行数据比较(先看看数据库是否有数据)
  321 + if (null == endLatLng) {
  322 + if (null == userStepEntity) {
  323 + userStepEntity = StepUtil.getUserStepData(getContext(), CommonInfo.getUserId(getContext()));
  324 + }
  325 + if (null != userStepEntity) {
  326 + if (!TextUtils.isEmpty(userStepEntity.getEndLatLng())) {
  327 + endLatLng = GsonUtil.GsonToBean(userStepEntity.getEndLatLng(), LatLng.class);
  328 + }
  329 + }
  330 + }
  331 + //开始比较
  332 + if (null != endLatLng) {
  333 + LatLng current = new LatLng(location.getLatitude(), location.getLongitude());
  334 + if (null != current) {
  335 + //开始比较数据
  336 + double distance = DistanceUtil.getDistance(current, endLatLng);
  337 + if (distance < Constant.LOCA_END_POINT_ACCURACY) {
  338 + //设置数据
  339 + if (userStepEntity != null) {
  340 + userStepEntity.setIsArriveEndPoint(true);
  341 + //更新数据
  342 + StepUtil.updateStepData(getContext(), userStepEntity);
  343 + }
  344 + //进行提示
  345 + if (null == tipDialog) {
  346 + tipDialog = new TipDialog(getContext(), getContext().getResources().getString(R.string.run_race_arrive_end_tip), "好的", R.color.green_round, new TipDialog.DialogInterface() {
  347 + @Override
  348 + public void onClick(TipDialog dialog) {
  349 + dialog.dismiss();
  350 + }
  351 + });
  352 + tipDialog.setCancelable(false);
  353 + tipDialog.setCanceledOnTouchOutside(false);
  354 + }
  355 + if (!tipDialog.isShowing()) {
  356 + tipDialog.show();
  357 + }
  358 + }
  359 + }
  360 + }
  361 +
307 mCurrentAccracy = location.getRadius(); 362 mCurrentAccracy = location.getRadius();
308 mylocation = new MyLocationData.Builder() 363 mylocation = new MyLocationData.Builder()
309 .accuracy(location.getRadius()) 364 .accuracy(location.getRadius())
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/SelfRecordView.java
@@ -2,6 +2,7 @@ package com.cnlive.moudle.pedometer.frame.view; @@ -2,6 +2,7 @@ package com.cnlive.moudle.pedometer.frame.view;
2 2
3 3
4 import android.support.v7.widget.LinearLayoutManager; 4 import android.support.v7.widget.LinearLayoutManager;
  5 +import android.text.TextUtils;
5 import android.view.View; 6 import android.view.View;
6 7
7 import com.cnlive.libs.base.util.AlertUtil; 8 import com.cnlive.libs.base.util.AlertUtil;
@@ -90,11 +91,19 @@ public class SelfRecordView implements MvpView { @@ -90,11 +91,19 @@ public class SelfRecordView implements MvpView {
90 runningFinishBean.setUserFinishTime(bean.getEndTime()); 91 runningFinishBean.setUserFinishTime(bean.getEndTime());
91 //设置用户是否完成 92 //设置用户是否完成
92 runningFinishBean.setIsFinish(bean.getCompleteStatus() + ""); 93 runningFinishBean.setIsFinish(bean.getCompleteStatus() + "");
93 - 94 + //设置是否暂停
  95 + if (!TextUtils.isEmpty(bean.getPauseTime())) {
  96 + runningFinishBean.setPause(true);
  97 + //设置暂停时间
  98 + runningFinishBean.setUserPauseTime(bean.getPauseTime());
  99 + //设置用户继续时间
  100 + runningFinishBean.setUserContinueTime(bean.getContinueTime());
  101 + }
94 //设置起点 102 //设置起点
95 ALLScoreDetailActivity.startActivity(fragment.getActivity(), runningFinishBean); 103 ALLScoreDetailActivity.startActivity(fragment.getActivity(), runningFinishBean);
96 104
97 - } } 105 + }
  106 + }
98 }); 107 });
99 } else { 108 } else {
100 adapter.notifyDataSetChanged(); 109 adapter.notifyDataSetChanged();
@@ -111,13 +120,19 @@ public class SelfRecordView implements MvpView { @@ -111,13 +120,19 @@ public class SelfRecordView implements MvpView {
111 120
112 SelfRecordInfo.RecordSumBean recordSumBean = selfRecordInfoBaseInfo.getData().getRecordSum(); 121 SelfRecordInfo.RecordSumBean recordSumBean = selfRecordInfoBaseInfo.getData().getRecordSum();
113 fragment.binding.kilometerNum.setText(recordSumBean.getCountMileage() + ""); 122 fragment.binding.kilometerNum.setText(recordSumBean.getCountMileage() + "");
114 - if(recordSumBean.getYetStep() != null)fragment.binding.stepNum.setText(recordSumBean.getYetStep());  
115 - if(recordSumBean.getYetEmployTime() != null)fragment.binding.allTime.setText(TimeUtil.stampToChronometers(Double.parseDouble(recordSumBean.getYetEmployTime())));  
116 - if(recordSumBean.getYetNumber() != null)fragment.binding.finishNum.setText(recordSumBean.getYetNumber());  
117 -  
118 - if(recordSumBean.getNotStep() != null)fragment.binding.stepNumNo.setText(recordSumBean.getNotStep());  
119 - if(recordSumBean.getNotEmployTime() != null)fragment.binding.allTimeNo.setText(TimeUtil.stampToChronometers(Double.parseDouble(recordSumBean.getNotEmployTime())));  
120 - if(recordSumBean.getNotNumber() != null)fragment.binding.finishNumNo.setText(recordSumBean.getNotNumber()); 123 + if (recordSumBean.getYetStep() != null)
  124 + fragment.binding.stepNum.setText(recordSumBean.getYetStep());
  125 + if (recordSumBean.getYetEmployTime() != null)
  126 + fragment.binding.allTime.setText(TimeUtil.stampToChronometers(Double.parseDouble(recordSumBean.getYetEmployTime())));
  127 + if (recordSumBean.getYetNumber() != null)
  128 + fragment.binding.finishNum.setText(recordSumBean.getYetNumber());
  129 +
  130 + if (recordSumBean.getNotStep() != null)
  131 + fragment.binding.stepNumNo.setText(recordSumBean.getNotStep());
  132 + if (recordSumBean.getNotEmployTime() != null)
  133 + fragment.binding.allTimeNo.setText(TimeUtil.stampToChronometers(Double.parseDouble(recordSumBean.getNotEmployTime())));
  134 + if (recordSumBean.getNotNumber() != null)
  135 + fragment.binding.finishNumNo.setText(recordSumBean.getNotNumber());
121 136
122 if (selfRecordInfoBaseInfo.getData().getEventRouteRecordBeanVoList().size() < fragment.pageSize) { 137 if (selfRecordInfoBaseInfo.getData().getEventRouteRecordBeanVoList().size() < fragment.pageSize) {
123 fragment.binding.refreshLayout.setEnableLoadMore(false); 138 fragment.binding.refreshLayout.setEnableLoadMore(false);
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/model/Constant.java
@@ -20,4 +20,8 @@ public class Constant { @@ -20,4 +20,8 @@ public class Constant {
20 public static final int REGISTRATION_SUCCESS = 11;//用户报名成功 20 public static final int REGISTRATION_SUCCESS = 11;//用户报名成功
21 public static final double PASS_RATE = 0.7;//通过率70% 21 public static final double PASS_RATE = 0.7;//通过率70%
22 public static final int CHECK_ACCURACY = 50;//判断用户是否完成的精度范围 22 public static final int CHECK_ACCURACY = 50;//判断用户是否完成的精度范围
  23 + public static final int LOCA_ACCURACY = 20;//定位过滤精度
  24 + public static final int LOCA_END_POINT_ACCURACY = 20;//终点位置比较精度
  25 + public static final int LOCA_START_POINT_ACCURACY = 200;//起点位置比较精度
  26 +
23 } 27 }
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/model/RunningFinishBean.java
@@ -21,8 +21,36 @@ public class RunningFinishBean implements Serializable { @@ -21,8 +21,36 @@ public class RunningFinishBean implements Serializable {
21 private String isFinish; 21 private String isFinish;
22 private String roadmap; 22 private String roadmap;
23 private String streetTitle; 23 private String streetTitle;
  24 + //****************************后续添加的,用于我的记录详情页跳转
24 private String userStartTime; 25 private String userStartTime;
25 private String userFinishTime; 26 private String userFinishTime;
  27 + private boolean isPause;
  28 + private String userPauseTime;
  29 + private String userContinueTime;
  30 +
  31 + public boolean isPause() {
  32 + return isPause;
  33 + }
  34 +
  35 + public void setPause(boolean pause) {
  36 + isPause = pause;
  37 + }
  38 +
  39 + public String getUserPauseTime() {
  40 + return userPauseTime;
  41 + }
  42 +
  43 + public void setUserPauseTime(String userPauseTime) {
  44 + this.userPauseTime = userPauseTime;
  45 + }
  46 +
  47 + public String getUserContinueTime() {
  48 + return userContinueTime;
  49 + }
  50 +
  51 + public void setUserContinueTime(String userContinueTime) {
  52 + this.userContinueTime = userContinueTime;
  53 + }
26 54
27 public String getUserStartTime() { 55 public String getUserStartTime() {
28 return userStartTime; 56 return userStartTime;
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/net/bean/EventRouteRecordBeanVoListBean.java
@@ -30,6 +30,24 @@ public class EventRouteRecordBeanVoListBean { @@ -30,6 +30,24 @@ public class EventRouteRecordBeanVoListBean {
30 private String startLocation; 30 private String startLocation;
31 private String endLocation; 31 private String endLocation;
32 private int completeStatus; 32 private int completeStatus;
  33 + private String pauseTime;
  34 + private String continueTime;
  35 +
  36 + public String getPauseTime() {
  37 + return pauseTime;
  38 + }
  39 +
  40 + public void setPauseTime(String pauseTime) {
  41 + this.pauseTime = pauseTime;
  42 + }
  43 +
  44 + public String getContinueTime() {
  45 + return continueTime;
  46 + }
  47 +
  48 + public void setContinueTime(String continueTime) {
  49 + this.continueTime = continueTime;
  50 + }
33 51
34 public String getStartTime() { 52 public String getStartTime() {
35 return startTime; 53 return startTime;
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/net/bean/RunRaceDetailInfo.java
1 package com.cnlive.moudle.pedometer.net.bean; 1 package com.cnlive.moudle.pedometer.net.bean;
2 2
  3 +import com.baidu.mapapi.model.LatLng;
  4 +
3 import java.io.Serializable; 5 import java.io.Serializable;
4 import java.util.List; 6 import java.util.List;
5 7
@@ -84,6 +86,15 @@ public class RunRaceDetailInfo implements Serializable { @@ -84,6 +86,15 @@ public class RunRaceDetailInfo implements Serializable {
84 private String userMileage; 86 private String userMileage;
85 private List<String> faceUrl; 87 private List<String> faceUrl;
86 private List<String> finishFaceUrl; 88 private List<String> finishFaceUrl;
  89 + private String endLatLng;//终点坐标,后加的,不是后台返回,这是从百度历史轨迹查出来的
  90 +
  91 + public String getEndLatLng() {
  92 + return endLatLng;
  93 + }
  94 +
  95 + public void setEndLatLng(String endLatLng) {
  96 + this.endLatLng = endLatLng;
  97 + }
87 98
88 public String getAddress() { 99 public String getAddress() {
89 return address; 100 return address;
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/service/StepService.java
@@ -369,7 +369,10 @@ public class StepService extends Service implements SensorEventListener { @@ -369,7 +369,10 @@ public class StepService extends Service implements SensorEventListener {
369 return; 369 return;
370 } 370 }
371 UserStepEntity userStepEntity = StepUtil.getUserStepData(getApplicationContext(), CommonInfo.getUserId(getApplicationContext())); 371 UserStepEntity userStepEntity = StepUtil.getUserStepData(getApplicationContext(), CommonInfo.getUserId(getApplicationContext()));
372 - if (userStepEntity == null) { 372 + if (null == userStepEntity) {
  373 + return;
  374 + }
  375 + if (userStepEntity.getFenceId() == 0) {
373 return; 376 return;
374 } 377 }
375 if (alarmPushInfo.getFenceId() == userStepEntity.getFenceId()) { 378 if (alarmPushInfo.getFenceId() == userStepEntity.getFenceId()) {
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/sql/dao/FailedEntityDao.java
@@ -45,6 +45,7 @@ public class FailedEntityDao extends AbstractDao&lt;FailedEntity, String&gt; { @@ -45,6 +45,7 @@ public class FailedEntityDao extends AbstractDao&lt;FailedEntity, String&gt; {
45 public final static Property StreetId = new Property(18, String.class, "streetId", false, "STREET_ID"); 45 public final static Property StreetId = new Property(18, String.class, "streetId", false, "STREET_ID");
46 public final static Property StreetTitle = new Property(19, String.class, "streetTitle", false, "STREET_TITLE"); 46 public final static Property StreetTitle = new Property(19, String.class, "streetTitle", false, "STREET_TITLE");
47 public final static Property CreatTimeStamp = new Property(20, long.class, "creatTimeStamp", false, "CREAT_TIME_STAMP"); 47 public final static Property CreatTimeStamp = new Property(20, long.class, "creatTimeStamp", false, "CREAT_TIME_STAMP");
  48 + public final static Property IsArriveEndPoint = new Property(21, boolean.class, "isArriveEndPoint", false, "IS_ARRIVE_END_POINT");
48 } 49 }
49 50
50 51
@@ -80,7 +81,8 @@ public class FailedEntityDao extends AbstractDao&lt;FailedEntity, String&gt; { @@ -80,7 +81,8 @@ public class FailedEntityDao extends AbstractDao&lt;FailedEntity, String&gt; {
80 "\"IMPORT_POINT\" TEXT," + // 17: importPoint 81 "\"IMPORT_POINT\" TEXT," + // 17: importPoint
81 "\"STREET_ID\" TEXT," + // 18: streetId 82 "\"STREET_ID\" TEXT," + // 18: streetId
82 "\"STREET_TITLE\" TEXT," + // 19: streetTitle 83 "\"STREET_TITLE\" TEXT," + // 19: streetTitle
83 - "\"CREAT_TIME_STAMP\" INTEGER NOT NULL );"); // 20: creatTimeStamp 84 + "\"CREAT_TIME_STAMP\" INTEGER NOT NULL ," + // 20: creatTimeStamp
  85 + "\"IS_ARRIVE_END_POINT\" INTEGER NOT NULL );"); // 21: isArriveEndPoint
84 } 86 }
85 87
86 /** Drops the underlying database table. */ 88 /** Drops the underlying database table. */
@@ -165,6 +167,7 @@ public class FailedEntityDao extends AbstractDao&lt;FailedEntity, String&gt; { @@ -165,6 +167,7 @@ public class FailedEntityDao extends AbstractDao&lt;FailedEntity, String&gt; {
165 stmt.bindString(20, streetTitle); 167 stmt.bindString(20, streetTitle);
166 } 168 }
167 stmt.bindLong(21, entity.getCreatTimeStamp()); 169 stmt.bindLong(21, entity.getCreatTimeStamp());
  170 + stmt.bindLong(22, entity.getIsArriveEndPoint() ? 1L: 0L);
168 } 171 }
169 172
170 @Override 173 @Override
@@ -243,6 +246,7 @@ public class FailedEntityDao extends AbstractDao&lt;FailedEntity, String&gt; { @@ -243,6 +246,7 @@ public class FailedEntityDao extends AbstractDao&lt;FailedEntity, String&gt; {
243 stmt.bindString(20, streetTitle); 246 stmt.bindString(20, streetTitle);
244 } 247 }
245 stmt.bindLong(21, entity.getCreatTimeStamp()); 248 stmt.bindLong(21, entity.getCreatTimeStamp());
  249 + stmt.bindLong(22, entity.getIsArriveEndPoint() ? 1L: 0L);
246 } 250 }
247 251
248 @Override 252 @Override
@@ -273,7 +277,8 @@ public class FailedEntityDao extends AbstractDao&lt;FailedEntity, String&gt; { @@ -273,7 +277,8 @@ public class FailedEntityDao extends AbstractDao&lt;FailedEntity, String&gt; {
273 cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // importPoint 277 cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // importPoint
274 cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // streetId 278 cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // streetId
275 cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // streetTitle 279 cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // streetTitle
276 - cursor.getLong(offset + 20) // creatTimeStamp 280 + cursor.getLong(offset + 20), // creatTimeStamp
  281 + cursor.getShort(offset + 21) != 0 // isArriveEndPoint
277 ); 282 );
278 return entity; 283 return entity;
279 } 284 }
@@ -301,6 +306,7 @@ public class FailedEntityDao extends AbstractDao&lt;FailedEntity, String&gt; { @@ -301,6 +306,7 @@ public class FailedEntityDao extends AbstractDao&lt;FailedEntity, String&gt; {
301 entity.setStreetId(cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18)); 306 entity.setStreetId(cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18));
302 entity.setStreetTitle(cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19)); 307 entity.setStreetTitle(cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19));
303 entity.setCreatTimeStamp(cursor.getLong(offset + 20)); 308 entity.setCreatTimeStamp(cursor.getLong(offset + 20));
  309 + entity.setIsArriveEndPoint(cursor.getShort(offset + 21) != 0);
304 } 310 }
305 311
306 @Override 312 @Override
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/sql/dao/UserStepEntityDao.java
@@ -27,25 +27,26 @@ public class UserStepEntityDao extends AbstractDao&lt;UserStepEntity, String&gt; { @@ -27,25 +27,26 @@ public class UserStepEntityDao extends AbstractDao&lt;UserStepEntity, String&gt; {
27 public final static Property UserId = new Property(0, String.class, "userId", true, "USER_ID"); 27 public final static Property UserId = new Property(0, String.class, "userId", true, "USER_ID");
28 public final static Property Date = new Property(1, String.class, "date", false, "DATE"); 28 public final static Property Date = new Property(1, String.class, "date", false, "DATE");
29 public final static Property StepCount = new Property(2, String.class, "stepCount", false, "STEP_COUNT"); 29 public final static Property StepCount = new Property(2, String.class, "stepCount", false, "STEP_COUNT");
30 - public final static Property PauseTimeStamp = new Property(3, long.class, "pauseTimeStamp", false, "PAUSE_TIME_STAMP");  
31 - public final static Property RecordTime = new Property(4, long.class, "recordTime", false, "RECORD_TIME");  
32 - public final static Property CaloriesCount = new Property(5, double.class, "caloriesCount", false, "CALORIES_COUNT");  
33 - public final static Property ServerTraceData = new Property(6, String.class, "serverTraceData", false, "SERVER_TRACE_DATA");  
34 - public final static Property StartPoint = new Property(7, String.class, "startPoint", false, "START_POINT");  
35 - public final static Property EndPoint = new Property(8, String.class, "endPoint", false, "END_POINT");  
36 - public final static Property StartTimeStamp = new Property(9, long.class, "startTimeStamp", false, "START_TIME_STAMP");  
37 - public final static Property FinishTimeStamp = new Property(10, long.class, "finishTimeStamp", false, "FINISH_TIME_STAMP");  
38 - public final static Property StreetId = new Property(11, String.class, "streetId", false, "STREET_ID");  
39 - public final static Property PauseCount = new Property(12, int.class, "pauseCount", false, "PAUSE_COUNT");  
40 - public final static Property UserPauseTimeStamp = new Property(13, long.class, "userPauseTimeStamp", false, "USER_PAUSE_TIME_STAMP");  
41 - public final static Property ChronometerBase = new Property(14, long.class, "chronometerBase", false, "CHRONOMETER_BASE");  
42 - public final static Property QueryTraceStartTime = new Property(15, long.class, "queryTraceStartTime", false, "QUERY_TRACE_START_TIME");  
43 - public final static Property QueryTraceEndTime = new Property(16, long.class, "queryTraceEndTime", false, "QUERY_TRACE_END_TIME");  
44 - public final static Property QueryEntityName = new Property(17, String.class, "queryEntityName", false, "QUERY_ENTITY_NAME");  
45 - public final static Property ContinueTime = new Property(18, long.class, "continueTime", false, "CONTINUE_TIME");  
46 - public final static Property FenceId = new Property(19, long.class, "fenceId", false, "FENCE_ID");  
47 - public final static Property ImportPoint = new Property(20, String.class, "importPoint", false, "IMPORT_POINT");  
48 - public final static Property StreetTitle = new Property(21, String.class, "streetTitle", false, "STREET_TITLE"); 30 + public final static Property RecordTime = new Property(3, long.class, "recordTime", false, "RECORD_TIME");
  31 + public final static Property CaloriesCount = new Property(4, double.class, "caloriesCount", false, "CALORIES_COUNT");
  32 + public final static Property ServerTraceData = new Property(5, String.class, "serverTraceData", false, "SERVER_TRACE_DATA");
  33 + public final static Property StartPoint = new Property(6, String.class, "startPoint", false, "START_POINT");
  34 + public final static Property EndPoint = new Property(7, String.class, "endPoint", false, "END_POINT");
  35 + public final static Property StartTimeStamp = new Property(8, long.class, "startTimeStamp", false, "START_TIME_STAMP");
  36 + public final static Property FinishTimeStamp = new Property(9, long.class, "finishTimeStamp", false, "FINISH_TIME_STAMP");
  37 + public final static Property StreetId = new Property(10, String.class, "streetId", false, "STREET_ID");
  38 + public final static Property PauseCount = new Property(11, int.class, "pauseCount", false, "PAUSE_COUNT");
  39 + public final static Property UserPauseTimeStamp = new Property(12, long.class, "userPauseTimeStamp", false, "USER_PAUSE_TIME_STAMP");
  40 + public final static Property ChronometerBase = new Property(13, long.class, "chronometerBase", false, "CHRONOMETER_BASE");
  41 + public final static Property QueryTraceStartTime = new Property(14, long.class, "queryTraceStartTime", false, "QUERY_TRACE_START_TIME");
  42 + public final static Property QueryTraceEndTime = new Property(15, long.class, "queryTraceEndTime", false, "QUERY_TRACE_END_TIME");
  43 + public final static Property QueryEntityName = new Property(16, String.class, "queryEntityName", false, "QUERY_ENTITY_NAME");
  44 + public final static Property ContinueTime = new Property(17, long.class, "continueTime", false, "CONTINUE_TIME");
  45 + public final static Property FenceId = new Property(18, long.class, "fenceId", false, "FENCE_ID");
  46 + public final static Property ImportPoint = new Property(19, String.class, "importPoint", false, "IMPORT_POINT");
  47 + public final static Property StreetTitle = new Property(20, String.class, "streetTitle", false, "STREET_TITLE");
  48 + public final static Property EndLatLng = new Property(21, String.class, "endLatLng", false, "END_LAT_LNG");
  49 + public final static Property IsArriveEndPoint = new Property(22, boolean.class, "isArriveEndPoint", false, "IS_ARRIVE_END_POINT");
49 } 50 }
50 51
51 52
@@ -64,25 +65,26 @@ public class UserStepEntityDao extends AbstractDao&lt;UserStepEntity, String&gt; { @@ -64,25 +65,26 @@ public class UserStepEntityDao extends AbstractDao&lt;UserStepEntity, String&gt; {
64 "\"USER_ID\" TEXT PRIMARY KEY NOT NULL ," + // 0: userId 65 "\"USER_ID\" TEXT PRIMARY KEY NOT NULL ," + // 0: userId
65 "\"DATE\" TEXT," + // 1: date 66 "\"DATE\" TEXT," + // 1: date
66 "\"STEP_COUNT\" TEXT," + // 2: stepCount 67 "\"STEP_COUNT\" TEXT," + // 2: stepCount
67 - "\"PAUSE_TIME_STAMP\" INTEGER NOT NULL ," + // 3: pauseTimeStamp  
68 - "\"RECORD_TIME\" INTEGER NOT NULL ," + // 4: recordTime  
69 - "\"CALORIES_COUNT\" REAL NOT NULL ," + // 5: caloriesCount  
70 - "\"SERVER_TRACE_DATA\" TEXT," + // 6: serverTraceData  
71 - "\"START_POINT\" TEXT," + // 7: startPoint  
72 - "\"END_POINT\" TEXT," + // 8: endPoint  
73 - "\"START_TIME_STAMP\" INTEGER NOT NULL ," + // 9: startTimeStamp  
74 - "\"FINISH_TIME_STAMP\" INTEGER NOT NULL ," + // 10: finishTimeStamp  
75 - "\"STREET_ID\" TEXT," + // 11: streetId  
76 - "\"PAUSE_COUNT\" INTEGER NOT NULL ," + // 12: pauseCount  
77 - "\"USER_PAUSE_TIME_STAMP\" INTEGER NOT NULL ," + // 13: userPauseTimeStamp  
78 - "\"CHRONOMETER_BASE\" INTEGER NOT NULL ," + // 14: chronometerBase  
79 - "\"QUERY_TRACE_START_TIME\" INTEGER NOT NULL ," + // 15: queryTraceStartTime  
80 - "\"QUERY_TRACE_END_TIME\" INTEGER NOT NULL ," + // 16: queryTraceEndTime  
81 - "\"QUERY_ENTITY_NAME\" TEXT," + // 17: queryEntityName  
82 - "\"CONTINUE_TIME\" INTEGER NOT NULL ," + // 18: continueTime  
83 - "\"FENCE_ID\" INTEGER NOT NULL ," + // 19: fenceId  
84 - "\"IMPORT_POINT\" TEXT," + // 20: importPoint  
85 - "\"STREET_TITLE\" TEXT);"); // 21: streetTitle 68 + "\"RECORD_TIME\" INTEGER NOT NULL ," + // 3: recordTime
  69 + "\"CALORIES_COUNT\" REAL NOT NULL ," + // 4: caloriesCount
  70 + "\"SERVER_TRACE_DATA\" TEXT," + // 5: serverTraceData
  71 + "\"START_POINT\" TEXT," + // 6: startPoint
  72 + "\"END_POINT\" TEXT," + // 7: endPoint
  73 + "\"START_TIME_STAMP\" INTEGER NOT NULL ," + // 8: startTimeStamp
  74 + "\"FINISH_TIME_STAMP\" INTEGER NOT NULL ," + // 9: finishTimeStamp
  75 + "\"STREET_ID\" TEXT," + // 10: streetId
  76 + "\"PAUSE_COUNT\" INTEGER NOT NULL ," + // 11: pauseCount
  77 + "\"USER_PAUSE_TIME_STAMP\" INTEGER NOT NULL ," + // 12: userPauseTimeStamp
  78 + "\"CHRONOMETER_BASE\" INTEGER NOT NULL ," + // 13: chronometerBase
  79 + "\"QUERY_TRACE_START_TIME\" INTEGER NOT NULL ," + // 14: queryTraceStartTime
  80 + "\"QUERY_TRACE_END_TIME\" INTEGER NOT NULL ," + // 15: queryTraceEndTime
  81 + "\"QUERY_ENTITY_NAME\" TEXT," + // 16: queryEntityName
  82 + "\"CONTINUE_TIME\" INTEGER NOT NULL ," + // 17: continueTime
  83 + "\"FENCE_ID\" INTEGER NOT NULL ," + // 18: fenceId
  84 + "\"IMPORT_POINT\" TEXT," + // 19: importPoint
  85 + "\"STREET_TITLE\" TEXT," + // 20: streetTitle
  86 + "\"END_LAT_LNG\" TEXT," + // 21: endLatLng
  87 + "\"IS_ARRIVE_END_POINT\" INTEGER NOT NULL );"); // 22: isArriveEndPoint
86 } 88 }
87 89
88 /** Drops the underlying database table. */ 90 /** Drops the underlying database table. */
@@ -109,53 +111,58 @@ public class UserStepEntityDao extends AbstractDao&lt;UserStepEntity, String&gt; { @@ -109,53 +111,58 @@ public class UserStepEntityDao extends AbstractDao&lt;UserStepEntity, String&gt; {
109 if (stepCount != null) { 111 if (stepCount != null) {
110 stmt.bindString(3, stepCount); 112 stmt.bindString(3, stepCount);
111 } 113 }
112 - stmt.bindLong(4, entity.getPauseTimeStamp());  
113 - stmt.bindLong(5, entity.getRecordTime());  
114 - stmt.bindDouble(6, entity.getCaloriesCount()); 114 + stmt.bindLong(4, entity.getRecordTime());
  115 + stmt.bindDouble(5, entity.getCaloriesCount());
115 116
116 String serverTraceData = entity.getServerTraceData(); 117 String serverTraceData = entity.getServerTraceData();
117 if (serverTraceData != null) { 118 if (serverTraceData != null) {
118 - stmt.bindString(7, serverTraceData); 119 + stmt.bindString(6, serverTraceData);
119 } 120 }
120 121
121 String startPoint = entity.getStartPoint(); 122 String startPoint = entity.getStartPoint();
122 if (startPoint != null) { 123 if (startPoint != null) {
123 - stmt.bindString(8, startPoint); 124 + stmt.bindString(7, startPoint);
124 } 125 }
125 126
126 String endPoint = entity.getEndPoint(); 127 String endPoint = entity.getEndPoint();
127 if (endPoint != null) { 128 if (endPoint != null) {
128 - stmt.bindString(9, endPoint); 129 + stmt.bindString(8, endPoint);
129 } 130 }
130 - stmt.bindLong(10, entity.getStartTimeStamp());  
131 - stmt.bindLong(11, entity.getFinishTimeStamp()); 131 + stmt.bindLong(9, entity.getStartTimeStamp());
  132 + stmt.bindLong(10, entity.getFinishTimeStamp());
132 133
133 String streetId = entity.getStreetId(); 134 String streetId = entity.getStreetId();
134 if (streetId != null) { 135 if (streetId != null) {
135 - stmt.bindString(12, streetId); 136 + stmt.bindString(11, streetId);
136 } 137 }
137 - stmt.bindLong(13, entity.getPauseCount());  
138 - stmt.bindLong(14, entity.getUserPauseTimeStamp());  
139 - stmt.bindLong(15, entity.getChronometerBase());  
140 - stmt.bindLong(16, entity.getQueryTraceStartTime());  
141 - stmt.bindLong(17, entity.getQueryTraceEndTime()); 138 + stmt.bindLong(12, entity.getPauseCount());
  139 + stmt.bindLong(13, entity.getUserPauseTimeStamp());
  140 + stmt.bindLong(14, entity.getChronometerBase());
  141 + stmt.bindLong(15, entity.getQueryTraceStartTime());
  142 + stmt.bindLong(16, entity.getQueryTraceEndTime());
142 143
143 String queryEntityName = entity.getQueryEntityName(); 144 String queryEntityName = entity.getQueryEntityName();
144 if (queryEntityName != null) { 145 if (queryEntityName != null) {
145 - stmt.bindString(18, queryEntityName); 146 + stmt.bindString(17, queryEntityName);
146 } 147 }
147 - stmt.bindLong(19, entity.getContinueTime());  
148 - stmt.bindLong(20, entity.getFenceId()); 148 + stmt.bindLong(18, entity.getContinueTime());
  149 + stmt.bindLong(19, entity.getFenceId());
149 150
150 String importPoint = entity.getImportPoint(); 151 String importPoint = entity.getImportPoint();
151 if (importPoint != null) { 152 if (importPoint != null) {
152 - stmt.bindString(21, importPoint); 153 + stmt.bindString(20, importPoint);
153 } 154 }
154 155
155 String streetTitle = entity.getStreetTitle(); 156 String streetTitle = entity.getStreetTitle();
156 if (streetTitle != null) { 157 if (streetTitle != null) {
157 - stmt.bindString(22, streetTitle); 158 + stmt.bindString(21, streetTitle);
158 } 159 }
  160 +
  161 + String endLatLng = entity.getEndLatLng();
  162 + if (endLatLng != null) {
  163 + stmt.bindString(22, endLatLng);
  164 + }
  165 + stmt.bindLong(23, entity.getIsArriveEndPoint() ? 1L: 0L);
159 } 166 }
160 167
161 @Override 168 @Override
@@ -176,53 +183,58 @@ public class UserStepEntityDao extends AbstractDao&lt;UserStepEntity, String&gt; { @@ -176,53 +183,58 @@ public class UserStepEntityDao extends AbstractDao&lt;UserStepEntity, String&gt; {
176 if (stepCount != null) { 183 if (stepCount != null) {
177 stmt.bindString(3, stepCount); 184 stmt.bindString(3, stepCount);
178 } 185 }
179 - stmt.bindLong(4, entity.getPauseTimeStamp());  
180 - stmt.bindLong(5, entity.getRecordTime());  
181 - stmt.bindDouble(6, entity.getCaloriesCount()); 186 + stmt.bindLong(4, entity.getRecordTime());
  187 + stmt.bindDouble(5, entity.getCaloriesCount());
182 188
183 String serverTraceData = entity.getServerTraceData(); 189 String serverTraceData = entity.getServerTraceData();
184 if (serverTraceData != null) { 190 if (serverTraceData != null) {
185 - stmt.bindString(7, serverTraceData); 191 + stmt.bindString(6, serverTraceData);
186 } 192 }
187 193
188 String startPoint = entity.getStartPoint(); 194 String startPoint = entity.getStartPoint();
189 if (startPoint != null) { 195 if (startPoint != null) {
190 - stmt.bindString(8, startPoint); 196 + stmt.bindString(7, startPoint);
191 } 197 }
192 198
193 String endPoint = entity.getEndPoint(); 199 String endPoint = entity.getEndPoint();
194 if (endPoint != null) { 200 if (endPoint != null) {
195 - stmt.bindString(9, endPoint); 201 + stmt.bindString(8, endPoint);
196 } 202 }
197 - stmt.bindLong(10, entity.getStartTimeStamp());  
198 - stmt.bindLong(11, entity.getFinishTimeStamp()); 203 + stmt.bindLong(9, entity.getStartTimeStamp());
  204 + stmt.bindLong(10, entity.getFinishTimeStamp());
199 205
200 String streetId = entity.getStreetId(); 206 String streetId = entity.getStreetId();
201 if (streetId != null) { 207 if (streetId != null) {
202 - stmt.bindString(12, streetId); 208 + stmt.bindString(11, streetId);
203 } 209 }
204 - stmt.bindLong(13, entity.getPauseCount());  
205 - stmt.bindLong(14, entity.getUserPauseTimeStamp());  
206 - stmt.bindLong(15, entity.getChronometerBase());  
207 - stmt.bindLong(16, entity.getQueryTraceStartTime());  
208 - stmt.bindLong(17, entity.getQueryTraceEndTime()); 210 + stmt.bindLong(12, entity.getPauseCount());
  211 + stmt.bindLong(13, entity.getUserPauseTimeStamp());
  212 + stmt.bindLong(14, entity.getChronometerBase());
  213 + stmt.bindLong(15, entity.getQueryTraceStartTime());
  214 + stmt.bindLong(16, entity.getQueryTraceEndTime());
209 215
210 String queryEntityName = entity.getQueryEntityName(); 216 String queryEntityName = entity.getQueryEntityName();
211 if (queryEntityName != null) { 217 if (queryEntityName != null) {
212 - stmt.bindString(18, queryEntityName); 218 + stmt.bindString(17, queryEntityName);
213 } 219 }
214 - stmt.bindLong(19, entity.getContinueTime());  
215 - stmt.bindLong(20, entity.getFenceId()); 220 + stmt.bindLong(18, entity.getContinueTime());
  221 + stmt.bindLong(19, entity.getFenceId());
216 222
217 String importPoint = entity.getImportPoint(); 223 String importPoint = entity.getImportPoint();
218 if (importPoint != null) { 224 if (importPoint != null) {
219 - stmt.bindString(21, importPoint); 225 + stmt.bindString(20, importPoint);
220 } 226 }
221 227
222 String streetTitle = entity.getStreetTitle(); 228 String streetTitle = entity.getStreetTitle();
223 if (streetTitle != null) { 229 if (streetTitle != null) {
224 - stmt.bindString(22, streetTitle); 230 + stmt.bindString(21, streetTitle);
  231 + }
  232 +
  233 + String endLatLng = entity.getEndLatLng();
  234 + if (endLatLng != null) {
  235 + stmt.bindString(22, endLatLng);
225 } 236 }
  237 + stmt.bindLong(23, entity.getIsArriveEndPoint() ? 1L: 0L);
226 } 238 }
227 239
228 @Override 240 @Override
@@ -236,25 +248,26 @@ public class UserStepEntityDao extends AbstractDao&lt;UserStepEntity, String&gt; { @@ -236,25 +248,26 @@ public class UserStepEntityDao extends AbstractDao&lt;UserStepEntity, String&gt; {
236 cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0), // userId 248 cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0), // userId
237 cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // date 249 cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // date
238 cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // stepCount 250 cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // stepCount
239 - cursor.getLong(offset + 3), // pauseTimeStamp  
240 - cursor.getLong(offset + 4), // recordTime  
241 - cursor.getDouble(offset + 5), // caloriesCount  
242 - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // serverTraceData  
243 - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // startPoint  
244 - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // endPoint  
245 - cursor.getLong(offset + 9), // startTimeStamp  
246 - cursor.getLong(offset + 10), // finishTimeStamp  
247 - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // streetId  
248 - cursor.getInt(offset + 12), // pauseCount  
249 - cursor.getLong(offset + 13), // userPauseTimeStamp  
250 - cursor.getLong(offset + 14), // chronometerBase  
251 - cursor.getLong(offset + 15), // queryTraceStartTime  
252 - cursor.getLong(offset + 16), // queryTraceEndTime  
253 - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // queryEntityName  
254 - cursor.getLong(offset + 18), // continueTime  
255 - cursor.getLong(offset + 19), // fenceId  
256 - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // importPoint  
257 - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21) // streetTitle 251 + cursor.getLong(offset + 3), // recordTime
  252 + cursor.getDouble(offset + 4), // caloriesCount
  253 + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // serverTraceData
  254 + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // startPoint
  255 + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // endPoint
  256 + cursor.getLong(offset + 8), // startTimeStamp
  257 + cursor.getLong(offset + 9), // finishTimeStamp
  258 + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // streetId
  259 + cursor.getInt(offset + 11), // pauseCount
  260 + cursor.getLong(offset + 12), // userPauseTimeStamp
  261 + cursor.getLong(offset + 13), // chronometerBase
  262 + cursor.getLong(offset + 14), // queryTraceStartTime
  263 + cursor.getLong(offset + 15), // queryTraceEndTime
  264 + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // queryEntityName
  265 + cursor.getLong(offset + 17), // continueTime
  266 + cursor.getLong(offset + 18), // fenceId
  267 + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // importPoint
  268 + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // streetTitle
  269 + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // endLatLng
  270 + cursor.getShort(offset + 22) != 0 // isArriveEndPoint
258 ); 271 );
259 return entity; 272 return entity;
260 } 273 }
@@ -264,25 +277,26 @@ public class UserStepEntityDao extends AbstractDao&lt;UserStepEntity, String&gt; { @@ -264,25 +277,26 @@ public class UserStepEntityDao extends AbstractDao&lt;UserStepEntity, String&gt; {
264 entity.setUserId(cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0)); 277 entity.setUserId(cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0));
265 entity.setDate(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); 278 entity.setDate(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
266 entity.setStepCount(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); 279 entity.setStepCount(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
267 - entity.setPauseTimeStamp(cursor.getLong(offset + 3));  
268 - entity.setRecordTime(cursor.getLong(offset + 4));  
269 - entity.setCaloriesCount(cursor.getDouble(offset + 5));  
270 - entity.setServerTraceData(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));  
271 - entity.setStartPoint(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));  
272 - entity.setEndPoint(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8));  
273 - entity.setStartTimeStamp(cursor.getLong(offset + 9));  
274 - entity.setFinishTimeStamp(cursor.getLong(offset + 10));  
275 - entity.setStreetId(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11));  
276 - entity.setPauseCount(cursor.getInt(offset + 12));  
277 - entity.setUserPauseTimeStamp(cursor.getLong(offset + 13));  
278 - entity.setChronometerBase(cursor.getLong(offset + 14));  
279 - entity.setQueryTraceStartTime(cursor.getLong(offset + 15));  
280 - entity.setQueryTraceEndTime(cursor.getLong(offset + 16));  
281 - entity.setQueryEntityName(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17));  
282 - entity.setContinueTime(cursor.getLong(offset + 18));  
283 - entity.setFenceId(cursor.getLong(offset + 19));  
284 - entity.setImportPoint(cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20));  
285 - entity.setStreetTitle(cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21)); 280 + entity.setRecordTime(cursor.getLong(offset + 3));
  281 + entity.setCaloriesCount(cursor.getDouble(offset + 4));
  282 + entity.setServerTraceData(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
  283 + entity.setStartPoint(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
  284 + entity.setEndPoint(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
  285 + entity.setStartTimeStamp(cursor.getLong(offset + 8));
  286 + entity.setFinishTimeStamp(cursor.getLong(offset + 9));
  287 + entity.setStreetId(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10));
  288 + entity.setPauseCount(cursor.getInt(offset + 11));
  289 + entity.setUserPauseTimeStamp(cursor.getLong(offset + 12));
  290 + entity.setChronometerBase(cursor.getLong(offset + 13));
  291 + entity.setQueryTraceStartTime(cursor.getLong(offset + 14));
  292 + entity.setQueryTraceEndTime(cursor.getLong(offset + 15));
  293 + entity.setQueryEntityName(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16));
  294 + entity.setContinueTime(cursor.getLong(offset + 17));
  295 + entity.setFenceId(cursor.getLong(offset + 18));
  296 + entity.setImportPoint(cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19));
  297 + entity.setStreetTitle(cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20));
  298 + entity.setEndLatLng(cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21));
  299 + entity.setIsArriveEndPoint(cursor.getShort(offset + 22) != 0);
286 } 300 }
287 301
288 @Override 302 @Override
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/sql/entity/FailedEntity.java
@@ -36,13 +36,13 @@ public class FailedEntity implements Serializable { @@ -36,13 +36,13 @@ public class FailedEntity implements Serializable {
36 private String streetId;//赛事id 36 private String streetId;//赛事id
37 private String streetTitle;//赛道标题 37 private String streetTitle;//赛道标题
38 private long creatTimeStamp;//数据创建的时间 38 private long creatTimeStamp;//数据创建的时间
  39 + private boolean isArriveEndPoint;//是否到达终点
39 40
40 - @Generated(hash = 458367844)  
41 - public FailedEntity(String uuid, String uid, boolean isPause, long userPauseTime, long usrContinueTime,  
42 - String isFinish, String time, String speed, String step, String distance, String startPoint,  
43 - String endPoint, long streetTraceStartTime, long streetTraceEndTime, String entityName,  
44 - long userStartTime, long userEndTime, String importPoint, String streetId, String streetTitle,  
45 - long creatTimeStamp) { 41 + @Generated(hash = 1057412546)
  42 + public FailedEntity(String uuid, String uid, boolean isPause, long userPauseTime, long usrContinueTime, String isFinish,
  43 + String time, String speed, String step, String distance, String startPoint, String endPoint,
  44 + long streetTraceStartTime, long streetTraceEndTime, String entityName, long userStartTime, long userEndTime,
  45 + String importPoint, String streetId, String streetTitle, long creatTimeStamp, boolean isArriveEndPoint) {
46 this.uuid = uuid; 46 this.uuid = uuid;
47 this.uid = uid; 47 this.uid = uid;
48 this.isPause = isPause; 48 this.isPause = isPause;
@@ -64,6 +64,7 @@ public class FailedEntity implements Serializable { @@ -64,6 +64,7 @@ public class FailedEntity implements Serializable {
64 this.streetId = streetId; 64 this.streetId = streetId;
65 this.streetTitle = streetTitle; 65 this.streetTitle = streetTitle;
66 this.creatTimeStamp = creatTimeStamp; 66 this.creatTimeStamp = creatTimeStamp;
  67 + this.isArriveEndPoint = isArriveEndPoint;
67 } 68 }
68 69
69 @Generated(hash = 1639581354) 70 @Generated(hash = 1639581354)
@@ -238,6 +239,13 @@ public class FailedEntity implements Serializable { @@ -238,6 +239,13 @@ public class FailedEntity implements Serializable {
238 this.distance = distance; 239 this.distance = distance;
239 } 240 }
240 241
  242 + public boolean getIsArriveEndPoint() {
  243 + return this.isArriveEndPoint;
  244 + }
  245 +
  246 + public void setIsArriveEndPoint(boolean isArriveEndPoint) {
  247 + this.isArriveEndPoint = isArriveEndPoint;
  248 + }
241 249
242 250
243 } 251 }
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/sql/entity/UserStepEntity.java
1 package com.cnlive.moudle.pedometer.sql.entity; 1 package com.cnlive.moudle.pedometer.sql.entity;
2 2
  3 +import com.baidu.mapapi.model.LatLng;
  4 +
3 import org.greenrobot.greendao.annotation.Entity; 5 import org.greenrobot.greendao.annotation.Entity;
4 import org.greenrobot.greendao.annotation.Generated; 6 import org.greenrobot.greendao.annotation.Generated;
5 import org.greenrobot.greendao.annotation.Id; 7 import org.greenrobot.greendao.annotation.Id;
@@ -10,7 +12,6 @@ public class UserStepEntity { @@ -10,7 +12,6 @@ public class UserStepEntity {
10 private String userId; 12 private String userId;
11 private String date; 13 private String date;
12 private String stepCount; 14 private String stepCount;
13 - private long pauseTimeStamp;//暂停时间戳  
14 private long recordTime;//暂停时间 15 private long recordTime;//暂停时间
15 private double caloriesCount;//卡路里 16 private double caloriesCount;//卡路里
16 private String serverTraceData;//服务端赛道数据 17 private String serverTraceData;//服务端赛道数据
@@ -29,15 +30,15 @@ public class UserStepEntity { @@ -29,15 +30,15 @@ public class UserStepEntity {
29 private long fenceId;//围栏id 30 private long fenceId;//围栏id
30 private String importPoint;//关键点 31 private String importPoint;//关键点
31 private String streetTitle;//赛事标题 32 private String streetTitle;//赛事标题
32 -  
33 - @Generated(hash = 1762072682)  
34 - public UserStepEntity(String userId, String date, String stepCount, long pauseTimeStamp, long recordTime, double caloriesCount, String serverTraceData, String startPoint,  
35 - String endPoint, long startTimeStamp, long finishTimeStamp, String streetId, int pauseCount, long userPauseTimeStamp, long chronometerBase, long queryTraceStartTime,  
36 - long queryTraceEndTime, String queryEntityName, long continueTime, long fenceId, String importPoint, String streetTitle) { 33 + private String endLatLng;//终点坐标
  34 + private boolean isArriveEndPoint;//是否到达终点
  35 + @Generated(hash = 434792384)
  36 + public UserStepEntity(String userId, String date, String stepCount, long recordTime, double caloriesCount, String serverTraceData, String startPoint, String endPoint,
  37 + long startTimeStamp, long finishTimeStamp, String streetId, int pauseCount, long userPauseTimeStamp, long chronometerBase, long queryTraceStartTime, long queryTraceEndTime,
  38 + String queryEntityName, long continueTime, long fenceId, String importPoint, String streetTitle, String endLatLng, boolean isArriveEndPoint) {
37 this.userId = userId; 39 this.userId = userId;
38 this.date = date; 40 this.date = date;
39 this.stepCount = stepCount; 41 this.stepCount = stepCount;
40 - this.pauseTimeStamp = pauseTimeStamp;  
41 this.recordTime = recordTime; 42 this.recordTime = recordTime;
42 this.caloriesCount = caloriesCount; 43 this.caloriesCount = caloriesCount;
43 this.serverTraceData = serverTraceData; 44 this.serverTraceData = serverTraceData;
@@ -56,6 +57,8 @@ public class UserStepEntity { @@ -56,6 +57,8 @@ public class UserStepEntity {
56 this.fenceId = fenceId; 57 this.fenceId = fenceId;
57 this.importPoint = importPoint; 58 this.importPoint = importPoint;
58 this.streetTitle = streetTitle; 59 this.streetTitle = streetTitle;
  60 + this.endLatLng = endLatLng;
  61 + this.isArriveEndPoint = isArriveEndPoint;
59 } 62 }
60 63
61 @Generated(hash = 273857141) 64 @Generated(hash = 273857141)
@@ -86,13 +89,6 @@ public class UserStepEntity { @@ -86,13 +89,6 @@ public class UserStepEntity {
86 this.stepCount = stepCount; 89 this.stepCount = stepCount;
87 } 90 }
88 91
89 - public long getPauseTimeStamp() {  
90 - return this.pauseTimeStamp;  
91 - }  
92 -  
93 - public void setPauseTimeStamp(long pauseTimeStamp) {  
94 - this.pauseTimeStamp = pauseTimeStamp;  
95 - }  
96 92
97 public long getRecordTime() { 93 public long getRecordTime() {
98 return this.recordTime; 94 return this.recordTime;
@@ -238,5 +234,21 @@ public class UserStepEntity { @@ -238,5 +234,21 @@ public class UserStepEntity {
238 this.streetTitle = streetTitle; 234 this.streetTitle = streetTitle;
239 } 235 }
240 236
  237 + public boolean getIsArriveEndPoint() {
  238 + return this.isArriveEndPoint;
  239 + }
  240 +
  241 + public void setIsArriveEndPoint(boolean isArriveEndPoint) {
  242 + this.isArriveEndPoint = isArriveEndPoint;
  243 + }
  244 +
  245 + public String getEndLatLng() {
  246 + return this.endLatLng;
  247 + }
  248 +
  249 + public void setEndLatLng(String endLatLng) {
  250 + this.endLatLng = endLatLng;
  251 + }
  252 +
241 253
242 } 254 }
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/fragment/ALLScoreDetailFragment.java
@@ -12,6 +12,11 @@ import com.cnlive.moudle.pedometer.model.RunningFinishBean; @@ -12,6 +12,11 @@ import com.cnlive.moudle.pedometer.model.RunningFinishBean;
12 import com.example.moudle_pedometer.R; 12 import com.example.moudle_pedometer.R;
13 import com.example.moudle_pedometer.databinding.FragmentFinishRunMapBinding; 13 import com.example.moudle_pedometer.databinding.FragmentFinishRunMapBinding;
14 14
  15 +/**
  16 + * 我的活动-全部成绩
  17 + *
  18 + * @author ShinnyYang
  19 + */
15 public class ALLScoreDetailFragment extends QMUIFragment<ALLScoreDetailFragmentView, ALLScoreDetailFragmentPresenter, FragmentFinishRunMapBinding> { 20 public class ALLScoreDetailFragment extends QMUIFragment<ALLScoreDetailFragmentView, ALLScoreDetailFragmentPresenter, FragmentFinishRunMapBinding> {
16 private RunningFinishBean runningFinishBean; 21 private RunningFinishBean runningFinishBean;
17 22
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/fragment/RunMainFragment.java
@@ -2,6 +2,7 @@ package com.cnlive.moudle.pedometer.ui.fragment; @@ -2,6 +2,7 @@ package com.cnlive.moudle.pedometer.ui.fragment;
2 2
3 import android.os.Bundle; 3 import android.os.Bundle;
4 import android.os.Handler; 4 import android.os.Handler;
  5 +import android.os.Vibrator;
5 import android.support.annotation.Nullable; 6 import android.support.annotation.Nullable;
6 import android.text.TextUtils; 7 import android.text.TextUtils;
7 import android.util.Log; 8 import android.util.Log;
@@ -18,6 +19,8 @@ import com.cnlive.moudle.pedometer.model.Constant; @@ -18,6 +19,8 @@ import com.cnlive.moudle.pedometer.model.Constant;
18 import com.cnlive.moudle.pedometer.model.MessageEvent; 19 import com.cnlive.moudle.pedometer.model.MessageEvent;
19 import com.cnlive.moudle.pedometer.net.bean.RunRaceDetailInfo; 20 import com.cnlive.moudle.pedometer.net.bean.RunRaceDetailInfo;
20 import com.cnlive.moudle.pedometer.sql.entity.UserStepEntity; 21 import com.cnlive.moudle.pedometer.sql.entity.UserStepEntity;
  22 +import com.cnlive.moudle.pedometer.ui.widget.TipDialog;
  23 +import com.cnlive.moudle.pedometer.utils.ChineseToSpeechUtil;
21 import com.cnlive.moudle.pedometer.utils.GsonUtil; 24 import com.cnlive.moudle.pedometer.utils.GsonUtil;
22 import com.cnlive.moudle.pedometer.utils.StepUtil; 25 import com.cnlive.moudle.pedometer.utils.StepUtil;
23 import com.example.moudle_pedometer.R; 26 import com.example.moudle_pedometer.R;
@@ -34,6 +37,9 @@ import java.util.List; @@ -34,6 +37,9 @@ import java.util.List;
34 public class RunMainFragment extends QMUIFragment<RunMainFragmentView, RunMainFragmentPresenter, FragmentRunMainBinding> { 37 public class RunMainFragment extends QMUIFragment<RunMainFragmentView, RunMainFragmentPresenter, FragmentRunMainBinding> {
35 private final String TAG = "RunMainFragment"; 38 private final String TAG = "RunMainFragment";
36 private RunRaceDetailInfo runRaceDetailInfo; 39 private RunRaceDetailInfo runRaceDetailInfo;
  40 + //创建震动服务对象
  41 + private Vibrator mVibrator;
  42 + private TipDialog tipDialog;
37 43
38 public static RunMainFragment newInstance(RunRaceDetailInfo runRaceDetailInfo) { 44 public static RunMainFragment newInstance(RunRaceDetailInfo runRaceDetailInfo) {
39 Bundle bundle = new Bundle(); 45 Bundle bundle = new Bundle();
@@ -50,6 +56,7 @@ public class RunMainFragment extends QMUIFragment&lt;RunMainFragmentView, RunMainFr @@ -50,6 +56,7 @@ public class RunMainFragment extends QMUIFragment&lt;RunMainFragmentView, RunMainFr
50 StatusBarUtil2.setColor(getActivity(), getResources().getColor(R.color.run_main_bg), 0); 56 StatusBarUtil2.setColor(getActivity(), getResources().getColor(R.color.run_main_bg), 0);
51 EventBus.getDefault().register(this); 57 EventBus.getDefault().register(this);
52 if (getArguments() != null) { 58 if (getArguments() != null) {
  59 + initTipDialog();
53 runRaceDetailInfo = (RunRaceDetailInfo) getArguments().getSerializable("runRaceDetailInfo"); 60 runRaceDetailInfo = (RunRaceDetailInfo) getArguments().getSerializable("runRaceDetailInfo");
54 UserStepEntity userStepEntity = StepUtil.getUserStepData(getActivity(), CommonInfo.getUserId(getActivity())); 61 UserStepEntity userStepEntity = StepUtil.getUserStepData(getActivity(), CommonInfo.getUserId(getActivity()));
55 if (userStepEntity != null) { 62 if (userStepEntity != null) {
@@ -129,6 +136,19 @@ public class RunMainFragment extends QMUIFragment&lt;RunMainFragmentView, RunMainFr @@ -129,6 +136,19 @@ public class RunMainFragment extends QMUIFragment&lt;RunMainFragmentView, RunMainFr
129 return R.layout.fragment_run_main; 136 return R.layout.fragment_run_main;
130 } 137 }
131 138
  139 + private void initTipDialog() {
  140 + if (tipDialog == null) {
  141 + tipDialog = new TipDialog(getActivity(), "您已偏离预定轨迹!", "我知道了", R.color.green_round, new TipDialog.DialogInterface() {
  142 + @Override
  143 + public void onClick(TipDialog dialog) {
  144 + dialog.dismiss();
  145 + }
  146 + });
  147 + tipDialog.setCancelable(false);
  148 + tipDialog.setCanceledOnTouchOutside(false);
  149 + }
  150 + }
  151 +
132 @Subscribe(threadMode = ThreadMode.MAIN) 152 @Subscribe(threadMode = ThreadMode.MAIN)
133 public void Event(MessageEvent messageEvent) { 153 public void Event(MessageEvent messageEvent) {
134 //更新步数 154 //更新步数
@@ -143,6 +163,32 @@ public class RunMainFragment extends QMUIFragment&lt;RunMainFragmentView, RunMainFr @@ -143,6 +163,32 @@ public class RunMainFragment extends QMUIFragment&lt;RunMainFragmentView, RunMainFr
143 getMvpView().resetSpeed(); 163 getMvpView().resetSpeed();
144 } 164 }
145 } 165 }
  166 + //超出范围
  167 + else if (messageEvent.getMessageType() == Constant.EXIT_RANGE) {
  168 + ChineseToSpeechUtil.speech(getActivity().getApplicationContext(), getString(R.string.exit_range_tip));
  169 + if (mVibrator != null) {
  170 + //设置震动周期,数组表示时间:等待+执行,单位是毫秒,下面操作代表:等待100,执行100,等待100,执行1000,
  171 + //后面的数字如果为-1代表不重复,之执行一次,其他代表会重复,0代表从数组的第0个位置开始
  172 + mVibrator.vibrate(new long[]{100, 1000, 100, 1000}, -1);
  173 + }
  174 + if (tipDialog != null) {
  175 + tipDialog.setTipMsg("您已偏离路径轨迹\n请您计时回归路径!");
  176 + tipDialog.show();
  177 + }
  178 + }
  179 + //进入范围
  180 + else if (messageEvent.getMessageType() == Constant.ENTER_RANGE) {
  181 + ChineseToSpeechUtil.speech(getActivity().getApplicationContext(), getString(R.string.enter_range_tip));
  182 + if (mVibrator != null) {
  183 + //设置震动周期,数组表示时间:等待+执行,单位是毫秒,下面操作代表:等待100,执行100,等待100,执行1000,
  184 + //后面的数字如果为-1代表不重复,之执行一次,其他代表会重复,0代表从数组的第0个位置开始
  185 + mVibrator.vibrate(new long[]{100, 1000, 100, 1000}, -1);
  186 + }
  187 + if (tipDialog != null) {
  188 + tipDialog.setTipMsg("您已回归轨迹\n继续参与运动吧");
  189 + tipDialog.show();
  190 + }
  191 + }
146 } 192 }
147 193
148 /** 194 /**
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/fragment/RunRaceDetailFragment.java
@@ -177,8 +177,8 @@ public class RunRaceDetailFragment extends QMUIFragment&lt;RunRaceDetailFragmentVie @@ -177,8 +177,8 @@ public class RunRaceDetailFragment extends QMUIFragment&lt;RunRaceDetailFragmentVie
177 public void Event(MessageEvent messageEvent) { 177 public void Event(MessageEvent messageEvent) {
178 //启动鹰眼成功 178 //启动鹰眼成功
179 if (messageEvent.getMessageType() == Constant.START_TRACE_GATHER_SUCCESS) { 179 if (messageEvent.getMessageType() == Constant.START_TRACE_GATHER_SUCCESS) {
  180 + Log.e(TAG, "Event: 启动成功");
180 if (getMvpView() != null) { 181 if (getMvpView() != null) {
181 - Log.e(TAG, "跳转: " + getMvpView().importStreetPoints.size());  
182 QMUITipDialogUtil.dismessDialog(); 182 QMUITipDialogUtil.dismessDialog();
183 PedometerMainActivity.startActivity(getActivity(), getMvpView().runRaceDetailInfo); 183 PedometerMainActivity.startActivity(getActivity(), getMvpView().runRaceDetailInfo);
184 } 184 }
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/fragment/RunningMapFragment.java
@@ -110,9 +110,15 @@ public class RunningMapFragment extends QMUIFragment&lt;RunningMapFragmentView, Run @@ -110,9 +110,15 @@ public class RunningMapFragment extends QMUIFragment&lt;RunningMapFragmentView, Run
110 if (getMvpView() != null && userStepEntity != null) { 110 if (getMvpView() != null && userStepEntity != null) {
111 //查询运营人员踩得轨迹 111 //查询运营人员踩得轨迹
112 getPresenter().getServerStreetTrace(getActivity(), userStepEntity); 112 getPresenter().getServerStreetTrace(getActivity(), userStepEntity);
113 -  
114 - //开始查询  
115 - getPresenter().queryHistoryTrace(getActivity(), userStepEntity); 113 + //判断用户是否暂停过
  114 + if (userStepEntity.getPauseCount() != 0) {
  115 + //开始查询,用户已经点击暂停按钮(先画出用户 开始-暂停时间中的轨迹)
  116 + getPresenter().queryHistoryTrace(getActivity(), userStepEntity, true);
  117 +
  118 + } else {
  119 + //开始查询,用户没有点击暂停按钮
  120 + getPresenter().queryHistoryTrace(getActivity(), userStepEntity, false);
  121 + }
116 } 122 }
117 123
118 124
@@ -193,6 +199,7 @@ public class RunningMapFragment extends QMUIFragment&lt;RunningMapFragmentView, Run @@ -193,6 +199,7 @@ public class RunningMapFragment extends QMUIFragment&lt;RunningMapFragmentView, Run
193 mVibrator.vibrate(new long[]{100, 1000, 100, 1000}, -1); 199 mVibrator.vibrate(new long[]{100, 1000, 100, 1000}, -1);
194 } 200 }
195 if (tipDialog != null) { 201 if (tipDialog != null) {
  202 + tipDialog.setTipMsg("您已偏离路径轨迹\n请您计时回归路径!");
196 tipDialog.show(); 203 tipDialog.show();
197 } 204 }
198 } 205 }
@@ -205,6 +212,7 @@ public class RunningMapFragment extends QMUIFragment&lt;RunningMapFragmentView, Run @@ -205,6 +212,7 @@ public class RunningMapFragment extends QMUIFragment&lt;RunningMapFragmentView, Run
205 mVibrator.vibrate(new long[]{100, 1000, 100, 1000}, -1); 212 mVibrator.vibrate(new long[]{100, 1000, 100, 1000}, -1);
206 } 213 }
207 if (tipDialog != null) { 214 if (tipDialog != null) {
  215 + tipDialog.setTipMsg("您已回归轨迹\n继续参与运动吧");
208 tipDialog.show(); 216 tipDialog.show();
209 } 217 }
210 } 218 }
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/fragment/UploadFailDetailFragment.java
@@ -15,7 +15,7 @@ import com.example.moudle_pedometer.databinding.FragmentFinishRunMapBinding; @@ -15,7 +15,7 @@ import com.example.moudle_pedometer.databinding.FragmentFinishRunMapBinding;
15 import java.io.Serializable; 15 import java.io.Serializable;
16 16
17 /** 17 /**
18 - * 重新 上传详情页面 18 + * 重新上传详情页面
19 * 19 *
20 * @author ShinnyYang 20 * @author ShinnyYang
21 */ 21 */
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/widget/TipDialog.java
@@ -54,12 +54,14 @@ public class TipDialog extends Dialog { @@ -54,12 +54,14 @@ public class TipDialog extends Dialog {
54 @Override 54 @Override
55 protected void onCreate(Bundle savedInstanceState) { 55 protected void onCreate(Bundle savedInstanceState) {
56 super.onCreate(savedInstanceState); 56 super.onCreate(savedInstanceState);
57 -  
58 -  
59 //显示视图 57 //显示视图
60 this.setContentView(view); 58 this.setContentView(view);
61 } 59 }
62 60
  61 + public void setTipMsg(String tipMsg) {
  62 + tv_dialog_tip.setText(tipMsg);
  63 + }
  64 +
63 private void initView(View rootView) { 65 private void initView(View rootView) {
64 this.tv_dialog_tip = (TextView) rootView.findViewById(R.id.tv_dialog_tip); 66 this.tv_dialog_tip = (TextView) rootView.findViewById(R.id.tv_dialog_tip);
65 this.btn_ok = (Button) rootView.findViewById(R.id.btn_ok); 67 this.btn_ok = (Button) rootView.findViewById(R.id.btn_ok);
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/utils/MyMapUtil.java
@@ -270,7 +270,7 @@ public class MyMapUtil { @@ -270,7 +270,7 @@ public class MyMapUtil {
270 */ 270 */
271 public static Overlay drawHistoryTrack(Context context, BaiduMap baiduMap, List<LatLng> points, SortType sortType, int lineColor, int startIconRes, int endIconRes) { 271 public static Overlay drawHistoryTrack(Context context, BaiduMap baiduMap, List<LatLng> points, SortType sortType, int lineColor, int startIconRes, int endIconRes) {
272 // 绘制新覆盖物前,清空之前的覆盖物 272 // 绘制新覆盖物前,清空之前的覆盖物
273 - if (points == null || points.size() == 0 || lineColor == 0 || startIconRes == 0 || endIconRes == 0) { 273 + if (points == null || points.size() == 0 || lineColor == 0) {
274 return null; 274 return null;
275 } 275 }
276 //只有一个点 276 //只有一个点
@@ -331,7 +331,7 @@ public class MyMapUtil { @@ -331,7 +331,7 @@ public class MyMapUtil {
331 */ 331 */
332 public static Overlay drawRealTimeTrack(Context context, BaiduMap baiduMap, List<LatLng> points, SortType sortType, int lineColor, int startIconRes) { 332 public static Overlay drawRealTimeTrack(Context context, BaiduMap baiduMap, List<LatLng> points, SortType sortType, int lineColor, int startIconRes) {
333 // 绘制新覆盖物前,清空之前的覆盖物 333 // 绘制新覆盖物前,清空之前的覆盖物
334 - if (points == null || points.size() == 0 || lineColor == 0 || startIconRes == 0) { 334 + if (points == null || points.size() == 0 || lineColor == 0 ) {
335 return null; 335 return null;
336 } 336 }
337 //只有一个点 337 //只有一个点
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/utils/StepUtil.java
@@ -32,6 +32,7 @@ public class StepUtil { @@ -32,6 +32,7 @@ public class StepUtil {
32 return UUID.randomUUID().toString().replace("-", ""); 32 return UUID.randomUUID().toString().replace("-", "");
33 } 33 }
34 34
  35 +
35 /** 36 /**
36 * 删除临时保存数据 37 * 删除临时保存数据
37 * 38 *
moudle_pedometer/src/main/res/layout/fragment_run_race_detail.xml
@@ -96,7 +96,7 @@ @@ -96,7 +96,7 @@
96 <!----> 96 <!---->
97 <View 97 <View
98 android:layout_width="match_parent" 98 android:layout_width="match_parent"
99 - android:layout_height="20dp" 99 + android:layout_height="10dp"
100 android:background="#F4F4F4" /> 100 android:background="#F4F4F4" />
101 <!--路线介绍--> 101 <!--路线介绍-->
102 <include 102 <include
moudle_pedometer/src/main/res/layout/fragment_running_map.xml
@@ -175,7 +175,6 @@ @@ -175,7 +175,6 @@
175 android:layout_weight="1" 175 android:layout_weight="1"
176 android:gravity="center" 176 android:gravity="center"
177 android:orientation="vertical" 177 android:orientation="vertical"
178 - android:paddingLeft="5dp"  
179 android:paddingRight="5dp"> 178 android:paddingRight="5dp">
180 179
181 <TextView 180 <TextView
@@ -183,6 +182,7 @@ @@ -183,6 +182,7 @@
183 android:layout_width="wrap_content" 182 android:layout_width="wrap_content"
184 android:layout_height="wrap_content" 183 android:layout_height="wrap_content"
185 android:text="--" 184 android:text="--"
  185 + android:layout_marginRight="5dp"
186 android:textColor="@color/black" 186 android:textColor="@color/black"
187 android:textSize="20sp" 187 android:textSize="20sp"
188 android:textStyle="bold" /> 188 android:textStyle="bold" />
@@ -192,6 +192,7 @@ @@ -192,6 +192,7 @@
192 android:layout_height="wrap_content" 192 android:layout_height="wrap_content"
193 android:layout_marginTop="10dp" 193 android:layout_marginTop="10dp"
194 android:text="距离(km)" 194 android:text="距离(km)"
  195 + android:layout_marginRight="5dp"
195 android:textColor="@color/black" 196 android:textColor="@color/black"
196 android:textSize="15sp" /> 197 android:textSize="15sp" />
197 </LinearLayout> 198 </LinearLayout>
moudle_pedometer/src/main/res/layout/fragment_self_record.xml
@@ -16,6 +16,7 @@ @@ -16,6 +16,7 @@
16 android:layout_width="wrap_content" 16 android:layout_width="wrap_content"
17 android:layout_height="wrap_content" 17 android:layout_height="wrap_content"
18 android:layout_centerVertical="true" 18 android:layout_centerVertical="true"
  19 + android:layout_marginLeft="10dp"
19 android:padding="10dp" 20 android:padding="10dp"
20 android:src="@drawable/top_back_black" /> 21 android:src="@drawable/top_back_black" />
21 22
@@ -44,7 +45,7 @@ @@ -44,7 +45,7 @@
44 android:id="@+id/ry_record" 45 android:id="@+id/ry_record"
45 android:layout_width="match_parent" 46 android:layout_width="match_parent"
46 android:layout_height="wrap_content" 47 android:layout_height="wrap_content"
47 - android:layout_marginTop="10dp" 48 + android:layout_marginTop="-15dp"
48 android:background="@drawable/wdjl_backgroud" 49 android:background="@drawable/wdjl_backgroud"
49 android:padding="25dp"> 50 android:padding="25dp">
50 51
@@ -68,7 +69,7 @@ @@ -68,7 +69,7 @@
68 android:layout_width="wrap_content" 69 android:layout_width="wrap_content"
69 android:layout_height="wrap_content" 70 android:layout_height="wrap_content"
70 android:layout_centerHorizontal="true" 71 android:layout_centerHorizontal="true"
71 - android:layout_marginTop="20dp" 72 + android:layout_marginTop="10dp"
72 android:text="0.0" 73 android:text="0.0"
73 android:textColor="@color/white" 74 android:textColor="@color/white"
74 android:textSize="50sp" /> 75 android:textSize="50sp" />
@@ -249,7 +250,6 @@ @@ -249,7 +250,6 @@
249 android:layout_width="match_parent" 250 android:layout_width="match_parent"
250 android:layout_height="wrap_content" 251 android:layout_height="wrap_content"
251 android:layout_marginLeft="10dp" 252 android:layout_marginLeft="10dp"
252 - android:layout_marginTop="10dp"  
253 android:layout_marginRight="10dp"> 253 android:layout_marginRight="10dp">
254 254
255 <TextView 255 <TextView
moudle_pedometer/src/main/res/layout/layout_finish_running_route.xml
@@ -4,7 +4,10 @@ @@ -4,7 +4,10 @@
4 <LinearLayout 4 <LinearLayout
5 android:layout_width="match_parent" 5 android:layout_width="match_parent"
6 android:layout_height="wrap_content" 6 android:layout_height="wrap_content"
7 - android:layout_margin="10dp" 7 + android:layout_marginLeft="10dp"
  8 + android:layout_marginTop="20dp"
  9 + android:layout_marginRight="10dp"
  10 + android:layout_marginBottom="10dp"
8 android:background="@drawable/shape_10dp_white_raduis_bg" 11 android:background="@drawable/shape_10dp_white_raduis_bg"
9 android:orientation="vertical"> 12 android:orientation="vertical">
10 <!--跑步路线--> 13 <!--跑步路线-->
moudle_pedometer/src/main/res/layout/layout_finish_step.xml
@@ -4,7 +4,10 @@ @@ -4,7 +4,10 @@
4 <LinearLayout 4 <LinearLayout
5 android:layout_width="match_parent" 5 android:layout_width="match_parent"
6 android:layout_height="80dp" 6 android:layout_height="80dp"
7 - android:layout_margin="10dp" 7 + android:layout_marginLeft="10dp"
  8 + android:layout_marginTop="20dp"
  9 + android:layout_marginRight="10dp"
  10 + android:layout_marginBottom="10dp"
8 android:background="@drawable/shape_10dp_white_raduis_bg" 11 android:background="@drawable/shape_10dp_white_raduis_bg"
9 android:orientation="vertical"> 12 android:orientation="vertical">
10 13
moudle_pedometer/src/main/res/layout/layout_finish_user_info.xml
@@ -85,7 +85,9 @@ @@ -85,7 +85,9 @@
85 <View 85 <View
86 android:layout_width="match_parent" 86 android:layout_width="match_parent"
87 android:layout_height="1dp" 87 android:layout_height="1dp"
  88 + android:layout_marginLeft="10dp"
88 android:layout_marginTop="10dp" 89 android:layout_marginTop="10dp"
  90 + android:layout_marginRight="10dp"
89 android:background="@color/line" /> 91 android:background="@color/line" />
90 <!--配速和用时--> 92 <!--配速和用时-->
91 <LinearLayout 93 <LinearLayout
@@ -113,6 +115,7 @@ @@ -113,6 +115,7 @@
113 android:layout_width="wrap_content" 115 android:layout_width="wrap_content"
114 android:layout_height="wrap_content" 116 android:layout_height="wrap_content"
115 android:layout_marginTop="5dp" 117 android:layout_marginTop="5dp"
  118 + android:layout_marginBottom="10dp"
116 android:text="配速" 119 android:text="配速"
117 android:textColor="@color/text_black" 120 android:textColor="@color/text_black"
118 android:textSize="15sp" /> 121 android:textSize="15sp" />
@@ -138,6 +141,7 @@ @@ -138,6 +141,7 @@
138 android:layout_width="wrap_content" 141 android:layout_width="wrap_content"
139 android:layout_height="wrap_content" 142 android:layout_height="wrap_content"
140 android:layout_marginTop="5dp" 143 android:layout_marginTop="5dp"
  144 + android:layout_marginBottom="10dp"
141 android:text="用时" 145 android:text="用时"
142 android:textColor="@color/text_black" 146 android:textColor="@color/text_black"
143 android:textSize="15sp" /> 147 android:textSize="15sp" />
moudle_pedometer/src/main/res/layout/layout_run_detail_person_score.xml
@@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
9 <!--个人最佳成绩--> 9 <!--个人最佳成绩-->
10 <LinearLayout 10 <LinearLayout
11 android:layout_width="match_parent" 11 android:layout_width="match_parent"
12 - android:layout_height="180dp" 12 + android:layout_height="200dp"
13 android:background="@drawable/white_shadow_bg" 13 android:background="@drawable/white_shadow_bg"
14 android:orientation="vertical" 14 android:orientation="vertical"
15 android:paddingLeft="15dp" 15 android:paddingLeft="15dp"
moudle_pedometer/src/main/res/layout/layout_run_detail_rank.xml
@@ -11,6 +11,7 @@ @@ -11,6 +11,7 @@
11 <LinearLayout 11 <LinearLayout
12 android:layout_width="match_parent" 12 android:layout_width="match_parent"
13 android:layout_height="150dp" 13 android:layout_height="150dp"
  14 + android:layout_marginBottom="20dp"
14 android:background="@drawable/white_shadow_bg" 15 android:background="@drawable/white_shadow_bg"
15 android:orientation="vertical" 16 android:orientation="vertical"
16 android:paddingLeft="15dp" 17 android:paddingLeft="15dp"
moudle_pedometer/src/main/res/layout/layout_run_detail_street.xml
@@ -3,7 +3,8 @@ @@ -3,7 +3,8 @@
3 3
4 <LinearLayout xmlns:FivePersonIconView="http://schemas.android.com/apk/res-auto" 4 <LinearLayout xmlns:FivePersonIconView="http://schemas.android.com/apk/res-auto"
5 android:layout_width="match_parent" 5 android:layout_width="match_parent"
6 - android:layout_height="wrap_content"> 6 + android:layout_height="wrap_content"
  7 + android:background="@color/white">
7 8
8 <LinearLayout 9 <LinearLayout
9 android:id="@+id/ll_run_detail_street_root" 10 android:id="@+id/ll_run_detail_street_root"
@@ -78,6 +79,14 @@ @@ -78,6 +79,14 @@
78 79
79 </LinearLayout> 80 </LinearLayout>
80 </LinearLayout> 81 </LinearLayout>
  82 +
  83 + <View
  84 + android:layout_width="match_parent"
  85 + android:layout_height="1dp"
  86 + android:layout_marginLeft="35dp"
  87 + android:layout_marginRight="35dp"
  88 + android:layout_marginBottom="5dp"
  89 + android:background="@color/line" />
81 <!--按钮--> 90 <!--按钮-->
82 <RelativeLayout 91 <RelativeLayout
83 android:id="@+id/rl_start_btn" 92 android:id="@+id/rl_start_btn"
@@ -128,8 +137,8 @@ @@ -128,8 +137,8 @@
128 android:gravity="center_vertical"> 137 android:gravity="center_vertical">
129 138
130 <View 139 <View
131 - android:layout_width="10dp"  
132 - android:layout_height="10dp" 140 + android:layout_width="6dp"
  141 + android:layout_height="6dp"
133 android:layout_marginLeft="25dp" 142 android:layout_marginLeft="25dp"
134 android:background="@drawable/shape_circle_green" /> 143 android:background="@drawable/shape_circle_green" />
135 144
@@ -150,6 +159,14 @@ @@ -150,6 +159,14 @@
150 android:textColor="@color/text_black" 159 android:textColor="@color/text_black"
151 android:textSize="15sp" /> 160 android:textSize="15sp" />
152 </LinearLayout> 161 </LinearLayout>
  162 + <!--竖线-->
  163 + <View
  164 + android:layout_width="1dp"
  165 + android:layout_height="20dp"
  166 + android:layout_marginLeft="37dp"
  167 + android:layout_marginTop="-3dp"
  168 + android:layout_marginBottom="-13dp"
  169 + android:background="@color/vertical_line" />
153 <!--终点--> 170 <!--终点-->
154 <LinearLayout 171 <LinearLayout
155 android:id="@+id/ll_end_point" 172 android:id="@+id/ll_end_point"
@@ -160,8 +177,8 @@ @@ -160,8 +177,8 @@
160 android:gravity="center_vertical"> 177 android:gravity="center_vertical">
161 178
162 <View 179 <View
163 - android:layout_width="10dp"  
164 - android:layout_height="10dp" 180 + android:layout_width="6dp"
  181 + android:layout_height="6dp"
165 android:layout_marginLeft="25dp" 182 android:layout_marginLeft="25dp"
166 android:background="@drawable/shape_circle_red" /> 183 android:background="@drawable/shape_circle_red" />
167 184
@@ -242,9 +259,9 @@ @@ -242,9 +259,9 @@
242 <View 259 <View
243 android:layout_width="match_parent" 260 android:layout_width="match_parent"
244 android:layout_height="1dp" 261 android:layout_height="1dp"
245 - android:layout_marginLeft="10dp" 262 + android:layout_marginLeft="35dp"
246 android:layout_marginTop="5dp" 263 android:layout_marginTop="5dp"
247 - android:layout_marginRight="10dp" 264 + android:layout_marginRight="35dp"
248 android:background="@color/line" /> 265 android:background="@color/line" />
249 <!--活动时间--> 266 <!--活动时间-->
250 <LinearLayout 267 <LinearLayout
@@ -304,9 +321,9 @@ @@ -304,9 +321,9 @@
304 <View 321 <View
305 android:layout_width="match_parent" 322 android:layout_width="match_parent"
306 android:layout_height="1dp" 323 android:layout_height="1dp"
307 - android:layout_marginLeft="10dp" 324 + android:layout_marginLeft="35dp"
308 android:layout_marginTop="5dp" 325 android:layout_marginTop="5dp"
309 - android:layout_marginRight="10dp" 326 + android:layout_marginRight="35dp"
310 android:background="@color/line" /> 327 android:background="@color/line" />
311 <!--活动类型--> 328 <!--活动类型-->
312 <LinearLayout 329 <LinearLayout
@@ -347,6 +364,14 @@ @@ -347,6 +364,14 @@
347 android:textStyle="bold" /> 364 android:textStyle="bold" />
348 365
349 </LinearLayout> 366 </LinearLayout>
  367 +
  368 + <View
  369 + android:layout_width="match_parent"
  370 + android:layout_height="1dp"
  371 + android:layout_marginLeft="35dp"
  372 + android:layout_marginTop="5dp"
  373 + android:layout_marginRight="35dp"
  374 + android:background="@color/line" />
350 <!--参与人数--> 375 <!--参与人数-->
351 <LinearLayout 376 <LinearLayout
352 android:layout_width="match_parent" 377 android:layout_width="match_parent"
moudle_pedometer/src/main/res/layout/layout_run_detail_street_introduce.xml
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
13 android:id="@+id/tv_race_title" 13 android:id="@+id/tv_race_title"
14 android:layout_width="wrap_content" 14 android:layout_width="wrap_content"
15 android:layout_height="wrap_content" 15 android:layout_height="wrap_content"
16 - android:layout_marginTop="10dp" 16 + android:layout_marginTop="18dp"
17 android:text="@string/layout_run_detail_street_introduce_title" 17 android:text="@string/layout_run_detail_street_introduce_title"
18 android:textSize="18sp" 18 android:textSize="18sp"
19 android:textStyle="bold" /> 19 android:textStyle="bold" />
moudle_pedometer/src/main/res/values/strings.xml
@@ -31,7 +31,6 @@ @@ -31,7 +31,6 @@
31 <!--赛事详情--> 31 <!--赛事详情-->
32 <string name="run_race_btn_sign_up">立即报名</string> 32 <string name="run_race_btn_sign_up">立即报名</string>
33 <string name="run_race_btn_start_now">现在开始</string> 33 <string name="run_race_btn_start_now">现在开始</string>
34 - <string name="run_race_far_tip">您距离起点较远\n请到达起点附近再开始!</string>  
35 <!--layout_street--> 34 <!--layout_street-->
36 <string name="layout_street_active_point">活动地点</string> 35 <string name="layout_street_active_point">活动地点</string>
37 <string name="layout_street_start_point">(起)</string> 36 <string name="layout_street_start_point">(起)</string>
@@ -81,14 +80,16 @@ @@ -81,14 +80,16 @@
81 <string name="again_up">重新上传</string> 80 <string name="again_up">重新上传</string>
82 <string name="myrecord">我的记录</string> 81 <string name="myrecord">我的记录</string>
83 <string name="up_fail">上传失败</string> 82 <string name="up_fail">上传失败</string>
84 - <string name="enter_range_tip">您已回归轨迹 继续参与运动吧</string>  
85 - <string name="exit_range_tip">您已偏离路径轨迹 请您计时回归路径!</string>  
86 - <string name="more_than_pause_count_tip">您已超过最大暂停次数,无法继续比赛!</string> 83 + <string name="enter_range_tip">您已回归轨迹继续参与运动吧</string>
  84 + <string name="exit_range_tip">您已偏离路径轨迹请您计时回归路径</string>
  85 + <string name="more_than_pause_count_tip">您已超过最大暂停次数,无法继续比赛</string>
87 <string name="run_pause_tip">固定赛事只可暂停一次\n是否确定使用?</string> 86 <string name="run_pause_tip">固定赛事只可暂停一次\n是否确定使用?</string>
88 <string name="add_path">添加轨迹</string> 87 <string name="add_path">添加轨迹</string>
89 <string name="addpath">绑定轨迹</string> 88 <string name="addpath">绑定轨迹</string>
90 <string name="delect">删除</string> 89 <string name="delect">删除</string>
91 <string name="no_fail_line_text_tip">没有上传失败的路线哦</string> 90 <string name="no_fail_line_text_tip">没有上传失败的路线哦</string>
  91 + <string name="run_race_far_tip">您距离起点较远\n请到达起点附近再开始</string>
  92 + <string name="run_race_arrive_end_tip">您已到达终点附近\n可以结束运动了</string>
92 93
93 94
94 </resources> 95 </resources>