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 | 3 | <component name="GradleSettings"> |
| 4 | 4 | <option name="linkedExternalProjectsSettings"> |
| 5 | 5 | <GradleProjectSettings> |
| 6 | - <compositeConfiguration> | |
| 7 | - <compositeBuild compositeDefinitionSource="SCRIPT" /> | |
| 8 | - </compositeConfiguration> | |
| 9 | 6 | <option name="distributionType" value="DEFAULT_WRAPPED" /> |
| 10 | 7 | <option name="externalProjectPath" value="$PROJECT_DIR$" /> |
| 11 | 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 | 212 | //判断用户是否点击暂停按钮 |
| 213 | 213 | if (userStepEntity.getPauseCount() == 0) { |
| 214 | 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 | 302 | } |
| 303 | 303 | } |
| 304 | 304 | } |
| 305 | + } else { | |
| 306 | + isArrive = true; | |
| 305 | 307 | } |
| 306 | 308 | if (isArrive) { |
| 307 | 309 | if (importPoints != null) { |
| ... | ... | @@ -318,6 +320,9 @@ public class RunningFinishFragmetPresenter extends MvpBasePresenter<RunningFinis |
| 318 | 320 | } else { |
| 319 | 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 | 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 | 319 | //获取当前的实体名称 |
| 320 | 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 | 326 | MyMapUtil.queryHistoryTrace(context, StepService.mClient, entityName, startTime, endTime, new MyMapUtil.CallBack() { |
| 324 | 327 | @Override |
| 325 | 328 | public void success(List<LatLng> resultPoints) { |
| ... | ... | @@ -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 | 16 | import com.cnlive.moudle.pedometer.commonInfo.CommonInfo; |
| 17 | 17 | import com.cnlive.moudle.pedometer.frame.view.UploadFailDetailFragmentView; |
| 18 | 18 | import com.cnlive.moudle.pedometer.model.Constant; |
| 19 | +import com.cnlive.moudle.pedometer.model.MessageEvent; | |
| 19 | 20 | import com.cnlive.moudle.pedometer.model.RunningFinishBean; |
| 20 | 21 | import com.cnlive.moudle.pedometer.net.ApiServiceRunLin; |
| 21 | 22 | import com.cnlive.moudle.pedometer.net.SubscriptionRequest; |
| ... | ... | @@ -31,6 +32,8 @@ import com.cnlive.moudle.pedometer.utils.StepUtil; |
| 31 | 32 | import com.example.moudle_pedometer.R; |
| 32 | 33 | import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter; |
| 33 | 34 | |
| 35 | +import org.greenrobot.eventbus.EventBus; | |
| 36 | + | |
| 34 | 37 | import java.util.HashMap; |
| 35 | 38 | import java.util.List; |
| 36 | 39 | import java.util.Map; |
| ... | ... | @@ -329,6 +332,8 @@ public class UploadFailDetailFragmentPresenter extends MvpBasePresenter<UploadFa |
| 329 | 332 | if (getView() == null) { |
| 330 | 333 | return; |
| 331 | 334 | } |
| 335 | + //更新我的记录列表 | |
| 336 | + EventBus.getDefault().post(new MessageEvent(Constant.UPDATE_MYSELF_RECORD_LIST, "")); | |
| 332 | 337 | QMUITipDialogUtil.dismessDialog(); |
| 333 | 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 | 5 | |
| 6 | 6 | import com.cnlive.moudle.pedometer.commonInfo.CommonInfo; |
| 7 | 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 | 10 | import com.cnlive.moudle.pedometer.sql.entity.FailedEntity; |
| 9 | 11 | import com.cnlive.moudle.pedometer.ui.activity.UploadFailDetailActivity; |
| 10 | 12 | import com.cnlive.moudle.pedometer.ui.adapter.LineUpAgainAdapter; |
| 11 | 13 | import com.cnlive.moudle.pedometer.ui.fragment.LineUpAgainFragment; |
| 14 | +import com.cnlive.moudle.pedometer.ui.widget.SelectDialog; | |
| 12 | 15 | import com.cnlive.moudle.pedometer.utils.StepUtil; |
| 13 | 16 | import com.example.moudle_pedometer.R; |
| 14 | 17 | import com.hannesdorfmann.mosby3.mvp.MvpView; |
| 15 | 18 | import com.scwang.smartrefresh.layout.footer.ClassicsFooter; |
| 16 | 19 | import com.scwang.smartrefresh.layout.header.ClassicsHeader; |
| 17 | 20 | |
| 21 | +import org.greenrobot.eventbus.EventBus; | |
| 22 | + | |
| 18 | 23 | import java.util.ArrayList; |
| 19 | 24 | import java.util.List; |
| 20 | 25 | |
| ... | ... | @@ -51,6 +56,31 @@ public class LineUpAgainView implements MvpView { |
| 51 | 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 | 85 | againAdapter.setOnRestartUploadClickListener(new LineUpAgainAdapter.OnRestartUploadClickListener() { |
| 56 | 86 | @Override |
| ... | ... | @@ -61,6 +91,8 @@ public class LineUpAgainView implements MvpView { |
| 61 | 91 | fragment.getPresenter().queryHistoryTraceNoMap(fragment.getActivity(), failedEntity, new LineUpAgainPresenter.onResultListener() { |
| 62 | 92 | @Override |
| 63 | 93 | public void onSuccess() { |
| 94 | + //更新我的记录列表 | |
| 95 | + EventBus.getDefault().post(new MessageEvent(Constant.UPDATE_MYSELF_RECORD_LIST, "")); | |
| 64 | 96 | //刷新列表 |
| 65 | 97 | List<FailedEntity> failedEntities = StepUtil.getFailListData(fragment.getActivity(), CommonInfo.getUserId(fragment.getActivity())); |
| 66 | 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 | 433 | runningFinishBean.setStreetTitle(userStepEntity.getStreetTitle()); |
| 434 | 434 | //设置用时 |
| 435 | 435 | runningFinishBean.setEmployTime(employTime); |
| 436 | - | |
| 436 | + //刷新一遍数据 | |
| 437 | + userStepEntity = StepUtil.getUserStepData(getContext(), uid); | |
| 437 | 438 | //先将失败数据保存起来 |
| 438 | 439 | if (runningFinishBean != null && userStepEntity != null) { |
| 439 | 440 | setFailData(getContext(), userStepEntity, runningFinishBean); |
| ... | ... | @@ -562,6 +563,7 @@ public class RunMainFragmentView implements MvpView { |
| 562 | 563 | if (getContext() == null) { |
| 563 | 564 | return; |
| 564 | 565 | } |
| 566 | + | |
| 565 | 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 | 14 | import com.bumptech.glide.Glide; |
| 15 | 15 | import com.cnlive.moudle.pedometer.commonInfo.CommonInfo; |
| 16 | 16 | import com.cnlive.moudle.pedometer.model.RunningFinishBean; |
| 17 | +import com.cnlive.moudle.pedometer.sql.entity.UserStepEntity; | |
| 17 | 18 | import com.cnlive.moudle.pedometer.ui.fragment.RunningFinishFragment; |
| 18 | 19 | import com.cnlive.moudle.pedometer.ui.fragment.RunningMapFragment; |
| 20 | +import com.cnlive.moudle.pedometer.ui.widget.SelectDialog; | |
| 19 | 21 | import com.cnlive.moudle.pedometer.utils.MyMapUtil; |
| 20 | 22 | import com.cnlive.moudle.pedometer.utils.QMUITipDialogUtil; |
| 21 | 23 | import com.cnlive.moudle.pedometer.utils.StepUtil; |
| ... | ... | @@ -32,6 +34,7 @@ public class RunningFinishFragmentView implements MvpView { |
| 32 | 34 | public BaiduMap baiduMap; |
| 33 | 35 | private MapView mMapView; |
| 34 | 36 | private UiSettings mUiSettings; |
| 37 | + | |
| 35 | 38 | public RunningFinishFragmentView(RunningFinishFragment fragment) { |
| 36 | 39 | this.fragment = fragment; |
| 37 | 40 | } |
| ... | ... | @@ -80,7 +83,30 @@ public class RunningFinishFragmentView implements MvpView { |
| 80 | 83 | if (fragment.getActivity() == null) { |
| 81 | 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 | 9 | public static final int FRAGMENT_RUN_CHRONOMETER = 4;//同步计时器 |
| 10 | 10 | public static final int EXIT_RANGE = 5;//超出范围 |
| 11 | 11 | public static final int ENTER_RANGE = 6;//进入范围 |
| 12 | + public static final int UPDATE_MYSELF_RECORD_LIST = 16;//更新我的记录页面 | |
| 12 | 13 | /*****************************************运营工具标志位****************************************************/ |
| 13 | 14 | public static final int COLL_SERVICE_STEP_COUNT_RESET_SPEED = 3;//重置速度 |
| 14 | 15 | public static final int COLL_SERVICE_STEP_COUNT_UPDATE = 0;//步数更新 |
| ... | ... | @@ -23,7 +24,6 @@ public class Constant { |
| 23 | 24 | public static final int COLL_SERVICE_STEP_COUNT_ONRESUME = 15;//运营从后台回到前台,更新步数 |
| 24 | 25 | |
| 25 | 26 | |
| 26 | - | |
| 27 | 27 | /*************************************用户其他值,非标志位************************************************************/ |
| 28 | 28 | public static final long SERVICE_ID = 213511;//公司账号 |
| 29 | 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 | 29 | private Context context; |
| 30 | 30 | private OnClickListener onClickListener; |
| 31 | 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 | 45 | public void setOnRestartUploadClickListener(OnRestartUploadClickListener onRestartUploadClickListener) { |
| 34 | 46 | this.onRestartUploadClickListener = onRestartUploadClickListener; |
| ... | ... | @@ -79,6 +91,14 @@ public class LineUpAgainAdapter extends RecyclerView.Adapter<LineUpAgainAdapter. |
| 79 | 91 | myHolder.up_record_speed.setText(list.get(i).getSpeed()); |
| 80 | 92 | //设置步数 |
| 81 | 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 | 119 | TextView up_record_speed; |
| 100 | 120 | TextView up_record_step; |
| 101 | 121 | TextView again_up; |
| 122 | + TextView tv_delete; | |
| 102 | 123 | RelativeLayout ry_re; |
| 103 | 124 | |
| 104 | 125 | public MyHolder(@NonNull View itemView) { |
| ... | ... | @@ -112,6 +133,7 @@ public class LineUpAgainAdapter extends RecyclerView.Adapter<LineUpAgainAdapter. |
| 112 | 133 | up_record_speed = itemView.findViewById(R.id.up_record_speed); |
| 113 | 134 | up_record_step = itemView.findViewById(R.id.up_record_step); |
| 114 | 135 | again_up = itemView.findViewById(R.id.again_up); |
| 136 | + tv_delete = itemView.findViewById(R.id.tv_delete); | |
| 115 | 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 | 143 | void onClickListener(FailedEntity bean, int position); |
| 122 | 144 | } |
| 123 | 145 | |
| 146 | + public interface OnDeleteClickListener { | |
| 147 | + void onDeleteClickListener(int position); | |
| 148 | + } | |
| 149 | + | |
| 124 | 150 | public interface OnRestartUploadClickListener { |
| 125 | 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 | import com.cnlive.moudle.pedometer.commonInfo.CommonInfo; |
| 12 | 12 | import com.cnlive.moudle.pedometer.frame.presenter.LineUpAgainPresenter; |
| 13 | 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 | 16 | import com.cnlive.moudle.pedometer.sql.entity.FailedEntity; |
| 17 | +import com.cnlive.moudle.pedometer.utils.ChineseToSpeechUtil; | |
| 15 | 18 | import com.cnlive.moudle.pedometer.utils.StepUtil; |
| 16 | 19 | import com.example.moudle_pedometer.R; |
| 17 | 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 | 26 | import java.util.List; |
| 20 | 27 | |
| 21 | 28 | /** |
| ... | ... | @@ -37,6 +44,7 @@ public class LineUpAgainFragment extends MvpBindingFragment<LineUpAgainView, Lin |
| 37 | 44 | @Override |
| 38 | 45 | public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { |
| 39 | 46 | super.onViewCreated(view, savedInstanceState); |
| 47 | + | |
| 40 | 48 | List<FailedEntity> failedEntities = StepUtil.getFailListData(getActivity(), CommonInfo.getUserId(getActivity())); |
| 41 | 49 | if (getMvpView() != null) { |
| 42 | 50 | getMvpView().initView(); |
| ... | ... | @@ -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 | 11 | import com.cnlive.moudle.pedometer.commonInfo.CommonInfo; |
| 12 | 12 | import com.cnlive.moudle.pedometer.frame.presenter.SelfRecordPresenter; |
| 13 | 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 | 16 | import com.cnlive.moudle.pedometer.sql.entity.FailedEntity; |
| 15 | 17 | import com.cnlive.moudle.pedometer.utils.StepUtil; |
| 16 | 18 | import com.example.moudle_pedometer.R; |
| ... | ... | @@ -19,6 +21,10 @@ import com.scwang.smartrefresh.layout.api.RefreshLayout; |
| 19 | 21 | import com.scwang.smartrefresh.layout.listener.OnLoadMoreListener; |
| 20 | 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 | 28 | import java.util.List; |
| 23 | 29 | |
| 24 | 30 | import q.rorbin.badgeview.QBadgeView; |
| ... | ... | @@ -42,6 +48,9 @@ public class SelfRecordFragment extends MvpBindingFragment<SelfRecordView, SelfR |
| 42 | 48 | @Override |
| 43 | 49 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { |
| 44 | 50 | super.onViewCreated(view, savedInstanceState); |
| 51 | + if (!EventBus.getDefault().isRegistered(this)) { | |
| 52 | + EventBus.getDefault().register(this); | |
| 53 | + } | |
| 45 | 54 | if (getMvpView() != null) getMvpView().initView(); |
| 46 | 55 | getData(completeStatus); |
| 47 | 56 | |
| ... | ... | @@ -69,7 +78,7 @@ public class SelfRecordFragment extends MvpBindingFragment<SelfRecordView, SelfR |
| 69 | 78 | |
| 70 | 79 | |
| 71 | 80 | private void getData(int completeStatu) { |
| 72 | - if(completeStatu != completeStatus) currentPage = 1; | |
| 81 | + if (completeStatu != completeStatus) currentPage = 1; | |
| 73 | 82 | this.completeStatus = completeStatu; |
| 74 | 83 | getPresenter().getData(getActivity(), CommonInfo.getUserId(getActivity()), completeStatus, currentPage, pageSize); |
| 75 | 84 | if (completeStatus == 1) { |
| ... | ... | @@ -114,4 +123,22 @@ public class SelfRecordFragment extends MvpBindingFragment<SelfRecordView, SelfR |
| 114 | 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 | 211 | public static boolean checkIsFinishTrace(List<LatLng> importPoints, List<LatLng> trackPoints, double passRate) { |
| 212 | 212 | HashMap<Integer, Boolean> importHash = new HashMap<>(); |
| 213 | 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 | 214 | importHash.put(i, false); |
| 220 | 215 | } |
| 221 | 216 | //开始比较数据 |
| 222 | 217 | int index = 0; |
| 218 | + boolean isContinue = false; | |
| 223 | 219 | for (int i = 0; i < importPoints.size(); i++) { |
| 220 | + isContinue=false; | |
| 224 | 221 | LatLng importLatLng = importPoints.get(i); |
| 225 | 222 | for (int j = index; j < trackPoints.size(); j++) { |
| 226 | 223 | double distance = DistanceUtil.getDistance(importLatLng, trackPoints.get(j)); |
| 227 | 224 | if (distance < Constant.CHECK_ACCURACY) { |
| 228 | 225 | importHash.put(i, true); |
| 229 | 226 | index = j; |
| 227 | + isContinue=true; | |
| 228 | + break; | |
| 230 | 229 | } |
| 231 | 230 | } |
| 231 | + if (isContinue){ | |
| 232 | + continue; | |
| 233 | + } | |
| 232 | 234 | } |
| 233 | 235 | //输出 |
| 234 | 236 | int result = 0; | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/utils/StepUtil.java
| ... | ... | @@ -140,11 +140,11 @@ public class StepUtil { |
| 140 | 140 | |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | - //获取上传失败列表 | |
| 143 | + //获取上传失败列表,按时间倒序 | |
| 144 | 144 | public static List<FailedEntity> getFailListData(Context context, String uid) { |
| 145 | 145 | try { |
| 146 | 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 | 148 | return list; |
| 149 | 149 | } catch (Exception e) { |
| 150 | 150 | Log.e(TAG, "getFailListData: " + e.toString()); | ... | ... |
moudle_pedometer/src/main/res/layout/fragment_run_main.xml
| ... | ... | @@ -4,10 +4,12 @@ |
| 4 | 4 | <LinearLayout |
| 5 | 5 | android:layout_width="match_parent" |
| 6 | 6 | android:layout_height="match_parent" |
| 7 | + android:background="@color/run_main_bg" | |
| 7 | 8 | android:orientation="vertical"> |
| 8 | 9 | |
| 9 | 10 | <FrameLayout |
| 10 | 11 | android:layout_width="match_parent" |
| 12 | + android:background="@color/run_main_bg" | |
| 11 | 13 | android:layout_height="match_parent"> |
| 12 | 14 | |
| 13 | 15 | <LinearLayout | ... | ... |
moudle_pedometer/src/main/res/layout/line_up__item_view.xml
| ... | ... | @@ -4,42 +4,43 @@ |
| 4 | 4 | <data> |
| 5 | 5 | |
| 6 | 6 | </data> |
| 7 | + | |
| 7 | 8 | <RelativeLayout |
| 8 | 9 | android:id="@+id/ry_re" |
| 9 | 10 | android:layout_width="match_parent" |
| 10 | 11 | android:layout_height="wrap_content" |
| 11 | - android:background="@drawable/background" | |
| 12 | - android:layout_marginTop="5dp" | |
| 13 | 12 | android:layout_marginLeft="5dp" |
| 13 | + android:layout_marginTop="5dp" | |
| 14 | 14 | android:layout_marginRight="5dp" |
| 15 | + android:background="@drawable/background" | |
| 15 | 16 | android:padding="15dp"> |
| 16 | 17 | |
| 17 | 18 | <TextView |
| 18 | 19 | android:id="@+id/up_day" |
| 19 | 20 | android:layout_width="wrap_content" |
| 20 | 21 | android:layout_height="wrap_content" |
| 22 | + android:text="5月1日" | |
| 21 | 23 | android:textColor="#333333" |
| 22 | - android:textSize="14sp" | |
| 23 | - android:text="5月1日" /> | |
| 24 | + android:textSize="14sp" /> | |
| 24 | 25 | |
| 25 | 26 | <TextView |
| 26 | 27 | android:id="@+id/up_record_time" |
| 27 | 28 | android:layout_width="wrap_content" |
| 28 | 29 | android:layout_height="wrap_content" |
| 29 | - android:layout_toRightOf="@id/up_day" | |
| 30 | 30 | android:layout_marginLeft="15dp" |
| 31 | + android:layout_toRightOf="@id/up_day" | |
| 32 | + android:text="15:30" | |
| 31 | 33 | android:textColor="#999999" |
| 32 | - android:textSize="14sp" | |
| 33 | - android:text="15:30" /> | |
| 34 | + android:textSize="14sp" /> | |
| 34 | 35 | |
| 35 | 36 | <TextView |
| 36 | 37 | android:layout_width="wrap_content" |
| 37 | 38 | android:layout_height="wrap_content" |
| 39 | + android:layout_alignParentRight="true" | |
| 38 | 40 | android:layout_marginRight="10dp" |
| 39 | - android:textColor="#FE4E4E" | |
| 40 | - android:textSize="12sp" | |
| 41 | 41 | android:text="@string/up_fail" |
| 42 | - android:layout_alignParentRight="true"/> | |
| 42 | + android:textColor="#FE4E4E" | |
| 43 | + android:textSize="12sp" /> | |
| 43 | 44 | |
| 44 | 45 | <LinearLayout |
| 45 | 46 | android:id="@+id/ly" |
| ... | ... | @@ -52,10 +53,10 @@ |
| 52 | 53 | android:id="@+id/up_item_img" |
| 53 | 54 | android:layout_width="80dp" |
| 54 | 55 | android:layout_height="80dp" |
| 55 | - android:scaleType="fitXY" | |
| 56 | - android:visibility="gone" | |
| 57 | 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 | 61 | <RelativeLayout |
| 61 | 62 | android:layout_width="match_parent" |
| ... | ... | @@ -67,31 +68,31 @@ |
| 67 | 68 | android:layout_width="wrap_content" |
| 68 | 69 | android:layout_height="wrap_content" |
| 69 | 70 | android:singleLine="true" |
| 70 | - android:textSize="12sp" | |
| 71 | - android:textColor="#333333"/> | |
| 71 | + android:textColor="#333333" | |
| 72 | + android:textSize="12sp" /> | |
| 72 | 73 | |
| 73 | 74 | <LinearLayout |
| 74 | 75 | android:layout_width="wrap_content" |
| 75 | 76 | android:layout_height="wrap_content" |
| 76 | 77 | android:layout_centerVertical="true" |
| 77 | 78 | android:orientation="horizontal"> |
| 79 | + | |
| 78 | 80 | <TextView |
| 79 | 81 | android:id="@+id/up_kilometer_num" |
| 80 | 82 | android:layout_width="wrap_content" |
| 81 | 83 | android:layout_height="wrap_content" |
| 82 | - android:textColor="#333333" | |
| 83 | - android:textSize="30sp" | |
| 84 | 84 | android:layout_centerVertical="true" |
| 85 | - /> | |
| 85 | + android:textColor="#333333" | |
| 86 | + android:textSize="30sp" /> | |
| 86 | 87 | |
| 87 | 88 | <TextView |
| 88 | 89 | android:layout_width="wrap_content" |
| 89 | 90 | android:layout_height="wrap_content" |
| 90 | 91 | android:layout_centerVertical="true" |
| 92 | + android:layout_marginLeft="5dp" | |
| 91 | 93 | android:text="@string/kilometer" |
| 92 | 94 | android:textColor="#333333" |
| 93 | - android:textSize="12sp" | |
| 94 | - android:layout_marginLeft="5dp"/> | |
| 95 | + android:textSize="12sp" /> | |
| 95 | 96 | </LinearLayout> |
| 96 | 97 | |
| 97 | 98 | |
| ... | ... | @@ -107,7 +108,7 @@ |
| 107 | 108 | android:drawableRight="@drawable/time_cost" |
| 108 | 109 | android:drawablePadding="5dp" |
| 109 | 110 | android:textColor="#333333" |
| 110 | - android:textSize="13sp"/> | |
| 111 | + android:textSize="13sp" /> | |
| 111 | 112 | |
| 112 | 113 | <TextView |
| 113 | 114 | android:id="@+id/up_record_speed" |
| ... | ... | @@ -117,7 +118,7 @@ |
| 117 | 118 | android:drawableRight="@drawable/speed" |
| 118 | 119 | android:drawablePadding="5dp" |
| 119 | 120 | android:textColor="#333333" |
| 120 | - android:textSize="13sp"/> | |
| 121 | + android:textSize="13sp" /> | |
| 121 | 122 | |
| 122 | 123 | <TextView |
| 123 | 124 | android:id="@+id/up_record_step" |
| ... | ... | @@ -125,7 +126,7 @@ |
| 125 | 126 | android:layout_height="wrap_content" |
| 126 | 127 | android:layout_marginLeft="20dp" |
| 127 | 128 | android:drawableRight="@drawable/step" |
| 128 | - android:drawablePadding="5dp"/> | |
| 129 | + android:drawablePadding="5dp" /> | |
| 129 | 130 | </LinearLayout> |
| 130 | 131 | </RelativeLayout> |
| 131 | 132 | </LinearLayout> |
| ... | ... | @@ -134,26 +135,45 @@ |
| 134 | 135 | android:id="@+id/view" |
| 135 | 136 | android:layout_width="match_parent" |
| 136 | 137 | android:layout_height="1dp" |
| 137 | - android:background="@color/line" | |
| 138 | 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 | 143 | android:layout_height="wrap_content" |
| 145 | - android:layout_alignParentRight="true" | |
| 146 | 144 | android:layout_below="@id/view" |
| 147 | 145 | android:layout_marginTop="10dp" |
| 148 | 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 | 178 | </RelativeLayout> |
| 159 | 179 | </layout> | ... | ... |
moudle_pedometer/src/main/res/values/strings.xml
| ... | ... | @@ -78,6 +78,7 @@ |
| 78 | 78 | <string name="finish">完成</string> |
| 79 | 79 | <string name="no_finish">未完成</string> |
| 80 | 80 | <string name="again_up">重新上传</string> |
| 81 | + <string name="delete">删 除</string> | |
| 81 | 82 | <string name="myrecord">我的记录</string> |
| 82 | 83 | <string name="up_fail">上传失败</string> |
| 83 | 84 | <string name="enter_range_tip">您已回归轨迹继续参与运动吧</string> | ... | ... |