Commit 6dae87fd369cb89c941529e7951d4d21d75a81e6
1 parent
6f8adc1d
1 路径工具,打点页面逻辑
Showing
2 changed files
with
21 additions
and
69 deletions
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/frame/view/CollTraceListDetailFragmentView.java
| ... | ... | @@ -14,6 +14,7 @@ import com.baidu.mapapi.map.Overlay; |
| 14 | 14 | import com.baidu.mapapi.map.UiSettings; |
| 15 | 15 | import com.baidu.mapapi.model.LatLng; |
| 16 | 16 | import com.baidu.trace.LBSTraceClient; |
| 17 | +import com.baidu.trace.model.SortType; | |
| 17 | 18 | import com.bumptech.glide.Glide; |
| 18 | 19 | import com.cnlive.moudle.collectionTrace.model.CollectPoint; |
| 19 | 20 | import com.cnlive.moudle.collectionTrace.model.RaceNameListInfo; |
| ... | ... | @@ -110,76 +111,27 @@ public class CollTraceListDetailFragmentView implements MvpView { |
| 110 | 111 | if (!TextUtils.isEmpty(eventShoeLinesBean.getEndTime())) { |
| 111 | 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 | 136 | fragment.binding.flBack.setOnClickListener(new View.OnClickListener() { |
| 185 | 137 | @Override | ... | ... |
moudle_pedometer/src/main/res/layout/fragment_coll_finish_run_map.xml