Commit a0f4ef1e5e32e586946011d4c51bb468c824ae65
Merge branch 'master' of bj.gitlab.cnlive.com:cnlive-team/ModulePedometer
Showing
10 changed files
with
412 additions
and
121 deletions
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/frame/presenter/CollRunningFinishFragmetPresenter.java
| @@ -84,6 +84,11 @@ public class CollRunningFinishFragmetPresenter extends MvpBasePresenter<CollRunn | @@ -84,6 +84,11 @@ public class CollRunningFinishFragmetPresenter extends MvpBasePresenter<CollRunn | ||
| 84 | if (!TextUtils.isEmpty(userStepEntity.getStepCount())) { | 84 | if (!TextUtils.isEmpty(userStepEntity.getStepCount())) { |
| 85 | double mileage = CollStepUtil.getWalkDistanceKM(Long.parseLong(userStepEntity.getStepCount())); | 85 | double mileage = CollStepUtil.getWalkDistanceKM(Long.parseLong(userStepEntity.getStepCount())); |
| 86 | paramsMap.put("mileage", mileage + ""); | 86 | paramsMap.put("mileage", mileage + ""); |
| 87 | + if (0==mileage){ | ||
| 88 | + paramsMap.put("mileage", "0"); | ||
| 89 | + } | ||
| 90 | + }else { | ||
| 91 | + paramsMap.put("mileage", "0"); | ||
| 87 | } | 92 | } |
| 88 | //开始时间 | 93 | //开始时间 |
| 89 | if (0 != userStepEntity.getStartTimeStamp()) { | 94 | if (0 != userStepEntity.getStartTimeStamp()) { |
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/frame/presenter/RaceNameListPresenter.java
| @@ -12,6 +12,7 @@ import com.cnlive.moudle.collectionTrace.model.RaceNameListInfo; | @@ -12,6 +12,7 @@ import com.cnlive.moudle.collectionTrace.model.RaceNameListInfo; | ||
| 12 | import com.cnlive.moudle.pedometer.net.ApiServiceRunLin; | 12 | import com.cnlive.moudle.pedometer.net.ApiServiceRunLin; |
| 13 | import com.cnlive.moudle.pedometer.net.SubscriptionRequest; | 13 | import com.cnlive.moudle.pedometer.net.SubscriptionRequest; |
| 14 | import com.cnlive.moudle.pedometer.net.bean.BaseInfo; | 14 | import com.cnlive.moudle.pedometer.net.bean.BaseInfo; |
| 15 | +import com.cnlive.moudle.pedometer.utils.QMUITipDialogUtil; | ||
| 15 | import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter; | 16 | import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter; |
| 16 | 17 | ||
| 17 | import java.util.HashMap; | 18 | import java.util.HashMap; |
| @@ -25,11 +26,11 @@ import io.reactivex.disposables.Disposable; | @@ -25,11 +26,11 @@ import io.reactivex.disposables.Disposable; | ||
| 25 | public class RaceNameListPresenter extends MvpBasePresenter<RaceNameListView> { | 26 | public class RaceNameListPresenter extends MvpBasePresenter<RaceNameListView> { |
| 26 | 27 | ||
| 27 | 28 | ||
| 28 | - public void setData(Context context,String eventId, int pageNo, int pageSize){ | 29 | + public void setData(Context context, String eventId, int pageNo, int pageSize) { |
| 29 | HashMap<String, String> map = new HashMap<>(); | 30 | HashMap<String, String> map = new HashMap<>(); |
| 30 | map.put("eventId", eventId); | 31 | map.put("eventId", eventId); |
| 31 | - map.put("pageNo", pageNo+""); | ||
| 32 | - map.put("pageSize", pageSize+""); | 32 | + map.put("pageNo", pageNo + ""); |
| 33 | + map.put("pageSize", pageSize + ""); | ||
| 33 | getView().showLoading(); | 34 | getView().showLoading(); |
| 34 | Logic.create(map).action(new Logic.Action<Map<String, String>, BaseInfo<RaceNameListInfo>>() { | 35 | Logic.create(map).action(new Logic.Action<Map<String, String>, BaseInfo<RaceNameListInfo>>() { |
| 35 | @Override | 36 | @Override |
| @@ -47,7 +48,7 @@ public class RaceNameListPresenter extends MvpBasePresenter<RaceNameListView> { | @@ -47,7 +48,7 @@ public class RaceNameListPresenter extends MvpBasePresenter<RaceNameListView> { | ||
| 47 | }).setSuccessCallback(new SuccessCallback<BaseInfo<RaceNameListInfo>>() { | 48 | }).setSuccessCallback(new SuccessCallback<BaseInfo<RaceNameListInfo>>() { |
| 48 | @Override | 49 | @Override |
| 49 | public void onSuccess(BaseInfo<RaceNameListInfo> registerInfo) { | 50 | public void onSuccess(BaseInfo<RaceNameListInfo> registerInfo) { |
| 50 | - if (getView() != null){ | 51 | + if (getView() != null) { |
| 51 | getView().onSuccess(registerInfo); | 52 | getView().onSuccess(registerInfo); |
| 52 | } | 53 | } |
| 53 | } | 54 | } |
| @@ -56,13 +57,14 @@ public class RaceNameListPresenter extends MvpBasePresenter<RaceNameListView> { | @@ -56,13 +57,14 @@ public class RaceNameListPresenter extends MvpBasePresenter<RaceNameListView> { | ||
| 56 | 57 | ||
| 57 | /** | 58 | /** |
| 58 | * 轨迹删除 | 59 | * 轨迹删除 |
| 60 | + * | ||
| 59 | * @param context | 61 | * @param context |
| 60 | - * @param id 轨迹id | 62 | + * @param id 轨迹id |
| 61 | */ | 63 | */ |
| 62 | - public void delectShoeLine(Context context,int id,int position){ | ||
| 63 | - Map<String,String> map = new HashMap<>(); | ||
| 64 | - map.put("id",id+""); | ||
| 65 | - Logic.create(map).action(new Logic.Action<Map<String,String>, BaseInfo>() { | 64 | + public void delectShoeLine(Context context, int id, int position) { |
| 65 | + Map<String, String> map = new HashMap<>(); | ||
| 66 | + map.put("id", id + ""); | ||
| 67 | + Logic.create(map).action(new Logic.Action<Map<String, String>, BaseInfo>() { | ||
| 66 | @Override | 68 | @Override |
| 67 | public Disposable action(Map<String, String> stringStringMap, DataCallback<BaseInfo> dataCallback) { | 69 | public Disposable action(Map<String, String> stringStringMap, DataCallback<BaseInfo> dataCallback) { |
| 68 | return SubscriptionRequest.service(ApiServiceRunLin.class, api -> api.deleteShoeLineInfo(stringStringMap)).subscribe(context, dataCallback); | 70 | return SubscriptionRequest.service(ApiServiceRunLin.class, api -> api.deleteShoeLineInfo(stringStringMap)).subscribe(context, dataCallback); |
| @@ -78,7 +80,7 @@ public class RaceNameListPresenter extends MvpBasePresenter<RaceNameListView> { | @@ -78,7 +80,7 @@ public class RaceNameListPresenter extends MvpBasePresenter<RaceNameListView> { | ||
| 78 | }).setSuccessCallback(new SuccessCallback<BaseInfo>() { | 80 | }).setSuccessCallback(new SuccessCallback<BaseInfo>() { |
| 79 | @Override | 81 | @Override |
| 80 | public void onSuccess(BaseInfo baseInfo) { | 82 | public void onSuccess(BaseInfo baseInfo) { |
| 81 | - if (getView() != null){ | 83 | + if (getView() != null) { |
| 82 | getView().delectShoeLine(position); | 84 | getView().delectShoeLine(position); |
| 83 | } | 85 | } |
| 84 | } | 86 | } |
| @@ -86,16 +88,21 @@ public class RaceNameListPresenter extends MvpBasePresenter<RaceNameListView> { | @@ -86,16 +88,21 @@ public class RaceNameListPresenter extends MvpBasePresenter<RaceNameListView> { | ||
| 86 | } | 88 | } |
| 87 | 89 | ||
| 88 | /** | 90 | /** |
| 89 | - *踩点轨迹与赛事绑定 | 91 | + * 踩点轨迹与赛事绑定 |
| 92 | + * | ||
| 90 | * @param context | 93 | * @param context |
| 91 | - * @param id 轨迹id | 94 | + * @param id 轨迹id |
| 92 | * @param eventId 赛事id | 95 | * @param eventId 赛事id |
| 93 | */ | 96 | */ |
| 94 | - public void bindingShoeLine(Context context,int id,String eventId,int position){ | ||
| 95 | - Map<String,String> map = new HashMap<>(); | ||
| 96 | - map.put("id",id+""); | ||
| 97 | - map.put("eventId",eventId); | ||
| 98 | - Logic.create(map).action(new Logic.Action<Map<String,String>, BaseInfo<BindingShoeInfo>>() { | 97 | + public void bindingShoeLine(Context context, int id, String eventId, String fenceId, String fenceName, int position) { |
| 98 | + QMUITipDialogUtil.loadingDialog(context, "正在绑定轨迹...", false); | ||
| 99 | + Map<String, String> map = new HashMap<>(); | ||
| 100 | + map.put("id", id + ""); | ||
| 101 | + map.put("eventId", eventId); | ||
| 102 | + map.put("fenceId", fenceId); | ||
| 103 | + map.put("fenceName", fenceName); | ||
| 104 | + | ||
| 105 | + Logic.create(map).action(new Logic.Action<Map<String, String>, BaseInfo<BindingShoeInfo>>() { | ||
| 99 | @Override | 106 | @Override |
| 100 | public Disposable action(Map<String, String> stringStringMap, DataCallback<BaseInfo<BindingShoeInfo>> dataCallback) { | 107 | public Disposable action(Map<String, String> stringStringMap, DataCallback<BaseInfo<BindingShoeInfo>> dataCallback) { |
| 101 | return SubscriptionRequest.service(ApiServiceRunLin.class, api -> api.bindingShoeLineInfo(stringStringMap)).subscribe(context, dataCallback); | 108 | return SubscriptionRequest.service(ApiServiceRunLin.class, api -> api.bindingShoeLineInfo(stringStringMap)).subscribe(context, dataCallback); |
| @@ -104,6 +111,7 @@ public class RaceNameListPresenter extends MvpBasePresenter<RaceNameListView> { | @@ -104,6 +111,7 @@ public class RaceNameListPresenter extends MvpBasePresenter<RaceNameListView> { | ||
| 104 | @Override | 111 | @Override |
| 105 | public void onFailure(int code, String message) { | 112 | public void onFailure(int code, String message) { |
| 106 | if (getView() != null) { | 113 | if (getView() != null) { |
| 114 | + QMUITipDialogUtil.dismessDialog(); | ||
| 107 | getView().showToast(message); | 115 | getView().showToast(message); |
| 108 | getView().hideLoading(); | 116 | getView().hideLoading(); |
| 109 | } | 117 | } |
| @@ -111,8 +119,9 @@ public class RaceNameListPresenter extends MvpBasePresenter<RaceNameListView> { | @@ -111,8 +119,9 @@ public class RaceNameListPresenter extends MvpBasePresenter<RaceNameListView> { | ||
| 111 | }).setSuccessCallback(new SuccessCallback<BaseInfo<BindingShoeInfo>>() { | 119 | }).setSuccessCallback(new SuccessCallback<BaseInfo<BindingShoeInfo>>() { |
| 112 | @Override | 120 | @Override |
| 113 | public void onSuccess(BaseInfo<BindingShoeInfo> baseInfo) { | 121 | public void onSuccess(BaseInfo<BindingShoeInfo> baseInfo) { |
| 114 | - if (getView() != null){ | ||
| 115 | - getView().bindingShoeLine(position,baseInfo); | 122 | + if (getView() != null) { |
| 123 | + QMUITipDialogUtil.dismessDialog(); | ||
| 124 | + getView().bindingShoeLine(position, baseInfo); | ||
| 116 | } | 125 | } |
| 117 | } | 126 | } |
| 118 | }).start(); | 127 | }).start(); |
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/frame/view/CollRunRaceDetailFragmentView.java
| @@ -41,12 +41,16 @@ import com.baidu.mapapi.search.route.RoutePlanSearch; | @@ -41,12 +41,16 @@ import com.baidu.mapapi.search.route.RoutePlanSearch; | ||
| 41 | import com.baidu.mapapi.search.route.TransitRouteResult; | 41 | import com.baidu.mapapi.search.route.TransitRouteResult; |
| 42 | import com.baidu.mapapi.search.route.WalkingRoutePlanOption; | 42 | import com.baidu.mapapi.search.route.WalkingRoutePlanOption; |
| 43 | import com.baidu.mapapi.search.route.WalkingRouteResult; | 43 | import com.baidu.mapapi.search.route.WalkingRouteResult; |
| 44 | +import com.baidu.trace.LBSTraceClient; | ||
| 45 | +import com.baidu.trace.model.SortType; | ||
| 46 | +import com.cnlive.moudle.collectionTrace.ui.activity.RaceNameListActivity; | ||
| 44 | import com.cnlive.moudle.collectionTrace.ui.activity.StartCollectTraceActivity; | 47 | import com.cnlive.moudle.collectionTrace.ui.activity.StartCollectTraceActivity; |
| 45 | import com.cnlive.moudle.collectionTrace.ui.fragment.CollRunRaceDetailFragment; | 48 | import com.cnlive.moudle.collectionTrace.ui.fragment.CollRunRaceDetailFragment; |
| 46 | import com.cnlive.moudle.collectionTrace.commonInfo.CollCommonInfo; | 49 | import com.cnlive.moudle.collectionTrace.commonInfo.CollCommonInfo; |
| 47 | import com.cnlive.moudle.pedometer.model.Constant; | 50 | import com.cnlive.moudle.pedometer.model.Constant; |
| 48 | import com.cnlive.moudle.pedometer.net.bean.RunRaceDetailInfo; | 51 | import com.cnlive.moudle.pedometer.net.bean.RunRaceDetailInfo; |
| 49 | import com.cnlive.moudle.pedometer.utils.BitmapUtil; | 52 | import com.cnlive.moudle.pedometer.utils.BitmapUtil; |
| 53 | +import com.cnlive.moudle.pedometer.utils.MyMapUtil; | ||
| 50 | import com.cnlive.moudle.pedometer.utils.ScreenUtil; | 54 | import com.cnlive.moudle.pedometer.utils.ScreenUtil; |
| 51 | import com.cnlive.moudle.pedometer.utils.TimeUtil; | 55 | import com.cnlive.moudle.pedometer.utils.TimeUtil; |
| 52 | import com.cnlive.strike.application.GlideApp; | 56 | import com.cnlive.strike.application.GlideApp; |
| @@ -94,6 +98,7 @@ public class CollRunRaceDetailFragmentView implements MvpView, SensorEventListen | @@ -94,6 +98,7 @@ public class CollRunRaceDetailFragmentView implements MvpView, SensorEventListen | ||
| 94 | private LatLng startLatLng = new LatLng(39.934733, 116.308646);//起始点 | 98 | private LatLng startLatLng = new LatLng(39.934733, 116.308646);//起始点 |
| 95 | private List<LatLng> trackPoints; | 99 | private List<LatLng> trackPoints; |
| 96 | public RunRaceDetailInfo runRaceDetailInfo; | 100 | public RunRaceDetailInfo runRaceDetailInfo; |
| 101 | + private LBSTraceClient mClient = null; | ||
| 97 | 102 | ||
| 98 | public CollRunRaceDetailFragmentView(CollRunRaceDetailFragment fragment) { | 103 | public CollRunRaceDetailFragmentView(CollRunRaceDetailFragment fragment) { |
| 99 | this.fragment = fragment; | 104 | this.fragment = fragment; |
| @@ -108,6 +113,9 @@ public class CollRunRaceDetailFragmentView implements MvpView, SensorEventListen | @@ -108,6 +113,9 @@ public class CollRunRaceDetailFragmentView implements MvpView, SensorEventListen | ||
| 108 | if (fragment.getActivity() == null) { | 113 | if (fragment.getActivity() == null) { |
| 109 | return; | 114 | return; |
| 110 | } | 115 | } |
| 116 | + if (null == mClient) { | ||
| 117 | + mClient = new LBSTraceClient(getContext()); | ||
| 118 | + } | ||
| 111 | CollCommonInfo.setUserId(getContext(), uid); | 119 | CollCommonInfo.setUserId(getContext(), uid); |
| 112 | this.runRaceDetailInfo = runRaceDetailInfo; | 120 | this.runRaceDetailInfo = runRaceDetailInfo; |
| 113 | //显示地图 | 121 | //显示地图 |
| @@ -128,6 +136,20 @@ public class CollRunRaceDetailFragmentView implements MvpView, SensorEventListen | @@ -128,6 +136,20 @@ public class CollRunRaceDetailFragmentView implements MvpView, SensorEventListen | ||
| 128 | } | 136 | } |
| 129 | }); | 137 | }); |
| 130 | /*************************设置相关页面数据***************************/ | 138 | /*************************设置相关页面数据***************************/ |
| 139 | + //获取轨迹开始时间 | ||
| 140 | + if (!TextUtils.isEmpty(runRaceDetailInfo.getStartTime()) && !TextUtils.isEmpty(runRaceDetailInfo.getEndTime()) && !TextUtils.isEmpty(runRaceDetailInfo.getEntityName())) { | ||
| 141 | + long startTime = Long.parseLong(runRaceDetailInfo.getStartTime()); | ||
| 142 | + long endTime = Long.parseLong(runRaceDetailInfo.getEndTime()); | ||
| 143 | + String entityName = runRaceDetailInfo.getEntityName(); | ||
| 144 | + MyMapUtil.queryHistoryTrace(getContext(), mClient, entityName, startTime, endTime, new MyMapUtil.CallBack() { | ||
| 145 | + @Override | ||
| 146 | + public void success(List<LatLng> resultPoints) { | ||
| 147 | + if (null != resultPoints) { | ||
| 148 | + MyMapUtil.drawHistoryTrack(getContext(), baiduMap, resultPoints, SortType.asc, R.color.green_round, R.drawable.icon_start, R.drawable.icon_end); | ||
| 149 | + } | ||
| 150 | + } | ||
| 151 | + }); | ||
| 152 | + } | ||
| 131 | //设置标题 | 153 | //设置标题 |
| 132 | if (!TextUtils.isEmpty(runRaceDetailInfo.getTitle())) { | 154 | if (!TextUtils.isEmpty(runRaceDetailInfo.getTitle())) { |
| 133 | fragment.binding.includeStreet.tvRaceTitle.setText(runRaceDetailInfo.getTitle()); | 155 | fragment.binding.includeStreet.tvRaceTitle.setText(runRaceDetailInfo.getTitle()); |
| @@ -222,7 +244,9 @@ public class CollRunRaceDetailFragmentView implements MvpView, SensorEventListen | @@ -222,7 +244,9 @@ public class CollRunRaceDetailFragmentView implements MvpView, SensorEventListen | ||
| 222 | @Override | 244 | @Override |
| 223 | public void onClick(View view) { | 245 | public void onClick(View view) { |
| 224 | if (null != runRaceDetailInfo) { | 246 | if (null != runRaceDetailInfo) { |
| 225 | - StartCollectTraceActivity.startActivity(fragment.getActivity(), runRaceDetailInfo); | 247 | + RaceNameListActivity.newInstance(fragment.getActivity(), CollCommonInfo.getStreetId(fragment.getActivity()),runRaceDetailInfo); |
| 248 | + | ||
| 249 | +// StartCollectTraceActivity.startActivity(fragment.getActivity(), runRaceDetailInfo); | ||
| 226 | } | 250 | } |
| 227 | } | 251 | } |
| 228 | }); | 252 | }); |
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/frame/view/CollRunningMapFragmentView.java
| 1 | package com.cnlive.moudle.collectionTrace.frame.view; | 1 | package com.cnlive.moudle.collectionTrace.frame.view; |
| 2 | 2 | ||
| 3 | import android.content.Context; | 3 | import android.content.Context; |
| 4 | +import android.content.Intent; | ||
| 4 | import android.graphics.Bitmap; | 5 | import android.graphics.Bitmap; |
| 5 | import android.graphics.BitmapFactory; | 6 | import android.graphics.BitmapFactory; |
| 6 | import android.hardware.Sensor; | 7 | import android.hardware.Sensor; |
| @@ -38,8 +39,10 @@ import com.cnlive.moudle.collectionTrace.service.CollStepService; | @@ -38,8 +39,10 @@ import com.cnlive.moudle.collectionTrace.service.CollStepService; | ||
| 38 | import com.cnlive.moudle.collectionTrace.ui.activity.CollRunningFinishActivity; | 39 | import com.cnlive.moudle.collectionTrace.ui.activity.CollRunningFinishActivity; |
| 39 | import com.cnlive.moudle.collectionTrace.ui.fragment.CollRunningMapFragment; | 40 | import com.cnlive.moudle.collectionTrace.ui.fragment.CollRunningMapFragment; |
| 40 | import com.cnlive.moudle.collectionTrace.commonInfo.CollCommonInfo; | 41 | import com.cnlive.moudle.collectionTrace.commonInfo.CollCommonInfo; |
| 42 | +import com.cnlive.moudle.pedometer.commonInfo.CommonInfo; | ||
| 41 | import com.cnlive.moudle.pedometer.model.Constant; | 43 | import com.cnlive.moudle.pedometer.model.Constant; |
| 42 | import com.cnlive.moudle.pedometer.net.bean.RunRaceDetailInfo; | 44 | import com.cnlive.moudle.pedometer.net.bean.RunRaceDetailInfo; |
| 45 | +import com.cnlive.moudle.pedometer.service.StepService; | ||
| 43 | import com.cnlive.moudle.pedometer.sql.entity.CollUserStepEntity; | 46 | import com.cnlive.moudle.pedometer.sql.entity.CollUserStepEntity; |
| 44 | import com.cnlive.moudle.pedometer.ui.widget.SelectDialog; | 47 | import com.cnlive.moudle.pedometer.ui.widget.SelectDialog; |
| 45 | import com.cnlive.moudle.pedometer.utils.BitmapUtil; | 48 | import com.cnlive.moudle.pedometer.utils.BitmapUtil; |
| @@ -363,6 +366,7 @@ public class CollRunningMapFragmentView implements MvpView, SensorEventListener | @@ -363,6 +366,7 @@ public class CollRunningMapFragmentView implements MvpView, SensorEventListener | ||
| 363 | if (null == currentImportLatLng || TextUtils.isEmpty(currentAddress)) { | 366 | if (null == currentImportLatLng || TextUtils.isEmpty(currentAddress)) { |
| 364 | return; | 367 | return; |
| 365 | } | 368 | } |
| 369 | + stopStepService(); | ||
| 366 | //保存用户完成时间 | 370 | //保存用户完成时间 |
| 367 | CollStepUtil.setCollUserFinishTimeStamp(getContext(), CollCommonInfo.getUserId(getContext()), TimeUtil.getNowTimeStamp()); | 371 | CollStepUtil.setCollUserFinishTimeStamp(getContext(), CollCommonInfo.getUserId(getContext()), TimeUtil.getNowTimeStamp()); |
| 368 | //设置终点信息 | 372 | //设置终点信息 |
| @@ -386,6 +390,17 @@ public class CollRunningMapFragmentView implements MvpView, SensorEventListener | @@ -386,6 +390,17 @@ public class CollRunningMapFragmentView implements MvpView, SensorEventListener | ||
| 386 | } | 390 | } |
| 387 | } | 391 | } |
| 388 | 392 | ||
| 393 | + private void stopStepService() { | ||
| 394 | + CollCommonInfo.setTsRunBaiduTraceService(getContext(), false); | ||
| 395 | + CollCommonInfo.setIsRunKeepAliveService(getContext(), false); | ||
| 396 | + CollCommonInfo.setIsWriteUserStep(getContext(), false); | ||
| 397 | + CollCommonInfo.setIsFirstStepSendTraceTip(getContext(), true); | ||
| 398 | + if (CollStepService.mClient != null) { | ||
| 399 | + CollStepService.mClient.stopGather(StepService.traceListener); | ||
| 400 | + } | ||
| 401 | + fragment.getActivity().stopService(new Intent(fragment.getActivity(), CollStepService.class)); | ||
| 402 | + } | ||
| 403 | + | ||
| 389 | private void initChrom() { | 404 | private void initChrom() { |
| 390 | //设置计时监听 | 405 | //设置计时监听 |
| 391 | fragment.binding.chronometer.setOnChronometerTickListener(new Chronometer.OnChronometerTickListener() { | 406 | fragment.binding.chronometer.setOnChronometerTickListener(new Chronometer.OnChronometerTickListener() { |
| @@ -537,12 +552,6 @@ public class CollRunningMapFragmentView implements MvpView, SensorEventListener | @@ -537,12 +552,6 @@ public class CollRunningMapFragmentView implements MvpView, SensorEventListener | ||
| 537 | return; | 552 | return; |
| 538 | } | 553 | } |
| 539 | 554 | ||
| 540 | - mCurrentAccracy = location.getRadius(); | ||
| 541 | - followMyLocation = new MyLocationData.Builder() | ||
| 542 | - .accuracy(location.getRadius()) | ||
| 543 | - // 此处设置开发者获取到的方向信息,顺时针0-360 | ||
| 544 | - .direction(mCurrentDirection).latitude(location.getLatitude()) | ||
| 545 | - .longitude(location.getLongitude()).build(); | ||
| 546 | // if (followMyLocation == null || followMyLocation.latitude == 0 || followMyLocation.longitude == 0) { | 555 | // if (followMyLocation == null || followMyLocation.latitude == 0 || followMyLocation.longitude == 0) { |
| 547 | // return; | 556 | // return; |
| 548 | // } | 557 | // } |
| @@ -550,8 +559,13 @@ public class CollRunningMapFragmentView implements MvpView, SensorEventListener | @@ -550,8 +559,13 @@ public class CollRunningMapFragmentView implements MvpView, SensorEventListener | ||
| 550 | //第一次定位 | 559 | //第一次定位 |
| 551 | if (isFirstLoc) { | 560 | if (isFirstLoc) { |
| 552 | isFirstLoc = false; | 561 | isFirstLoc = false; |
| 553 | - if (location.getRadius() > Constant.LOCA_ACCURACY) { | ||
| 554 | - } | 562 | + mCurrentAccracy = location.getRadius(); |
| 563 | + followMyLocation = new MyLocationData.Builder() | ||
| 564 | + .accuracy(location.getRadius()) | ||
| 565 | + // 此处设置开发者获取到的方向信息,顺时针0-360 | ||
| 566 | + .direction(mCurrentDirection).latitude(location.getLatitude()) | ||
| 567 | + .longitude(location.getLongitude()).build(); | ||
| 568 | + | ||
| 555 | baiduMap.setMyLocationData(followMyLocation); | 569 | baiduMap.setMyLocationData(followMyLocation); |
| 556 | builder.target(new LatLng(followMyLocation.latitude, followMyLocation.longitude)).zoom(DEFULT_ZOOM); | 570 | builder.target(new LatLng(followMyLocation.latitude, followMyLocation.longitude)).zoom(DEFULT_ZOOM); |
| 557 | baiduMap.animateMapStatus(MapStatusUpdateFactory.newMapStatus(builder.build())); | 571 | baiduMap.animateMapStatus(MapStatusUpdateFactory.newMapStatus(builder.build())); |
| @@ -561,6 +575,12 @@ public class CollRunningMapFragmentView implements MvpView, SensorEventListener | @@ -561,6 +575,12 @@ public class CollRunningMapFragmentView implements MvpView, SensorEventListener | ||
| 561 | if (location.getRadius() > Constant.LOCA_ACCURACY) { | 575 | if (location.getRadius() > Constant.LOCA_ACCURACY) { |
| 562 | return; | 576 | return; |
| 563 | } | 577 | } |
| 578 | + mCurrentAccracy = location.getRadius(); | ||
| 579 | + followMyLocation = new MyLocationData.Builder() | ||
| 580 | + .accuracy(location.getRadius()) | ||
| 581 | + // 此处设置开发者获取到的方向信息,顺时针0-360 | ||
| 582 | + .direction(mCurrentDirection).latitude(location.getLatitude()) | ||
| 583 | + .longitude(location.getLongitude()).build(); | ||
| 564 | if (null != currentWalkPoints && currentWalkPoints.size() > 0) { | 584 | if (null != currentWalkPoints && currentWalkPoints.size() > 0) { |
| 565 | //进行判断 | 585 | //进行判断 |
| 566 | LatLng lastLatLng = currentWalkPoints.get(currentWalkPoints.size() - 1); | 586 | LatLng lastLatLng = currentWalkPoints.get(currentWalkPoints.size() - 1); |
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/frame/view/CollTraceListDetailFragmentView.java
| @@ -14,6 +14,7 @@ import com.baidu.mapapi.map.Overlay; | @@ -14,6 +14,7 @@ import com.baidu.mapapi.map.Overlay; | ||
| 14 | import com.baidu.mapapi.map.UiSettings; | 14 | import com.baidu.mapapi.map.UiSettings; |
| 15 | import com.baidu.mapapi.model.LatLng; | 15 | import com.baidu.mapapi.model.LatLng; |
| 16 | import com.baidu.trace.LBSTraceClient; | 16 | import com.baidu.trace.LBSTraceClient; |
| 17 | +import com.baidu.trace.model.SortType; | ||
| 17 | import com.bumptech.glide.Glide; | 18 | import com.bumptech.glide.Glide; |
| 18 | import com.cnlive.moudle.collectionTrace.model.CollectPoint; | 19 | import com.cnlive.moudle.collectionTrace.model.CollectPoint; |
| 19 | import com.cnlive.moudle.collectionTrace.model.RaceNameListInfo; | 20 | import com.cnlive.moudle.collectionTrace.model.RaceNameListInfo; |
| @@ -110,76 +111,27 @@ public class CollTraceListDetailFragmentView implements MvpView { | @@ -110,76 +111,27 @@ public class CollTraceListDetailFragmentView implements MvpView { | ||
| 110 | if (!TextUtils.isEmpty(eventShoeLinesBean.getEndTime())) { | 111 | if (!TextUtils.isEmpty(eventShoeLinesBean.getEndTime())) { |
| 111 | fragment.binding.includeFinishUserInfo.tvDate.setText(TimeUtil.getStampToTime(Long.parseLong(eventShoeLinesBean.getEndTime()) * 1000, "yyyy-MM-dd HH:mm")); | 112 | fragment.binding.includeFinishUserInfo.tvDate.setText(TimeUtil.getStampToTime(Long.parseLong(eventShoeLinesBean.getEndTime()) * 1000, "yyyy-MM-dd HH:mm")); |
| 112 | } | 113 | } |
| 114 | + //设置标题 | ||
| 115 | + if (!TextUtils.isEmpty(eventShoeLinesBean.getEventName())) { | ||
| 116 | + fragment.binding.includeFinishUserInfo.tvStreetName.setText(eventShoeLinesBean.getEventName()); | ||
| 117 | + } | ||
| 113 | 118 | ||
| 114 | // //查询用户历史轨迹 | 119 | // //查询用户历史轨迹 |
| 115 | -// if (0 != collUserStepEntity.getStartTimeStamp() && 0 != collUserStepEntity.getFinishTimeStamp()) { | ||
| 116 | -// long startTime = collUserStepEntity.getStartTimeStamp(); | ||
| 117 | -// long endTime = collUserStepEntity.getFinishTimeStamp(); | ||
| 118 | -// //开始查询 | ||
| 119 | -// queryWalkTrace(startTime, endTime); | ||
| 120 | -// if (!TextUtils.isEmpty(collUserStepEntity.getImportPoint())) { | ||
| 121 | -// List<CollectPoint> collectPoints = GsonUtil.jsonToList(collUserStepEntity.getImportPoint(), CollectPoint.class); | ||
| 122 | -// //绘制运营打的点 | ||
| 123 | -// if (null != collectPoints) { | ||
| 124 | -// //根据打点集合,自适应缩放 | ||
| 125 | -// MyMapUtil.setCollMapAutoZoom(baiduMap, collectPoints, -1.5f); | ||
| 126 | -// for (CollectPoint point : collectPoints) { | ||
| 127 | -// LatLng markLatLng = new LatLng(point.getLatitude(), point.getLongitude()); | ||
| 128 | -// if (null != markLatLng) { | ||
| 129 | -// //将点位显示到地图上 | ||
| 130 | -// Overlay overlay = MyMapUtil.setMapMarker(getContext(), baiduMap, markLatLng, R.drawable.icon_map_import); | ||
| 131 | -// if (null != overlay) { | ||
| 132 | -// allMapOverlays.add(overlay); | ||
| 133 | -// } | ||
| 134 | -// } | ||
| 135 | -// } | ||
| 136 | -// } | ||
| 137 | -// } | ||
| 138 | -// } | ||
| 139 | -// //设置用户昵称 | ||
| 140 | -// String nickName = CommonInfo.getUserNickName(getContext()); | ||
| 141 | -// fragment.binding.includeFinishUserInfo.tvUserNickName.setText(nickName); | ||
| 142 | -// //设置用户头像 | ||
| 143 | -// String faceUrl = CommonInfo.getUserIcon(getContext()); | ||
| 144 | -// if (!TextUtils.isEmpty(faceUrl)) { | ||
| 145 | -// GlideApp.with(getContext()).load(faceUrl).into(fragment.binding.includeFinishUserInfo.qmIvIcon); | ||
| 146 | -// } | ||
| 147 | -// //设置标题 | ||
| 148 | -// if (!TextUtils.isEmpty(collUserStepEntity.getStreetTitle())) { | ||
| 149 | -// fragment.binding.includeFinishUserInfo.tvStreetName.setText(collUserStepEntity.getStreetTitle()); | ||
| 150 | -// } | ||
| 151 | -// //设置距离 | ||
| 152 | -// if (!TextUtils.isEmpty(collUserStepEntity.getStepCount())) { | ||
| 153 | -// fragment.binding.includeFinishUserInfo.tvDistance.setText(CollStepUtil.getWalkDistanceKM(Long.parseLong(collUserStepEntity.getStepCount())) + ""); | ||
| 154 | -// } else { | ||
| 155 | -// fragment.binding.includeFinishUserInfo.tvDistance.setText("0"); | ||
| 156 | -// } | ||
| 157 | -// if (0 != collUserStepEntity.getFinishTimeStamp()) { | ||
| 158 | -// //设置日期 | ||
| 159 | -// fragment.binding.includeFinishUserInfo.tvDate.setText(TimeUtil.getStampToTime(collUserStepEntity.getFinishTimeStamp() * 1000, "yyyy-MM-dd HH:mm")); | ||
| 160 | -// } | ||
| 161 | -// //设置适配器 | ||
| 162 | -// if (!TextUtils.isEmpty(collUserStepEntity.getImportPoint())) { | ||
| 163 | -// List<CollectPoint> collectPoints = GsonUtil.jsonToList(collUserStepEntity.getImportPoint(), CollectPoint.class); | ||
| 164 | -// if (null == collectPoints) { | ||
| 165 | -// collectPoints = new ArrayList<>(); | ||
| 166 | -// } | ||
| 167 | -// if (null != startPoint) { | ||
| 168 | -// collectPoints.add(0, startPoint); | ||
| 169 | -// } | ||
| 170 | -// if (null != endPoint) { | ||
| 171 | -// collectPoints.add(endPoint); | ||
| 172 | -// } | ||
| 173 | -// //格式化打的点 | ||
| 174 | -// collectLatLngs = new ArrayList<>(); | ||
| 175 | -// for (CollectPoint collectPoint : collectPoints) { | ||
| 176 | -// collectLatLngs.add(new com.baidu.trace.model.LatLng(collectPoint.getLatitude(), collectPoint.getLongitude())); | ||
| 177 | -// } | ||
| 178 | -// adapter = new CollFinishDetaiAdapter(fragment.getActivity(), collectPoints); | ||
| 179 | -// //设置 | ||
| 180 | -// fragment.binding.includeFinishUserInfo.rvList.setLayoutManager(new LinearLayoutManager(fragment.getActivity())); | ||
| 181 | -// fragment.binding.includeFinishUserInfo.rvList.setAdapter(adapter); | ||
| 182 | -// } | 120 | + if (!TextUtils.isEmpty(eventShoeLinesBean.getStartTime()) && !TextUtils.isEmpty(eventShoeLinesBean.getEndTime()) && !TextUtils.isEmpty(eventShoeLinesBean.getEntityName())) { |
| 121 | + long startTime = Long.parseLong(eventShoeLinesBean.getStartTime()); | ||
| 122 | + long endTime = Long.parseLong(eventShoeLinesBean.getEndTime()); | ||
| 123 | + String entityName = eventShoeLinesBean.getEntityName(); | ||
| 124 | + | ||
| 125 | + //开始查询 | ||
| 126 | + MyMapUtil.queryHistoryTrace(getContext(), mClient, entityName, startTime, endTime, new MyMapUtil.CallBack() { | ||
| 127 | + @Override | ||
| 128 | + public void success(List<LatLng> resultPoints) { | ||
| 129 | + if (null != resultPoints) { | ||
| 130 | + MyMapUtil.drawHistoryTrack(getContext(),baiduMap,resultPoints, SortType.asc,R.color.green_round,R.drawable.icon_start,R.drawable.icon_end); | ||
| 131 | + } | ||
| 132 | + } | ||
| 133 | + }); | ||
| 134 | + } | ||
| 183 | //返回按钮点击 | 135 | //返回按钮点击 |
| 184 | fragment.binding.flBack.setOnClickListener(new View.OnClickListener() { | 136 | fragment.binding.flBack.setOnClickListener(new View.OnClickListener() { |
| 185 | @Override | 137 | @Override |
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/frame/view/RaceNameListView.java
| 1 | package com.cnlive.moudle.collectionTrace.frame.view; | 1 | package com.cnlive.moudle.collectionTrace.frame.view; |
| 2 | 2 | ||
| 3 | +import android.os.Handler; | ||
| 3 | import android.support.v7.widget.LinearLayoutManager; | 4 | import android.support.v7.widget.LinearLayoutManager; |
| 5 | +import android.text.TextUtils; | ||
| 4 | import android.util.Log; | 6 | import android.util.Log; |
| 5 | import android.view.View; | 7 | import android.view.View; |
| 6 | 8 | ||
| 7 | import com.baidu.trace.LBSTraceClient; | 9 | import com.baidu.trace.LBSTraceClient; |
| 8 | import com.baidu.trace.api.fence.AddMonitoredPersonResponse; | 10 | import com.baidu.trace.api.fence.AddMonitoredPersonResponse; |
| 11 | +import com.baidu.trace.api.fence.CreateFenceRequest; | ||
| 9 | import com.baidu.trace.api.fence.CreateFenceResponse; | 12 | import com.baidu.trace.api.fence.CreateFenceResponse; |
| 13 | +import com.baidu.trace.api.fence.DeleteFenceRequest; | ||
| 10 | import com.baidu.trace.api.fence.DeleteFenceResponse; | 14 | import com.baidu.trace.api.fence.DeleteFenceResponse; |
| 11 | import com.baidu.trace.api.fence.DeleteMonitoredPersonResponse; | 15 | import com.baidu.trace.api.fence.DeleteMonitoredPersonResponse; |
| 16 | +import com.baidu.trace.api.fence.FenceInfo; | ||
| 12 | import com.baidu.trace.api.fence.FenceListRequest; | 17 | import com.baidu.trace.api.fence.FenceListRequest; |
| 13 | import com.baidu.trace.api.fence.FenceListResponse; | 18 | import com.baidu.trace.api.fence.FenceListResponse; |
| 19 | +import com.baidu.trace.api.fence.FenceShape; | ||
| 14 | import com.baidu.trace.api.fence.HistoryAlarmResponse; | 20 | import com.baidu.trace.api.fence.HistoryAlarmResponse; |
| 15 | import com.baidu.trace.api.fence.ListMonitoredPersonResponse; | 21 | import com.baidu.trace.api.fence.ListMonitoredPersonResponse; |
| 16 | import com.baidu.trace.api.fence.MonitoredStatusByLocationResponse; | 22 | import com.baidu.trace.api.fence.MonitoredStatusByLocationResponse; |
| 17 | import com.baidu.trace.api.fence.MonitoredStatusResponse; | 23 | import com.baidu.trace.api.fence.MonitoredStatusResponse; |
| 18 | import com.baidu.trace.api.fence.OnFenceListener; | 24 | import com.baidu.trace.api.fence.OnFenceListener; |
| 25 | +import com.baidu.trace.api.fence.PolylineFence; | ||
| 19 | import com.baidu.trace.api.fence.UpdateFenceResponse; | 26 | import com.baidu.trace.api.fence.UpdateFenceResponse; |
| 20 | import com.baidu.trace.model.CoordType; | 27 | import com.baidu.trace.model.CoordType; |
| 28 | +import com.baidu.trace.model.LatLng; | ||
| 21 | import com.cnlive.libs.base.util.AlertUtil; | 29 | import com.cnlive.libs.base.util.AlertUtil; |
| 22 | import com.cnlive.moudle.collectionTrace.commonInfo.CollCommonInfo; | 30 | import com.cnlive.moudle.collectionTrace.commonInfo.CollCommonInfo; |
| 23 | import com.cnlive.moudle.collectionTrace.model.BindingShoeInfo; | 31 | import com.cnlive.moudle.collectionTrace.model.BindingShoeInfo; |
| 32 | +import com.cnlive.moudle.collectionTrace.model.CollectPoint; | ||
| 24 | import com.cnlive.moudle.collectionTrace.model.RaceNameListInfo; | 33 | import com.cnlive.moudle.collectionTrace.model.RaceNameListInfo; |
| 25 | import com.cnlive.moudle.collectionTrace.ui.activity.CollTraceListDetailActivity; | 34 | import com.cnlive.moudle.collectionTrace.ui.activity.CollTraceListDetailActivity; |
| 26 | import com.cnlive.moudle.collectionTrace.ui.activity.StartCollectTraceActivity; | 35 | import com.cnlive.moudle.collectionTrace.ui.activity.StartCollectTraceActivity; |
| @@ -31,6 +40,8 @@ import com.cnlive.moudle.pedometer.model.Constant; | @@ -31,6 +40,8 @@ import com.cnlive.moudle.pedometer.model.Constant; | ||
| 31 | import com.cnlive.moudle.pedometer.net.bean.BaseInfo; | 40 | import com.cnlive.moudle.pedometer.net.bean.BaseInfo; |
| 32 | import com.cnlive.moudle.pedometer.net.bean.RunRaceDetailInfo; | 41 | import com.cnlive.moudle.pedometer.net.bean.RunRaceDetailInfo; |
| 33 | import com.cnlive.moudle.pedometer.ui.widget.SelectDialog; | 42 | import com.cnlive.moudle.pedometer.ui.widget.SelectDialog; |
| 43 | +import com.cnlive.moudle.pedometer.utils.GsonUtil; | ||
| 44 | +import com.cnlive.moudle.pedometer.utils.QMUITipDialogUtil; | ||
| 34 | import com.example.moudle_pedometer.R; | 45 | import com.example.moudle_pedometer.R; |
| 35 | import com.hannesdorfmann.mosby3.mvp.MvpView; | 46 | import com.hannesdorfmann.mosby3.mvp.MvpView; |
| 36 | import com.qmuiteam.qmui.widget.dialog.QMUITipDialog; | 47 | import com.qmuiteam.qmui.widget.dialog.QMUITipDialog; |
| @@ -50,6 +61,9 @@ public class RaceNameListView implements MvpView, OnFenceListener { | @@ -50,6 +61,9 @@ public class RaceNameListView implements MvpView, OnFenceListener { | ||
| 50 | List<RaceNameListInfo.EventShoeLinesBean> list = new ArrayList<>(); | 61 | List<RaceNameListInfo.EventShoeLinesBean> list = new ArrayList<>(); |
| 51 | private RaceNameListAdapter adapter; | 62 | private RaceNameListAdapter adapter; |
| 52 | private LBSTraceClient mClient = null; | 63 | private LBSTraceClient mClient = null; |
| 64 | + private List<LatLng> importPoints; | ||
| 65 | + private RaceNameListInfo.EventShoeLinesBean currentSelBean; | ||
| 66 | + private int currentSelPos = -1; | ||
| 53 | 67 | ||
| 54 | public RaceNameListView(RaceNameListFragment fragment) { | 68 | public RaceNameListView(RaceNameListFragment fragment) { |
| 55 | this.fragment = fragment; | 69 | this.fragment = fragment; |
| @@ -82,8 +96,10 @@ public class RaceNameListView implements MvpView, OnFenceListener { | @@ -82,8 +96,10 @@ public class RaceNameListView implements MvpView, OnFenceListener { | ||
| 82 | } | 96 | } |
| 83 | 97 | ||
| 84 | 98 | ||
| 85 | - public void bindingShoeLine(int position,BaseInfo<BindingShoeInfo> baseInfo) { | ||
| 86 | - if(baseInfo.getData().getEntityName() != null) fragment.entityName = baseInfo.getData().getEntityName(); | 99 | + public void bindingShoeLine(int position, BaseInfo<BindingShoeInfo> baseInfo) { |
| 100 | + if (baseInfo.getData().getEntityName() != null) { | ||
| 101 | + fragment.entityName = baseInfo.getData().getEntityName(); | ||
| 102 | + } | ||
| 87 | list.get(position).setIsEnable(0); | 103 | list.get(position).setIsEnable(0); |
| 88 | for (int i = 0; i < list.size(); i++) { | 104 | for (int i = 0; i < list.size(); i++) { |
| 89 | if (i != position && list.get(i).getIsEnable() == 0) { | 105 | if (i != position && list.get(i).getIsEnable() == 0) { |
| @@ -107,7 +123,8 @@ public class RaceNameListView implements MvpView, OnFenceListener { | @@ -107,7 +123,8 @@ public class RaceNameListView implements MvpView, OnFenceListener { | ||
| 107 | if (adapter == null) { | 123 | if (adapter == null) { |
| 108 | adapter = new RaceNameListAdapter(list, fragment.getActivity()); | 124 | adapter = new RaceNameListAdapter(list, fragment.getActivity()); |
| 109 | fragment.binding.raceRecy.setAdapter(adapter); | 125 | fragment.binding.raceRecy.setAdapter(adapter); |
| 110 | - if(raceNameListInfoBaseInfo.getData().getEntityName() != null) fragment.entityName = raceNameListInfoBaseInfo.getData().getEntityName(); | 126 | + if (raceNameListInfoBaseInfo.getData().getEntityName() != null) |
| 127 | + fragment.entityName = raceNameListInfoBaseInfo.getData().getEntityName(); | ||
| 111 | adapter.setOnItemClick(new RaceNameListAdapter.OnItemClick() { | 128 | adapter.setOnItemClick(new RaceNameListAdapter.OnItemClick() { |
| 112 | @Override | 129 | @Override |
| 113 | public void onItemClickListener(RaceNameListInfo.EventShoeLinesBean eventShoeLinesBean, int position) { | 130 | public void onItemClickListener(RaceNameListInfo.EventShoeLinesBean eventShoeLinesBean, int position) { |
| @@ -117,7 +134,24 @@ public class RaceNameListView implements MvpView, OnFenceListener { | @@ -117,7 +134,24 @@ public class RaceNameListView implements MvpView, OnFenceListener { | ||
| 117 | adapter.setOnAddShoeLineClick(new RaceNameListAdapter.OnAddShoeLineClick() { | 134 | adapter.setOnAddShoeLineClick(new RaceNameListAdapter.OnAddShoeLineClick() { |
| 118 | @Override | 135 | @Override |
| 119 | public void onAddSholeLineClickListener(RaceNameListInfo.EventShoeLinesBean eventShoeLinesBean, int position) { | 136 | public void onAddSholeLineClickListener(RaceNameListInfo.EventShoeLinesBean eventShoeLinesBean, int position) { |
| 120 | - if (list.get(position).getIsEnable() == 0) return; | 137 | + if (list.get(position).getIsEnable() == 0) { |
| 138 | + return; | ||
| 139 | + } | ||
| 140 | + importPoints = null; | ||
| 141 | + currentSelBean = eventShoeLinesBean; | ||
| 142 | + currentSelPos = position; | ||
| 143 | + //设置打的重要点 | ||
| 144 | + if (!TextUtils.isEmpty(eventShoeLinesBean.getLatLongitude())) { | ||
| 145 | + List<CollectPoint> collectPoints = GsonUtil.jsonToList(eventShoeLinesBean.getLatLongitude(), CollectPoint.class); | ||
| 146 | + if (null != collectPoints) { | ||
| 147 | + importPoints = new ArrayList<>(); | ||
| 148 | + for (CollectPoint collectPoint : collectPoints) { | ||
| 149 | + LatLng latLng = new LatLng(collectPoint.getLatitude(), collectPoint.getLongitude()); | ||
| 150 | + importPoints.add(latLng); | ||
| 151 | + } | ||
| 152 | + } | ||
| 153 | + } | ||
| 154 | + | ||
| 121 | SelectDialog selectDialog = new SelectDialog(fragment.getActivity(), "确定绑定该轨迹?", "否", new SelectDialog.DialogInterface() { | 155 | SelectDialog selectDialog = new SelectDialog(fragment.getActivity(), "确定绑定该轨迹?", "否", new SelectDialog.DialogInterface() { |
| 122 | @Override | 156 | @Override |
| 123 | public void onClick(SelectDialog dialog) { | 157 | public void onClick(SelectDialog dialog) { |
| @@ -127,8 +161,21 @@ public class RaceNameListView implements MvpView, OnFenceListener { | @@ -127,8 +161,21 @@ public class RaceNameListView implements MvpView, OnFenceListener { | ||
| 127 | @Override | 161 | @Override |
| 128 | public void onClick(SelectDialog dialog) { | 162 | public void onClick(SelectDialog dialog) { |
| 129 | dialog.cancel(); | 163 | dialog.cancel(); |
| 130 | - //查询当前赛事对应的轨迹列表 | ||
| 131 | - queryFenceList(eventShoeLinesBean.getEventId()); | 164 | + //先判断当前是否已经绑定轨迹 |
| 165 | + if (TextUtils.isEmpty(fragment.entityName)) { | ||
| 166 | + Log.e(TAG, "onClick: 未绑定轨迹"); | ||
| 167 | + //开始绑定轨迹 | ||
| 168 | + //判断是否有打的点 | ||
| 169 | + if (null != importPoints && !TextUtils.isEmpty(eventShoeLinesBean.getDarenId()) && !TextUtils.isEmpty(eventShoeLinesBean.getEventName())) { | ||
| 170 | + addFence(eventShoeLinesBean.getDarenId(), eventShoeLinesBean.getEventName(), importPoints); | ||
| 171 | + } | ||
| 172 | + } else { | ||
| 173 | + Log.e(TAG, "onClick: 已绑定轨迹"); | ||
| 174 | + //开始查询 | ||
| 175 | + queryFenceList(fragment.entityName); | ||
| 176 | + } | ||
| 177 | + | ||
| 178 | +// queryFenceList(eventShoeLinesBean.getEventId()); | ||
| 132 | // fragment.addShoeLine(eventShoeLinesBean, position); | 179 | // fragment.addShoeLine(eventShoeLinesBean, position); |
| 133 | } | 180 | } |
| 134 | }); | 181 | }); |
| @@ -184,6 +231,25 @@ public class RaceNameListView implements MvpView, OnFenceListener { | @@ -184,6 +231,25 @@ public class RaceNameListView implements MvpView, OnFenceListener { | ||
| 184 | fragment.binding.refreshLayout.finishLoadMore(); | 231 | fragment.binding.refreshLayout.finishLoadMore(); |
| 185 | } | 232 | } |
| 186 | 233 | ||
| 234 | + private void addFence(String entityName, String fenceName, List<LatLng> latLngs) { | ||
| 235 | + if (null == fragment.getActivity()) { | ||
| 236 | + return; | ||
| 237 | + } | ||
| 238 | + QMUITipDialogUtil.loadingDialog(fragment.getActivity(), "正在创建地理围栏", false); | ||
| 239 | + int offset = Constant.FENCE_OFFSET;// 偏离距离 | ||
| 240 | + int denoise = Constant.FENCE_DENOISE; //围栏去噪精度 | ||
| 241 | + if (mClient != null && !TextUtils.isEmpty(entityName)) { | ||
| 242 | + new Handler().postDelayed(new Runnable() { | ||
| 243 | + @Override | ||
| 244 | + public void run() { | ||
| 245 | + CreateFenceRequest createFenceRequest = null; | ||
| 246 | + createFenceRequest = CreateFenceRequest.buildServerPolylineRequest(Constant.TAG, Constant.SERVICE_ID, fenceName, entityName, latLngs, offset, denoise, CoordType.gcj02); | ||
| 247 | + mClient.createFence(createFenceRequest, RaceNameListView.this); | ||
| 248 | + } | ||
| 249 | + }, 1000); | ||
| 250 | + } | ||
| 251 | + } | ||
| 252 | + | ||
| 187 | public void showErr(String msg) { | 253 | public void showErr(String msg) { |
| 188 | fragment.binding.refreshLayout.finishRefresh(); | 254 | fragment.binding.refreshLayout.finishRefresh(); |
| 189 | fragment.binding.refreshLayout.finishLoadMore(); | 255 | fragment.binding.refreshLayout.finishLoadMore(); |
| @@ -220,19 +286,26 @@ public class RaceNameListView implements MvpView, OnFenceListener { | @@ -220,19 +286,26 @@ public class RaceNameListView implements MvpView, OnFenceListener { | ||
| 220 | 286 | ||
| 221 | 287 | ||
| 222 | public void showLoading() { | 288 | public void showLoading() { |
| 223 | - if (loadingDiaog != null) loadingDiaog.show(); | 289 | + if (loadingDiaog != null) { |
| 290 | + loadingDiaog.show(); | ||
| 291 | + } | ||
| 224 | } | 292 | } |
| 225 | 293 | ||
| 226 | public void hideLoading() { | 294 | public void hideLoading() { |
| 227 | - if (loadingDiaog != null) loadingDiaog.dismiss(); | 295 | + if (loadingDiaog != null) { |
| 296 | + loadingDiaog.dismiss(); | ||
| 297 | + } | ||
| 228 | } | 298 | } |
| 229 | 299 | ||
| 230 | 300 | ||
| 231 | /** | 301 | /** |
| 232 | * 查询地理围栏 | 302 | * 查询地理围栏 |
| 233 | */ | 303 | */ |
| 234 | - private void queryFenceList(String eventId) { | ||
| 235 | - FenceListRequest fenceListRequest = FenceListRequest.buildServerRequest(Constant.TAG, Constant.SERVICE_ID, eventId, null, CoordType.gcj02, 1, 5000); | 304 | + private void queryFenceList(String entityName) { |
| 305 | + QMUITipDialogUtil.loadingDialog(fragment.getActivity(), "正在查询围栏信息...", false); | ||
| 306 | + List<Long> fenceId = new ArrayList<>(); | ||
| 307 | + fenceId.add(0L); | ||
| 308 | + FenceListRequest fenceListRequest = FenceListRequest.buildServerRequest(Constant.TAG, Constant.SERVICE_ID, entityName, null, CoordType.gcj02, 1, 5000); | ||
| 236 | if (null != mClient || null != fenceListRequest) { | 309 | if (null != mClient || null != fenceListRequest) { |
| 237 | mClient.queryFenceList(fenceListRequest, RaceNameListView.this); | 310 | mClient.queryFenceList(fenceListRequest, RaceNameListView.this); |
| 238 | } | 311 | } |
| @@ -240,7 +313,23 @@ public class RaceNameListView implements MvpView, OnFenceListener { | @@ -240,7 +313,23 @@ public class RaceNameListView implements MvpView, OnFenceListener { | ||
| 240 | 313 | ||
| 241 | @Override | 314 | @Override |
| 242 | public void onCreateFenceCallback(CreateFenceResponse createFenceResponse) { | 315 | public void onCreateFenceCallback(CreateFenceResponse createFenceResponse) { |
| 243 | - | 316 | + //创建围栏成功 |
| 317 | + if (null == createFenceResponse) { | ||
| 318 | + QMUITipDialogUtil.dismessDialog(); | ||
| 319 | + return; | ||
| 320 | + } | ||
| 321 | + Log.e(TAG, "onCreateFenceCallback: " + createFenceResponse.getMessage() + "状态:" + createFenceResponse.getStatus()); | ||
| 322 | + Log.e(TAG, "创建的围栏ID: " + createFenceResponse.getFenceId() + "围栏名称:" + createFenceResponse.getFenceName()); | ||
| 323 | + //围栏创建失败 | ||
| 324 | + if (5102 == createFenceResponse.getStatus()) { | ||
| 325 | + QMUITipDialogUtil.dismessDialog(); | ||
| 326 | + QMUITipDialogUtil.failedDialog(fragment.getActivity(), createFenceResponse.getMessage(), 1); | ||
| 327 | + } else { | ||
| 328 | + if (null != currentSelBean && -1 != currentSelPos) { | ||
| 329 | + QMUITipDialogUtil.dismessDialog(); | ||
| 330 | + fragment.addShoeLine(currentSelBean, createFenceResponse.getFenceId() + "", currentSelPos); | ||
| 331 | + } | ||
| 332 | + } | ||
| 244 | } | 333 | } |
| 245 | 334 | ||
| 246 | @Override | 335 | @Override |
| @@ -250,7 +339,18 @@ public class RaceNameListView implements MvpView, OnFenceListener { | @@ -250,7 +339,18 @@ public class RaceNameListView implements MvpView, OnFenceListener { | ||
| 250 | 339 | ||
| 251 | @Override | 340 | @Override |
| 252 | public void onDeleteFenceCallback(DeleteFenceResponse deleteFenceResponse) { | 341 | public void onDeleteFenceCallback(DeleteFenceResponse deleteFenceResponse) { |
| 253 | - | 342 | + //删除围栏 |
| 343 | + if (null == deleteFenceResponse) { | ||
| 344 | + return; | ||
| 345 | + } | ||
| 346 | + Log.e(TAG, "onDeleteFenceCallback: " + deleteFenceResponse.getMessage() + ",状态:" + deleteFenceResponse.getStatus()); | ||
| 347 | + //删除成功 | ||
| 348 | + if (0 == deleteFenceResponse.getStatus()) { | ||
| 349 | + QMUITipDialogUtil.dismessDialog(); | ||
| 350 | + addFence(currentSelBean.getDarenId(), currentSelBean.getEventName(), importPoints); | ||
| 351 | + } else { | ||
| 352 | + QMUITipDialogUtil.dismessDialog(); | ||
| 353 | + } | ||
| 254 | } | 354 | } |
| 255 | 355 | ||
| 256 | /** | 356 | /** |
| @@ -264,7 +364,49 @@ public class RaceNameListView implements MvpView, OnFenceListener { | @@ -264,7 +364,49 @@ public class RaceNameListView implements MvpView, OnFenceListener { | ||
| 264 | return; | 364 | return; |
| 265 | } | 365 | } |
| 266 | Log.e(TAG, "onFenceListCallback:围栏数量 " + fenceListResponse.getFenceInfos().size() + ",fenceListResponse:" + fenceListResponse.getTotalSize()); | 366 | Log.e(TAG, "onFenceListCallback:围栏数量 " + fenceListResponse.getFenceInfos().size() + ",fenceListResponse:" + fenceListResponse.getTotalSize()); |
| 367 | + List<Long> fenceIdList = null; | ||
| 368 | + if (null != fenceListResponse.getFenceInfos()) { | ||
| 369 | + fenceIdList = new ArrayList<>(); | ||
| 370 | + for (FenceInfo fenceInfo : fenceListResponse.getFenceInfos()) { | ||
| 371 | + //如果是线性围栏 | ||
| 372 | + if (fenceInfo.getFenceShape() == FenceShape.polyline) { | ||
| 373 | + //判断是否是当前围栏名称 | ||
| 374 | + if (null != currentSelBean) { | ||
| 375 | + if (!TextUtils.isEmpty(currentSelBean.getEventName())) { | ||
| 376 | + String serverFenceName = fenceInfo.getPolylineFence().getFenceName(); | ||
| 377 | + String currentFenceName = currentSelBean.getEventName(); | ||
| 378 | + if (serverFenceName.equals(currentFenceName)) { | ||
| 379 | + //添加围栏id | ||
| 380 | + fenceIdList.add(fenceInfo.getPolylineFence().getFenceId()); | ||
| 381 | + } | ||
| 382 | + } | ||
| 383 | + } | ||
| 267 | 384 | ||
| 385 | + } | ||
| 386 | + } | ||
| 387 | + //判断围栏是否查询到 | ||
| 388 | + if (null != fenceIdList && fenceIdList.size() > 0) { | ||
| 389 | + Log.e(TAG, "onFenceListCallback: 获取到围栏数量" + fenceIdList.size()); | ||
| 390 | + List<Long> finalFenceIdList = fenceIdList; | ||
| 391 | + new Handler().postDelayed(new Runnable() { | ||
| 392 | + @Override | ||
| 393 | + public void run() { | ||
| 394 | + QMUITipDialogUtil.dismessDialog(); | ||
| 395 | + //开始删除围栏 | ||
| 396 | + DeleteFenceRequest deleteFenceRequest = DeleteFenceRequest.buildServerRequest(Constant.TAG, Constant.SERVICE_ID, fragment.entityName, finalFenceIdList); | ||
| 397 | + if (null != mClient) { | ||
| 398 | + QMUITipDialogUtil.loadingDialog(fragment.getActivity(), "正在删除围栏", false); | ||
| 399 | + mClient.deleteFence(deleteFenceRequest, RaceNameListView.this); | ||
| 400 | + } | ||
| 401 | + } | ||
| 402 | + }, 1000); | ||
| 403 | + } else { | ||
| 404 | + //没有查询到围栏,直接添加 | ||
| 405 | + addFence(currentSelBean.getDarenId(), currentSelBean.getEventName(), importPoints); | ||
| 406 | + } | ||
| 407 | + } else { | ||
| 408 | + QMUITipDialogUtil.dismessDialog(); | ||
| 409 | + } | ||
| 268 | } | 410 | } |
| 269 | 411 | ||
| 270 | @Override | 412 | @Override |
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/frame/view/StartTraceFragmentView.java
| @@ -210,21 +210,25 @@ public class StartTraceFragmentView implements MvpView, SensorEventListener { | @@ -210,21 +210,25 @@ public class StartTraceFragmentView implements MvpView, SensorEventListener { | ||
| 210 | } | 210 | } |
| 211 | 211 | ||
| 212 | private void checkBaiduServiceState() { | 212 | private void checkBaiduServiceState() { |
| 213 | - boolean isRunBaidu = CollCommonInfo.getIsRunBaiduTraceService(getContext()); | ||
| 214 | - //要运行百度 | ||
| 215 | - if (isRunBaidu) { | 213 | + |
| 214 | +// boolean isRunBaidu = CollCommonInfo.getIsRunBaiduTraceService(getContext()); | ||
| 215 | +// //要运行百度 | ||
| 216 | +// if (isRunBaidu) { | ||
| 216 | //判断百度服务是否运行 | 217 | //判断百度服务是否运行 |
| 217 | - if (!ServiceUtils.isServiceRunning(getContext(), "com.baidu.trace.LBSTraceService")) { | 218 | + boolean isBaiduRun = ServiceUtils.isServiceRunning(getContext(), "com.baidu.trace.LBSTraceService"); |
| 219 | + boolean isKeepRun = ServiceUtils.isServiceRunning(getContext(), "com.cnlive.moudle.collectionTrace.service.CollKeepLiveService"); | ||
| 220 | + boolean isStepRun = ServiceUtils.isServiceRunning(getContext(), "com.cnlive.moudle.collectionTrace.service.CollStepService"); | ||
| 221 | + if (!isBaiduRun || !isKeepRun || !isStepRun) { | ||
| 218 | stopStepService(); | 222 | stopStepService(); |
| 219 | startStepService(getContext()); | 223 | startStepService(getContext()); |
| 220 | } else { | 224 | } else { |
| 221 | CollRunningMapActivity.startActivity(fragment.getActivity(), runRaceDetailInfo); | 225 | CollRunningMapActivity.startActivity(fragment.getActivity(), runRaceDetailInfo); |
| 222 | fragment.getActivity().finish(); | 226 | fragment.getActivity().finish(); |
| 223 | } | 227 | } |
| 224 | - } else { | ||
| 225 | - CollRunningMapActivity.startActivity(fragment.getActivity(), runRaceDetailInfo); | ||
| 226 | - fragment.getActivity().finish(); | ||
| 227 | - } | 228 | +// } else { |
| 229 | +// CollRunningMapActivity.startActivity(fragment.getActivity(), runRaceDetailInfo); | ||
| 230 | +// fragment.getActivity().finish(); | ||
| 231 | +// } | ||
| 228 | } | 232 | } |
| 229 | 233 | ||
| 230 | private void stopStepService() { | 234 | private void stopStepService() { |
| @@ -232,10 +236,13 @@ public class StartTraceFragmentView implements MvpView, SensorEventListener { | @@ -232,10 +236,13 @@ public class StartTraceFragmentView implements MvpView, SensorEventListener { | ||
| 232 | CollCommonInfo.setIsRunKeepAliveService(getContext(), false); | 236 | CollCommonInfo.setIsRunKeepAliveService(getContext(), false); |
| 233 | CollCommonInfo.setIsWriteUserStep(getContext(), false); | 237 | CollCommonInfo.setIsWriteUserStep(getContext(), false); |
| 234 | CollCommonInfo.setIsFirstStepSendTraceTip(getContext(), true); | 238 | CollCommonInfo.setIsFirstStepSendTraceTip(getContext(), true); |
| 239 | + | ||
| 235 | if (CollStepService.mClient != null) { | 240 | if (CollStepService.mClient != null) { |
| 236 | CollStepService.mClient.stopGather(CollStepService.traceListener); | 241 | CollStepService.mClient.stopGather(CollStepService.traceListener); |
| 237 | } | 242 | } |
| 238 | fragment.getActivity().stopService(new Intent(fragment.getActivity(), CollStepService.class)); | 243 | fragment.getActivity().stopService(new Intent(fragment.getActivity(), CollStepService.class)); |
| 244 | + fragment.getActivity().stopService(new Intent(fragment.getActivity(), CollKeepLiveService.class)); | ||
| 245 | + | ||
| 239 | } | 246 | } |
| 240 | 247 | ||
| 241 | /** | 248 | /** |
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/ui/fragment/CollTraceListDetailFragment.java
| @@ -11,13 +11,14 @@ import com.cnlive.moudle.collectionTrace.frame.view.CollTraceListDetailFragmentV | @@ -11,13 +11,14 @@ import com.cnlive.moudle.collectionTrace.frame.view.CollTraceListDetailFragmentV | ||
| 11 | import com.cnlive.moudle.collectionTrace.model.RaceNameListInfo; | 11 | import com.cnlive.moudle.collectionTrace.model.RaceNameListInfo; |
| 12 | import com.example.moudle_pedometer.R; | 12 | import com.example.moudle_pedometer.R; |
| 13 | import com.example.moudle_pedometer.databinding.FragmentCollFinishRunMapBinding; | 13 | import com.example.moudle_pedometer.databinding.FragmentCollFinishRunMapBinding; |
| 14 | +import com.example.moudle_pedometer.databinding.FragmentCollRaceDetailBinding; | ||
| 14 | 15 | ||
| 15 | /** | 16 | /** |
| 16 | * 轨迹列表详情页 | 17 | * 轨迹列表详情页 |
| 17 | * | 18 | * |
| 18 | * @author ShinnyYang | 19 | * @author ShinnyYang |
| 19 | */ | 20 | */ |
| 20 | -public class CollTraceListDetailFragment extends QMUIFragment<CollTraceListDetailFragmentView, CollTraceListDetailFragmentPresenter, FragmentCollFinishRunMapBinding> { | 21 | +public class CollTraceListDetailFragment extends QMUIFragment<CollTraceListDetailFragmentView, CollTraceListDetailFragmentPresenter, FragmentCollRaceDetailBinding> { |
| 21 | private RaceNameListInfo.EventShoeLinesBean eventShoeLinesBean; | 22 | private RaceNameListInfo.EventShoeLinesBean eventShoeLinesBean; |
| 22 | 23 | ||
| 23 | public static CollTraceListDetailFragment newInstance(RaceNameListInfo.EventShoeLinesBean eventShoeLinesBean) { | 24 | public static CollTraceListDetailFragment newInstance(RaceNameListInfo.EventShoeLinesBean eventShoeLinesBean) { |
| @@ -40,13 +41,13 @@ public class CollTraceListDetailFragment extends QMUIFragment<CollTraceListDetai | @@ -40,13 +41,13 @@ public class CollTraceListDetailFragment extends QMUIFragment<CollTraceListDetai | ||
| 40 | 41 | ||
| 41 | @Override | 42 | @Override |
| 42 | protected int getLayoutId() { | 43 | protected int getLayoutId() { |
| 43 | - return R.layout.fragment_coll_finish_run_map; | 44 | + return R.layout.fragment_coll_race_detail; |
| 44 | } | 45 | } |
| 45 | 46 | ||
| 46 | @Override | 47 | @Override |
| 47 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { | 48 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { |
| 48 | super.onViewCreated(view, savedInstanceState); | 49 | super.onViewCreated(view, savedInstanceState); |
| 49 | - StatusBarUtil2.setColor(getActivity(), getResources().getColor(R.color.white), 0); | 50 | + StatusBarUtil2.setColor(getActivity(), getResources().getColor(R.color.run_main_bg), 0); |
| 50 | 51 | ||
| 51 | if (null != getArguments()) { | 52 | if (null != getArguments()) { |
| 52 | eventShoeLinesBean = (RaceNameListInfo.EventShoeLinesBean) getArguments().get("eventShoeLinesBean"); | 53 | eventShoeLinesBean = (RaceNameListInfo.EventShoeLinesBean) getArguments().get("eventShoeLinesBean"); |
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/ui/fragment/RaceNameListFragment.java
| @@ -69,8 +69,8 @@ public class RaceNameListFragment extends MvpBindingFragment<RaceNameListView, R | @@ -69,8 +69,8 @@ public class RaceNameListFragment extends MvpBindingFragment<RaceNameListView, R | ||
| 69 | } | 69 | } |
| 70 | 70 | ||
| 71 | 71 | ||
| 72 | - public void addShoeLine(RaceNameListInfo.EventShoeLinesBean eventShoeLinesBean, int position) { | ||
| 73 | - getPresenter().bindingShoeLine(getActivity(), eventShoeLinesBean.getId(), eventShoeLinesBean.getEventId(), position); | 72 | + public void addShoeLine(RaceNameListInfo.EventShoeLinesBean eventShoeLinesBean, String fenceId, int position) { |
| 73 | + getPresenter().bindingShoeLine(getActivity(), eventShoeLinesBean.getId(), eventShoeLinesBean.getEventId(), fenceId, eventShoeLinesBean.getEventName(), position); | ||
| 74 | } | 74 | } |
| 75 | 75 | ||
| 76 | public void delectShoeLine(RaceNameListInfo.EventShoeLinesBean eventShoeLinesBean, int position) { | 76 | public void delectShoeLine(RaceNameListInfo.EventShoeLinesBean eventShoeLinesBean, int position) { |
moudle_pedometer/src/main/res/layout/fragment_coll_race_detail.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<layout xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 3 | + xmlns:app="http://schemas.android.com/apk/res-auto"> | ||
| 4 | + | ||
| 5 | + <FrameLayout | ||
| 6 | + android:layout_width="match_parent" | ||
| 7 | + android:layout_height="match_parent"> | ||
| 8 | + | ||
| 9 | + <com.sothree.slidinguppanel.SlidingUpPanelLayout xmlns:sothree="http://schemas.android.com/apk/res-auto" | ||
| 10 | + android:id="@+id/sliding_layout" | ||
| 11 | + android:layout_width="match_parent" | ||
| 12 | + android:layout_height="match_parent" | ||
| 13 | + android:gravity="bottom" | ||
| 14 | + sothree:umanoDragView="@+id/dragView" | ||
| 15 | + sothree:umanoFadeColor="@color/black_20" | ||
| 16 | + sothree:umanoOverlay="true" | ||
| 17 | + sothree:umanoPanelHeight="250dp" | ||
| 18 | + sothree:umanoParallaxOffset="0dp" | ||
| 19 | + sothree:umanoScrollableView="@+id/rv_list" | ||
| 20 | + sothree:umanoShadowHeight="0dp"> | ||
| 21 | + | ||
| 22 | + <!-- MAIN CONTENT --> | ||
| 23 | + <FrameLayout | ||
| 24 | + android:layout_width="match_parent" | ||
| 25 | + android:layout_height="match_parent"> | ||
| 26 | + | ||
| 27 | + <com.baidu.mapapi.map.MapView | ||
| 28 | + android:id="@+id/mapView" | ||
| 29 | + android:layout_width="match_parent" | ||
| 30 | + android:layout_height="match_parent"></com.baidu.mapapi.map.MapView> | ||
| 31 | + <!--地图上面加一层类似于全透明黑色蒙版--> | ||
| 32 | + <LinearLayout | ||
| 33 | + android:layout_width="match_parent" | ||
| 34 | + android:layout_height="match_parent" | ||
| 35 | + android:background="#0D000000" | ||
| 36 | + android:clickable="false" | ||
| 37 | + android:focusable="false" | ||
| 38 | + android:focusableInTouchMode="false"></LinearLayout> | ||
| 39 | + | ||
| 40 | + <FrameLayout | ||
| 41 | + android:id="@+id/fl_back" | ||
| 42 | + android:layout_width="55dp" | ||
| 43 | + android:layout_height="55dp" | ||
| 44 | + android:background="@drawable/button_fab_white" | ||
| 45 | + android:focusable="true"> | ||
| 46 | + | ||
| 47 | + <ImageView | ||
| 48 | + android:layout_width="12dp" | ||
| 49 | + android:layout_height="20dp" | ||
| 50 | + android:layout_gravity="center" | ||
| 51 | + android:layout_marginLeft="-2dp" | ||
| 52 | + android:background="@drawable/icon_back" | ||
| 53 | + android:focusable="false" /> | ||
| 54 | + </FrameLayout> | ||
| 55 | + | ||
| 56 | + <FrameLayout | ||
| 57 | + android:layout_width="55dp" | ||
| 58 | + android:layout_height="55dp" | ||
| 59 | + android:layout_gravity="right" | ||
| 60 | + android:background="@drawable/button_fab_white" | ||
| 61 | + android:focusable="true" | ||
| 62 | + android:visibility="gone"> | ||
| 63 | + | ||
| 64 | + <ImageView | ||
| 65 | + android:layout_width="19dp" | ||
| 66 | + android:layout_height="18dp" | ||
| 67 | + android:layout_gravity="center" | ||
| 68 | + android:background="@drawable/icon_share" /> | ||
| 69 | + </FrameLayout> | ||
| 70 | + <!----> | ||
| 71 | + | ||
| 72 | + | ||
| 73 | + </FrameLayout> | ||
| 74 | + | ||
| 75 | + <!-- SLIDING LAYOUT --> | ||
| 76 | + <FrameLayout | ||
| 77 | + android:id="@+id/dragView" | ||
| 78 | + android:layout_width="match_parent" | ||
| 79 | + android:layout_height="wrap_content" | ||
| 80 | + android:clickable="true" | ||
| 81 | + android:focusable="false" | ||
| 82 | + android:orientation="vertical"> | ||
| 83 | + | ||
| 84 | + | ||
| 85 | + <LinearLayout | ||
| 86 | + android:id="@+id/ll_root" | ||
| 87 | + android:layout_width="match_parent" | ||
| 88 | + android:layout_height="wrap_content" | ||
| 89 | + android:layout_marginBottom="0dp" | ||
| 90 | + android:orientation="vertical"> | ||
| 91 | + | ||
| 92 | + | ||
| 93 | + <!--用户个人信息--> | ||
| 94 | + <include | ||
| 95 | + android:id="@+id/include_finish_user_info" | ||
| 96 | + layout="@layout/layout_coll_finish_user_info" /> | ||
| 97 | + </LinearLayout> | ||
| 98 | + | ||
| 99 | + | ||
| 100 | + </FrameLayout> | ||
| 101 | + </com.sothree.slidinguppanel.SlidingUpPanelLayout> | ||
| 102 | + <!--按钮--> | ||
| 103 | + <LinearLayout | ||
| 104 | + android:id="@+id/rl_scrollView_startBtn" | ||
| 105 | + android:layout_width="match_parent" | ||
| 106 | + android:layout_height="40sp" | ||
| 107 | + android:layout_gravity="bottom" | ||
| 108 | + android:focusable="true" | ||
| 109 | + android:clickable="true" | ||
| 110 | + android:focusableInTouchMode="true" | ||
| 111 | + android:background="@color/green_round" | ||
| 112 | + android:gravity="center" | ||
| 113 | + android:tag="0"> | ||
| 114 | + | ||
| 115 | + | ||
| 116 | + <TextView | ||
| 117 | + android:id="@+id/tv_run_now" | ||
| 118 | + android:layout_width="wrap_content" | ||
| 119 | + android:layout_height="wrap_content" | ||
| 120 | + android:layout_centerInParent="true" | ||
| 121 | + android:layout_marginLeft="5dp" | ||
| 122 | + android:clickable="false" | ||
| 123 | + android:focusable="false" | ||
| 124 | + android:focusableInTouchMode="false" | ||
| 125 | + android:tag="0" | ||
| 126 | + android:text="确定轨迹" | ||
| 127 | + android:textColor="@color/white" | ||
| 128 | + android:textSize="18sp" /> | ||
| 129 | + </LinearLayout> | ||
| 130 | + </FrameLayout> | ||
| 131 | +</layout> | ||
| 0 | \ No newline at end of file | 132 | \ No newline at end of file |