Commit 48fec4a772983e4999cd62ad8596062a16137275
1 parent
c18828ed
1.修改数据库结构
2.实现跑步完成提交数据功能
Showing
21 changed files
with
602 additions
and
92 deletions
moudle_pedometer/build.gradle
| @@ -121,4 +121,6 @@ dependencies { | @@ -121,4 +121,6 @@ dependencies { | ||
| 121 | } | 121 | } |
| 122 | implementation "com.cnlive.libs:mediapicker:$rootProject.libMediaPicker" | 122 | implementation "com.cnlive.libs:mediapicker:$rootProject.libMediaPicker" |
| 123 | implementation 'org.apache.httpcomponents:httpcore:4.4.2' | 123 | implementation 'org.apache.httpcomponents:httpcore:4.4.2' |
| 124 | + //气泡提醒 | ||
| 125 | + implementation 'q.rorbin:badgeview:1.1.3' | ||
| 124 | } | 126 | } |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/commonInfo/CommonInfo.java
| @@ -358,6 +358,27 @@ public class CommonInfo { | @@ -358,6 +358,27 @@ public class CommonInfo { | ||
| 358 | } | 358 | } |
| 359 | 359 | ||
| 360 | 360 | ||
| 361 | + /** | ||
| 362 | + * 设置赛事标题 | ||
| 363 | + * | ||
| 364 | + * @param context | ||
| 365 | + */ | ||
| 366 | + public static void setStreetTitle(Context context, String streetTitle) { | ||
| 367 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putString("runStreetTitle", streetTitle); | ||
| 368 | + | ||
| 369 | + } | ||
| 370 | + | ||
| 371 | + /** | ||
| 372 | + * 互殴轨迹查询\的实体名称 | ||
| 373 | + * | ||
| 374 | + * @param context | ||
| 375 | + */ | ||
| 376 | + public static String getStreetTitle(Context context) { | ||
| 377 | + return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getString("runStreetTitle", ""); | ||
| 378 | + | ||
| 379 | + } | ||
| 380 | + | ||
| 381 | + | ||
| 361 | /*重置 | 382 | /*重置 |
| 362 | * @param context | 383 | * @param context |
| 363 | */ | 384 | */ |
| @@ -373,6 +394,7 @@ public class CommonInfo { | @@ -373,6 +394,7 @@ public class CommonInfo { | ||
| 373 | MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("FenceId"); | 394 | MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("FenceId"); |
| 374 | MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("IsFirstShowTimeTip"); | 395 | MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("IsFirstShowTimeTip"); |
| 375 | MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("runIsPauseState"); | 396 | MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("runIsPauseState"); |
| 397 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("runStreetTitle"); | ||
| 376 | // MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("runQueryTraceStartTime"); | 398 | // MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("runQueryTraceStartTime"); |
| 377 | // MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("runQueryTraceEndTime"); | 399 | // MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("runQueryTraceEndTime"); |
| 378 | // MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("runQueryEntityName"); | 400 | // MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("runQueryEntityName"); |
| @@ -391,5 +413,7 @@ public class CommonInfo { | @@ -391,5 +413,7 @@ public class CommonInfo { | ||
| 391 | MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("RunBaiduTraceService"); | 413 | MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("RunBaiduTraceService"); |
| 392 | MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("FirstStepSendTraceTip"); | 414 | MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("FirstStepSendTraceTip"); |
| 393 | MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("IsFirstShowTimeTip"); | 415 | MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("IsFirstShowTimeTip"); |
| 416 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("runIsPauseState"); | ||
| 417 | + | ||
| 394 | } | 418 | } |
| 395 | } | 419 | } |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/presenter/LineUpAgainPresenter.java
| @@ -7,7 +7,4 @@ import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter; | @@ -7,7 +7,4 @@ import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter; | ||
| 7 | * Created by hanyayun 019/06/20. | 7 | * Created by hanyayun 019/06/20. |
| 8 | */ | 8 | */ |
| 9 | public class LineUpAgainPresenter extends MvpBasePresenter<LineUpAgainView> { | 9 | public class LineUpAgainPresenter extends MvpBasePresenter<LineUpAgainView> { |
| 10 | - public void getData(){ | ||
| 11 | - getView().setData(); | ||
| 12 | - } | ||
| 13 | } | 10 | } |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/presenter/RunningFinishFragmetPresenter.java
| 1 | package com.cnlive.moudle.pedometer.frame.presenter; | 1 | package com.cnlive.moudle.pedometer.frame.presenter; |
| 2 | 2 | ||
| 3 | +import android.app.Activity; | ||
| 3 | import android.content.Context; | 4 | import android.content.Context; |
| 4 | import android.graphics.Bitmap; | 5 | import android.graphics.Bitmap; |
| 5 | import android.os.Handler; | 6 | import android.os.Handler; |
| @@ -27,7 +28,9 @@ import com.cnlive.moudle.pedometer.net.SubscriptionRequest; | @@ -27,7 +28,9 @@ import com.cnlive.moudle.pedometer.net.SubscriptionRequest; | ||
| 27 | import com.cnlive.moudle.pedometer.net.bean.BaseInfo; | 28 | import com.cnlive.moudle.pedometer.net.bean.BaseInfo; |
| 28 | import com.cnlive.moudle.pedometer.net.bean.RunRaceDetailInfo; | 29 | import com.cnlive.moudle.pedometer.net.bean.RunRaceDetailInfo; |
| 29 | import com.cnlive.moudle.pedometer.service.StepService; | 30 | import com.cnlive.moudle.pedometer.service.StepService; |
| 31 | +import com.cnlive.moudle.pedometer.sql.entity.FailedEntity; | ||
| 30 | import com.cnlive.moudle.pedometer.sql.entity.UserStepEntity; | 32 | import com.cnlive.moudle.pedometer.sql.entity.UserStepEntity; |
| 33 | +import com.cnlive.moudle.pedometer.ui.activity.LineUpAgainActivity; | ||
| 31 | import com.cnlive.moudle.pedometer.ui.widget.SelectDialog; | 34 | import com.cnlive.moudle.pedometer.ui.widget.SelectDialog; |
| 32 | import com.cnlive.moudle.pedometer.ui.widget.TipDialog; | 35 | import com.cnlive.moudle.pedometer.ui.widget.TipDialog; |
| 33 | import com.cnlive.moudle.pedometer.upload.UploadLogic; | 36 | import com.cnlive.moudle.pedometer.upload.UploadLogic; |
| @@ -55,9 +58,9 @@ import static com.cnlive.libs.base.logic.Config.STATE_LOAD; | @@ -55,9 +58,9 @@ import static com.cnlive.libs.base.logic.Config.STATE_LOAD; | ||
| 55 | 58 | ||
| 56 | public class RunningFinishFragmetPresenter extends MvpBasePresenter<RunningFinishFragmentView> { | 59 | public class RunningFinishFragmetPresenter extends MvpBasePresenter<RunningFinishFragmentView> { |
| 57 | private LBSTraceClient mClient = null; | 60 | private LBSTraceClient mClient = null; |
| 58 | - private String imports = "[{\"latitude\":39.93395837223,\"latitudeE6\":3.993395837223E7,\"longitude\":116.30855458458,\"longitudeE6\":1.1630855458457999E8},{\"latitude\":39.93396326228,\"latitudeE6\":3.993396326228E7,\"longitude\":116.30861833018,\"longitudeE6\":1.1630861833017999E8},{\"latitude\":39.934156956749995,\"latitudeE6\":3.993415695675E7,\"longitude\":116.30869672329999,\"longitudeE6\":1.163086967233E8},{\"latitude\":39.934220163784,\"latitudeE6\":3.9934220163784E7,\"longitude\":116.3087100148,\"longitudeE6\":1.163087100148E8},{\"latitude\":39.934285263072,\"latitudeE6\":3.9934285263072E7,\"longitude\":116.30866498582,\"longitudeE6\":1.1630866498582E8},{\"latitude\":39.934351994321,\"latitudeE6\":3.9934351994320996E7,\"longitude\":116.30865820422,\"longitudeE6\":1.1630865820422E8},{\"latitude\":39.934393506188,\"latitudeE6\":3.9934393506188005E7,\"longitude\":116.3087268324,\"longitudeE6\":1.163087268324E8},{\"latitude\":39.934515310648,\"latitudeE6\":3.9934515310648E7,\"longitude\":116.30877023341,\"longitudeE6\":1.1630877023341E8},{\"latitude\":39.934576888398,\"latitudeE6\":3.9934576888398E7,\"longitude\":116.30876860572,\"longitudeE6\":1.1630876860572E8},{\"latitude\":39.934641987882,\"latitudeE6\":3.9934641987882E7,\"longitude\":116.30872520428,\"longitudeE6\":1.1630872520427999E8},{\"latitude\":39.934720386354,\"latitudeE6\":3.9934720386354E7,\"longitude\":116.30874175083,\"longitudeE6\":1.1630874175083E8},{\"latitude\":39.934703845843,\"latitudeE6\":3.9934703845843E7,\"longitude\":116.30880197017,\"longitudeE6\":1.1630880197016999E8},{\"latitude\":39.934719055573,\"latitudeE6\":3.9934719055573E7,\"longitude\":116.30896553874,\"longitudeE6\":1.1630896553874E8},{\"latitude\":39.93482461107,\"latitudeE6\":3.993482461107E7,\"longitude\":116.30924466304002,\"longitudeE6\":1.1630924466304001E8},{\"latitude\":39.934804821527,\"latitudeE6\":3.9934804821527004E7,\"longitude\":116.30935804892,\"longitudeE6\":1.1630935804892E8},{\"latitude\":39.934856643274,\"latitudeE6\":3.9934856643274E7,\"longitude\":116.30943996874,\"longitudeE6\":1.1630943996874E8},{\"latitude\":39.934844987999,\"latitudeE6\":3.9934844987999E7,\"longitude\":116.30952026112,\"longitudeE6\":1.1630952026112E8},{\"latitude\":39.934722121282,\"latitudeE6\":3.9934722121282004E7,\"longitude\":116.30967542086,\"longitudeE6\":1.1630967542086E8},{\"latitude\":39.934828721701,\"latitudeE6\":3.9934828721701E7,\"longitude\":116.30960516489,\"longitudeE6\":1.1630960516489E8},{\"latitude\":39.934408798988,\"latitudeE6\":3.9934408798988E7,\"longitude\":116.30961357453,\"longitudeE6\":1.1630961357453E8},{\"latitude\":39.934345321571,\"latitudeE6\":3.9934345321571E7,\"longitude\":116.30960842073,\"longitudeE6\":1.1630960842073E8},{\"latitude\":39.93436159016,\"latitudeE6\":3.9934361590160005E7,\"longitude\":116.30954331882,\"longitudeE6\":1.1630954331882E8},{\"latitude\":39.934295133241,\"latitudeE6\":3.9934295133241E7,\"longitude\":116.30957668364,\"longitudeE6\":1.1630957668364E8},{\"latitude\":39.934188525341,\"latitudeE6\":3.9934188525341E7,\"longitude\":116.30958183769,\"longitudeE6\":1.1630958183769001E8},{\"latitude\":39.933976660469,\"latitudeE6\":3.9933976660469E7,\"longitude\":116.30954494693,\"longitudeE6\":1.1630954494693E8},{\"latitude\":39.933993190121,\"latitudeE6\":3.9933993190121E7,\"longitude\":116.30939114375,\"longitudeE6\":1.1630939114375001E8},{\"latitude\":39.933938115564,\"latitudeE6\":3.9933938115563996E7,\"longitude\":116.30932956832,\"longitudeE6\":1.1630932956831999E8},{\"latitude\":39.933916130555,\"latitudeE6\":3.9933916130555E7,\"longitude\":116.30922269279,\"longitudeE6\":1.1630922269279E8},{\"latitude\":39.933836097011,\"latitudeE6\":3.9933836097011E7,\"longitude\":116.30914077307,\"longitudeE6\":1.1630914077307E8}]\n"; | 61 | + private List<LatLng> importPoints; |
| 59 | 62 | ||
| 60 | - public void saveRouteData(Context context, UserStepEntity userStepEntity, RunningFinishBean runningFinishBean) { | 63 | + public void saveRouteData(Activity context, UserStepEntity userStepEntity, RunningFinishBean runningFinishBean) { |
| 61 | // 赛事id | 64 | // 赛事id |
| 62 | String eventId = userStepEntity.getStreetId(); | 65 | String eventId = userStepEntity.getStreetId(); |
| 63 | //用户ID | 66 | //用户ID |
| @@ -157,17 +160,18 @@ public class RunningFinishFragmetPresenter extends MvpBasePresenter<RunningFinis | @@ -157,17 +160,18 @@ public class RunningFinishFragmetPresenter extends MvpBasePresenter<RunningFinis | ||
| 157 | /** | 160 | /** |
| 158 | * 查询当前用户历史轨迹 | 161 | * 查询当前用户历史轨迹 |
| 159 | */ | 162 | */ |
| 160 | - public void queryHistoryTrace(Context context, UserStepEntity userStepEntity, RunningFinishBean runningFinishBean) { | 163 | + public void queryHistoryTrace(Activity context, UserStepEntity userStepEntity, RunningFinishBean runningFinishBean) { |
| 161 | //查询当前用户的历史轨迹 | 164 | //查询当前用户的历史轨迹 |
| 162 | long startTime = userStepEntity.getStartTimeStamp(); | 165 | long startTime = userStepEntity.getStartTimeStamp(); |
| 163 | //获取当前的时间戳(秒) | 166 | //获取当前的时间戳(秒) |
| 164 | long endTime = userStepEntity.getFinishTimeStamp(); | 167 | long endTime = userStepEntity.getFinishTimeStamp(); |
| 165 | //获取当前的实体名称 | 168 | //获取当前的实体名称 |
| 166 | String entityName = CommonInfo.getUserId(context); | 169 | String entityName = CommonInfo.getUserId(context); |
| 167 | - //路线全程里数 | ||
| 168 | - | ||
| 169 | //打的重要点 | 170 | //打的重要点 |
| 170 | - List<LatLng> importPoints = GsonUtil.jsonToList(imports, LatLng.class); | 171 | + importPoints = null; |
| 172 | + if (!TextUtils.isEmpty(userStepEntity.getImportPoint())) { | ||
| 173 | + importPoints = GsonUtil.jsonToList(userStepEntity.getImportPoint(), LatLng.class); | ||
| 174 | + } | ||
| 171 | if (mClient == null) { | 175 | if (mClient == null) { |
| 172 | mClient = new LBSTraceClient(context); | 176 | mClient = new LBSTraceClient(context); |
| 173 | } | 177 | } |
| @@ -256,6 +260,8 @@ public class RunningFinishFragmetPresenter extends MvpBasePresenter<RunningFinis | @@ -256,6 +260,8 @@ public class RunningFinishFragmetPresenter extends MvpBasePresenter<RunningFinis | ||
| 256 | }, "暂存", new SelectDialog.DialogInterface() { | 260 | }, "暂存", new SelectDialog.DialogInterface() { |
| 257 | @Override | 261 | @Override |
| 258 | public void onClick(SelectDialog dialog) { | 262 | public void onClick(SelectDialog dialog) { |
| 263 | + setFailData(context, userStepEntity, runningFinishBean); | ||
| 264 | + | ||
| 259 | dialog.dismiss(); | 265 | dialog.dismiss(); |
| 260 | } | 266 | } |
| 261 | }); | 267 | }); |
| @@ -268,6 +274,79 @@ public class RunningFinishFragmetPresenter extends MvpBasePresenter<RunningFinis | @@ -268,6 +274,79 @@ public class RunningFinishFragmetPresenter extends MvpBasePresenter<RunningFinis | ||
| 268 | 274 | ||
| 269 | } | 275 | } |
| 270 | 276 | ||
| 277 | + public void setFailData(Activity activity, UserStepEntity userStepEntity, RunningFinishBean runningFinishBean) { | ||
| 278 | + if (userStepEntity == null || runningFinishBean == null || activity == null) { | ||
| 279 | + return; | ||
| 280 | + } | ||
| 281 | + //设置数据 | ||
| 282 | + FailedEntity failedEntity = new FailedEntity(); | ||
| 283 | + //设置主键 | ||
| 284 | + failedEntity.setUuid(StepUtil.getUUID()); | ||
| 285 | + //设置用户id | ||
| 286 | + failedEntity.setUid(userStepEntity.getUserId()); | ||
| 287 | + //设置当前数据创建时间戳 | ||
| 288 | + failedEntity.setCreatTimeStamp(TimeUtil.getNowTimeStamp()); | ||
| 289 | + //设置是否暂停 | ||
| 290 | + if (userStepEntity.getPauseCount() > 1) { | ||
| 291 | + failedEntity.setIsPause(true); | ||
| 292 | + //设置暂停时间 | ||
| 293 | + failedEntity.setUserPauseTime(userStepEntity.getUserPauseTimeStamp()); | ||
| 294 | + //设置继续时间戳 | ||
| 295 | + failedEntity.setUsrContinueTime(userStepEntity.getContinueTime()); | ||
| 296 | + } else { | ||
| 297 | + failedEntity.setIsPause(false); | ||
| 298 | + } | ||
| 299 | + //设置用时 | ||
| 300 | + failedEntity.setTime(runningFinishBean.getEmployTime()); | ||
| 301 | + //设置配速 | ||
| 302 | + if ("--".equals(runningFinishBean.getSpeed())) { | ||
| 303 | + failedEntity.setSpeed("0"); | ||
| 304 | + } else { | ||
| 305 | + failedEntity.setSpeed(runningFinishBean.getSpeed()); | ||
| 306 | + } | ||
| 307 | + //设置步数 | ||
| 308 | + if ("--".equals(runningFinishBean.getStep())) { | ||
| 309 | + failedEntity.setStep("0"); | ||
| 310 | + } else { | ||
| 311 | + failedEntity.setStep(runningFinishBean.getStep()); | ||
| 312 | + } | ||
| 313 | + //设置距离 | ||
| 314 | + if ("--".equals(runningFinishBean.getRunDistance())) { | ||
| 315 | + failedEntity.setDistance("0"); | ||
| 316 | + } else { | ||
| 317 | + failedEntity.setDistance(runningFinishBean.getRunDistance()); | ||
| 318 | + } | ||
| 319 | + //设置开始地点 | ||
| 320 | + failedEntity.setStartPoint(userStepEntity.getStartPoint()); | ||
| 321 | + //设置结束地点 | ||
| 322 | + failedEntity.setEndPoint(userStepEntity.getEndPoint()); | ||
| 323 | + //设置赛道开始时间 | ||
| 324 | + failedEntity.setStreetTraceStartTime(userStepEntity.getQueryTraceStartTime()); | ||
| 325 | + //设置赛道结束时间 | ||
| 326 | + failedEntity.setStreetTraceEndTime(userStepEntity.getQueryTraceEndTime()); | ||
| 327 | + //设置赛道查询实体 | ||
| 328 | + failedEntity.setEntityName(userStepEntity.getQueryEntityName()); | ||
| 329 | + //设置用户开始时间 | ||
| 330 | + failedEntity.setUserStartTime(userStepEntity.getStartTimeStamp()); | ||
| 331 | + //设置用户完成时间 | ||
| 332 | + failedEntity.setUserEndTime(userStepEntity.getFinishTimeStamp()); | ||
| 333 | + //设置关键点 | ||
| 334 | + failedEntity.setImportPoint(userStepEntity.getImportPoint()); | ||
| 335 | + //设置赛事id | ||
| 336 | + failedEntity.setStreetId(userStepEntity.getStreetId()); | ||
| 337 | + //设置赛事标题 | ||
| 338 | + failedEntity.setStreetTitle(userStepEntity.getStreetTitle()); | ||
| 339 | + //设置数据 | ||
| 340 | + StepUtil.setFailData(activity, failedEntity); | ||
| 341 | + //跳转到上传失败列表 | ||
| 342 | + LineUpAgainActivity.newInstance(activity); | ||
| 343 | + StepUtil.clearRunData(activity, CommonInfo.getUserId(activity)); | ||
| 344 | + CommonInfo.reset(activity); | ||
| 345 | + //关闭当前窗口 | ||
| 346 | + activity.finish(); | ||
| 347 | + | ||
| 348 | + } | ||
| 349 | + | ||
| 271 | /** | 350 | /** |
| 272 | * 查询运营人员踩得轨迹 | 351 | * 查询运营人员踩得轨迹 |
| 273 | * | 352 | * |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/LineUpAgainView.java
| @@ -2,8 +2,11 @@ package com.cnlive.moudle.pedometer.frame.view; | @@ -2,8 +2,11 @@ package com.cnlive.moudle.pedometer.frame.view; | ||
| 2 | 2 | ||
| 3 | import android.support.v7.widget.LinearLayoutManager; | 3 | import android.support.v7.widget.LinearLayoutManager; |
| 4 | 4 | ||
| 5 | +import com.cnlive.moudle.pedometer.commonInfo.CommonInfo; | ||
| 6 | +import com.cnlive.moudle.pedometer.sql.entity.FailedEntity; | ||
| 5 | import com.cnlive.moudle.pedometer.ui.adapter.LineUpAgainAdapter; | 7 | import com.cnlive.moudle.pedometer.ui.adapter.LineUpAgainAdapter; |
| 6 | import com.cnlive.moudle.pedometer.ui.fragment.LineUpAgainFragment; | 8 | import com.cnlive.moudle.pedometer.ui.fragment.LineUpAgainFragment; |
| 9 | +import com.cnlive.moudle.pedometer.utils.StepUtil; | ||
| 7 | import com.example.moudle_pedometer.R; | 10 | import com.example.moudle_pedometer.R; |
| 8 | import com.hannesdorfmann.mosby3.mvp.MvpView; | 11 | import com.hannesdorfmann.mosby3.mvp.MvpView; |
| 9 | import com.scwang.smartrefresh.layout.footer.ClassicsFooter; | 12 | import com.scwang.smartrefresh.layout.footer.ClassicsFooter; |
| @@ -19,30 +22,31 @@ import java.util.List; | @@ -19,30 +22,31 @@ import java.util.List; | ||
| 19 | public class LineUpAgainView implements MvpView { | 22 | public class LineUpAgainView implements MvpView { |
| 20 | 23 | ||
| 21 | private LineUpAgainFragment fragment; | 24 | private LineUpAgainFragment fragment; |
| 25 | + private LineUpAgainAdapter againAdapter; | ||
| 22 | 26 | ||
| 23 | public LineUpAgainView(LineUpAgainFragment fragment) { | 27 | public LineUpAgainView(LineUpAgainFragment fragment) { |
| 24 | this.fragment = fragment; | 28 | this.fragment = fragment; |
| 25 | } | 29 | } |
| 26 | 30 | ||
| 27 | - public void initView(){ | 31 | + public void initView() { |
| 28 | fragment.binding.topbar.addLeftImageButton(R.drawable.top_back_black, R.id.fragment_back).setOnClickListener(v -> { | 32 | fragment.binding.topbar.addLeftImageButton(R.drawable.top_back_black, R.id.fragment_back).setOnClickListener(v -> { |
| 29 | fragment.getActivity().finish(); | 33 | fragment.getActivity().finish(); |
| 30 | }); | 34 | }); |
| 31 | fragment.binding.topbar.setTitle("重新上传"); | 35 | fragment.binding.topbar.setTitle("重新上传"); |
| 32 | - | 36 | + //获取上传失败的数据 |
| 37 | + List<FailedEntity> failedEntities = StepUtil.getFailListData(fragment.getContext(), CommonInfo.getUserId(fragment.getContext())); | ||
| 38 | + //没有失败数据 | ||
| 39 | + if (failedEntities == null) { | ||
| 40 | + | ||
| 41 | + } | ||
| 42 | + //有失败数据 | ||
| 43 | + else { | ||
| 44 | + againAdapter = new LineUpAgainAdapter(failedEntities, fragment.getActivity()); | ||
| 45 | + fragment.binding.recycler.setAdapter(againAdapter); | ||
| 46 | + } | ||
| 33 | // fragment.binding.refreshLayout.setRefreshHeader(new ClassicsHeader(fragment.getActivity())); | 47 | // fragment.binding.refreshLayout.setRefreshHeader(new ClassicsHeader(fragment.getActivity())); |
| 34 | // fragment.binding.refreshLayout.setRefreshFooter(new ClassicsFooter(fragment.getActivity())); | 48 | // fragment.binding.refreshLayout.setRefreshFooter(new ClassicsFooter(fragment.getActivity())); |
| 35 | fragment.binding.recycler.setLayoutManager(new LinearLayoutManager(fragment.getActivity())); | 49 | fragment.binding.recycler.setLayoutManager(new LinearLayoutManager(fragment.getActivity())); |
| 36 | } | 50 | } |
| 37 | 51 | ||
| 38 | - public void setData(){ | ||
| 39 | - List<String> list = new ArrayList<>(); | ||
| 40 | - list.add("fffff"); | ||
| 41 | - list.add("fffff"); | ||
| 42 | - list.add("fffff"); | ||
| 43 | - list.add("fffff"); | ||
| 44 | - list.add("fffff"); | ||
| 45 | - LineUpAgainAdapter againAdapter = new LineUpAgainAdapter(list,fragment.getActivity()); | ||
| 46 | - fragment.binding.recycler.setAdapter(againAdapter); | ||
| 47 | - } | ||
| 48 | } | 52 | } |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RunMainFragmentView.java
| @@ -64,6 +64,7 @@ public class RunMainFragmentView implements MvpView { | @@ -64,6 +64,7 @@ public class RunMainFragmentView implements MvpView { | ||
| 64 | // 定位相关 | 64 | // 定位相关 |
| 65 | private LocationClient mLocClient; | 65 | private LocationClient mLocClient; |
| 66 | public MyLocationListenner myListener = new MyLocationListenner(); | 66 | public MyLocationListenner myListener = new MyLocationListenner(); |
| 67 | + private String employTime = ""; | ||
| 67 | 68 | ||
| 68 | public RunMainFragmentView(RunMainFragment fragment) { | 69 | public RunMainFragmentView(RunMainFragment fragment) { |
| 69 | this.fragment = fragment; | 70 | this.fragment = fragment; |
| @@ -167,6 +168,7 @@ public class RunMainFragmentView implements MvpView { | @@ -167,6 +168,7 @@ public class RunMainFragmentView implements MvpView { | ||
| 167 | int hour = (int) ((SystemClock.elapsedRealtime() - chronometer.getBase()) / 1000 / 60 / 60); | 168 | int hour = (int) ((SystemClock.elapsedRealtime() - chronometer.getBase()) / 1000 / 60 / 60); |
| 168 | int minute = (int) ((SystemClock.elapsedRealtime() - chronometer.getBase()) / 1000 / 60) % 60; | 169 | int minute = (int) ((SystemClock.elapsedRealtime() - chronometer.getBase()) / 1000 / 60) % 60; |
| 169 | int second = (int) ((SystemClock.elapsedRealtime() - chronometer.getBase()) / 1000) % 60; | 170 | int second = (int) ((SystemClock.elapsedRealtime() - chronometer.getBase()) / 1000) % 60; |
| 171 | + employTime = (hour * 3600 + minute * 60 + second) + ""; | ||
| 170 | if (hour < 1) { | 172 | if (hour < 1) { |
| 171 | if (minute == 59 && second == 59) { | 173 | if (minute == 59 && second == 59) { |
| 172 | chronometer.setFormat("0" + "%s"); | 174 | chronometer.setFormat("0" + "%s"); |
| @@ -210,7 +212,7 @@ public class RunMainFragmentView implements MvpView { | @@ -210,7 +212,7 @@ public class RunMainFragmentView implements MvpView { | ||
| 210 | fragment.binding.chronometer.setBase(SystemClock.elapsedRealtime()); | 212 | fragment.binding.chronometer.setBase(SystemClock.elapsedRealtime()); |
| 211 | } | 213 | } |
| 212 | //设置继续运动时间 | 214 | //设置继续运动时间 |
| 213 | - StepUtil.setContinueTime(getContext(),uid,TimeUtil.getNowTimeStamp()); | 215 | + StepUtil.setContinueTime(getContext(), uid, TimeUtil.getNowTimeStamp()); |
| 214 | //因为进来以后就运动了,所以需要改变状态 | 216 | //因为进来以后就运动了,所以需要改变状态 |
| 215 | CommonInfo.setIsPauseState(getContext(), false); | 217 | CommonInfo.setIsPauseState(getContext(), false); |
| 216 | //重新设置开始时间 | 218 | //重新设置开始时间 |
| @@ -263,7 +265,7 @@ public class RunMainFragmentView implements MvpView { | @@ -263,7 +265,7 @@ public class RunMainFragmentView implements MvpView { | ||
| 263 | @Override | 265 | @Override |
| 264 | public void onClick(View view) { | 266 | public void onClick(View view) { |
| 265 | //设置继续运动时间 | 267 | //设置继续运动时间 |
| 266 | - StepUtil.setContinueTime(getContext(),uid,TimeUtil.getNowTimeStamp()); | 268 | + StepUtil.setContinueTime(getContext(), uid, TimeUtil.getNowTimeStamp()); |
| 267 | //设置继续标志 | 269 | //设置继续标志 |
| 268 | CommonInfo.setIsPauseState(getContext(), false); | 270 | CommonInfo.setIsPauseState(getContext(), false); |
| 269 | //继续记录轨迹 | 271 | //继续记录轨迹 |
| @@ -330,6 +332,8 @@ public class RunMainFragmentView implements MvpView { | @@ -330,6 +332,8 @@ public class RunMainFragmentView implements MvpView { | ||
| 330 | SelectDialog selectDialog = new SelectDialog(fragment.getActivity(), "确定结束运动吗?", "确定", new SelectDialog.DialogInterface() { | 332 | SelectDialog selectDialog = new SelectDialog(fragment.getActivity(), "确定结束运动吗?", "确定", new SelectDialog.DialogInterface() { |
| 331 | @Override | 333 | @Override |
| 332 | public void onClick(SelectDialog dialog) { | 334 | public void onClick(SelectDialog dialog) { |
| 335 | + //停止计时 | ||
| 336 | + fragment.binding.chronometer.stop(); | ||
| 333 | //设置状态标志位 | 337 | //设置状态标志位 |
| 334 | setStopStartFlag(); | 338 | setStopStartFlag(); |
| 335 | //设置运动结束时间戳 | 339 | //设置运动结束时间戳 |
| @@ -347,7 +351,7 @@ public class RunMainFragmentView implements MvpView { | @@ -347,7 +351,7 @@ public class RunMainFragmentView implements MvpView { | ||
| 347 | runningFinishBean.setTime(fragment.binding.chronometer.getText().toString()); | 351 | runningFinishBean.setTime(fragment.binding.chronometer.getText().toString()); |
| 348 | runningFinishBean.setDate(TimeUtil.getFormatNowTime()); | 352 | runningFinishBean.setDate(TimeUtil.getFormatNowTime()); |
| 349 | //设置用时 | 353 | //设置用时 |
| 350 | - runningFinishBean.setEmployTime(TimeUtil.getChronometerSeconds(fragment.binding.chronometer)); | 354 | + runningFinishBean.setEmployTime(employTime); |
| 351 | RunningFinishActivity.startActivity(fragment.getActivity(), runningFinishBean); | 355 | RunningFinishActivity.startActivity(fragment.getActivity(), runningFinishBean); |
| 352 | fragment.getActivity().finish(); | 356 | fragment.getActivity().finish(); |
| 353 | } | 357 | } |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RunRaceDetailFragmentView.java
| @@ -148,7 +148,7 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { | @@ -148,7 +148,7 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { | ||
| 148 | 148 | ||
| 149 | 149 | ||
| 150 | public void initView(RunRaceDetailInfo runRaceDetailInfo) { | 150 | public void initView(RunRaceDetailInfo runRaceDetailInfo) { |
| 151 | - | 151 | + Log.e(TAG, "initView: " + TimeUtil.getNowTimeStamp()); |
| 152 | // new Handler().postDelayed(new Runnable() { | 152 | // new Handler().postDelayed(new Runnable() { |
| 153 | // @Override | 153 | // @Override |
| 154 | // public void run() { | 154 | // public void run() { |
| @@ -203,7 +203,6 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { | @@ -203,7 +203,6 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { | ||
| 203 | // //初始化地图点位 | 203 | // //初始化地图点位 |
| 204 | if (runRaceDetailInfo.getLatLongitude() != null) { | 204 | if (runRaceDetailInfo.getLatLongitude() != null) { |
| 205 | importStreetPoints = GsonUtil.jsonToList(runRaceDetailInfo.getLatLongitude().trim(), LatLng.class); | 205 | importStreetPoints = GsonUtil.jsonToList(runRaceDetailInfo.getLatLongitude().trim(), LatLng.class); |
| 206 | - Log.e(TAG, "importStreetPoints点数量" + importStreetPoints.size()); | ||
| 207 | } | 206 | } |
| 208 | //轨迹开始时间 | 207 | //轨迹开始时间 |
| 209 | long startTime = 0; | 208 | long startTime = 0; |
| @@ -308,6 +307,7 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { | @@ -308,6 +307,7 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { | ||
| 308 | } | 307 | } |
| 309 | //设置标题 | 308 | //设置标题 |
| 310 | if (!TextUtils.isEmpty(runRaceDetailInfo.getTitle())) { | 309 | if (!TextUtils.isEmpty(runRaceDetailInfo.getTitle())) { |
| 310 | + CommonInfo.setStreetTitle(getContext(), runRaceDetailInfo.getTitle()); | ||
| 311 | fragment.binding.includeStreet.tvRaceTitle.setText(runRaceDetailInfo.getTitle()); | 311 | fragment.binding.includeStreet.tvRaceTitle.setText(runRaceDetailInfo.getTitle()); |
| 312 | //根据标题字数动态设置卡片高度 | 312 | //根据标题字数动态设置卡片高度 |
| 313 | if (runRaceDetailInfo.getTitle().length() > 19) { | 313 | if (runRaceDetailInfo.getTitle().length() > 19) { |
| @@ -574,10 +574,10 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { | @@ -574,10 +574,10 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { | ||
| 574 | stopStepService(); | 574 | stopStepService(); |
| 575 | startStepService(getContext()); | 575 | startStepService(getContext()); |
| 576 | } else { | 576 | } else { |
| 577 | - PedometerMainActivity.startActivity(fragment.getActivity(), runRaceDetailInfo.getStartLocation(), runRaceDetailInfo.getEndLocation(),importStreetPoints); | 577 | + PedometerMainActivity.startActivity(fragment.getActivity(), runRaceDetailInfo.getStartLocation(), runRaceDetailInfo.getEndLocation(), importStreetPoints); |
| 578 | } | 578 | } |
| 579 | } else { | 579 | } else { |
| 580 | - PedometerMainActivity.startActivity(fragment.getActivity(), runRaceDetailInfo.getStartLocation(), runRaceDetailInfo.getEndLocation(),importStreetPoints); | 580 | + PedometerMainActivity.startActivity(fragment.getActivity(), runRaceDetailInfo.getStartLocation(), runRaceDetailInfo.getEndLocation(), importStreetPoints); |
| 581 | } | 581 | } |
| 582 | } | 582 | } |
| 583 | 583 | ||
| @@ -924,6 +924,9 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { | @@ -924,6 +924,9 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { | ||
| 924 | //设置轨迹查询结束时间 | 924 | //设置轨迹查询结束时间 |
| 925 | CommonInfo.setQueryTraceEndTime(getContext(), endTime); | 925 | CommonInfo.setQueryTraceEndTime(getContext(), endTime); |
| 926 | } | 926 | } |
| 927 | + if (!TextUtils.isEmpty(runRaceDetailInfo.getTitle())) { | ||
| 928 | + CommonInfo.setStreetTitle(getContext(), runRaceDetailInfo.getTitle()); | ||
| 929 | + } | ||
| 927 | } | 930 | } |
| 928 | 931 | ||
| 929 | } | 932 | } |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/SelfRecordView.java
| 1 | package com.cnlive.moudle.pedometer.frame.view; | 1 | package com.cnlive.moudle.pedometer.frame.view; |
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | +import android.content.Context; | ||
| 4 | import android.content.Intent; | 5 | import android.content.Intent; |
| 5 | import android.support.v7.widget.LinearLayoutManager; | 6 | import android.support.v7.widget.LinearLayoutManager; |
| 6 | import android.view.View; | 7 | import android.view.View; |
| @@ -12,10 +13,12 @@ import com.cnlive.moudle.pedometer.model.RunningFinishBean; | @@ -12,10 +13,12 @@ import com.cnlive.moudle.pedometer.model.RunningFinishBean; | ||
| 12 | import com.cnlive.moudle.pedometer.net.bean.BaseInfo; | 13 | import com.cnlive.moudle.pedometer.net.bean.BaseInfo; |
| 13 | import com.cnlive.moudle.pedometer.net.bean.EventRouteRecordBeanVoListBean; | 14 | import com.cnlive.moudle.pedometer.net.bean.EventRouteRecordBeanVoListBean; |
| 14 | import com.cnlive.moudle.pedometer.net.bean.SelfRecordInfo; | 15 | import com.cnlive.moudle.pedometer.net.bean.SelfRecordInfo; |
| 16 | +import com.cnlive.moudle.pedometer.sql.entity.FailedEntity; | ||
| 15 | import com.cnlive.moudle.pedometer.ui.activity.LineUpAgainActivity; | 17 | import com.cnlive.moudle.pedometer.ui.activity.LineUpAgainActivity; |
| 16 | import com.cnlive.moudle.pedometer.ui.activity.RunLineActivity; | 18 | import com.cnlive.moudle.pedometer.ui.activity.RunLineActivity; |
| 17 | import com.cnlive.moudle.pedometer.ui.adapter.RaceRecordAdapter; | 19 | import com.cnlive.moudle.pedometer.ui.adapter.RaceRecordAdapter; |
| 18 | import com.cnlive.moudle.pedometer.ui.fragment.SelfRecordFragment; | 20 | import com.cnlive.moudle.pedometer.ui.fragment.SelfRecordFragment; |
| 21 | +import com.cnlive.moudle.pedometer.utils.StepUtil; | ||
| 19 | import com.example.moudle_pedometer.R; | 22 | import com.example.moudle_pedometer.R; |
| 20 | import com.hannesdorfmann.mosby3.mvp.MvpView; | 23 | import com.hannesdorfmann.mosby3.mvp.MvpView; |
| 21 | import com.qmuiteam.qmui.widget.dialog.QMUITipDialog; | 24 | import com.qmuiteam.qmui.widget.dialog.QMUITipDialog; |
| @@ -25,6 +28,8 @@ import com.scwang.smartrefresh.layout.header.ClassicsHeader; | @@ -25,6 +28,8 @@ import com.scwang.smartrefresh.layout.header.ClassicsHeader; | ||
| 25 | import java.util.ArrayList; | 28 | import java.util.ArrayList; |
| 26 | import java.util.List; | 29 | import java.util.List; |
| 27 | 30 | ||
| 31 | +import q.rorbin.badgeview.QBadgeView; | ||
| 32 | + | ||
| 28 | /** | 33 | /** |
| 29 | * Created by hanyayun 019/06/12. | 34 | * Created by hanyayun 019/06/12. |
| 30 | */ | 35 | */ |
| @@ -103,6 +108,7 @@ public class SelfRecordView implements MvpView { | @@ -103,6 +108,7 @@ public class SelfRecordView implements MvpView { | ||
| 103 | } | 108 | } |
| 104 | 109 | ||
| 105 | public void initView() { | 110 | public void initView() { |
| 111 | + | ||
| 106 | fragment.binding.back.setOnClickListener(v -> fragment.getActivity().finish()); | 112 | fragment.binding.back.setOnClickListener(v -> fragment.getActivity().finish()); |
| 107 | fragment.binding.refreshLayout.setRefreshHeader(new ClassicsHeader(fragment.getActivity())); | 113 | fragment.binding.refreshLayout.setRefreshHeader(new ClassicsHeader(fragment.getActivity())); |
| 108 | fragment.binding.refreshLayout.setRefreshFooter(new ClassicsFooter(fragment.getActivity())); | 114 | fragment.binding.refreshLayout.setRefreshFooter(new ClassicsFooter(fragment.getActivity())); |
| @@ -120,7 +126,7 @@ public class SelfRecordView implements MvpView { | @@ -120,7 +126,7 @@ public class SelfRecordView implements MvpView { | ||
| 120 | fragment.binding.finishNum.setText("0"); | 126 | fragment.binding.finishNum.setText("0"); |
| 121 | fragment.binding.allTime.setText("00:00:00"); | 127 | fragment.binding.allTime.setText("00:00:00"); |
| 122 | fragment.binding.checkAllLine.setOnClickListener(v -> { | 128 | fragment.binding.checkAllLine.setOnClickListener(v -> { |
| 123 | - RunLineActivity.newInstance(fragment.getActivity(),null,null,null,null); | 129 | + RunLineActivity.newInstance(fragment.getActivity(), null, null, null, null); |
| 124 | }); | 130 | }); |
| 125 | } | 131 | } |
| 126 | 132 | ||
| @@ -161,4 +167,6 @@ public class SelfRecordView implements MvpView { | @@ -161,4 +167,6 @@ public class SelfRecordView implements MvpView { | ||
| 161 | public void hideLoading() { | 167 | public void hideLoading() { |
| 162 | if (loadingDiaog != null) loadingDiaog.dismiss(); | 168 | if (loadingDiaog != null) loadingDiaog.dismiss(); |
| 163 | } | 169 | } |
| 170 | + | ||
| 171 | + | ||
| 164 | } | 172 | } |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/net/ApiServiceRunLin.java
| @@ -67,13 +67,6 @@ public interface ApiServiceRunLin { | @@ -67,13 +67,6 @@ public interface ApiServiceRunLin { | ||
| 67 | Observable<Result<BaseInfo<SelfRecordInfo>>> getSelfRecordInfo(@QueryMap() Map<String, String> maps); | 67 | Observable<Result<BaseInfo<SelfRecordInfo>>> getSelfRecordInfo(@QueryMap() Map<String, String> maps); |
| 68 | 68 | ||
| 69 | /** | 69 | /** |
| 70 | - * 保存个人约跑路线记录 | ||
| 71 | - */ | ||
| 72 | - @POST("Daren/event/routeRecord.action") | ||
| 73 | - Observable<Result<BaseInfo>> saveRouteData(@QueryMap() Map<String, String> maps); | ||
| 74 | - | ||
| 75 | - | ||
| 76 | - /** | ||
| 77 | * 踩点轨迹列表 | 70 | * 踩点轨迹列表 |
| 78 | */ | 71 | */ |
| 79 | @POST("Daren/event/getShoeLineList.action") | 72 | @POST("Daren/event/getShoeLineList.action") |
| @@ -91,5 +84,15 @@ public interface ApiServiceRunLin { | @@ -91,5 +84,15 @@ public interface ApiServiceRunLin { | ||
| 91 | @POST("Daren/event/bindingShoeLine.action") | 84 | @POST("Daren/event/bindingShoeLine.action") |
| 92 | Observable<Result<BaseInfo>> bindingShoeLineInfo(@QueryMap() Map<String, String> maps); | 85 | Observable<Result<BaseInfo>> bindingShoeLineInfo(@QueryMap() Map<String, String> maps); |
| 93 | 86 | ||
| 87 | + | ||
| 88 | + /** | ||
| 89 | + * 保存个人约跑路线记录 | ||
| 90 | + */ | ||
| 91 | + @POST("Daren/event/routeRecord.action") | ||
| 92 | + Observable<Result<BaseInfo>> saveRouteData(@QueryMap() Map<String, String> maps); | ||
| 93 | + | ||
| 94 | + | ||
| 95 | + | ||
| 96 | + | ||
| 94 | } | 97 | } |
| 95 | 98 |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/service/StepService.java
| @@ -259,11 +259,15 @@ public class StepService extends Service implements SensorEventListener { | @@ -259,11 +259,15 @@ public class StepService extends Service implements SensorEventListener { | ||
| 259 | int fenceId = CommonInfo.getFenceId(getApplicationContext()); | 259 | int fenceId = CommonInfo.getFenceId(getApplicationContext()); |
| 260 | //设置围栏id | 260 | //设置围栏id |
| 261 | StepUtil.setFenceId(getApplicationContext(), CommonInfo.getUserId(getApplicationContext()), fenceId); | 261 | StepUtil.setFenceId(getApplicationContext(), CommonInfo.getUserId(getApplicationContext()), fenceId); |
| 262 | + //设置赛事标题 | ||
| 263 | + StepUtil.setStreetTitle(getApplicationContext(), CommonInfo.getUserId(getApplicationContext()), CommonInfo.getStreetTitle(getApplicationContext())); | ||
| 262 | //清空临时保存的时间 | 264 | //清空临时保存的时间 |
| 263 | CommonInfo.setQueryTraceEndTime(getApplicationContext(), 0); | 265 | CommonInfo.setQueryTraceEndTime(getApplicationContext(), 0); |
| 264 | CommonInfo.setQueryTraceStartTime(getApplicationContext(), 0); | 266 | CommonInfo.setQueryTraceStartTime(getApplicationContext(), 0); |
| 265 | CommonInfo.setQueryEntityName(getApplicationContext(), ""); | 267 | CommonInfo.setQueryEntityName(getApplicationContext(), ""); |
| 266 | CommonInfo.setFenceId(getApplicationContext(), -1); | 268 | CommonInfo.setFenceId(getApplicationContext(), -1); |
| 269 | + CommonInfo.setStreetTitle(getApplicationContext(), ""); | ||
| 270 | + | ||
| 267 | } | 271 | } |
| 268 | //开始设置围栏报警 | 272 | //开始设置围栏报警 |
| 269 | startQueryFence(); | 273 | startQueryFence(); |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/sql/dao/DaoMaster.java
| @@ -23,12 +23,14 @@ public class DaoMaster extends AbstractDaoMaster { | @@ -23,12 +23,14 @@ public class DaoMaster extends AbstractDaoMaster { | ||
| 23 | public static void createAllTables(Database db, boolean ifNotExists) { | 23 | public static void createAllTables(Database db, boolean ifNotExists) { |
| 24 | CollUserStepEntityDao.createTable(db, ifNotExists); | 24 | CollUserStepEntityDao.createTable(db, ifNotExists); |
| 25 | UserStepEntityDao.createTable(db, ifNotExists); | 25 | UserStepEntityDao.createTable(db, ifNotExists); |
| 26 | + FailedEntityDao.createTable(db, ifNotExists); | ||
| 26 | } | 27 | } |
| 27 | 28 | ||
| 28 | /** Drops underlying database table using DAOs. */ | 29 | /** Drops underlying database table using DAOs. */ |
| 29 | public static void dropAllTables(Database db, boolean ifExists) { | 30 | public static void dropAllTables(Database db, boolean ifExists) { |
| 30 | CollUserStepEntityDao.dropTable(db, ifExists); | 31 | CollUserStepEntityDao.dropTable(db, ifExists); |
| 31 | UserStepEntityDao.dropTable(db, ifExists); | 32 | UserStepEntityDao.dropTable(db, ifExists); |
| 33 | + FailedEntityDao.dropTable(db, ifExists); | ||
| 32 | } | 34 | } |
| 33 | 35 | ||
| 34 | /** | 36 | /** |
| @@ -49,6 +51,7 @@ public class DaoMaster extends AbstractDaoMaster { | @@ -49,6 +51,7 @@ public class DaoMaster extends AbstractDaoMaster { | ||
| 49 | super(db, SCHEMA_VERSION); | 51 | super(db, SCHEMA_VERSION); |
| 50 | registerDaoClass(CollUserStepEntityDao.class); | 52 | registerDaoClass(CollUserStepEntityDao.class); |
| 51 | registerDaoClass(UserStepEntityDao.class); | 53 | registerDaoClass(UserStepEntityDao.class); |
| 54 | + registerDaoClass(FailedEntityDao.class); | ||
| 52 | } | 55 | } |
| 53 | 56 | ||
| 54 | public DaoSession newSession() { | 57 | public DaoSession newSession() { |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/sql/dao/DaoSession.java
| @@ -10,9 +10,11 @@ import org.greenrobot.greendao.internal.DaoConfig; | @@ -10,9 +10,11 @@ import org.greenrobot.greendao.internal.DaoConfig; | ||
| 10 | 10 | ||
| 11 | import com.cnlive.moudle.pedometer.sql.entity.CollUserStepEntity; | 11 | import com.cnlive.moudle.pedometer.sql.entity.CollUserStepEntity; |
| 12 | import com.cnlive.moudle.pedometer.sql.entity.UserStepEntity; | 12 | import com.cnlive.moudle.pedometer.sql.entity.UserStepEntity; |
| 13 | +import com.cnlive.moudle.pedometer.sql.entity.FailedEntity; | ||
| 13 | 14 | ||
| 14 | import com.cnlive.moudle.pedometer.sql.dao.CollUserStepEntityDao; | 15 | import com.cnlive.moudle.pedometer.sql.dao.CollUserStepEntityDao; |
| 15 | import com.cnlive.moudle.pedometer.sql.dao.UserStepEntityDao; | 16 | import com.cnlive.moudle.pedometer.sql.dao.UserStepEntityDao; |
| 17 | +import com.cnlive.moudle.pedometer.sql.dao.FailedEntityDao; | ||
| 16 | 18 | ||
| 17 | // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. | 19 | // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. |
| 18 | 20 | ||
| @@ -25,9 +27,11 @@ public class DaoSession extends AbstractDaoSession { | @@ -25,9 +27,11 @@ public class DaoSession extends AbstractDaoSession { | ||
| 25 | 27 | ||
| 26 | private final DaoConfig collUserStepEntityDaoConfig; | 28 | private final DaoConfig collUserStepEntityDaoConfig; |
| 27 | private final DaoConfig userStepEntityDaoConfig; | 29 | private final DaoConfig userStepEntityDaoConfig; |
| 30 | + private final DaoConfig failedEntityDaoConfig; | ||
| 28 | 31 | ||
| 29 | private final CollUserStepEntityDao collUserStepEntityDao; | 32 | private final CollUserStepEntityDao collUserStepEntityDao; |
| 30 | private final UserStepEntityDao userStepEntityDao; | 33 | private final UserStepEntityDao userStepEntityDao; |
| 34 | + private final FailedEntityDao failedEntityDao; | ||
| 31 | 35 | ||
| 32 | public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig> | 36 | public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig> |
| 33 | daoConfigMap) { | 37 | daoConfigMap) { |
| @@ -39,16 +43,22 @@ public class DaoSession extends AbstractDaoSession { | @@ -39,16 +43,22 @@ public class DaoSession extends AbstractDaoSession { | ||
| 39 | userStepEntityDaoConfig = daoConfigMap.get(UserStepEntityDao.class).clone(); | 43 | userStepEntityDaoConfig = daoConfigMap.get(UserStepEntityDao.class).clone(); |
| 40 | userStepEntityDaoConfig.initIdentityScope(type); | 44 | userStepEntityDaoConfig.initIdentityScope(type); |
| 41 | 45 | ||
| 46 | + failedEntityDaoConfig = daoConfigMap.get(FailedEntityDao.class).clone(); | ||
| 47 | + failedEntityDaoConfig.initIdentityScope(type); | ||
| 48 | + | ||
| 42 | collUserStepEntityDao = new CollUserStepEntityDao(collUserStepEntityDaoConfig, this); | 49 | collUserStepEntityDao = new CollUserStepEntityDao(collUserStepEntityDaoConfig, this); |
| 43 | userStepEntityDao = new UserStepEntityDao(userStepEntityDaoConfig, this); | 50 | userStepEntityDao = new UserStepEntityDao(userStepEntityDaoConfig, this); |
| 51 | + failedEntityDao = new FailedEntityDao(failedEntityDaoConfig, this); | ||
| 44 | 52 | ||
| 45 | registerDao(CollUserStepEntity.class, collUserStepEntityDao); | 53 | registerDao(CollUserStepEntity.class, collUserStepEntityDao); |
| 46 | registerDao(UserStepEntity.class, userStepEntityDao); | 54 | registerDao(UserStepEntity.class, userStepEntityDao); |
| 55 | + registerDao(FailedEntity.class, failedEntityDao); | ||
| 47 | } | 56 | } |
| 48 | 57 | ||
| 49 | public void clear() { | 58 | public void clear() { |
| 50 | collUserStepEntityDaoConfig.clearIdentityScope(); | 59 | collUserStepEntityDaoConfig.clearIdentityScope(); |
| 51 | userStepEntityDaoConfig.clearIdentityScope(); | 60 | userStepEntityDaoConfig.clearIdentityScope(); |
| 61 | + failedEntityDaoConfig.clearIdentityScope(); | ||
| 52 | } | 62 | } |
| 53 | 63 | ||
| 54 | public CollUserStepEntityDao getCollUserStepEntityDao() { | 64 | public CollUserStepEntityDao getCollUserStepEntityDao() { |
| @@ -59,4 +69,8 @@ public class DaoSession extends AbstractDaoSession { | @@ -59,4 +69,8 @@ public class DaoSession extends AbstractDaoSession { | ||
| 59 | return userStepEntityDao; | 69 | return userStepEntityDao; |
| 60 | } | 70 | } |
| 61 | 71 | ||
| 72 | + public FailedEntityDao getFailedEntityDao() { | ||
| 73 | + return failedEntityDao; | ||
| 74 | + } | ||
| 75 | + | ||
| 62 | } | 76 | } |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/sql/dao/UserStepEntityDao.java
| @@ -45,6 +45,7 @@ public class UserStepEntityDao extends AbstractDao<UserStepEntity, String> { | @@ -45,6 +45,7 @@ public class UserStepEntityDao extends AbstractDao<UserStepEntity, String> { | ||
| 45 | public final static Property ContinueTime = new Property(18, long.class, "continueTime", false, "CONTINUE_TIME"); | 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"); | 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"); | 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"); | ||
| 48 | } | 49 | } |
| 49 | 50 | ||
| 50 | 51 | ||
| @@ -80,7 +81,8 @@ public class UserStepEntityDao extends AbstractDao<UserStepEntity, String> { | @@ -80,7 +81,8 @@ public class UserStepEntityDao extends AbstractDao<UserStepEntity, String> { | ||
| 80 | "\"QUERY_ENTITY_NAME\" TEXT," + // 17: queryEntityName | 81 | "\"QUERY_ENTITY_NAME\" TEXT," + // 17: queryEntityName |
| 81 | "\"CONTINUE_TIME\" INTEGER NOT NULL ," + // 18: continueTime | 82 | "\"CONTINUE_TIME\" INTEGER NOT NULL ," + // 18: continueTime |
| 82 | "\"FENCE_ID\" INTEGER NOT NULL ," + // 19: fenceId | 83 | "\"FENCE_ID\" INTEGER NOT NULL ," + // 19: fenceId |
| 83 | - "\"IMPORT_POINT\" TEXT);"); // 20: importPoint | 84 | + "\"IMPORT_POINT\" TEXT," + // 20: importPoint |
| 85 | + "\"STREET_TITLE\" TEXT);"); // 21: streetTitle | ||
| 84 | } | 86 | } |
| 85 | 87 | ||
| 86 | /** Drops the underlying database table. */ | 88 | /** Drops the underlying database table. */ |
| @@ -149,6 +151,11 @@ public class UserStepEntityDao extends AbstractDao<UserStepEntity, String> { | @@ -149,6 +151,11 @@ public class UserStepEntityDao extends AbstractDao<UserStepEntity, String> { | ||
| 149 | if (importPoint != null) { | 151 | if (importPoint != null) { |
| 150 | stmt.bindString(21, importPoint); | 152 | stmt.bindString(21, importPoint); |
| 151 | } | 153 | } |
| 154 | + | ||
| 155 | + String streetTitle = entity.getStreetTitle(); | ||
| 156 | + if (streetTitle != null) { | ||
| 157 | + stmt.bindString(22, streetTitle); | ||
| 158 | + } | ||
| 152 | } | 159 | } |
| 153 | 160 | ||
| 154 | @Override | 161 | @Override |
| @@ -211,6 +218,11 @@ public class UserStepEntityDao extends AbstractDao<UserStepEntity, String> { | @@ -211,6 +218,11 @@ public class UserStepEntityDao extends AbstractDao<UserStepEntity, String> { | ||
| 211 | if (importPoint != null) { | 218 | if (importPoint != null) { |
| 212 | stmt.bindString(21, importPoint); | 219 | stmt.bindString(21, importPoint); |
| 213 | } | 220 | } |
| 221 | + | ||
| 222 | + String streetTitle = entity.getStreetTitle(); | ||
| 223 | + if (streetTitle != null) { | ||
| 224 | + stmt.bindString(22, streetTitle); | ||
| 225 | + } | ||
| 214 | } | 226 | } |
| 215 | 227 | ||
| 216 | @Override | 228 | @Override |
| @@ -241,7 +253,8 @@ public class UserStepEntityDao extends AbstractDao<UserStepEntity, String> { | @@ -241,7 +253,8 @@ public class UserStepEntityDao extends AbstractDao<UserStepEntity, String> { | ||
| 241 | cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // queryEntityName | 253 | cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // queryEntityName |
| 242 | cursor.getLong(offset + 18), // continueTime | 254 | cursor.getLong(offset + 18), // continueTime |
| 243 | cursor.getLong(offset + 19), // fenceId | 255 | cursor.getLong(offset + 19), // fenceId |
| 244 | - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20) // importPoint | 256 | + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // importPoint |
| 257 | + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21) // streetTitle | ||
| 245 | ); | 258 | ); |
| 246 | return entity; | 259 | return entity; |
| 247 | } | 260 | } |
| @@ -269,6 +282,7 @@ public class UserStepEntityDao extends AbstractDao<UserStepEntity, String> { | @@ -269,6 +282,7 @@ public class UserStepEntityDao extends AbstractDao<UserStepEntity, String> { | ||
| 269 | entity.setContinueTime(cursor.getLong(offset + 18)); | 282 | entity.setContinueTime(cursor.getLong(offset + 18)); |
| 270 | entity.setFenceId(cursor.getLong(offset + 19)); | 283 | entity.setFenceId(cursor.getLong(offset + 19)); |
| 271 | entity.setImportPoint(cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20)); | 284 | entity.setImportPoint(cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20)); |
| 285 | + entity.setStreetTitle(cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21)); | ||
| 272 | } | 286 | } |
| 273 | 287 | ||
| 274 | @Override | 288 | @Override |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/sql/entity/FailedEntity.java
| 1 | package com.cnlive.moudle.pedometer.sql.entity; | 1 | package com.cnlive.moudle.pedometer.sql.entity; |
| 2 | 2 | ||
| 3 | +import org.greenrobot.greendao.annotation.Entity; | ||
| 4 | +import org.greenrobot.greendao.annotation.Id; | ||
| 5 | +import org.greenrobot.greendao.annotation.Generated; | ||
| 6 | + | ||
| 3 | /** | 7 | /** |
| 4 | * 上传失败列表 | 8 | * 上传失败列表 |
| 5 | * | 9 | * |
| 6 | * @author ShinnyYang | 10 | * @author ShinnyYang |
| 7 | */ | 11 | */ |
| 12 | +@Entity | ||
| 8 | public class FailedEntity { | 13 | public class FailedEntity { |
| 14 | + @Id | ||
| 9 | private String uuid;//主键 | 15 | private String uuid;//主键 |
| 10 | private String uid;//用户id | 16 | private String uid;//用户id |
| 11 | - private String streetTitle;//赛道标题 | ||
| 12 | private boolean isPause;//是否暂停 | 17 | private boolean isPause;//是否暂停 |
| 18 | + private long userPauseTime;//用户暂停时间 | ||
| 19 | + private long usrContinueTime;//用户继续时间 | ||
| 13 | private String isFinish;//是否完成 | 20 | private String isFinish;//是否完成 |
| 14 | private String time;//用时 | 21 | private String time;//用时 |
| 15 | private String speed;//配速 | 22 | private String speed;//配速 |
| 16 | private String step;//步数 | 23 | private String step;//步数 |
| 24 | + private String distance;//距离 | ||
| 17 | private String startPoint;//开始地点 | 25 | private String startPoint;//开始地点 |
| 18 | private String endPoint;//结束地点 | 26 | private String endPoint;//结束地点 |
| 19 | private long streetTraceStartTime;//赛道开始时间 | 27 | private long streetTraceStartTime;//赛道开始时间 |
| @@ -23,5 +31,210 @@ public class FailedEntity { | @@ -23,5 +31,210 @@ public class FailedEntity { | ||
| 23 | private long userEndTime;//用户结束时间 | 31 | private long userEndTime;//用户结束时间 |
| 24 | private String importPoint;//关键点 | 32 | private String importPoint;//关键点 |
| 25 | private String streetId;//赛事id | 33 | private String streetId;//赛事id |
| 34 | + private String streetTitle;//赛道标题 | ||
| 35 | + private long creatTimeStamp;//数据创建的时间 | ||
| 36 | + | ||
| 37 | + @Generated(hash = 458367844) | ||
| 38 | + public FailedEntity(String uuid, String uid, boolean isPause, long userPauseTime, long usrContinueTime, | ||
| 39 | + String isFinish, String time, String speed, String step, String distance, String startPoint, | ||
| 40 | + String endPoint, long streetTraceStartTime, long streetTraceEndTime, String entityName, | ||
| 41 | + long userStartTime, long userEndTime, String importPoint, String streetId, String streetTitle, | ||
| 42 | + long creatTimeStamp) { | ||
| 43 | + this.uuid = uuid; | ||
| 44 | + this.uid = uid; | ||
| 45 | + this.isPause = isPause; | ||
| 46 | + this.userPauseTime = userPauseTime; | ||
| 47 | + this.usrContinueTime = usrContinueTime; | ||
| 48 | + this.isFinish = isFinish; | ||
| 49 | + this.time = time; | ||
| 50 | + this.speed = speed; | ||
| 51 | + this.step = step; | ||
| 52 | + this.distance = distance; | ||
| 53 | + this.startPoint = startPoint; | ||
| 54 | + this.endPoint = endPoint; | ||
| 55 | + this.streetTraceStartTime = streetTraceStartTime; | ||
| 56 | + this.streetTraceEndTime = streetTraceEndTime; | ||
| 57 | + this.entityName = entityName; | ||
| 58 | + this.userStartTime = userStartTime; | ||
| 59 | + this.userEndTime = userEndTime; | ||
| 60 | + this.importPoint = importPoint; | ||
| 61 | + this.streetId = streetId; | ||
| 62 | + this.streetTitle = streetTitle; | ||
| 63 | + this.creatTimeStamp = creatTimeStamp; | ||
| 64 | + } | ||
| 65 | + | ||
| 66 | + @Generated(hash = 1639581354) | ||
| 67 | + public FailedEntity() { | ||
| 68 | + } | ||
| 69 | + | ||
| 70 | + public String getUuid() { | ||
| 71 | + return this.uuid; | ||
| 72 | + } | ||
| 73 | + | ||
| 74 | + public void setUuid(String uuid) { | ||
| 75 | + this.uuid = uuid; | ||
| 76 | + } | ||
| 77 | + | ||
| 78 | + public String getUid() { | ||
| 79 | + return this.uid; | ||
| 80 | + } | ||
| 81 | + | ||
| 82 | + public void setUid(String uid) { | ||
| 83 | + this.uid = uid; | ||
| 84 | + } | ||
| 85 | + | ||
| 86 | + public boolean getIsPause() { | ||
| 87 | + return this.isPause; | ||
| 88 | + } | ||
| 89 | + | ||
| 90 | + public void setIsPause(boolean isPause) { | ||
| 91 | + this.isPause = isPause; | ||
| 92 | + } | ||
| 93 | + | ||
| 94 | + public long getUserPauseTime() { | ||
| 95 | + return this.userPauseTime; | ||
| 96 | + } | ||
| 97 | + | ||
| 98 | + public void setUserPauseTime(long userPauseTime) { | ||
| 99 | + this.userPauseTime = userPauseTime; | ||
| 100 | + } | ||
| 101 | + | ||
| 102 | + public long getUsrContinueTime() { | ||
| 103 | + return this.usrContinueTime; | ||
| 104 | + } | ||
| 105 | + | ||
| 106 | + public void setUsrContinueTime(long usrContinueTime) { | ||
| 107 | + this.usrContinueTime = usrContinueTime; | ||
| 108 | + } | ||
| 109 | + | ||
| 110 | + public String getIsFinish() { | ||
| 111 | + return this.isFinish; | ||
| 112 | + } | ||
| 113 | + | ||
| 114 | + public void setIsFinish(String isFinish) { | ||
| 115 | + this.isFinish = isFinish; | ||
| 116 | + } | ||
| 117 | + | ||
| 118 | + public String getTime() { | ||
| 119 | + return this.time; | ||
| 120 | + } | ||
| 121 | + | ||
| 122 | + public void setTime(String time) { | ||
| 123 | + this.time = time; | ||
| 124 | + } | ||
| 125 | + | ||
| 126 | + public String getSpeed() { | ||
| 127 | + return this.speed; | ||
| 128 | + } | ||
| 129 | + | ||
| 130 | + public void setSpeed(String speed) { | ||
| 131 | + this.speed = speed; | ||
| 132 | + } | ||
| 133 | + | ||
| 134 | + public String getStep() { | ||
| 135 | + return this.step; | ||
| 136 | + } | ||
| 137 | + | ||
| 138 | + public void setStep(String step) { | ||
| 139 | + this.step = step; | ||
| 140 | + } | ||
| 141 | + | ||
| 142 | + public String getStartPoint() { | ||
| 143 | + return this.startPoint; | ||
| 144 | + } | ||
| 145 | + | ||
| 146 | + public void setStartPoint(String startPoint) { | ||
| 147 | + this.startPoint = startPoint; | ||
| 148 | + } | ||
| 149 | + | ||
| 150 | + public String getEndPoint() { | ||
| 151 | + return this.endPoint; | ||
| 152 | + } | ||
| 153 | + | ||
| 154 | + public void setEndPoint(String endPoint) { | ||
| 155 | + this.endPoint = endPoint; | ||
| 156 | + } | ||
| 157 | + | ||
| 158 | + public long getStreetTraceStartTime() { | ||
| 159 | + return this.streetTraceStartTime; | ||
| 160 | + } | ||
| 161 | + | ||
| 162 | + public void setStreetTraceStartTime(long streetTraceStartTime) { | ||
| 163 | + this.streetTraceStartTime = streetTraceStartTime; | ||
| 164 | + } | ||
| 165 | + | ||
| 166 | + public long getStreetTraceEndTime() { | ||
| 167 | + return this.streetTraceEndTime; | ||
| 168 | + } | ||
| 169 | + | ||
| 170 | + public void setStreetTraceEndTime(long streetTraceEndTime) { | ||
| 171 | + this.streetTraceEndTime = streetTraceEndTime; | ||
| 172 | + } | ||
| 173 | + | ||
| 174 | + public String getEntityName() { | ||
| 175 | + return this.entityName; | ||
| 176 | + } | ||
| 177 | + | ||
| 178 | + public void setEntityName(String entityName) { | ||
| 179 | + this.entityName = entityName; | ||
| 180 | + } | ||
| 181 | + | ||
| 182 | + public long getUserStartTime() { | ||
| 183 | + return this.userStartTime; | ||
| 184 | + } | ||
| 185 | + | ||
| 186 | + public void setUserStartTime(long userStartTime) { | ||
| 187 | + this.userStartTime = userStartTime; | ||
| 188 | + } | ||
| 189 | + | ||
| 190 | + public long getUserEndTime() { | ||
| 191 | + return this.userEndTime; | ||
| 192 | + } | ||
| 193 | + | ||
| 194 | + public void setUserEndTime(long userEndTime) { | ||
| 195 | + this.userEndTime = userEndTime; | ||
| 196 | + } | ||
| 197 | + | ||
| 198 | + public String getImportPoint() { | ||
| 199 | + return this.importPoint; | ||
| 200 | + } | ||
| 201 | + | ||
| 202 | + public void setImportPoint(String importPoint) { | ||
| 203 | + this.importPoint = importPoint; | ||
| 204 | + } | ||
| 205 | + | ||
| 206 | + public String getStreetId() { | ||
| 207 | + return this.streetId; | ||
| 208 | + } | ||
| 209 | + | ||
| 210 | + public void setStreetId(String streetId) { | ||
| 211 | + this.streetId = streetId; | ||
| 212 | + } | ||
| 213 | + | ||
| 214 | + public String getStreetTitle() { | ||
| 215 | + return this.streetTitle; | ||
| 216 | + } | ||
| 217 | + | ||
| 218 | + public void setStreetTitle(String streetTitle) { | ||
| 219 | + this.streetTitle = streetTitle; | ||
| 220 | + } | ||
| 221 | + | ||
| 222 | + public long getCreatTimeStamp() { | ||
| 223 | + return this.creatTimeStamp; | ||
| 224 | + } | ||
| 225 | + | ||
| 226 | + public void setCreatTimeStamp(long creatTimeStamp) { | ||
| 227 | + this.creatTimeStamp = creatTimeStamp; | ||
| 228 | + } | ||
| 229 | + | ||
| 230 | + public String getDistance() { | ||
| 231 | + return this.distance; | ||
| 232 | + } | ||
| 233 | + | ||
| 234 | + public void setDistance(String distance) { | ||
| 235 | + this.distance = distance; | ||
| 236 | + } | ||
| 237 | + | ||
| 238 | + | ||
| 26 | 239 | ||
| 27 | } | 240 | } |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/sql/entity/UserStepEntity.java
| @@ -28,12 +28,12 @@ public class UserStepEntity { | @@ -28,12 +28,12 @@ public class UserStepEntity { | ||
| 28 | private long continueTime;//继续运动时间 | 28 | private long continueTime;//继续运动时间 |
| 29 | private long fenceId;//围栏id | 29 | private long fenceId;//围栏id |
| 30 | private String importPoint;//关键点 | 30 | private String importPoint;//关键点 |
| 31 | + private String streetTitle;//赛事标题 | ||
| 31 | 32 | ||
| 32 | - | ||
| 33 | - @Generated(hash = 24427970) | ||
| 34 | - public UserStepEntity(String userId, String date, String stepCount, long pauseTimeStamp, long recordTime, double caloriesCount, String serverTraceData, | ||
| 35 | - String startPoint, String endPoint, long startTimeStamp, long finishTimeStamp, String streetId, int pauseCount, long userPauseTimeStamp, | ||
| 36 | - long chronometerBase, long queryTraceStartTime, long queryTraceEndTime, String queryEntityName, long continueTime, long fenceId, String importPoint) { | 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) { | ||
| 37 | this.userId = userId; | 37 | this.userId = userId; |
| 38 | this.date = date; | 38 | this.date = date; |
| 39 | this.stepCount = stepCount; | 39 | this.stepCount = stepCount; |
| @@ -55,6 +55,7 @@ public class UserStepEntity { | @@ -55,6 +55,7 @@ public class UserStepEntity { | ||
| 55 | this.continueTime = continueTime; | 55 | this.continueTime = continueTime; |
| 56 | this.fenceId = fenceId; | 56 | this.fenceId = fenceId; |
| 57 | this.importPoint = importPoint; | 57 | this.importPoint = importPoint; |
| 58 | + this.streetTitle = streetTitle; | ||
| 58 | } | 59 | } |
| 59 | 60 | ||
| 60 | @Generated(hash = 273857141) | 61 | @Generated(hash = 273857141) |
| @@ -229,5 +230,13 @@ public class UserStepEntity { | @@ -229,5 +230,13 @@ public class UserStepEntity { | ||
| 229 | this.importPoint = importPoint; | 230 | this.importPoint = importPoint; |
| 230 | } | 231 | } |
| 231 | 232 | ||
| 233 | + public String getStreetTitle() { | ||
| 234 | + return this.streetTitle; | ||
| 235 | + } | ||
| 236 | + | ||
| 237 | + public void setStreetTitle(String streetTitle) { | ||
| 238 | + this.streetTitle = streetTitle; | ||
| 239 | + } | ||
| 240 | + | ||
| 232 | 241 | ||
| 233 | } | 242 | } |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/adapter/LineUpAgainAdapter.java
| @@ -4,6 +4,7 @@ package com.cnlive.moudle.pedometer.ui.adapter; | @@ -4,6 +4,7 @@ package com.cnlive.moudle.pedometer.ui.adapter; | ||
| 4 | import android.content.Context; | 4 | import android.content.Context; |
| 5 | import android.support.annotation.NonNull; | 5 | import android.support.annotation.NonNull; |
| 6 | import android.support.v7.widget.RecyclerView; | 6 | import android.support.v7.widget.RecyclerView; |
| 7 | +import android.util.Log; | ||
| 7 | import android.view.LayoutInflater; | 8 | import android.view.LayoutInflater; |
| 8 | import android.view.View; | 9 | import android.view.View; |
| 9 | import android.view.ViewGroup; | 10 | import android.view.ViewGroup; |
| @@ -12,6 +13,8 @@ import android.widget.RelativeLayout; | @@ -12,6 +13,8 @@ import android.widget.RelativeLayout; | ||
| 12 | import android.widget.TextView; | 13 | import android.widget.TextView; |
| 13 | 14 | ||
| 14 | import com.cnlive.moudle.pedometer.net.bean.EventRouteRecordBeanVoListBean; | 15 | import com.cnlive.moudle.pedometer.net.bean.EventRouteRecordBeanVoListBean; |
| 16 | +import com.cnlive.moudle.pedometer.sql.entity.FailedEntity; | ||
| 17 | +import com.cnlive.moudle.pedometer.utils.StepUtil; | ||
| 15 | import com.cnlive.moudle.pedometer.utils.TimeUtil; | 18 | import com.cnlive.moudle.pedometer.utils.TimeUtil; |
| 16 | import com.example.moudle_pedometer.R; | 19 | import com.example.moudle_pedometer.R; |
| 17 | 20 | ||
| @@ -22,7 +25,7 @@ import java.util.List; | @@ -22,7 +25,7 @@ import java.util.List; | ||
| 22 | */ | 25 | */ |
| 23 | public class LineUpAgainAdapter extends RecyclerView.Adapter<LineUpAgainAdapter.MyHolder> { | 26 | public class LineUpAgainAdapter extends RecyclerView.Adapter<LineUpAgainAdapter.MyHolder> { |
| 24 | 27 | ||
| 25 | - private List<String> list; | 28 | + private List<FailedEntity> list; |
| 26 | private Context context; | 29 | private Context context; |
| 27 | private OnClickListener onClickListener; | 30 | private OnClickListener onClickListener; |
| 28 | 31 | ||
| @@ -30,7 +33,7 @@ public class LineUpAgainAdapter extends RecyclerView.Adapter<LineUpAgainAdapter. | @@ -30,7 +33,7 @@ public class LineUpAgainAdapter extends RecyclerView.Adapter<LineUpAgainAdapter. | ||
| 30 | this.onClickListener = onClickListener; | 33 | this.onClickListener = onClickListener; |
| 31 | } | 34 | } |
| 32 | 35 | ||
| 33 | - public LineUpAgainAdapter(List<String> list, Context context) { | 36 | + public LineUpAgainAdapter(List<FailedEntity> list, Context context) { |
| 34 | this.list = list; | 37 | this.list = list; |
| 35 | this.context = context; | 38 | this.context = context; |
| 36 | } | 39 | } |
| @@ -38,15 +41,33 @@ public class LineUpAgainAdapter extends RecyclerView.Adapter<LineUpAgainAdapter. | @@ -38,15 +41,33 @@ public class LineUpAgainAdapter extends RecyclerView.Adapter<LineUpAgainAdapter. | ||
| 38 | @NonNull | 41 | @NonNull |
| 39 | @Override | 42 | @Override |
| 40 | public MyHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) { | 43 | public MyHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) { |
| 41 | - View view = LayoutInflater.from(context).inflate(R.layout.line_up__item_view,viewGroup,false); | 44 | + View view = LayoutInflater.from(context).inflate(R.layout.line_up__item_view, viewGroup, false); |
| 42 | return new MyHolder(view); | 45 | return new MyHolder(view); |
| 43 | } | 46 | } |
| 44 | 47 | ||
| 45 | @Override | 48 | @Override |
| 46 | public void onBindViewHolder(@NonNull MyHolder myHolder, int i) { | 49 | public void onBindViewHolder(@NonNull MyHolder myHolder, int i) { |
| 47 | 50 | ||
| 48 | -// myHolder.again_up.setOnClickListener(v -> ); | ||
| 49 | - if(onClickListener != null) myHolder.ry_re.setOnClickListener(v -> onClickListener.onClickListener(list.get(i),i)); | 51 | + if (onClickListener != null) { |
| 52 | + myHolder.ry_re.setOnClickListener(v -> onClickListener.onClickListener(list.get(i), i)); | ||
| 53 | + } | ||
| 54 | + //设置视图数据 | ||
| 55 | + if (myHolder != null) { | ||
| 56 | + //设置数据创建时间 | ||
| 57 | + myHolder.up_day.setText(TimeUtil.getStampToTime(list.get(i).getCreatTimeStamp()*1000, "MM月dd日")); | ||
| 58 | + myHolder.up_record_time.setText(TimeUtil.getStampToTime(list.get(i).getCreatTimeStamp()*1000, " HH:mm")); | ||
| 59 | + //设置赛道标题 | ||
| 60 | + myHolder.up_item_title.setText(list.get(i).getStreetTitle()); | ||
| 61 | + //设置公里 | ||
| 62 | + myHolder.up_kilometer_num.setText(list.get(i).getDistance()); | ||
| 63 | + Log.e("时间", "onBindViewHolder: "+list.get(i).getTime() ); | ||
| 64 | + //设置运动时间 | ||
| 65 | + myHolder.up_record_minit.setText(TimeUtil.stampToChronometer(Long.parseLong(list.get(i).getTime()))); | ||
| 66 | + //设置配速 | ||
| 67 | + myHolder.up_record_speed.setText(list.get(i).getSpeed()); | ||
| 68 | + //设置步数 | ||
| 69 | + myHolder.up_record_step.setText(list.get(i).getStep()); | ||
| 70 | + } | ||
| 50 | 71 | ||
| 51 | } | 72 | } |
| 52 | 73 | ||
| @@ -55,7 +76,7 @@ public class LineUpAgainAdapter extends RecyclerView.Adapter<LineUpAgainAdapter. | @@ -55,7 +76,7 @@ public class LineUpAgainAdapter extends RecyclerView.Adapter<LineUpAgainAdapter. | ||
| 55 | return list.size(); | 76 | return list.size(); |
| 56 | } | 77 | } |
| 57 | 78 | ||
| 58 | - class MyHolder extends RecyclerView.ViewHolder{ | 79 | + class MyHolder extends RecyclerView.ViewHolder { |
| 59 | 80 | ||
| 60 | TextView up_day; | 81 | TextView up_day; |
| 61 | TextView up_record_time; | 82 | TextView up_record_time; |
| @@ -84,7 +105,7 @@ public class LineUpAgainAdapter extends RecyclerView.Adapter<LineUpAgainAdapter. | @@ -84,7 +105,7 @@ public class LineUpAgainAdapter extends RecyclerView.Adapter<LineUpAgainAdapter. | ||
| 84 | } | 105 | } |
| 85 | 106 | ||
| 86 | 107 | ||
| 87 | - public interface OnClickListener{ | ||
| 88 | - void onClickListener(String bean, int position); | 108 | + public interface OnClickListener { |
| 109 | + void onClickListener(FailedEntity bean, int position); | ||
| 89 | } | 110 | } |
| 90 | } | 111 | } |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/fragment/LineUpAgainFragment.java
| @@ -32,7 +32,6 @@ public class LineUpAgainFragment extends MvpBindingFragment<LineUpAgainView, Lin | @@ -32,7 +32,6 @@ public class LineUpAgainFragment extends MvpBindingFragment<LineUpAgainView, Lin | ||
| 32 | public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { | 32 | public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { |
| 33 | super.onViewCreated(view, savedInstanceState); | 33 | super.onViewCreated(view, savedInstanceState); |
| 34 | if(getMvpView() != null) getMvpView().initView(); | 34 | if(getMvpView() != null) getMvpView().initView(); |
| 35 | - getPresenter().getData(); | ||
| 36 | binding.refreshLayout.setEnableLoadMore(false); | 35 | binding.refreshLayout.setEnableLoadMore(false); |
| 37 | binding.refreshLayout.setEnableRefresh(false); | 36 | binding.refreshLayout.setEnableRefresh(false); |
| 38 | } | 37 | } |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/fragment/SelfRecordFragment.java
| 1 | package com.cnlive.moudle.pedometer.ui.fragment; | 1 | package com.cnlive.moudle.pedometer.ui.fragment; |
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | +import android.content.Context; | ||
| 4 | import android.os.Bundle; | 5 | import android.os.Bundle; |
| 5 | import android.support.annotation.NonNull; | 6 | import android.support.annotation.NonNull; |
| 6 | import android.support.annotation.Nullable; | 7 | import android.support.annotation.Nullable; |
| @@ -10,21 +11,29 @@ import com.cnlive.libs.base.frame.fragment.MvpBindingFragment; | @@ -10,21 +11,29 @@ import com.cnlive.libs.base.frame.fragment.MvpBindingFragment; | ||
| 10 | import com.cnlive.moudle.pedometer.commonInfo.CommonInfo; | 11 | import com.cnlive.moudle.pedometer.commonInfo.CommonInfo; |
| 11 | import com.cnlive.moudle.pedometer.frame.presenter.SelfRecordPresenter; | 12 | import com.cnlive.moudle.pedometer.frame.presenter.SelfRecordPresenter; |
| 12 | import com.cnlive.moudle.pedometer.frame.view.SelfRecordView; | 13 | import com.cnlive.moudle.pedometer.frame.view.SelfRecordView; |
| 14 | +import com.cnlive.moudle.pedometer.sql.entity.FailedEntity; | ||
| 15 | +import com.cnlive.moudle.pedometer.utils.StepUtil; | ||
| 13 | import com.example.moudle_pedometer.R; | 16 | import com.example.moudle_pedometer.R; |
| 14 | import com.example.moudle_pedometer.databinding.FragmentSelfRecordBinding; | 17 | import com.example.moudle_pedometer.databinding.FragmentSelfRecordBinding; |
| 15 | import com.scwang.smartrefresh.layout.api.RefreshLayout; | 18 | import com.scwang.smartrefresh.layout.api.RefreshLayout; |
| 16 | import com.scwang.smartrefresh.layout.listener.OnLoadMoreListener; | 19 | import com.scwang.smartrefresh.layout.listener.OnLoadMoreListener; |
| 17 | import com.scwang.smartrefresh.layout.listener.OnRefreshListener; | 20 | import com.scwang.smartrefresh.layout.listener.OnRefreshListener; |
| 18 | 21 | ||
| 22 | +import java.util.List; | ||
| 23 | + | ||
| 24 | +import q.rorbin.badgeview.QBadgeView; | ||
| 25 | + | ||
| 19 | /** | 26 | /** |
| 20 | * Created by hanyayun 019/06/12. | 27 | * Created by hanyayun 019/06/12. |
| 21 | */ | 28 | */ |
| 22 | -public class SelfRecordFragment extends MvpBindingFragment<SelfRecordView, SelfRecordPresenter,Object, FragmentSelfRecordBinding> { | 29 | +public class SelfRecordFragment extends MvpBindingFragment<SelfRecordView, SelfRecordPresenter, Object, FragmentSelfRecordBinding> { |
| 23 | 30 | ||
| 24 | 31 | ||
| 25 | public int currentPage = 1; | 32 | public int currentPage = 1; |
| 26 | public int pageSize = 10; | 33 | public int pageSize = 10; |
| 27 | public int completeStatus = 0; | 34 | public int completeStatus = 0; |
| 35 | + private QBadgeView qBadgeView; | ||
| 36 | + | ||
| 28 | public SelfRecordFragment() { | 37 | public SelfRecordFragment() { |
| 29 | // Required empty public constructor | 38 | // Required empty public constructor |
| 30 | } | 39 | } |
| @@ -33,7 +42,7 @@ public class SelfRecordFragment extends MvpBindingFragment<SelfRecordView, SelfR | @@ -33,7 +42,7 @@ public class SelfRecordFragment extends MvpBindingFragment<SelfRecordView, SelfR | ||
| 33 | @Override | 42 | @Override |
| 34 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { | 43 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { |
| 35 | super.onViewCreated(view, savedInstanceState); | 44 | super.onViewCreated(view, savedInstanceState); |
| 36 | - if(getMvpView() != null) getMvpView().initView(); | 45 | + if (getMvpView() != null) getMvpView().initView(); |
| 37 | getData(-1); | 46 | getData(-1); |
| 38 | 47 | ||
| 39 | binding.hasFinish.setOnClickListener(v -> getData(0)); | 48 | binding.hasFinish.setOnClickListener(v -> getData(0)); |
| @@ -52,20 +61,22 @@ public class SelfRecordFragment extends MvpBindingFragment<SelfRecordView, SelfR | @@ -52,20 +61,22 @@ public class SelfRecordFragment extends MvpBindingFragment<SelfRecordView, SelfR | ||
| 52 | getData(-1); | 61 | getData(-1); |
| 53 | } | 62 | } |
| 54 | }); | 63 | }); |
| 64 | + | ||
| 65 | +// getMvpView().onCheckFailDataCount(getActivity()); | ||
| 55 | } | 66 | } |
| 56 | 67 | ||
| 57 | - private void getData(int completeStatus){ | ||
| 58 | - if(completeStatus == -1){ | ||
| 59 | - getPresenter().getData(getActivity(),CommonInfo.getUserId(getActivity()),completeStatus,currentPage,pageSize); | ||
| 60 | - }else { | 68 | + private void getData(int completeStatus) { |
| 69 | + if (completeStatus == -1) { | ||
| 70 | + getPresenter().getData(getActivity(), CommonInfo.getUserId(getActivity()), completeStatus, currentPage, pageSize); | ||
| 71 | + } else { | ||
| 61 | this.completeStatus = currentPage; | 72 | this.completeStatus = currentPage; |
| 62 | - getPresenter().getData(getActivity(), CommonInfo.getUserId(getActivity()),completeStatus,currentPage,pageSize); | ||
| 63 | - if(completeStatus == 0){ | 73 | + getPresenter().getData(getActivity(), CommonInfo.getUserId(getActivity()), completeStatus, currentPage, pageSize); |
| 74 | + if (completeStatus == 0) { | ||
| 64 | binding.hasFinish.setTextColor(getActivity().getResources().getColor(R.color.green_tx)); | 75 | binding.hasFinish.setTextColor(getActivity().getResources().getColor(R.color.green_tx)); |
| 65 | binding.hasFinish.setTextSize(18); | 76 | binding.hasFinish.setTextSize(18); |
| 66 | binding.noFinish.setTextColor(getActivity().getResources().getColor(R.color.text_black)); | 77 | binding.noFinish.setTextColor(getActivity().getResources().getColor(R.color.text_black)); |
| 67 | binding.noFinish.setTextSize(15); | 78 | binding.noFinish.setTextSize(15); |
| 68 | - }else { | 79 | + } else { |
| 69 | binding.hasFinish.setTextColor(getActivity().getResources().getColor(R.color.text_black)); | 80 | binding.hasFinish.setTextColor(getActivity().getResources().getColor(R.color.text_black)); |
| 70 | binding.hasFinish.setTextSize(15); | 81 | binding.hasFinish.setTextSize(15); |
| 71 | binding.noFinish.setTextColor(getActivity().getResources().getColor(R.color.green_tx)); | 82 | binding.noFinish.setTextColor(getActivity().getResources().getColor(R.color.green_tx)); |
| @@ -79,4 +90,28 @@ public class SelfRecordFragment extends MvpBindingFragment<SelfRecordView, SelfR | @@ -79,4 +90,28 @@ public class SelfRecordFragment extends MvpBindingFragment<SelfRecordView, SelfR | ||
| 79 | protected int getLayoutId() { | 90 | protected int getLayoutId() { |
| 80 | return R.layout.fragment_self_record; | 91 | return R.layout.fragment_self_record; |
| 81 | } | 92 | } |
| 93 | + | ||
| 94 | + @Override | ||
| 95 | + public void onResume() { | ||
| 96 | + super.onResume(); | ||
| 97 | + if (getMvpView() == null) { | ||
| 98 | + return; | ||
| 99 | + } | ||
| 100 | + onCheckFailDataCount(); | ||
| 101 | + | ||
| 102 | + } | ||
| 103 | + | ||
| 104 | + public void onCheckFailDataCount() { | ||
| 105 | + //初始化 | ||
| 106 | + if (qBadgeView == null) { | ||
| 107 | + qBadgeView = new QBadgeView(getActivity()); | ||
| 108 | + qBadgeView.bindTarget(binding.againUp); | ||
| 109 | + qBadgeView.setBadgeTextSize(10, true); | ||
| 110 | +// qBadgeView.setGravityOffset(0, -5, true); | ||
| 111 | + } | ||
| 112 | + List<FailedEntity> failedEntities = StepUtil.getFailListData(getActivity(), CommonInfo.getUserId(getActivity())); | ||
| 113 | + if (failedEntities != null) { | ||
| 114 | + qBadgeView.setBadgeNumber(failedEntities.size()); | ||
| 115 | + } | ||
| 116 | + } | ||
| 82 | } | 117 | } |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/utils/StepUtil.java
| @@ -6,13 +6,16 @@ import android.util.Log; | @@ -6,13 +6,16 @@ import android.util.Log; | ||
| 6 | 6 | ||
| 7 | import com.cnlive.moudle.pedometer.commonInfo.CommonInfo; | 7 | import com.cnlive.moudle.pedometer.commonInfo.CommonInfo; |
| 8 | import com.cnlive.moudle.pedometer.model.Constant; | 8 | import com.cnlive.moudle.pedometer.model.Constant; |
| 9 | +import com.cnlive.moudle.pedometer.sql.dao.FailedEntityDao; | ||
| 9 | import com.cnlive.moudle.pedometer.sql.dao.UserStepEntityDao; | 10 | import com.cnlive.moudle.pedometer.sql.dao.UserStepEntityDao; |
| 10 | import com.cnlive.moudle.pedometer.sql.db.DbCore; | 11 | import com.cnlive.moudle.pedometer.sql.db.DbCore; |
| 12 | +import com.cnlive.moudle.pedometer.sql.entity.FailedEntity; | ||
| 11 | import com.cnlive.moudle.pedometer.sql.entity.UserStepEntity; | 13 | import com.cnlive.moudle.pedometer.sql.entity.UserStepEntity; |
| 12 | 14 | ||
| 13 | import java.text.SimpleDateFormat; | 15 | import java.text.SimpleDateFormat; |
| 14 | import java.util.Date; | 16 | import java.util.Date; |
| 15 | import java.util.List; | 17 | import java.util.List; |
| 18 | +import java.util.UUID; | ||
| 16 | 19 | ||
| 17 | import static android.support.constraint.Constraints.TAG; | 20 | import static android.support.constraint.Constraints.TAG; |
| 18 | 21 | ||
| @@ -25,6 +28,46 @@ public class StepUtil { | @@ -25,6 +28,46 @@ public class StepUtil { | ||
| 25 | private static final String TAG = "StepUtil"; | 28 | private static final String TAG = "StepUtil"; |
| 26 | private static final String dbName = "Step.db"; | 29 | private static final String dbName = "Step.db"; |
| 27 | 30 | ||
| 31 | + public static String getUUID() { | ||
| 32 | + return UUID.randomUUID().toString().replace("-", ""); | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | + //获取上传失败列表 | ||
| 36 | + public static List<FailedEntity> getFailListData(Context context, String uid) { | ||
| 37 | + DbCore.init(context, dbName); | ||
| 38 | + List<FailedEntity> list = DbCore.getDaoSession().getFailedEntityDao().queryBuilder().where(FailedEntityDao.Properties.Uid.eq(uid)).list(); | ||
| 39 | + return list; | ||
| 40 | + } | ||
| 41 | + | ||
| 42 | + //设置失败数据 | ||
| 43 | + public static void setFailData(Context context, FailedEntity failedEntity) { | ||
| 44 | + DbCore.init(context, dbName); | ||
| 45 | + DbCore.getDaoSession().getFailedEntityDao().insert(failedEntity); | ||
| 46 | + } | ||
| 47 | + | ||
| 48 | + /** | ||
| 49 | + * 设置赛事标题 | ||
| 50 | + * | ||
| 51 | + * @param context | ||
| 52 | + * @param uid | ||
| 53 | + * @param streetTitle | ||
| 54 | + */ | ||
| 55 | + public static void setStreetTitle(Context context, String uid, String streetTitle) { | ||
| 56 | + if (getUserStepData(context, uid) != null) { | ||
| 57 | + UserStepEntity entity = getUserStepData(context, uid); | ||
| 58 | + entity.setStreetTitle(streetTitle); | ||
| 59 | + //更新数据 | ||
| 60 | + updateStepData(context, entity); | ||
| 61 | + } | ||
| 62 | + } | ||
| 63 | + | ||
| 64 | + /** | ||
| 65 | + * 设置重要点 | ||
| 66 | + * | ||
| 67 | + * @param context | ||
| 68 | + * @param uid | ||
| 69 | + * @param importStr | ||
| 70 | + */ | ||
| 28 | public static void setImportPoints(Context context, String uid, String importStr) { | 71 | public static void setImportPoints(Context context, String uid, String importStr) { |
| 29 | if (getUserStepData(context, uid) != null) { | 72 | if (getUserStepData(context, uid) != null) { |
| 30 | UserStepEntity entity = getUserStepData(context, uid); | 73 | UserStepEntity entity = getUserStepData(context, uid); |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/utils/TimeUtil.java
| @@ -11,6 +11,37 @@ import java.util.Date; | @@ -11,6 +11,37 @@ import java.util.Date; | ||
| 11 | */ | 11 | */ |
| 12 | public class TimeUtil { | 12 | public class TimeUtil { |
| 13 | 13 | ||
| 14 | + // public static String stampToChronometer(long stamp){ | ||
| 15 | +//// int hour=stamp/60/60 | ||
| 16 | +// } | ||
| 17 | + public static String stampToChronometer(long mss) { | ||
| 18 | + String DateTimes = ""; | ||
| 19 | + long days = mss / (60 * 60 * 24); | ||
| 20 | + long hours = (mss % (60 * 60 * 24)) / (60 * 60); | ||
| 21 | + long minutes = (mss % (60 * 60)) / 60; | ||
| 22 | + long seconds = mss % 60; | ||
| 23 | + | ||
| 24 | + if (hours < 10) { | ||
| 25 | + DateTimes += "0" + hours + ":"; | ||
| 26 | + } else { | ||
| 27 | + DateTimes += hours + ":"; | ||
| 28 | + } | ||
| 29 | + | ||
| 30 | + if (minutes < 10) { | ||
| 31 | + DateTimes += "0" + minutes + ":"; | ||
| 32 | + } else { | ||
| 33 | + DateTimes += minutes + ":"; | ||
| 34 | + | ||
| 35 | + } | ||
| 36 | + if (seconds < 10) { | ||
| 37 | + DateTimes += "0" + seconds; | ||
| 38 | + } else { | ||
| 39 | + DateTimes += seconds; | ||
| 40 | + | ||
| 41 | + } | ||
| 42 | + return DateTimes; | ||
| 43 | + } | ||
| 44 | + | ||
| 14 | /** | 45 | /** |
| 15 | * 日期格式字符串转换成时间戳 | 46 | * 日期格式字符串转换成时间戳 |
| 16 | * | 47 | * |
moudle_pedometer/src/main/res/layout/line_up__item_view.xml
| @@ -4,42 +4,43 @@ | @@ -4,42 +4,43 @@ | ||
| 4 | <data> | 4 | <data> |
| 5 | 5 | ||
| 6 | </data> | 6 | </data> |
| 7 | + | ||
| 7 | <RelativeLayout | 8 | <RelativeLayout |
| 8 | android:id="@+id/ry_re" | 9 | android:id="@+id/ry_re" |
| 9 | android:layout_width="match_parent" | 10 | android:layout_width="match_parent" |
| 10 | android:layout_height="wrap_content" | 11 | android:layout_height="wrap_content" |
| 11 | - android:background="@color/white" | ||
| 12 | - android:layout_marginTop="10dp" | ||
| 13 | android:layout_marginLeft="10dp" | 12 | android:layout_marginLeft="10dp" |
| 13 | + android:layout_marginTop="10dp" | ||
| 14 | android:layout_marginRight="10dp" | 14 | android:layout_marginRight="10dp" |
| 15 | + android:background="@color/white" | ||
| 15 | android:padding="10dp"> | 16 | android:padding="10dp"> |
| 16 | 17 | ||
| 17 | <TextView | 18 | <TextView |
| 18 | android:id="@+id/up_day" | 19 | android:id="@+id/up_day" |
| 19 | android:layout_width="wrap_content" | 20 | android:layout_width="wrap_content" |
| 20 | android:layout_height="wrap_content" | 21 | android:layout_height="wrap_content" |
| 22 | + android:text="5月1日" | ||
| 21 | android:textColor="#333333" | 23 | android:textColor="#333333" |
| 22 | - android:textSize="14sp" | ||
| 23 | - android:text="5月1日" /> | 24 | + android:textSize="14sp" /> |
| 24 | 25 | ||
| 25 | <TextView | 26 | <TextView |
| 26 | android:id="@+id/up_record_time" | 27 | android:id="@+id/up_record_time" |
| 27 | android:layout_width="wrap_content" | 28 | android:layout_width="wrap_content" |
| 28 | android:layout_height="wrap_content" | 29 | android:layout_height="wrap_content" |
| 29 | - android:layout_toRightOf="@id/up_day" | ||
| 30 | android:layout_marginLeft="15dp" | 30 | android:layout_marginLeft="15dp" |
| 31 | + android:layout_toRightOf="@id/up_day" | ||
| 32 | + android:text="15:30" | ||
| 31 | android:textColor="#999999" | 33 | android:textColor="#999999" |
| 32 | - android:textSize="14sp" | ||
| 33 | - android:text="15:30" /> | 34 | + android:textSize="14sp" /> |
| 34 | 35 | ||
| 35 | <TextView | 36 | <TextView |
| 36 | android:layout_width="wrap_content" | 37 | android:layout_width="wrap_content" |
| 37 | android:layout_height="wrap_content" | 38 | android:layout_height="wrap_content" |
| 39 | + android:layout_alignParentRight="true" | ||
| 38 | android:layout_marginRight="10dp" | 40 | android:layout_marginRight="10dp" |
| 39 | - android:textColor="#FE4E4E" | ||
| 40 | - android:textSize="12sp" | ||
| 41 | android:text="@string/up_fail" | 41 | android:text="@string/up_fail" |
| 42 | - android:layout_alignParentRight="true"/> | 42 | + android:textColor="#FE4E4E" |
| 43 | + android:textSize="12sp" /> | ||
| 43 | 44 | ||
| 44 | <LinearLayout | 45 | <LinearLayout |
| 45 | android:id="@+id/ly" | 46 | android:id="@+id/ly" |
| @@ -65,33 +66,34 @@ | @@ -65,33 +66,34 @@ | ||
| 65 | android:id="@+id/up_item_title" | 66 | android:id="@+id/up_item_title" |
| 66 | android:layout_width="wrap_content" | 67 | android:layout_width="wrap_content" |
| 67 | android:layout_height="wrap_content" | 68 | android:layout_height="wrap_content" |
| 68 | - android:textSize="12sp" | 69 | + android:text="奥森南园跑道" |
| 69 | android:textColor="#333333" | 70 | android:textColor="#333333" |
| 70 | - android:text="奥森南园跑道" /> | 71 | + android:textSize="12sp" /> |
| 71 | 72 | ||
| 72 | <LinearLayout | 73 | <LinearLayout |
| 73 | android:layout_width="wrap_content" | 74 | android:layout_width="wrap_content" |
| 74 | android:layout_height="wrap_content" | 75 | android:layout_height="wrap_content" |
| 75 | android:layout_centerVertical="true" | 76 | android:layout_centerVertical="true" |
| 76 | android:orientation="horizontal"> | 77 | android:orientation="horizontal"> |
| 78 | + | ||
| 77 | <TextView | 79 | <TextView |
| 78 | android:id="@+id/up_kilometer_num" | 80 | android:id="@+id/up_kilometer_num" |
| 79 | android:layout_width="wrap_content" | 81 | android:layout_width="wrap_content" |
| 80 | android:layout_height="wrap_content" | 82 | android:layout_height="wrap_content" |
| 83 | + android:layout_centerVertical="true" | ||
| 84 | + android:layout_marginTop="5dp" | ||
| 81 | android:text="1.23" | 85 | android:text="1.23" |
| 82 | android:textColor="#333333" | 86 | android:textColor="#333333" |
| 83 | - android:textSize="30sp" | ||
| 84 | - android:layout_centerVertical="true" | ||
| 85 | - /> | 87 | + android:textSize="30sp" /> |
| 86 | 88 | ||
| 87 | <TextView | 89 | <TextView |
| 88 | android:layout_width="wrap_content" | 90 | android:layout_width="wrap_content" |
| 89 | android:layout_height="wrap_content" | 91 | android:layout_height="wrap_content" |
| 90 | android:layout_centerVertical="true" | 92 | android:layout_centerVertical="true" |
| 93 | + android:layout_marginLeft="5dp" | ||
| 91 | android:text="@string/kilometer" | 94 | android:text="@string/kilometer" |
| 92 | android:textColor="#333333" | 95 | android:textColor="#333333" |
| 93 | - android:textSize="12sp" | ||
| 94 | - android:layout_marginLeft="5dp"/> | 96 | + android:textSize="12sp" /> |
| 95 | </LinearLayout> | 97 | </LinearLayout> |
| 96 | 98 | ||
| 97 | 99 | ||
| @@ -106,9 +108,9 @@ | @@ -106,9 +108,9 @@ | ||
| 106 | android:layout_height="wrap_content" | 108 | android:layout_height="wrap_content" |
| 107 | android:drawableRight="@drawable/time_cost" | 109 | android:drawableRight="@drawable/time_cost" |
| 108 | android:drawablePadding="5dp" | 110 | android:drawablePadding="5dp" |
| 111 | + android:text="00:27:23" | ||
| 109 | android:textColor="#333333" | 112 | android:textColor="#333333" |
| 110 | - android:textSize="13sp" | ||
| 111 | - android:text="00:27:23" /> | 113 | + android:textSize="13sp" /> |
| 112 | 114 | ||
| 113 | <TextView | 115 | <TextView |
| 114 | android:id="@+id/up_record_speed" | 116 | android:id="@+id/up_record_speed" |
| @@ -117,9 +119,9 @@ | @@ -117,9 +119,9 @@ | ||
| 117 | android:layout_marginLeft="20dp" | 119 | android:layout_marginLeft="20dp" |
| 118 | android:drawableRight="@drawable/speed" | 120 | android:drawableRight="@drawable/speed" |
| 119 | android:drawablePadding="5dp" | 121 | android:drawablePadding="5dp" |
| 122 | + android:text="22'22''" | ||
| 120 | android:textColor="#333333" | 123 | android:textColor="#333333" |
| 121 | - android:textSize="13sp" | ||
| 122 | - android:text="22'22''" /> | 124 | + android:textSize="13sp" /> |
| 123 | 125 | ||
| 124 | <TextView | 126 | <TextView |
| 125 | android:id="@+id/up_record_step" | 127 | android:id="@+id/up_record_step" |
| @@ -137,26 +139,24 @@ | @@ -137,26 +139,24 @@ | ||
| 137 | android:id="@+id/view" | 139 | android:id="@+id/view" |
| 138 | android:layout_width="match_parent" | 140 | android:layout_width="match_parent" |
| 139 | android:layout_height="1dp" | 141 | android:layout_height="1dp" |
| 140 | - android:background="@color/line" | ||
| 141 | android:layout_below="@id/ly" | 142 | android:layout_below="@id/ly" |
| 142 | - /> | 143 | + android:background="@color/line" /> |
| 143 | 144 | ||
| 144 | <TextView | 145 | <TextView |
| 145 | android:id="@+id/again_up" | 146 | android:id="@+id/again_up" |
| 146 | android:layout_width="wrap_content" | 147 | android:layout_width="wrap_content" |
| 147 | android:layout_height="wrap_content" | 148 | android:layout_height="wrap_content" |
| 148 | - android:layout_alignParentRight="true" | ||
| 149 | android:layout_below="@id/view" | 149 | android:layout_below="@id/view" |
| 150 | + android:layout_alignParentRight="true" | ||
| 150 | android:layout_marginTop="10dp" | 151 | android:layout_marginTop="10dp" |
| 151 | android:layout_marginRight="10dp" | 152 | android:layout_marginRight="10dp" |
| 152 | android:background="@drawable/green_raduis_bg" | 153 | android:background="@drawable/green_raduis_bg" |
| 153 | - android:text="@string/again_up" | ||
| 154 | - android:textColor="#36C28D" | ||
| 155 | - android:textSize="12sp" | 154 | + android:paddingLeft="10dp" |
| 156 | android:paddingTop="7dp" | 155 | android:paddingTop="7dp" |
| 157 | - android:paddingBottom="7dp" | ||
| 158 | android:paddingRight="10dp" | 156 | android:paddingRight="10dp" |
| 159 | - android:paddingLeft="10dp" | ||
| 160 | - /> | 157 | + android:paddingBottom="7dp" |
| 158 | + android:text="@string/again_up" | ||
| 159 | + android:textColor="#36C28D" | ||
| 160 | + android:textSize="12sp" /> | ||
| 161 | </RelativeLayout> | 161 | </RelativeLayout> |
| 162 | </layout> | 162 | </layout> |