Commit 26eb5e52841a1c7170f8a65ad903395ad4715e82
1 parent
5d7443d8
1 重新上传列表增加删除功能
2 修复"我的记录页面",点击重新上传记录,在上传成功后,我的记录页面数据未刷新问题 3 修改判断路线是否完成算法 4 修复从运动页点击返回按钮,再次进入运动页,小概率背景颜色消失的问题
Showing
16 changed files
with
217 additions
and
57 deletions
.idea/gradle.xml
| @@ -3,9 +3,6 @@ | @@ -3,9 +3,6 @@ | ||
| 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> | ||
| 9 | <option name="distributionType" value="DEFAULT_WRAPPED" /> | 6 | <option name="distributionType" value="DEFAULT_WRAPPED" /> |
| 10 | <option name="externalProjectPath" value="$PROJECT_DIR$" /> | 7 | <option name="externalProjectPath" value="$PROJECT_DIR$" /> |
| 11 | <option name="modules"> | 8 | <option name="modules"> |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/presenter/RunningFinishFragmetPresenter.java
| @@ -212,7 +212,7 @@ public class RunningFinishFragmetPresenter extends MvpBasePresenter<RunningFinis | @@ -212,7 +212,7 @@ public class RunningFinishFragmetPresenter extends MvpBasePresenter<RunningFinis | ||
| 212 | //判断用户是否点击暂停按钮 | 212 | //判断用户是否点击暂停按钮 |
| 213 | if (userStepEntity.getPauseCount() == 0) { | 213 | if (userStepEntity.getPauseCount() == 0) { |
| 214 | MyMapUtil.drawHistoryTrack(context, getView().baiduMap, resultPoints, SortType.asc, R.color.red, R.drawable.icon_start, R.drawable.icon_end); | 214 | MyMapUtil.drawHistoryTrack(context, getView().baiduMap, resultPoints, SortType.asc, R.color.red, R.drawable.icon_start, R.drawable.icon_end); |
| 215 | - MyMapUtil.setMapAutoZoom(getView().baiduMap, resultPoints, -2f); | 215 | + MyMapUtil.setMapAutoZoom(getView().baiduMap, resultPoints, -1.5f); |
| 216 | 216 | ||
| 217 | //没有点击暂停 | 217 | //没有点击暂停 |
| 218 | //先判断是否到达终点 | 218 | //先判断是否到达终点 |
| @@ -302,6 +302,8 @@ public class RunningFinishFragmetPresenter extends MvpBasePresenter<RunningFinis | @@ -302,6 +302,8 @@ public class RunningFinishFragmetPresenter extends MvpBasePresenter<RunningFinis | ||
| 302 | } | 302 | } |
| 303 | } | 303 | } |
| 304 | } | 304 | } |
| 305 | + } else { | ||
| 306 | + isArrive = true; | ||
| 305 | } | 307 | } |
| 306 | if (isArrive) { | 308 | if (isArrive) { |
| 307 | if (importPoints != null) { | 309 | if (importPoints != null) { |
| @@ -318,6 +320,9 @@ public class RunningFinishFragmetPresenter extends MvpBasePresenter<RunningFinis | @@ -318,6 +320,9 @@ public class RunningFinishFragmetPresenter extends MvpBasePresenter<RunningFinis | ||
| 318 | } else { | 320 | } else { |
| 319 | runningFinishBean.setIsFinish("0"); | 321 | runningFinishBean.setIsFinish("0"); |
| 320 | } | 322 | } |
| 323 | + if (null != getView()) { | ||
| 324 | + getView().updataIsFinish(runningFinishBean); | ||
| 325 | + } | ||
| 321 | } | 326 | } |
| 322 | 327 | ||
| 323 | /** | 328 | /** |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/presenter/RunningMapFragmentPresenter.java
| @@ -72,8 +72,8 @@ public class RunningMapFragmentPresenter extends MvpBasePresenter<RunningMapFrag | @@ -72,8 +72,8 @@ public class RunningMapFragmentPresenter extends MvpBasePresenter<RunningMapFrag | ||
| 72 | /** | 72 | /** |
| 73 | * 轨迹点集合 | 73 | * 轨迹点集合 |
| 74 | */ | 74 | */ |
| 75 | - 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"; | ||
| 76 | - private HashMap<Integer, Boolean> importHash; | 75 | +// 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"; |
| 76 | + private List<LatLng> importPoints; | ||
| 77 | 77 | ||
| 78 | /** | 78 | /** |
| 79 | * 查询运营人员踩得轨迹 | 79 | * 查询运营人员踩得轨迹 |
| @@ -319,7 +319,10 @@ public class RunningMapFragmentPresenter extends MvpBasePresenter<RunningMapFrag | @@ -319,7 +319,10 @@ public class RunningMapFragmentPresenter extends MvpBasePresenter<RunningMapFrag | ||
| 319 | //获取当前的实体名称 | 319 | //获取当前的实体名称 |
| 320 | String entityName = CommonInfo.getUserId(context); | 320 | String entityName = CommonInfo.getUserId(context); |
| 321 | //打的重要点 | 321 | //打的重要点 |
| 322 | - List<LatLng> importPoints = GsonUtil.jsonToList(imports, LatLng.class); | 322 | + importPoints = null; |
| 323 | + if (!TextUtils.isEmpty(userStepEntity.getImportPoint())) { | ||
| 324 | + importPoints = GsonUtil.jsonToList(userStepEntity.getImportPoint(), LatLng.class); | ||
| 325 | + } | ||
| 323 | MyMapUtil.queryHistoryTrace(context, StepService.mClient, entityName, startTime, endTime, new MyMapUtil.CallBack() { | 326 | MyMapUtil.queryHistoryTrace(context, StepService.mClient, entityName, startTime, endTime, new MyMapUtil.CallBack() { |
| 324 | @Override | 327 | @Override |
| 325 | public void success(List<LatLng> resultPoints) { | 328 | public void success(List<LatLng> resultPoints) { |
| @@ -371,7 +374,7 @@ public class RunningMapFragmentPresenter extends MvpBasePresenter<RunningMapFrag | @@ -371,7 +374,7 @@ public class RunningMapFragmentPresenter extends MvpBasePresenter<RunningMapFrag | ||
| 371 | } | 374 | } |
| 372 | } | 375 | } |
| 373 | //开始划线 | 376 | //开始划线 |
| 374 | - MyMapUtil.drawHistoryTrack(context, getView().baiduMap, resultPoints, SortType.asc, R.color.red, 0, R.drawable.icon_end); | 377 | + MyMapUtil.drawHistoryTrack(context, getView().baiduMap, resultPoints, SortType.asc, R.color.red, 0, R.drawable.icon_end); |
| 375 | 378 | ||
| 376 | } | 379 | } |
| 377 | } | 380 | } |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/presenter/UploadFailDetailFragmentPresenter.java
| @@ -16,6 +16,7 @@ import com.cnlive.libs.base.logic.callback.SuccessCallback; | @@ -16,6 +16,7 @@ import com.cnlive.libs.base.logic.callback.SuccessCallback; | ||
| 16 | import com.cnlive.moudle.pedometer.commonInfo.CommonInfo; | 16 | import com.cnlive.moudle.pedometer.commonInfo.CommonInfo; |
| 17 | import com.cnlive.moudle.pedometer.frame.view.UploadFailDetailFragmentView; | 17 | import com.cnlive.moudle.pedometer.frame.view.UploadFailDetailFragmentView; |
| 18 | import com.cnlive.moudle.pedometer.model.Constant; | 18 | import com.cnlive.moudle.pedometer.model.Constant; |
| 19 | +import com.cnlive.moudle.pedometer.model.MessageEvent; | ||
| 19 | import com.cnlive.moudle.pedometer.model.RunningFinishBean; | 20 | import com.cnlive.moudle.pedometer.model.RunningFinishBean; |
| 20 | import com.cnlive.moudle.pedometer.net.ApiServiceRunLin; | 21 | import com.cnlive.moudle.pedometer.net.ApiServiceRunLin; |
| 21 | import com.cnlive.moudle.pedometer.net.SubscriptionRequest; | 22 | import com.cnlive.moudle.pedometer.net.SubscriptionRequest; |
| @@ -31,6 +32,8 @@ import com.cnlive.moudle.pedometer.utils.StepUtil; | @@ -31,6 +32,8 @@ import com.cnlive.moudle.pedometer.utils.StepUtil; | ||
| 31 | import com.example.moudle_pedometer.R; | 32 | import com.example.moudle_pedometer.R; |
| 32 | import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter; | 33 | import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter; |
| 33 | 34 | ||
| 35 | +import org.greenrobot.eventbus.EventBus; | ||
| 36 | + | ||
| 34 | import java.util.HashMap; | 37 | import java.util.HashMap; |
| 35 | import java.util.List; | 38 | import java.util.List; |
| 36 | import java.util.Map; | 39 | import java.util.Map; |
| @@ -329,6 +332,8 @@ public class UploadFailDetailFragmentPresenter extends MvpBasePresenter<UploadFa | @@ -329,6 +332,8 @@ public class UploadFailDetailFragmentPresenter extends MvpBasePresenter<UploadFa | ||
| 329 | if (getView() == null) { | 332 | if (getView() == null) { |
| 330 | return; | 333 | return; |
| 331 | } | 334 | } |
| 335 | + //更新我的记录列表 | ||
| 336 | + EventBus.getDefault().post(new MessageEvent(Constant.UPDATE_MYSELF_RECORD_LIST, "")); | ||
| 332 | QMUITipDialogUtil.dismessDialog(); | 337 | QMUITipDialogUtil.dismessDialog(); |
| 333 | QMUITipDialogUtil.successDialog(context, "上传成功", 1); | 338 | QMUITipDialogUtil.successDialog(context, "上传成功", 1); |
| 334 | //删除暂存数据 | 339 | //删除暂存数据 |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/LineUpAgainView.java
| @@ -5,16 +5,21 @@ import android.view.View; | @@ -5,16 +5,21 @@ import android.view.View; | ||
| 5 | 5 | ||
| 6 | import com.cnlive.moudle.pedometer.commonInfo.CommonInfo; | 6 | import com.cnlive.moudle.pedometer.commonInfo.CommonInfo; |
| 7 | import com.cnlive.moudle.pedometer.frame.presenter.LineUpAgainPresenter; | 7 | import com.cnlive.moudle.pedometer.frame.presenter.LineUpAgainPresenter; |
| 8 | +import com.cnlive.moudle.pedometer.model.Constant; | ||
| 9 | +import com.cnlive.moudle.pedometer.model.MessageEvent; | ||
| 8 | import com.cnlive.moudle.pedometer.sql.entity.FailedEntity; | 10 | import com.cnlive.moudle.pedometer.sql.entity.FailedEntity; |
| 9 | import com.cnlive.moudle.pedometer.ui.activity.UploadFailDetailActivity; | 11 | import com.cnlive.moudle.pedometer.ui.activity.UploadFailDetailActivity; |
| 10 | import com.cnlive.moudle.pedometer.ui.adapter.LineUpAgainAdapter; | 12 | import com.cnlive.moudle.pedometer.ui.adapter.LineUpAgainAdapter; |
| 11 | import com.cnlive.moudle.pedometer.ui.fragment.LineUpAgainFragment; | 13 | import com.cnlive.moudle.pedometer.ui.fragment.LineUpAgainFragment; |
| 14 | +import com.cnlive.moudle.pedometer.ui.widget.SelectDialog; | ||
| 12 | import com.cnlive.moudle.pedometer.utils.StepUtil; | 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.hannesdorfmann.mosby3.mvp.MvpView; | 17 | import com.hannesdorfmann.mosby3.mvp.MvpView; |
| 15 | import com.scwang.smartrefresh.layout.footer.ClassicsFooter; | 18 | import com.scwang.smartrefresh.layout.footer.ClassicsFooter; |
| 16 | import com.scwang.smartrefresh.layout.header.ClassicsHeader; | 19 | import com.scwang.smartrefresh.layout.header.ClassicsHeader; |
| 17 | 20 | ||
| 21 | +import org.greenrobot.eventbus.EventBus; | ||
| 22 | + | ||
| 18 | import java.util.ArrayList; | 23 | import java.util.ArrayList; |
| 19 | import java.util.List; | 24 | import java.util.List; |
| 20 | 25 | ||
| @@ -51,6 +56,31 @@ public class LineUpAgainView implements MvpView { | @@ -51,6 +56,31 @@ public class LineUpAgainView implements MvpView { | ||
| 51 | UploadFailDetailActivity.startActivity(fragment.getActivity(), bean); | 56 | UploadFailDetailActivity.startActivity(fragment.getActivity(), bean); |
| 52 | } | 57 | } |
| 53 | }); | 58 | }); |
| 59 | + //设置点击删除按钮点击事件 | ||
| 60 | + againAdapter.setOnDeleteClickListener(new LineUpAgainAdapter.OnDeleteClickListener() { | ||
| 61 | + @Override | ||
| 62 | + public void onDeleteClickListener(int position) { | ||
| 63 | + SelectDialog selectDialog = new SelectDialog(fragment.getActivity(), "确认删除该条记录?", "取消", new SelectDialog.DialogInterface() { | ||
| 64 | + @Override | ||
| 65 | + public void onClick(SelectDialog dialog) { | ||
| 66 | + dialog.dismiss(); | ||
| 67 | + } | ||
| 68 | + }, "删除", new SelectDialog.DialogInterface() { | ||
| 69 | + @Override | ||
| 70 | + public void onClick(SelectDialog dialog) { | ||
| 71 | + dialog.dismiss(); | ||
| 72 | + if (null != failedEntities && null != failedEntities.get(position) && null != againAdapter) { | ||
| 73 | + StepUtil.deleteTempSaveFailData(fragment.getActivity(), failedEntities.get(position)); | ||
| 74 | + //先删除数据库,再更新列表 | ||
| 75 | + againAdapter.updateDeleteList(position); | ||
| 76 | + } | ||
| 77 | + } | ||
| 78 | + }); | ||
| 79 | + selectDialog.setCancelable(false); | ||
| 80 | + selectDialog.setCanceledOnTouchOutside(false); | ||
| 81 | + selectDialog.show(); | ||
| 82 | + } | ||
| 83 | + }); | ||
| 54 | //设置重新上传按钮点击事件 | 84 | //设置重新上传按钮点击事件 |
| 55 | againAdapter.setOnRestartUploadClickListener(new LineUpAgainAdapter.OnRestartUploadClickListener() { | 85 | againAdapter.setOnRestartUploadClickListener(new LineUpAgainAdapter.OnRestartUploadClickListener() { |
| 56 | @Override | 86 | @Override |
| @@ -61,6 +91,8 @@ public class LineUpAgainView implements MvpView { | @@ -61,6 +91,8 @@ public class LineUpAgainView implements MvpView { | ||
| 61 | fragment.getPresenter().queryHistoryTraceNoMap(fragment.getActivity(), failedEntity, new LineUpAgainPresenter.onResultListener() { | 91 | fragment.getPresenter().queryHistoryTraceNoMap(fragment.getActivity(), failedEntity, new LineUpAgainPresenter.onResultListener() { |
| 62 | @Override | 92 | @Override |
| 63 | public void onSuccess() { | 93 | public void onSuccess() { |
| 94 | + //更新我的记录列表 | ||
| 95 | + EventBus.getDefault().post(new MessageEvent(Constant.UPDATE_MYSELF_RECORD_LIST, "")); | ||
| 64 | //刷新列表 | 96 | //刷新列表 |
| 65 | List<FailedEntity> failedEntities = StepUtil.getFailListData(fragment.getActivity(), CommonInfo.getUserId(fragment.getActivity())); | 97 | List<FailedEntity> failedEntities = StepUtil.getFailListData(fragment.getActivity(), CommonInfo.getUserId(fragment.getActivity())); |
| 66 | if (failedEntities == null || failedEntities.size() < 1) { | 98 | if (failedEntities == null || failedEntities.size() < 1) { |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RunMainFragmentView.java
| @@ -433,7 +433,8 @@ public class RunMainFragmentView implements MvpView { | @@ -433,7 +433,8 @@ public class RunMainFragmentView implements MvpView { | ||
| 433 | runningFinishBean.setStreetTitle(userStepEntity.getStreetTitle()); | 433 | runningFinishBean.setStreetTitle(userStepEntity.getStreetTitle()); |
| 434 | //设置用时 | 434 | //设置用时 |
| 435 | runningFinishBean.setEmployTime(employTime); | 435 | runningFinishBean.setEmployTime(employTime); |
| 436 | - | 436 | + //刷新一遍数据 |
| 437 | + userStepEntity = StepUtil.getUserStepData(getContext(), uid); | ||
| 437 | //先将失败数据保存起来 | 438 | //先将失败数据保存起来 |
| 438 | if (runningFinishBean != null && userStepEntity != null) { | 439 | if (runningFinishBean != null && userStepEntity != null) { |
| 439 | setFailData(getContext(), userStepEntity, runningFinishBean); | 440 | setFailData(getContext(), userStepEntity, runningFinishBean); |
| @@ -562,6 +563,7 @@ public class RunMainFragmentView implements MvpView { | @@ -562,6 +563,7 @@ public class RunMainFragmentView implements MvpView { | ||
| 562 | if (getContext() == null) { | 563 | if (getContext() == null) { |
| 563 | return; | 564 | return; |
| 564 | } | 565 | } |
| 566 | + | ||
| 565 | fragment.getActivity().finish(); | 567 | fragment.getActivity().finish(); |
| 566 | } | 568 | } |
| 567 | }); | 569 | }); |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RunningFinishFragmentView.java
| @@ -14,8 +14,10 @@ import com.baidu.trace.model.SortType; | @@ -14,8 +14,10 @@ import com.baidu.trace.model.SortType; | ||
| 14 | import com.bumptech.glide.Glide; | 14 | import com.bumptech.glide.Glide; |
| 15 | import com.cnlive.moudle.pedometer.commonInfo.CommonInfo; | 15 | import com.cnlive.moudle.pedometer.commonInfo.CommonInfo; |
| 16 | import com.cnlive.moudle.pedometer.model.RunningFinishBean; | 16 | import com.cnlive.moudle.pedometer.model.RunningFinishBean; |
| 17 | +import com.cnlive.moudle.pedometer.sql.entity.UserStepEntity; | ||
| 17 | import com.cnlive.moudle.pedometer.ui.fragment.RunningFinishFragment; | 18 | import com.cnlive.moudle.pedometer.ui.fragment.RunningFinishFragment; |
| 18 | import com.cnlive.moudle.pedometer.ui.fragment.RunningMapFragment; | 19 | import com.cnlive.moudle.pedometer.ui.fragment.RunningMapFragment; |
| 20 | +import com.cnlive.moudle.pedometer.ui.widget.SelectDialog; | ||
| 19 | import com.cnlive.moudle.pedometer.utils.MyMapUtil; | 21 | import com.cnlive.moudle.pedometer.utils.MyMapUtil; |
| 20 | import com.cnlive.moudle.pedometer.utils.QMUITipDialogUtil; | 22 | import com.cnlive.moudle.pedometer.utils.QMUITipDialogUtil; |
| 21 | import com.cnlive.moudle.pedometer.utils.StepUtil; | 23 | import com.cnlive.moudle.pedometer.utils.StepUtil; |
| @@ -32,6 +34,7 @@ public class RunningFinishFragmentView implements MvpView { | @@ -32,6 +34,7 @@ public class RunningFinishFragmentView implements MvpView { | ||
| 32 | public BaiduMap baiduMap; | 34 | public BaiduMap baiduMap; |
| 33 | private MapView mMapView; | 35 | private MapView mMapView; |
| 34 | private UiSettings mUiSettings; | 36 | private UiSettings mUiSettings; |
| 37 | + | ||
| 35 | public RunningFinishFragmentView(RunningFinishFragment fragment) { | 38 | public RunningFinishFragmentView(RunningFinishFragment fragment) { |
| 36 | this.fragment = fragment; | 39 | this.fragment = fragment; |
| 37 | } | 40 | } |
| @@ -80,7 +83,30 @@ public class RunningFinishFragmentView implements MvpView { | @@ -80,7 +83,30 @@ public class RunningFinishFragmentView implements MvpView { | ||
| 80 | if (fragment.getActivity() == null) { | 83 | if (fragment.getActivity() == null) { |
| 81 | return; | 84 | return; |
| 82 | } | 85 | } |
| 83 | - fragment.getActivity().finish(); | 86 | + UserStepEntity userStepEntity = StepUtil.getUserStepData(getContext(), CommonInfo.getUserId(getContext())); |
| 87 | + if (null != userStepEntity) { | ||
| 88 | + SelectDialog selectDialog = new SelectDialog(getContext(), "上传数据失败,您可在重新上传页面查看失败数据,是否确认返回?", "取消", new SelectDialog.DialogInterface() { | ||
| 89 | + @Override | ||
| 90 | + public void onClick(SelectDialog dialog) { | ||
| 91 | + dialog.dismiss(); | ||
| 92 | + } | ||
| 93 | + }, "返回", new SelectDialog.DialogInterface() { | ||
| 94 | + @Override | ||
| 95 | + public void onClick(SelectDialog dialog) { | ||
| 96 | + dialog.dismiss(); | ||
| 97 | + StepUtil.clearRunData(getContext(), CommonInfo.getUserId(getContext())); | ||
| 98 | + CommonInfo.reset(getContext()); | ||
| 99 | + fragment.getActivity().finish(); | ||
| 100 | + } | ||
| 101 | + }); | ||
| 102 | + selectDialog.setCanceledOnTouchOutside(false); | ||
| 103 | + selectDialog.setCancelable(false); | ||
| 104 | + if (!selectDialog.isShowing()) { | ||
| 105 | + selectDialog.show(); | ||
| 106 | + } | ||
| 107 | + } else { | ||
| 108 | + fragment.getActivity().finish(); | ||
| 109 | + } | ||
| 84 | } | 110 | } |
| 85 | }); | 111 | }); |
| 86 | //完成按钮 | 112 | //完成按钮 |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/model/Constant.java
| @@ -9,6 +9,7 @@ public class Constant { | @@ -9,6 +9,7 @@ public class Constant { | ||
| 9 | public static final int FRAGMENT_RUN_CHRONOMETER = 4;//同步计时器 | 9 | public static final int FRAGMENT_RUN_CHRONOMETER = 4;//同步计时器 |
| 10 | public static final int EXIT_RANGE = 5;//超出范围 | 10 | public static final int EXIT_RANGE = 5;//超出范围 |
| 11 | public static final int ENTER_RANGE = 6;//进入范围 | 11 | public static final int ENTER_RANGE = 6;//进入范围 |
| 12 | + public static final int UPDATE_MYSELF_RECORD_LIST = 16;//更新我的记录页面 | ||
| 12 | /*****************************************运营工具标志位****************************************************/ | 13 | /*****************************************运营工具标志位****************************************************/ |
| 13 | public static final int COLL_SERVICE_STEP_COUNT_RESET_SPEED = 3;//重置速度 | 14 | public static final int COLL_SERVICE_STEP_COUNT_RESET_SPEED = 3;//重置速度 |
| 14 | public static final int COLL_SERVICE_STEP_COUNT_UPDATE = 0;//步数更新 | 15 | public static final int COLL_SERVICE_STEP_COUNT_UPDATE = 0;//步数更新 |
| @@ -23,7 +24,6 @@ public class Constant { | @@ -23,7 +24,6 @@ public class Constant { | ||
| 23 | public static final int COLL_SERVICE_STEP_COUNT_ONRESUME = 15;//运营从后台回到前台,更新步数 | 24 | public static final int COLL_SERVICE_STEP_COUNT_ONRESUME = 15;//运营从后台回到前台,更新步数 |
| 24 | 25 | ||
| 25 | 26 | ||
| 26 | - | ||
| 27 | /*************************************用户其他值,非标志位************************************************************/ | 27 | /*************************************用户其他值,非标志位************************************************************/ |
| 28 | public static final long SERVICE_ID = 213511;//公司账号 | 28 | public static final long SERVICE_ID = 213511;//公司账号 |
| 29 | // public static final long SERVICE_ID = 213553; | 29 | // public static final long SERVICE_ID = 213553; |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/adapter/LineUpAgainAdapter.java
| @@ -29,6 +29,18 @@ public class LineUpAgainAdapter extends RecyclerView.Adapter<LineUpAgainAdapter. | @@ -29,6 +29,18 @@ public class LineUpAgainAdapter extends RecyclerView.Adapter<LineUpAgainAdapter. | ||
| 29 | private Context context; | 29 | private Context context; |
| 30 | private OnClickListener onClickListener; | 30 | private OnClickListener onClickListener; |
| 31 | private OnRestartUploadClickListener onRestartUploadClickListener; | 31 | private OnRestartUploadClickListener onRestartUploadClickListener; |
| 32 | + private OnDeleteClickListener onDeleteClickListener; | ||
| 33 | + | ||
| 34 | + public void updateDeleteList(int position) { | ||
| 35 | + if (null != list) { | ||
| 36 | + list.remove(position); | ||
| 37 | + notifyDataSetChanged(); | ||
| 38 | + } | ||
| 39 | + } | ||
| 40 | + | ||
| 41 | + public void setOnDeleteClickListener(OnDeleteClickListener onDeleteClickListener) { | ||
| 42 | + this.onDeleteClickListener = onDeleteClickListener; | ||
| 43 | + } | ||
| 32 | 44 | ||
| 33 | public void setOnRestartUploadClickListener(OnRestartUploadClickListener onRestartUploadClickListener) { | 45 | public void setOnRestartUploadClickListener(OnRestartUploadClickListener onRestartUploadClickListener) { |
| 34 | this.onRestartUploadClickListener = onRestartUploadClickListener; | 46 | this.onRestartUploadClickListener = onRestartUploadClickListener; |
| @@ -79,6 +91,14 @@ public class LineUpAgainAdapter extends RecyclerView.Adapter<LineUpAgainAdapter. | @@ -79,6 +91,14 @@ public class LineUpAgainAdapter extends RecyclerView.Adapter<LineUpAgainAdapter. | ||
| 79 | myHolder.up_record_speed.setText(list.get(i).getSpeed()); | 91 | myHolder.up_record_speed.setText(list.get(i).getSpeed()); |
| 80 | //设置步数 | 92 | //设置步数 |
| 81 | myHolder.up_record_step.setText(list.get(i).getStep()); | 93 | myHolder.up_record_step.setText(list.get(i).getStep()); |
| 94 | + myHolder.tv_delete.setOnClickListener(new View.OnClickListener() { | ||
| 95 | + @Override | ||
| 96 | + public void onClick(View view) { | ||
| 97 | + if (null != onDeleteClickListener) { | ||
| 98 | + onDeleteClickListener.onDeleteClickListener(i); | ||
| 99 | + } | ||
| 100 | + } | ||
| 101 | + }); | ||
| 82 | } | 102 | } |
| 83 | 103 | ||
| 84 | } | 104 | } |
| @@ -99,6 +119,7 @@ public class LineUpAgainAdapter extends RecyclerView.Adapter<LineUpAgainAdapter. | @@ -99,6 +119,7 @@ public class LineUpAgainAdapter extends RecyclerView.Adapter<LineUpAgainAdapter. | ||
| 99 | TextView up_record_speed; | 119 | TextView up_record_speed; |
| 100 | TextView up_record_step; | 120 | TextView up_record_step; |
| 101 | TextView again_up; | 121 | TextView again_up; |
| 122 | + TextView tv_delete; | ||
| 102 | RelativeLayout ry_re; | 123 | RelativeLayout ry_re; |
| 103 | 124 | ||
| 104 | public MyHolder(@NonNull View itemView) { | 125 | public MyHolder(@NonNull View itemView) { |
| @@ -112,6 +133,7 @@ public class LineUpAgainAdapter extends RecyclerView.Adapter<LineUpAgainAdapter. | @@ -112,6 +133,7 @@ public class LineUpAgainAdapter extends RecyclerView.Adapter<LineUpAgainAdapter. | ||
| 112 | up_record_speed = itemView.findViewById(R.id.up_record_speed); | 133 | up_record_speed = itemView.findViewById(R.id.up_record_speed); |
| 113 | up_record_step = itemView.findViewById(R.id.up_record_step); | 134 | up_record_step = itemView.findViewById(R.id.up_record_step); |
| 114 | again_up = itemView.findViewById(R.id.again_up); | 135 | again_up = itemView.findViewById(R.id.again_up); |
| 136 | + tv_delete = itemView.findViewById(R.id.tv_delete); | ||
| 115 | ry_re = itemView.findViewById(R.id.ry_re); | 137 | ry_re = itemView.findViewById(R.id.ry_re); |
| 116 | } | 138 | } |
| 117 | } | 139 | } |
| @@ -121,6 +143,10 @@ public class LineUpAgainAdapter extends RecyclerView.Adapter<LineUpAgainAdapter. | @@ -121,6 +143,10 @@ public class LineUpAgainAdapter extends RecyclerView.Adapter<LineUpAgainAdapter. | ||
| 121 | void onClickListener(FailedEntity bean, int position); | 143 | void onClickListener(FailedEntity bean, int position); |
| 122 | } | 144 | } |
| 123 | 145 | ||
| 146 | + public interface OnDeleteClickListener { | ||
| 147 | + void onDeleteClickListener(int position); | ||
| 148 | + } | ||
| 149 | + | ||
| 124 | public interface OnRestartUploadClickListener { | 150 | public interface OnRestartUploadClickListener { |
| 125 | void onRestartUploadClickListener(FailedEntity failedEntity); | 151 | void onRestartUploadClickListener(FailedEntity failedEntity); |
| 126 | } | 152 | } |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/fragment/LineUpAgainFragment.java
| @@ -11,11 +11,18 @@ import com.cnlive.libs.base.frame.fragment.MvpBindingFragment; | @@ -11,11 +11,18 @@ import com.cnlive.libs.base.frame.fragment.MvpBindingFragment; | ||
| 11 | import com.cnlive.moudle.pedometer.commonInfo.CommonInfo; | 11 | import com.cnlive.moudle.pedometer.commonInfo.CommonInfo; |
| 12 | import com.cnlive.moudle.pedometer.frame.presenter.LineUpAgainPresenter; | 12 | import com.cnlive.moudle.pedometer.frame.presenter.LineUpAgainPresenter; |
| 13 | import com.cnlive.moudle.pedometer.frame.view.LineUpAgainView; | 13 | import com.cnlive.moudle.pedometer.frame.view.LineUpAgainView; |
| 14 | +import com.cnlive.moudle.pedometer.model.Constant; | ||
| 15 | +import com.cnlive.moudle.pedometer.model.MessageEvent; | ||
| 14 | import com.cnlive.moudle.pedometer.sql.entity.FailedEntity; | 16 | import com.cnlive.moudle.pedometer.sql.entity.FailedEntity; |
| 17 | +import com.cnlive.moudle.pedometer.utils.ChineseToSpeechUtil; | ||
| 15 | import com.cnlive.moudle.pedometer.utils.StepUtil; | 18 | import com.cnlive.moudle.pedometer.utils.StepUtil; |
| 16 | import com.example.moudle_pedometer.R; | 19 | import com.example.moudle_pedometer.R; |
| 17 | import com.example.moudle_pedometer.databinding.FragmentLineUpAgainBinding; | 20 | import com.example.moudle_pedometer.databinding.FragmentLineUpAgainBinding; |
| 18 | 21 | ||
| 22 | +import org.greenrobot.eventbus.EventBus; | ||
| 23 | +import org.greenrobot.eventbus.Subscribe; | ||
| 24 | +import org.greenrobot.eventbus.ThreadMode; | ||
| 25 | + | ||
| 19 | import java.util.List; | 26 | import java.util.List; |
| 20 | 27 | ||
| 21 | /** | 28 | /** |
| @@ -37,6 +44,7 @@ public class LineUpAgainFragment extends MvpBindingFragment<LineUpAgainView, Lin | @@ -37,6 +44,7 @@ public class LineUpAgainFragment extends MvpBindingFragment<LineUpAgainView, Lin | ||
| 37 | @Override | 44 | @Override |
| 38 | public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { | 45 | public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { |
| 39 | super.onViewCreated(view, savedInstanceState); | 46 | super.onViewCreated(view, savedInstanceState); |
| 47 | + | ||
| 40 | List<FailedEntity> failedEntities = StepUtil.getFailListData(getActivity(), CommonInfo.getUserId(getActivity())); | 48 | List<FailedEntity> failedEntities = StepUtil.getFailListData(getActivity(), CommonInfo.getUserId(getActivity())); |
| 41 | if (getMvpView() != null) { | 49 | if (getMvpView() != null) { |
| 42 | getMvpView().initView(); | 50 | getMvpView().initView(); |
| @@ -63,4 +71,8 @@ public class LineUpAgainFragment extends MvpBindingFragment<LineUpAgainView, Lin | @@ -63,4 +71,8 @@ public class LineUpAgainFragment extends MvpBindingFragment<LineUpAgainView, Lin | ||
| 63 | } | 71 | } |
| 64 | } | 72 | } |
| 65 | } | 73 | } |
| 74 | + | ||
| 75 | + | ||
| 76 | + | ||
| 77 | + | ||
| 66 | } | 78 | } |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/fragment/SelfRecordFragment.java
| @@ -11,6 +11,8 @@ import com.cnlive.libs.base.frame.fragment.MvpBindingFragment; | @@ -11,6 +11,8 @@ import com.cnlive.libs.base.frame.fragment.MvpBindingFragment; | ||
| 11 | import com.cnlive.moudle.pedometer.commonInfo.CommonInfo; | 11 | import com.cnlive.moudle.pedometer.commonInfo.CommonInfo; |
| 12 | import com.cnlive.moudle.pedometer.frame.presenter.SelfRecordPresenter; | 12 | import com.cnlive.moudle.pedometer.frame.presenter.SelfRecordPresenter; |
| 13 | import com.cnlive.moudle.pedometer.frame.view.SelfRecordView; | 13 | import com.cnlive.moudle.pedometer.frame.view.SelfRecordView; |
| 14 | +import com.cnlive.moudle.pedometer.model.Constant; | ||
| 15 | +import com.cnlive.moudle.pedometer.model.MessageEvent; | ||
| 14 | import com.cnlive.moudle.pedometer.sql.entity.FailedEntity; | 16 | import com.cnlive.moudle.pedometer.sql.entity.FailedEntity; |
| 15 | import com.cnlive.moudle.pedometer.utils.StepUtil; | 17 | import com.cnlive.moudle.pedometer.utils.StepUtil; |
| 16 | import com.example.moudle_pedometer.R; | 18 | import com.example.moudle_pedometer.R; |
| @@ -19,6 +21,10 @@ import com.scwang.smartrefresh.layout.api.RefreshLayout; | @@ -19,6 +21,10 @@ import com.scwang.smartrefresh.layout.api.RefreshLayout; | ||
| 19 | import com.scwang.smartrefresh.layout.listener.OnLoadMoreListener; | 21 | import com.scwang.smartrefresh.layout.listener.OnLoadMoreListener; |
| 20 | import com.scwang.smartrefresh.layout.listener.OnRefreshListener; | 22 | import com.scwang.smartrefresh.layout.listener.OnRefreshListener; |
| 21 | 23 | ||
| 24 | +import org.greenrobot.eventbus.EventBus; | ||
| 25 | +import org.greenrobot.eventbus.Subscribe; | ||
| 26 | +import org.greenrobot.eventbus.ThreadMode; | ||
| 27 | + | ||
| 22 | import java.util.List; | 28 | import java.util.List; |
| 23 | 29 | ||
| 24 | import q.rorbin.badgeview.QBadgeView; | 30 | import q.rorbin.badgeview.QBadgeView; |
| @@ -42,6 +48,9 @@ public class SelfRecordFragment extends MvpBindingFragment<SelfRecordView, SelfR | @@ -42,6 +48,9 @@ public class SelfRecordFragment extends MvpBindingFragment<SelfRecordView, SelfR | ||
| 42 | @Override | 48 | @Override |
| 43 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { | 49 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { |
| 44 | super.onViewCreated(view, savedInstanceState); | 50 | super.onViewCreated(view, savedInstanceState); |
| 51 | + if (!EventBus.getDefault().isRegistered(this)) { | ||
| 52 | + EventBus.getDefault().register(this); | ||
| 53 | + } | ||
| 45 | if (getMvpView() != null) getMvpView().initView(); | 54 | if (getMvpView() != null) getMvpView().initView(); |
| 46 | getData(completeStatus); | 55 | getData(completeStatus); |
| 47 | 56 | ||
| @@ -69,7 +78,7 @@ public class SelfRecordFragment extends MvpBindingFragment<SelfRecordView, SelfR | @@ -69,7 +78,7 @@ public class SelfRecordFragment extends MvpBindingFragment<SelfRecordView, SelfR | ||
| 69 | 78 | ||
| 70 | 79 | ||
| 71 | private void getData(int completeStatu) { | 80 | private void getData(int completeStatu) { |
| 72 | - if(completeStatu != completeStatus) currentPage = 1; | 81 | + if (completeStatu != completeStatus) currentPage = 1; |
| 73 | this.completeStatus = completeStatu; | 82 | this.completeStatus = completeStatu; |
| 74 | getPresenter().getData(getActivity(), CommonInfo.getUserId(getActivity()), completeStatus, currentPage, pageSize); | 83 | getPresenter().getData(getActivity(), CommonInfo.getUserId(getActivity()), completeStatus, currentPage, pageSize); |
| 75 | if (completeStatus == 1) { | 84 | if (completeStatus == 1) { |
| @@ -114,4 +123,22 @@ public class SelfRecordFragment extends MvpBindingFragment<SelfRecordView, SelfR | @@ -114,4 +123,22 @@ public class SelfRecordFragment extends MvpBindingFragment<SelfRecordView, SelfR | ||
| 114 | qBadgeView.setBadgeNumber(failedEntities.size()); | 123 | qBadgeView.setBadgeNumber(failedEntities.size()); |
| 115 | } | 124 | } |
| 116 | } | 125 | } |
| 126 | + | ||
| 127 | + @Subscribe(threadMode = ThreadMode.MAIN) | ||
| 128 | + public void Event(MessageEvent messageEvent) { | ||
| 129 | + //刷新我的记录页面 | ||
| 130 | + if (messageEvent.getMessageType() == Constant.UPDATE_MYSELF_RECORD_LIST) { | ||
| 131 | + if (getMvpView() != null) { | ||
| 132 | + getData(completeStatus); | ||
| 133 | + } | ||
| 134 | + } | ||
| 135 | + } | ||
| 136 | + | ||
| 137 | + @Override | ||
| 138 | + public void onDestroy() { | ||
| 139 | + super.onDestroy(); | ||
| 140 | + if (EventBus.getDefault().isRegistered(this)) { | ||
| 141 | + EventBus.getDefault().unregister(this); | ||
| 142 | + } | ||
| 143 | + } | ||
| 117 | } | 144 | } |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/utils/MyMapUtil.java
| @@ -211,24 +211,26 @@ public class MyMapUtil { | @@ -211,24 +211,26 @@ public class MyMapUtil { | ||
| 211 | public static boolean checkIsFinishTrace(List<LatLng> importPoints, List<LatLng> trackPoints, double passRate) { | 211 | public static boolean checkIsFinishTrace(List<LatLng> importPoints, List<LatLng> trackPoints, double passRate) { |
| 212 | HashMap<Integer, Boolean> importHash = new HashMap<>(); | 212 | HashMap<Integer, Boolean> importHash = new HashMap<>(); |
| 213 | for (int i = 0; i < importPoints.size(); i++) { | 213 | for (int i = 0; i < importPoints.size(); i++) { |
| 214 | - if (i % 3 != 0) { | ||
| 215 | - importPoints.remove(i); | ||
| 216 | - } | ||
| 217 | - } | ||
| 218 | - for (int i = 0; i < importPoints.size(); i++) { | ||
| 219 | importHash.put(i, false); | 214 | importHash.put(i, false); |
| 220 | } | 215 | } |
| 221 | //开始比较数据 | 216 | //开始比较数据 |
| 222 | int index = 0; | 217 | int index = 0; |
| 218 | + boolean isContinue = false; | ||
| 223 | for (int i = 0; i < importPoints.size(); i++) { | 219 | for (int i = 0; i < importPoints.size(); i++) { |
| 220 | + isContinue=false; | ||
| 224 | LatLng importLatLng = importPoints.get(i); | 221 | LatLng importLatLng = importPoints.get(i); |
| 225 | for (int j = index; j < trackPoints.size(); j++) { | 222 | for (int j = index; j < trackPoints.size(); j++) { |
| 226 | double distance = DistanceUtil.getDistance(importLatLng, trackPoints.get(j)); | 223 | double distance = DistanceUtil.getDistance(importLatLng, trackPoints.get(j)); |
| 227 | if (distance < Constant.CHECK_ACCURACY) { | 224 | if (distance < Constant.CHECK_ACCURACY) { |
| 228 | importHash.put(i, true); | 225 | importHash.put(i, true); |
| 229 | index = j; | 226 | index = j; |
| 227 | + isContinue=true; | ||
| 228 | + break; | ||
| 230 | } | 229 | } |
| 231 | } | 230 | } |
| 231 | + if (isContinue){ | ||
| 232 | + continue; | ||
| 233 | + } | ||
| 232 | } | 234 | } |
| 233 | //输出 | 235 | //输出 |
| 234 | int result = 0; | 236 | int result = 0; |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/utils/StepUtil.java
| @@ -140,11 +140,11 @@ public class StepUtil { | @@ -140,11 +140,11 @@ public class StepUtil { | ||
| 140 | 140 | ||
| 141 | } | 141 | } |
| 142 | 142 | ||
| 143 | - //获取上传失败列表 | 143 | + //获取上传失败列表,按时间倒序 |
| 144 | public static List<FailedEntity> getFailListData(Context context, String uid) { | 144 | public static List<FailedEntity> getFailListData(Context context, String uid) { |
| 145 | try { | 145 | try { |
| 146 | DbCore.init(context, dbName); | 146 | DbCore.init(context, dbName); |
| 147 | - List<FailedEntity> list = DbCore.getDaoSession().getFailedEntityDao().queryBuilder().where(FailedEntityDao.Properties.Uid.eq(uid)).list(); | 147 | + List<FailedEntity> list = DbCore.getDaoSession().getFailedEntityDao().queryBuilder().where(FailedEntityDao.Properties.Uid.eq(uid)).orderDesc(FailedEntityDao.Properties.CreatTimeStamp).list(); |
| 148 | return list; | 148 | return list; |
| 149 | } catch (Exception e) { | 149 | } catch (Exception e) { |
| 150 | Log.e(TAG, "getFailListData: " + e.toString()); | 150 | Log.e(TAG, "getFailListData: " + e.toString()); |
moudle_pedometer/src/main/res/layout/fragment_run_main.xml
| @@ -4,10 +4,12 @@ | @@ -4,10 +4,12 @@ | ||
| 4 | <LinearLayout | 4 | <LinearLayout |
| 5 | android:layout_width="match_parent" | 5 | android:layout_width="match_parent" |
| 6 | android:layout_height="match_parent" | 6 | android:layout_height="match_parent" |
| 7 | + android:background="@color/run_main_bg" | ||
| 7 | android:orientation="vertical"> | 8 | android:orientation="vertical"> |
| 8 | 9 | ||
| 9 | <FrameLayout | 10 | <FrameLayout |
| 10 | android:layout_width="match_parent" | 11 | android:layout_width="match_parent" |
| 12 | + android:background="@color/run_main_bg" | ||
| 11 | android:layout_height="match_parent"> | 13 | android:layout_height="match_parent"> |
| 12 | 14 | ||
| 13 | <LinearLayout | 15 | <LinearLayout |
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="@drawable/background" | ||
| 12 | - android:layout_marginTop="5dp" | ||
| 13 | android:layout_marginLeft="5dp" | 12 | android:layout_marginLeft="5dp" |
| 13 | + android:layout_marginTop="5dp" | ||
| 14 | android:layout_marginRight="5dp" | 14 | android:layout_marginRight="5dp" |
| 15 | + android:background="@drawable/background" | ||
| 15 | android:padding="15dp"> | 16 | android:padding="15dp"> |
| 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" |
| @@ -52,10 +53,10 @@ | @@ -52,10 +53,10 @@ | ||
| 52 | android:id="@+id/up_item_img" | 53 | android:id="@+id/up_item_img" |
| 53 | android:layout_width="80dp" | 54 | android:layout_width="80dp" |
| 54 | android:layout_height="80dp" | 55 | android:layout_height="80dp" |
| 55 | - android:scaleType="fitXY" | ||
| 56 | - android:visibility="gone" | ||
| 57 | android:layout_gravity="center_vertical" | 56 | android:layout_gravity="center_vertical" |
| 58 | - android:src="@drawable/defaults" /> | 57 | + android:scaleType="fitXY" |
| 58 | + android:src="@drawable/defaults" | ||
| 59 | + android:visibility="gone" /> | ||
| 59 | 60 | ||
| 60 | <RelativeLayout | 61 | <RelativeLayout |
| 61 | android:layout_width="match_parent" | 62 | android:layout_width="match_parent" |
| @@ -67,31 +68,31 @@ | @@ -67,31 +68,31 @@ | ||
| 67 | android:layout_width="wrap_content" | 68 | android:layout_width="wrap_content" |
| 68 | android:layout_height="wrap_content" | 69 | android:layout_height="wrap_content" |
| 69 | android:singleLine="true" | 70 | android:singleLine="true" |
| 70 | - android:textSize="12sp" | ||
| 71 | - android:textColor="#333333"/> | 71 | + android:textColor="#333333" |
| 72 | + android:textSize="12sp" /> | ||
| 72 | 73 | ||
| 73 | <LinearLayout | 74 | <LinearLayout |
| 74 | android:layout_width="wrap_content" | 75 | android:layout_width="wrap_content" |
| 75 | android:layout_height="wrap_content" | 76 | android:layout_height="wrap_content" |
| 76 | android:layout_centerVertical="true" | 77 | android:layout_centerVertical="true" |
| 77 | android:orientation="horizontal"> | 78 | android:orientation="horizontal"> |
| 79 | + | ||
| 78 | <TextView | 80 | <TextView |
| 79 | android:id="@+id/up_kilometer_num" | 81 | android:id="@+id/up_kilometer_num" |
| 80 | android:layout_width="wrap_content" | 82 | android:layout_width="wrap_content" |
| 81 | android:layout_height="wrap_content" | 83 | android:layout_height="wrap_content" |
| 82 | - android:textColor="#333333" | ||
| 83 | - android:textSize="30sp" | ||
| 84 | android:layout_centerVertical="true" | 84 | android:layout_centerVertical="true" |
| 85 | - /> | 85 | + android:textColor="#333333" |
| 86 | + android:textSize="30sp" /> | ||
| 86 | 87 | ||
| 87 | <TextView | 88 | <TextView |
| 88 | android:layout_width="wrap_content" | 89 | android:layout_width="wrap_content" |
| 89 | android:layout_height="wrap_content" | 90 | android:layout_height="wrap_content" |
| 90 | android:layout_centerVertical="true" | 91 | android:layout_centerVertical="true" |
| 92 | + android:layout_marginLeft="5dp" | ||
| 91 | android:text="@string/kilometer" | 93 | android:text="@string/kilometer" |
| 92 | android:textColor="#333333" | 94 | android:textColor="#333333" |
| 93 | - android:textSize="12sp" | ||
| 94 | - android:layout_marginLeft="5dp"/> | 95 | + android:textSize="12sp" /> |
| 95 | </LinearLayout> | 96 | </LinearLayout> |
| 96 | 97 | ||
| 97 | 98 | ||
| @@ -107,7 +108,7 @@ | @@ -107,7 +108,7 @@ | ||
| 107 | android:drawableRight="@drawable/time_cost" | 108 | android:drawableRight="@drawable/time_cost" |
| 108 | android:drawablePadding="5dp" | 109 | android:drawablePadding="5dp" |
| 109 | android:textColor="#333333" | 110 | android:textColor="#333333" |
| 110 | - android:textSize="13sp"/> | 111 | + android:textSize="13sp" /> |
| 111 | 112 | ||
| 112 | <TextView | 113 | <TextView |
| 113 | android:id="@+id/up_record_speed" | 114 | android:id="@+id/up_record_speed" |
| @@ -117,7 +118,7 @@ | @@ -117,7 +118,7 @@ | ||
| 117 | android:drawableRight="@drawable/speed" | 118 | android:drawableRight="@drawable/speed" |
| 118 | android:drawablePadding="5dp" | 119 | android:drawablePadding="5dp" |
| 119 | android:textColor="#333333" | 120 | android:textColor="#333333" |
| 120 | - android:textSize="13sp"/> | 121 | + android:textSize="13sp" /> |
| 121 | 122 | ||
| 122 | <TextView | 123 | <TextView |
| 123 | android:id="@+id/up_record_step" | 124 | android:id="@+id/up_record_step" |
| @@ -125,7 +126,7 @@ | @@ -125,7 +126,7 @@ | ||
| 125 | android:layout_height="wrap_content" | 126 | android:layout_height="wrap_content" |
| 126 | android:layout_marginLeft="20dp" | 127 | android:layout_marginLeft="20dp" |
| 127 | android:drawableRight="@drawable/step" | 128 | android:drawableRight="@drawable/step" |
| 128 | - android:drawablePadding="5dp"/> | 129 | + android:drawablePadding="5dp" /> |
| 129 | </LinearLayout> | 130 | </LinearLayout> |
| 130 | </RelativeLayout> | 131 | </RelativeLayout> |
| 131 | </LinearLayout> | 132 | </LinearLayout> |
| @@ -134,26 +135,45 @@ | @@ -134,26 +135,45 @@ | ||
| 134 | android:id="@+id/view" | 135 | android:id="@+id/view" |
| 135 | android:layout_width="match_parent" | 136 | android:layout_width="match_parent" |
| 136 | android:layout_height="1dp" | 137 | android:layout_height="1dp" |
| 137 | - android:background="@color/line" | ||
| 138 | android:layout_below="@id/ly" | 138 | android:layout_below="@id/ly" |
| 139 | - /> | 139 | + android:background="@color/line" /> |
| 140 | 140 | ||
| 141 | - <TextView | ||
| 142 | - android:id="@+id/again_up" | ||
| 143 | - android:layout_width="wrap_content" | 141 | + <LinearLayout |
| 142 | + android:layout_width="match_parent" | ||
| 144 | android:layout_height="wrap_content" | 143 | android:layout_height="wrap_content" |
| 145 | - android:layout_alignParentRight="true" | ||
| 146 | android:layout_below="@id/view" | 144 | android:layout_below="@id/view" |
| 147 | android:layout_marginTop="10dp" | 145 | android:layout_marginTop="10dp" |
| 148 | android:layout_marginRight="5dp" | 146 | android:layout_marginRight="5dp" |
| 149 | - android:background="@drawable/green_raduis_bg" | ||
| 150 | - android:text="@string/again_up" | ||
| 151 | - android:textColor="#36C28D" | ||
| 152 | - android:textSize="12sp" | ||
| 153 | - android:paddingTop="7dp" | ||
| 154 | - android:paddingBottom="7dp" | ||
| 155 | - android:paddingRight="10dp" | ||
| 156 | - android:paddingLeft="10dp" | ||
| 157 | - /> | 147 | + android:gravity="center|right"> |
| 148 | + | ||
| 149 | + <TextView | ||
| 150 | + android:id="@+id/again_up" | ||
| 151 | + android:layout_width="wrap_content" | ||
| 152 | + android:layout_height="wrap_content" | ||
| 153 | + android:layout_alignParentRight="true" | ||
| 154 | + android:layout_marginRight="15dp" | ||
| 155 | + android:background="@drawable/green_raduis_bg" | ||
| 156 | + android:paddingLeft="10dp" | ||
| 157 | + android:paddingTop="7dp" | ||
| 158 | + android:paddingRight="10dp" | ||
| 159 | + android:paddingBottom="7dp" | ||
| 160 | + android:text="@string/again_up" | ||
| 161 | + android:textColor="#36C28D" | ||
| 162 | + android:textSize="12sp" /> | ||
| 163 | + | ||
| 164 | + <TextView | ||
| 165 | + android:id="@+id/tv_delete" | ||
| 166 | + android:layout_width="wrap_content" | ||
| 167 | + android:layout_height="wrap_content" | ||
| 168 | + android:layout_alignParentRight="true" | ||
| 169 | + android:background="@drawable/green_raduis_bg" | ||
| 170 | + android:paddingLeft="15dp" | ||
| 171 | + android:paddingTop="7dp" | ||
| 172 | + android:paddingRight="15dp" | ||
| 173 | + android:paddingBottom="7dp" | ||
| 174 | + android:text="@string/delete" | ||
| 175 | + android:textColor="#36C28D" | ||
| 176 | + android:textSize="12sp" /> | ||
| 177 | + </LinearLayout> | ||
| 158 | </RelativeLayout> | 178 | </RelativeLayout> |
| 159 | </layout> | 179 | </layout> |
moudle_pedometer/src/main/res/values/strings.xml
| @@ -78,6 +78,7 @@ | @@ -78,6 +78,7 @@ | ||
| 78 | <string name="finish">完成</string> | 78 | <string name="finish">完成</string> |
| 79 | <string name="no_finish">未完成</string> | 79 | <string name="no_finish">未完成</string> |
| 80 | <string name="again_up">重新上传</string> | 80 | <string name="again_up">重新上传</string> |
| 81 | + <string name="delete">删 除</string> | ||
| 81 | <string name="myrecord">我的记录</string> | 82 | <string name="myrecord">我的记录</string> |
| 82 | <string name="up_fail">上传失败</string> | 83 | <string name="up_fail">上传失败</string> |
| 83 | <string name="enter_range_tip">您已回归轨迹继续参与运动吧</string> | 84 | <string name="enter_range_tip">您已回归轨迹继续参与运动吧</string> |