Commit 043dc4d8b1c65c5fcb572f36e93d1a0b57244c5f
1 parent
63fcc83f
1.赛事详情
Showing
74 changed files
with
328 additions
and
197 deletions
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/presenter/RunningMapFragmentPresenter.java
| @@ -309,8 +309,8 @@ public class RunningMapFragmentPresenter extends MvpBasePresenter<RunningMapFrag | @@ -309,8 +309,8 @@ public class RunningMapFragmentPresenter extends MvpBasePresenter<RunningMapFrag | ||
| 309 | //创建地理围栏 | 309 | //创建地理围栏 |
| 310 | public void createFence(Context context, List<com.baidu.trace.model.LatLng> latLngs) { | 310 | public void createFence(Context context, List<com.baidu.trace.model.LatLng> latLngs) { |
| 311 | CreateFenceRequest createFenceRequest = null; | 311 | CreateFenceRequest createFenceRequest = null; |
| 312 | - int offset = 1;// 偏离距离 | ||
| 313 | - int denoise = 5; //围栏去噪精度 | 312 | + int offset = 20;// 偏离距离 |
| 313 | + int denoise = 20; //围栏去噪精度 | ||
| 314 | // 初始化围栏监听器 | 314 | // 初始化围栏监听器 |
| 315 | OnFenceListener onFenceListener = new OnFenceListener() { | 315 | OnFenceListener onFenceListener = new OnFenceListener() { |
| 316 | // 创建围栏回调 | 316 | // 创建围栏回调 |
| @@ -428,8 +428,8 @@ public class RunningMapFragmentPresenter extends MvpBasePresenter<RunningMapFrag | @@ -428,8 +428,8 @@ public class RunningMapFragmentPresenter extends MvpBasePresenter<RunningMapFrag | ||
| 428 | } | 428 | } |
| 429 | 429 | ||
| 430 | List<Long> fenid = new ArrayList<>(); | 430 | List<Long> fenid = new ArrayList<>(); |
| 431 | - fenid.add(107L); | ||
| 432 | - MonitoredStatusRequest request1 = MonitoredStatusRequest.buildLocalRequest(1, | 431 | + fenid.add(111L); |
| 432 | + MonitoredStatusRequest request1 = MonitoredStatusRequest.buildServerRequest(1, | ||
| 433 | StepService.serviceId, "yangshuai", fenid); | 433 | StepService.serviceId, "yangshuai", fenid); |
| 434 | Handler handler = new Handler(); | 434 | Handler handler = new Handler(); |
| 435 | Runnable runnable = new Runnable() { | 435 | Runnable runnable = new Runnable() { |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RunMainFragmentView.java
| @@ -21,6 +21,7 @@ import com.cnlive.moudle.pedometer.ui.widget.SelectDialog; | @@ -21,6 +21,7 @@ import com.cnlive.moudle.pedometer.ui.widget.SelectDialog; | ||
| 21 | import com.cnlive.moudle.pedometer.utils.ButtonAnimUtil; | 21 | import com.cnlive.moudle.pedometer.utils.ButtonAnimUtil; |
| 22 | import com.cnlive.moudle.pedometer.utils.MySpHelper; | 22 | import com.cnlive.moudle.pedometer.utils.MySpHelper; |
| 23 | import com.cnlive.moudle.pedometer.utils.StepUtil; | 23 | import com.cnlive.moudle.pedometer.utils.StepUtil; |
| 24 | +import com.cnlive.moudle.pedometer.utils.TimeUtil; | ||
| 24 | import com.example.moudle_pedometer.R; | 25 | import com.example.moudle_pedometer.R; |
| 25 | import com.hannesdorfmann.mosby3.mvp.MvpView; | 26 | import com.hannesdorfmann.mosby3.mvp.MvpView; |
| 26 | 27 | ||
| @@ -60,7 +61,8 @@ public class RunMainFragmentView implements MvpView { | @@ -60,7 +61,8 @@ public class RunMainFragmentView implements MvpView { | ||
| 60 | * 初始化相关视图 | 61 | * 初始化相关视图 |
| 61 | */ | 62 | */ |
| 62 | public void initView() { | 63 | public void initView() { |
| 63 | - uid = "yangshuai11"; | 64 | + uid = "yangshuai"; |
| 65 | + MySpHelper.getInstance(getContext(), Context.MODE_MULTI_PROCESS).putString("userId", uid); | ||
| 64 | fragment.binding.llRunMainRoot.setVisibility(View.GONE); | 66 | fragment.binding.llRunMainRoot.setVisibility(View.GONE); |
| 65 | ButtonAnimUtil.startAnimation(fragment.binding.llStartTimeTip, false); | 67 | ButtonAnimUtil.startAnimation(fragment.binding.llStartTimeTip, false); |
| 66 | firstTimeFlag = true; | 68 | firstTimeFlag = true; |
| @@ -93,7 +95,7 @@ public class RunMainFragmentView implements MvpView { | @@ -93,7 +95,7 @@ public class RunMainFragmentView implements MvpView { | ||
| 93 | } | 95 | } |
| 94 | }, 10); | 96 | }, 10); |
| 95 | //开启计步服务 | 97 | //开启计步服务 |
| 96 | - startStepService(uid); | 98 | + startStepService(getContext(), uid); |
| 97 | } | 99 | } |
| 98 | } | 100 | } |
| 99 | }; | 101 | }; |
| @@ -145,7 +147,7 @@ public class RunMainFragmentView implements MvpView { | @@ -145,7 +147,7 @@ public class RunMainFragmentView implements MvpView { | ||
| 145 | } | 147 | } |
| 146 | }, 10); | 148 | }, 10); |
| 147 | //开启计步服务 | 149 | //开启计步服务 |
| 148 | - startStepService(uid); | 150 | + startStepService(getContext(), uid); |
| 149 | } | 151 | } |
| 150 | 152 | ||
| 151 | //设置继续按钮,缩放效果 | 153 | //设置继续按钮,缩放效果 |
| @@ -250,6 +252,7 @@ public class RunMainFragmentView implements MvpView { | @@ -250,6 +252,7 @@ public class RunMainFragmentView implements MvpView { | ||
| 250 | } | 252 | } |
| 251 | MySpHelper.getInstance(getContext(), Context.MODE_MULTI_PROCESS).putLong("stepStartTime", 0); | 253 | MySpHelper.getInstance(getContext(), Context.MODE_MULTI_PROCESS).putLong("stepStartTime", 0); |
| 252 | fragment.getActivity().stopService(new Intent(fragment.getActivity(), StepService.class)); | 254 | fragment.getActivity().stopService(new Intent(fragment.getActivity(), StepService.class)); |
| 255 | + MySpHelper.getInstance(getContext(), Context.MODE_MULTI_PROCESS).putString("userId", ""); | ||
| 253 | 256 | ||
| 254 | // fragment.getActivity().finish(); | 257 | // fragment.getActivity().finish(); |
| 255 | } | 258 | } |
| @@ -381,9 +384,9 @@ public class RunMainFragmentView implements MvpView { | @@ -381,9 +384,9 @@ public class RunMainFragmentView implements MvpView { | ||
| 381 | * | 384 | * |
| 382 | * @param userId | 385 | * @param userId |
| 383 | */ | 386 | */ |
| 384 | - public void startStepService(String userId) { | 387 | + public void startStepService(Context context, String userId) { |
| 385 | Intent intent = new Intent(fragment.getActivity(), StepService.class); | 388 | Intent intent = new Intent(fragment.getActivity(), StepService.class); |
| 386 | - intent.putExtra("userId", userId); | 389 | +// intent.putExtra("userId", userId); |
| 387 | ContextCompat.startForegroundService(fragment.getActivity(), intent); | 390 | ContextCompat.startForegroundService(fragment.getActivity(), intent); |
| 388 | 391 | ||
| 389 | } | 392 | } |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RunRaceDetailFragmentView.java
| @@ -20,6 +20,7 @@ import com.baidu.mapapi.map.BaiduMap; | @@ -20,6 +20,7 @@ import com.baidu.mapapi.map.BaiduMap; | ||
| 20 | import com.baidu.mapapi.map.BitmapDescriptor; | 20 | import com.baidu.mapapi.map.BitmapDescriptor; |
| 21 | import com.baidu.mapapi.map.BitmapDescriptorFactory; | 21 | import com.baidu.mapapi.map.BitmapDescriptorFactory; |
| 22 | import com.baidu.mapapi.map.MapStatus; | 22 | import com.baidu.mapapi.map.MapStatus; |
| 23 | +import com.baidu.mapapi.map.MapStatusUpdate; | ||
| 23 | import com.baidu.mapapi.map.MapStatusUpdateFactory; | 24 | import com.baidu.mapapi.map.MapStatusUpdateFactory; |
| 24 | import com.baidu.mapapi.map.MapView; | 25 | import com.baidu.mapapi.map.MapView; |
| 25 | import com.baidu.mapapi.map.MarkerOptions; | 26 | import com.baidu.mapapi.map.MarkerOptions; |
| @@ -30,6 +31,7 @@ import com.baidu.mapapi.map.OverlayOptions; | @@ -30,6 +31,7 @@ import com.baidu.mapapi.map.OverlayOptions; | ||
| 30 | import com.baidu.mapapi.map.PolylineOptions; | 31 | import com.baidu.mapapi.map.PolylineOptions; |
| 31 | import com.baidu.mapapi.map.UiSettings; | 32 | import com.baidu.mapapi.map.UiSettings; |
| 32 | import com.baidu.mapapi.model.LatLng; | 33 | import com.baidu.mapapi.model.LatLng; |
| 34 | +import com.baidu.mapapi.model.LatLngBounds; | ||
| 33 | import com.baidu.mapapi.search.core.SearchResult; | 35 | import com.baidu.mapapi.search.core.SearchResult; |
| 34 | import com.baidu.mapapi.search.route.BikingRouteResult; | 36 | import com.baidu.mapapi.search.route.BikingRouteResult; |
| 35 | import com.baidu.mapapi.search.route.DrivingRouteResult; | 37 | import com.baidu.mapapi.search.route.DrivingRouteResult; |
| @@ -41,6 +43,9 @@ import com.baidu.mapapi.search.route.RoutePlanSearch; | @@ -41,6 +43,9 @@ import com.baidu.mapapi.search.route.RoutePlanSearch; | ||
| 41 | import com.baidu.mapapi.search.route.TransitRouteResult; | 43 | import com.baidu.mapapi.search.route.TransitRouteResult; |
| 42 | import com.baidu.mapapi.search.route.WalkingRoutePlanOption; | 44 | import com.baidu.mapapi.search.route.WalkingRoutePlanOption; |
| 43 | import com.baidu.mapapi.search.route.WalkingRouteResult; | 45 | import com.baidu.mapapi.search.route.WalkingRouteResult; |
| 46 | +import com.baidu.mapapi.utils.DistanceUtil; | ||
| 47 | +import com.baidu.trace.api.analysis.EndPoint; | ||
| 48 | +import com.baidu.trace.model.SortType; | ||
| 44 | import com.cnlive.moudle.pedometer.ui.activity.PedometerMainActivity; | 49 | import com.cnlive.moudle.pedometer.ui.activity.PedometerMainActivity; |
| 45 | import com.cnlive.moudle.pedometer.ui.activity.RaceRecordActivity; | 50 | import com.cnlive.moudle.pedometer.ui.activity.RaceRecordActivity; |
| 46 | import com.cnlive.moudle.pedometer.ui.activity.RegistrationInfoActivity; | 51 | import com.cnlive.moudle.pedometer.ui.activity.RegistrationInfoActivity; |
| @@ -48,6 +53,7 @@ import com.cnlive.moudle.pedometer.ui.activity.RunningMapActivity; | @@ -48,6 +53,7 @@ import com.cnlive.moudle.pedometer.ui.activity.RunningMapActivity; | ||
| 48 | import com.cnlive.moudle.pedometer.ui.activity.TakePartActivity; | 53 | import com.cnlive.moudle.pedometer.ui.activity.TakePartActivity; |
| 49 | import com.cnlive.moudle.pedometer.ui.fragment.RunMainFragment; | 54 | import com.cnlive.moudle.pedometer.ui.fragment.RunMainFragment; |
| 50 | import com.cnlive.moudle.pedometer.ui.fragment.RunRaceDetailFragment; | 55 | import com.cnlive.moudle.pedometer.ui.fragment.RunRaceDetailFragment; |
| 56 | +import com.cnlive.moudle.pedometer.ui.widget.TipDialog; | ||
| 51 | import com.cnlive.moudle.pedometer.utils.BitmapUtil; | 57 | import com.cnlive.moudle.pedometer.utils.BitmapUtil; |
| 52 | import com.cnlive.moudle.pedometer.utils.GsonUtil; | 58 | import com.cnlive.moudle.pedometer.utils.GsonUtil; |
| 53 | import com.cnlive.moudle.pedometer.utils.MyMapUtil; | 59 | import com.cnlive.moudle.pedometer.utils.MyMapUtil; |
| @@ -98,6 +104,8 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { | @@ -98,6 +104,8 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { | ||
| 98 | private String test = "[{\"latitude\":39.933889208848,\"latitudeE6\":3.9933889208848E7,\"longitude\":116.30900265517,\"longitudeE6\":1.1630900265517001E8},{\"latitude\":39.933868507347,\"latitudeE6\":3.9933868507347E7,\"longitude\":116.30865416508,\"longitudeE6\":1.1630865416508E8},{\"latitude\":39.934756505077,\"latitudeE6\":3.9934756505077E7,\"longitude\":116.30860516469,\"longitudeE6\":1.1630860516468999E8},{\"latitude\":39.934781620502,\"latitudeE6\":3.9934781620502E7,\"longitude\":116.30961013007,\"longitudeE6\":1.1630961013007E8},{\"latitude\":39.934881620374,\"latitudeE6\":3.9934881620374E7,\"longitude\":116.30960513008,\"longitudeE6\":1.1630960513008E8},{\"latitude\":39.934077623132,\"latitudeE6\":3.9934077623132E7,\"longitude\":116.30965812942,\"longitudeE6\":1.1630965812942E8},{\"latitude\":39.933972618463,\"latitudeE6\":3.9933972618463E7,\"longitude\":116.30962113087,\"longitudeE6\":1.1630962113087E8},{\"latitude\":39.933932608856,\"latitudeE6\":3.9933932608856E7,\"longitude\":116.30953913383,\"longitudeE6\":1.1630953913383E8},{\"latitude\":39.933903844942,\"latitudeE6\":3.9933903844942E7,\"longitude\":116.30918357649,\"longitudeE6\":1.1630918357649E8}]"; | 104 | private String test = "[{\"latitude\":39.933889208848,\"latitudeE6\":3.9933889208848E7,\"longitude\":116.30900265517,\"longitudeE6\":1.1630900265517001E8},{\"latitude\":39.933868507347,\"latitudeE6\":3.9933868507347E7,\"longitude\":116.30865416508,\"longitudeE6\":1.1630865416508E8},{\"latitude\":39.934756505077,\"latitudeE6\":3.9934756505077E7,\"longitude\":116.30860516469,\"longitudeE6\":1.1630860516468999E8},{\"latitude\":39.934781620502,\"latitudeE6\":3.9934781620502E7,\"longitude\":116.30961013007,\"longitudeE6\":1.1630961013007E8},{\"latitude\":39.934881620374,\"latitudeE6\":3.9934881620374E7,\"longitude\":116.30960513008,\"longitudeE6\":1.1630960513008E8},{\"latitude\":39.934077623132,\"latitudeE6\":3.9934077623132E7,\"longitude\":116.30965812942,\"longitudeE6\":1.1630965812942E8},{\"latitude\":39.933972618463,\"latitudeE6\":3.9933972618463E7,\"longitude\":116.30962113087,\"longitudeE6\":1.1630962113087E8},{\"latitude\":39.933932608856,\"latitudeE6\":3.9933932608856E7,\"longitude\":116.30953913383,\"longitudeE6\":1.1630953913383E8},{\"latitude\":39.933903844942,\"latitudeE6\":3.9933903844942E7,\"longitude\":116.30918357649,\"longitudeE6\":1.1630918357649E8}]"; |
| 99 | private LinkedList<LatLng> importLatLngs;//关键点 | 105 | private LinkedList<LatLng> importLatLngs;//关键点 |
| 100 | private LatLng startLatLng = new LatLng(39.934733, 116.308646);//起始点 | 106 | private LatLng startLatLng = new LatLng(39.934733, 116.308646);//起始点 |
| 107 | + private List<LatLng> trackPoints; | ||
| 108 | + | ||
| 101 | 109 | ||
| 102 | public RunRaceDetailFragmentView(RunRaceDetailFragment fragment) { | 110 | public RunRaceDetailFragmentView(RunRaceDetailFragment fragment) { |
| 103 | this.fragment = fragment; | 111 | this.fragment = fragment; |
| @@ -111,48 +119,14 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { | @@ -111,48 +119,14 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { | ||
| 111 | if (fragment.getActivity() == null) { | 119 | if (fragment.getActivity() == null) { |
| 112 | return; | 120 | return; |
| 113 | } | 121 | } |
| 114 | - initMap(); | ||
| 115 | - List<LatLng> trackPoints = GsonUtil.jsonToList(test, LatLng.class); | ||
| 116 | - Log.e(TAG, "initView: " + trackPoints.size()); | ||
| 117 | //初始化运营人员所选的关键点 | 122 | //初始化运营人员所选的关键点 |
| 118 | - importLatLngs = new LinkedList<>(); | ||
| 119 | -// importLatLngs.add(new LatLng(39.935861,116.308621)); | ||
| 120 | -// importLatLngs.add(new LatLng( 39.934948,116.308605)); | ||
| 121 | -// importLatLngs.add(new LatLng( 39.934516,116.3086)); | ||
| 122 | -// importLatLngs.add(new LatLng( 39.934121,116.30861)); | ||
| 123 | -// importLatLngs.add(new LatLng( 39.934105,116.308605)); | ||
| 124 | -// | ||
| 125 | -// | ||
| 126 | -// importLatLngs.add(new LatLng( 39.933702,116.3086)); | ||
| 127 | - importLatLngs.add(new LatLng(39.933890, 116.308726)); | ||
| 128 | - importLatLngs.add(new LatLng(39.933943, 116.309627)); | ||
| 129 | - importLatLngs.add(new LatLng(39.934733, 116.309515)); | ||
| 130 | - importLatLngs.add(new LatLng(39.934733, 116.308742)); | ||
| 131 | - | ||
| 132 | - MyMapUtil.drawMapLine(getContext(), baiduMap, trackPoints, R.color.red); | ||
| 133 | - | ||
| 134 | -// searchRouteResult(new LatLng(39.934266, 116.309228), new LatLng(39.939756, 116.319766), 0); | ||
| 135 | - | ||
| 136 | - | ||
| 137 | - //根据几个关键点进行步行路径规划 | ||
| 138 | -// if (importLatLngs != null) { | ||
| 139 | -// if (importLatLngs.size() >= 1) { | ||
| 140 | -// for (int index = 0; index < importLatLngs.size(); index++) { | ||
| 141 | -// //开始分段规划路径 | ||
| 142 | -// //第一个点 | ||
| 143 | -// if (index == 0) { | ||
| 144 | -// searchRouteResult(startLatLng, importLatLngs.get(index), 0); | ||
| 145 | -// } else { | ||
| 146 | -// searchRouteResult(importLatLngs.get(index - 1), importLatLngs.get(index), index); | ||
| 147 | -// } | ||
| 148 | -// } | ||
| 149 | -// } else { | ||
| 150 | -// } | ||
| 151 | -// } | 123 | + trackPoints = GsonUtil.jsonToList(test, LatLng.class); |
| 124 | + initMap(); | ||
| 125 | + MyMapUtil.drawServerLineTrack(getContext(), baiduMap, trackPoints, SortType.asc, R.color.green_round, R.drawable.icon_start, R.drawable.icon_end); | ||
| 152 | //设置底部卡片第一次可滑动的位置 | 126 | //设置底部卡片第一次可滑动的位置 |
| 153 | fragment.binding.slidingLayout.setAnchorPoint(0.6f); | 127 | fragment.binding.slidingLayout.setAnchorPoint(0.6f); |
| 154 | //设置底部卡片初始位置 | 128 | //设置底部卡片初始位置 |
| 155 | - fragment.binding.slidingLayout.setPanelHeight(ScreenUtil.dip2px(fragment.getActivity(), 200)); | 129 | + fragment.binding.slidingLayout.setPanelHeight(ScreenUtil.dip2px(fragment.getActivity(), 140)); |
| 156 | fragment.binding.slidingLayout.addPanelSlideListener(new SlidingUpPanelLayout.PanelSlideListener() { | 130 | fragment.binding.slidingLayout.addPanelSlideListener(new SlidingUpPanelLayout.PanelSlideListener() { |
| 157 | @Override | 131 | @Override |
| 158 | public void onPanelSlide(View panel, float slideOffset) { | 132 | public void onPanelSlide(View panel, float slideOffset) { |
| @@ -173,27 +147,46 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { | @@ -173,27 +147,46 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { | ||
| 173 | fragment.binding.includeStreet.rlStartBtn.setOnClickListener(new View.OnClickListener() { | 147 | fragment.binding.includeStreet.rlStartBtn.setOnClickListener(new View.OnClickListener() { |
| 174 | @Override | 148 | @Override |
| 175 | public void onClick(View view) { | 149 | public void onClick(View view) { |
| 150 | + if (fragment.getActivity() == null) { | ||
| 151 | + return; | ||
| 152 | + } | ||
| 176 | //立即报名 | 153 | //立即报名 |
| 177 | if ("0".equals(fragment.binding.includeStreet.rlStartBtn.getTag())) { | 154 | if ("0".equals(fragment.binding.includeStreet.rlStartBtn.getTag())) { |
| 178 | fragment.binding.includeStreet.rlStartBtn.setTag("1"); | 155 | fragment.binding.includeStreet.rlStartBtn.setTag("1"); |
| 179 | - fragment.binding.includeStreet.tvRunNow.setText("现在开始"); | 156 | + fragment.binding.includeStreet.tvRunNow.setText(getContext().getResources().getString(R.string.run_race_btn_start_now)); |
| 180 | fragment.binding.includeStreet.tvGoTip.setVisibility(View.VISIBLE); | 157 | fragment.binding.includeStreet.tvGoTip.setVisibility(View.VISIBLE); |
| 181 | 158 | ||
| 182 | //设置滑动 | 159 | //设置滑动 |
| 183 | fragment.binding.rlScrollViewStartBtn.setTag("1"); | 160 | fragment.binding.rlScrollViewStartBtn.setTag("1"); |
| 184 | - fragment.binding.tvRunNow.setText("现在开始"); | 161 | + fragment.binding.tvRunNow.setText(getContext().getResources().getString(R.string.run_race_btn_start_now)); |
| 185 | fragment.binding.tvGoTip.setVisibility(View.VISIBLE); | 162 | fragment.binding.tvGoTip.setVisibility(View.VISIBLE); |
| 186 | RegistrationInfoActivity.newInstance(fragment.getActivity(), 1001); | 163 | RegistrationInfoActivity.newInstance(fragment.getActivity(), 1001); |
| 187 | } else { | 164 | } else { |
| 188 | - //开始运动 | ||
| 189 | - fragment.binding.includeStreet.rlStartBtn.setTag("0"); | ||
| 190 | - fragment.binding.includeStreet.tvRunNow.setText("立即报名"); | ||
| 191 | - fragment.binding.includeStreet.tvGoTip.setVisibility(View.GONE); | ||
| 192 | - fragment.getActivity().startActivity(new Intent(getContext(), PedometerMainActivity.class)); | ||
| 193 | - //设置滑动 | ||
| 194 | - fragment.binding.rlScrollViewStartBtn.setTag("0"); | ||
| 195 | - fragment.binding.tvRunNow.setText("立即报名"); | ||
| 196 | - fragment.binding.tvGoTip.setVisibility(View.GONE); | 165 | + //计算当前位置与起点坐标距离 |
| 166 | + if (firstLatLng != null && trackPoints != null && trackPoints.size() > 0) { | ||
| 167 | + double distance = DistanceUtil.getDistance(firstLatLng, trackPoints.get(0)); | ||
| 168 | + if (distance < 20) { | ||
| 169 | + //开始运动 | ||
| 170 | + fragment.binding.includeStreet.rlStartBtn.setTag("0"); | ||
| 171 | + fragment.binding.includeStreet.tvRunNow.setText(getContext().getResources().getString(R.string.run_race_btn_sign_up)); | ||
| 172 | + fragment.binding.includeStreet.tvGoTip.setVisibility(View.GONE); | ||
| 173 | + fragment.getActivity().startActivity(new Intent(getContext(), PedometerMainActivity.class)); | ||
| 174 | + //设置滑动 | ||
| 175 | + fragment.binding.rlScrollViewStartBtn.setTag("0"); | ||
| 176 | + fragment.binding.tvRunNow.setText(getContext().getResources().getString(R.string.run_race_btn_sign_up)); | ||
| 177 | + fragment.binding.tvGoTip.setVisibility(View.GONE); | ||
| 178 | + } else { | ||
| 179 | + TipDialog tipDialog = new TipDialog(getContext(), getContext().getResources().getString(R.string.run_race_far_tip), "确定", new TipDialog.DialogInterface() { | ||
| 180 | + @Override | ||
| 181 | + public void onClick(TipDialog dialog) { | ||
| 182 | + dialog.dismiss(); | ||
| 183 | + } | ||
| 184 | + }); | ||
| 185 | + tipDialog.show(); | ||
| 186 | + tipDialog.setCancelable(false); | ||
| 187 | + tipDialog.setCanceledOnTouchOutside(false); | ||
| 188 | + } | ||
| 189 | + } | ||
| 197 | } | 190 | } |
| 198 | } | 191 | } |
| 199 | }); | 192 | }); |
| @@ -231,7 +224,7 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { | @@ -231,7 +224,7 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { | ||
| 231 | RaceRecordActivity.newInstance(fragment.getActivity()); | 224 | RaceRecordActivity.newInstance(fragment.getActivity()); |
| 232 | }); | 225 | }); |
| 233 | 226 | ||
| 234 | - fragment.binding.includeStreet.fiveJoinPerson.setOnClickListener(v ->{ | 227 | + fragment.binding.includeStreet.fiveJoinPerson.setOnClickListener(v -> { |
| 235 | TakePartActivity.newInstance(fragment.getActivity()); | 228 | TakePartActivity.newInstance(fragment.getActivity()); |
| 236 | }); | 229 | }); |
| 237 | } | 230 | } |
| @@ -275,9 +268,34 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { | @@ -275,9 +268,34 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { | ||
| 275 | LocationClientOption option = new LocationClientOption(); | 268 | LocationClientOption option = new LocationClientOption(); |
| 276 | option.setOpenGps(true); // 打开gps | 269 | option.setOpenGps(true); // 打开gps |
| 277 | option.setCoorType("gcj02"); // 设置坐标类型 | 270 | option.setCoorType("gcj02"); // 设置坐标类型 |
| 278 | - option.setScanSpan(3000); | 271 | + //可选,默认false,设置是否开启Gps定位 |
| 272 | + option.setOpenGps(true); | ||
| 273 | + //设置打开自动回调位置模式,该开关打开后,期间只要定位SDK检测到位置变化就会主动回调给开发者,该模式下开发者无需再关心定位间隔是多少,定位SDK本身发现位置变化就会及时回调给开发者 | ||
| 274 | + option.setOpenAutoNotifyMode(); | ||
| 275 | + //可选,默认高精度,设置定位模式,高精度,低功耗,仅设备 | ||
| 276 | + option.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy); | ||
| 277 | + //可选,设置是否需要地址信息,默认不需要 | ||
| 278 | + option.setIsNeedAddress(true); | ||
| 279 | + //可选,设置是否需要地址描述 | ||
| 280 | + option.setIsNeedLocationDescribe(true); | ||
| 281 | + //可选,设置是否需要设备方向结果 | ||
| 282 | + option.setNeedDeviceDirect(true); | ||
| 283 | + //设置打开自动回调位置模式,该开关打开后,期间只要定位SDK检测到位置变化就会主动回调给开发者 | ||
| 284 | + option.setOpenAutoNotifyMode(3000, 1, LocationClientOption.LOC_SENSITIVITY_HIGHT); | ||
| 279 | mLocClient.setLocOption(option); | 285 | mLocClient.setLocOption(option); |
| 280 | mLocClient.start(); | 286 | mLocClient.start(); |
| 287 | + //设置地图加载完毕监听 | ||
| 288 | + baiduMap.setOnMapLoadedCallback(new BaiduMap.OnMapLoadedCallback() { | ||
| 289 | + @Override | ||
| 290 | + public void onMapLoaded() { | ||
| 291 | + //自动计算地图缩放 | ||
| 292 | + MapStatus.Builder builder = new MapStatus.Builder(); | ||
| 293 | + builder.target(MyMapUtil.getCenterZoomPosition(trackPoints)); | ||
| 294 | + builder.zoom(MyMapUtil.getZoom(trackPoints)); | ||
| 295 | + baiduMap.animateMapStatus(MapStatusUpdateFactory.newMapStatus(builder.build())); | ||
| 296 | + | ||
| 297 | + } | ||
| 298 | + }); | ||
| 281 | } | 299 | } |
| 282 | 300 | ||
| 283 | /** | 301 | /** |
| @@ -558,34 +576,43 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { | @@ -558,34 +576,43 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { | ||
| 558 | if (location == null || mMapView == null) { | 576 | if (location == null || mMapView == null) { |
| 559 | return; | 577 | return; |
| 560 | } | 578 | } |
| 561 | -// mCurrentLat = location.getLatitude(); | ||
| 562 | -// mCurrentLon = location.getLongitude(); | 579 | + if (isFirstLoc) { |
| 580 | + isFirstLoc = false; | ||
| 581 | + if (location.getRadius() > 20) { | ||
| 582 | + Toast.makeText(getContext(), "当前定位精度为:" + location.getRadius() + "米,请您移动至空旷地带!", Toast.LENGTH_SHORT).show(); | ||
| 583 | + } | ||
| 584 | + } else { | ||
| 585 | + //过滤定位精度 | ||
| 586 | + if (location.getRadius() > 20) { | ||
| 587 | + return; | ||
| 588 | + } | ||
| 589 | + } | ||
| 563 | mCurrentAccracy = location.getRadius(); | 590 | mCurrentAccracy = location.getRadius(); |
| 564 | followMyLocation = new MyLocationData.Builder() | 591 | followMyLocation = new MyLocationData.Builder() |
| 565 | .accuracy(location.getRadius()) | 592 | .accuracy(location.getRadius()) |
| 566 | // 此处设置开发者获取到的方向信息,顺时针0-360 | 593 | // 此处设置开发者获取到的方向信息,顺时针0-360 |
| 567 | - .direction(location.getDirection()).latitude(location.getLatitude()) | 594 | + .direction(mCurrentDirection).latitude(location.getLatitude()) |
| 568 | .longitude(location.getLongitude()).build(); | 595 | .longitude(location.getLongitude()).build(); |
| 569 | - if (followMyLocation == null) { | 596 | + if (followMyLocation == null || followMyLocation.latitude == 0 || followMyLocation.longitude == 0) { |
| 570 | return; | 597 | return; |
| 571 | } | 598 | } |
| 572 | 599 | ||
| 573 | MapStatus.Builder builder = new MapStatus.Builder(); | 600 | MapStatus.Builder builder = new MapStatus.Builder(); |
| 574 | 601 | ||
| 575 | - if (isFirstLoc) { | ||
| 576 | - isFirstLoc = false; | ||
| 577 | - firstLatLng = new LatLng(location.getLatitude(), | ||
| 578 | - location.getLongitude()); | ||
| 579 | - baiduMap.setMyLocationData(followMyLocation); | ||
| 580 | - builder.target(firstLatLng).zoom(DEFULT_ZOOM); | ||
| 581 | - baiduMap.animateMapStatus(MapStatusUpdateFactory.newMapStatus(builder.build())); | 602 | +// if (isFirstLoc) { |
| 603 | +// isFirstLoc = false; | ||
| 604 | + firstLatLng = new LatLng(location.getLatitude(), | ||
| 605 | + location.getLongitude()); | ||
| 606 | + baiduMap.setMyLocationData(followMyLocation); | ||
| 607 | +// builder.target(firstLatLng).zoom(DEFULT_ZOOM); | ||
| 608 | +// baiduMap.animateMapStatus(MapStatusUpdateFactory.newMapStatus(builder.build())); | ||
| 582 | 609 | ||
| 583 | // //显示当前位置图标 | 610 | // //显示当前位置图标 |
| 584 | // Bitmap pointBitmap = BitmapUtil.getBitmapFromDp(getContext(), BitmapFactory.decodeResource(getContext().getResources(), R.drawable.rt_ic_location), 40, 40); | 611 | // Bitmap pointBitmap = BitmapUtil.getBitmapFromDp(getContext(), BitmapFactory.decodeResource(getContext().getResources(), R.drawable.rt_ic_location), 40, 40); |
| 585 | // currentMark = new MarkerOptions().position(firstLatLng).icon(BitmapDescriptorFactory.fromBitmap(pointBitmap)); | 612 | // currentMark = new MarkerOptions().position(firstLatLng).icon(BitmapDescriptorFactory.fromBitmap(pointBitmap)); |
| 586 | // baiduMap.addOverlay(currentMark); | 613 | // baiduMap.addOverlay(currentMark); |
| 587 | 614 | ||
| 588 | - //根据几个关键点进行步行路径规划 | 615 | + //根据几个关键点进行步行路径规划 |
| 589 | // if (importLatLngs != null) { | 616 | // if (importLatLngs != null) { |
| 590 | // if (importLatLngs.size() >= 1) { | 617 | // if (importLatLngs.size() >= 1) { |
| 591 | // for (int index = 0; index < importLatLngs.size(); index++) { | 618 | // for (int index = 0; index < importLatLngs.size(); index++) { |
| @@ -602,7 +629,7 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { | @@ -602,7 +629,7 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { | ||
| 602 | // } | 629 | // } |
| 603 | // } | 630 | // } |
| 604 | 631 | ||
| 605 | - } | 632 | +// } |
| 606 | } | 633 | } |
| 607 | } | 634 | } |
| 608 | } | 635 | } |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RunningMapFragmentView.java
| @@ -13,6 +13,7 @@ import android.util.Log; | @@ -13,6 +13,7 @@ import android.util.Log; | ||
| 13 | import android.view.MotionEvent; | 13 | import android.view.MotionEvent; |
| 14 | import android.view.View; | 14 | import android.view.View; |
| 15 | import android.widget.Chronometer; | 15 | import android.widget.Chronometer; |
| 16 | +import android.widget.Toast; | ||
| 16 | 17 | ||
| 17 | import com.baidu.location.BDAbstractLocationListener; | 18 | import com.baidu.location.BDAbstractLocationListener; |
| 18 | import com.baidu.location.BDLocation; | 19 | import com.baidu.location.BDLocation; |
| @@ -83,7 +84,7 @@ public class RunningMapFragmentView implements MvpView, SensorEventListener { | @@ -83,7 +84,7 @@ public class RunningMapFragmentView implements MvpView, SensorEventListener { | ||
| 83 | mUiSettings = baiduMap.getUiSettings(); | 84 | mUiSettings = baiduMap.getUiSettings(); |
| 84 | } | 85 | } |
| 85 | //设置定位模式, 默认为 LocationMode.NORMAL 普通态 | 86 | //设置定位模式, 默认为 LocationMode.NORMAL 普通态 |
| 86 | - mCurrentMode = MyLocationConfiguration.LocationMode.FOLLOWING; | 87 | + mCurrentMode = MyLocationConfiguration.LocationMode.NORMAL; |
| 87 | // 设置定位图标修改为自定义marker | 88 | // 设置定位图标修改为自定义marker |
| 88 | Bitmap pointBitmap = BitmapUtil.getBitmapFromDp(getContext(), BitmapFactory.decodeResource(getContext().getResources(), R.drawable.rt_ic_location), 40, 40); | 89 | Bitmap pointBitmap = BitmapUtil.getBitmapFromDp(getContext(), BitmapFactory.decodeResource(getContext().getResources(), R.drawable.rt_ic_location), 40, 40); |
| 89 | mCurrentMarker = BitmapDescriptorFactory.fromBitmap(pointBitmap); | 90 | mCurrentMarker = BitmapDescriptorFactory.fromBitmap(pointBitmap); |
| @@ -110,7 +111,20 @@ public class RunningMapFragmentView implements MvpView, SensorEventListener { | @@ -110,7 +111,20 @@ public class RunningMapFragmentView implements MvpView, SensorEventListener { | ||
| 110 | LocationClientOption option = new LocationClientOption(); | 111 | LocationClientOption option = new LocationClientOption(); |
| 111 | option.setOpenGps(true); // 打开gps | 112 | option.setOpenGps(true); // 打开gps |
| 112 | option.setCoorType("gcj02"); // 设置坐标类型 | 113 | option.setCoorType("gcj02"); // 设置坐标类型 |
| 113 | - option.setScanSpan(3000); | 114 | + //可选,默认false,设置是否开启Gps定位 |
| 115 | + option.setOpenGps(true); | ||
| 116 | + //设置打开自动回调位置模式,该开关打开后,期间只要定位SDK检测到位置变化就会主动回调给开发者,该模式下开发者无需再关心定位间隔是多少,定位SDK本身发现位置变化就会及时回调给开发者 | ||
| 117 | + option.setOpenAutoNotifyMode(); | ||
| 118 | + //可选,默认高精度,设置定位模式,高精度,低功耗,仅设备 | ||
| 119 | + option.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy); | ||
| 120 | + //可选,设置是否需要地址信息,默认不需要 | ||
| 121 | + option.setIsNeedAddress(true); | ||
| 122 | + //可选,设置是否需要地址描述 | ||
| 123 | + option.setIsNeedLocationDescribe(true); | ||
| 124 | + //可选,设置是否需要设备方向结果 | ||
| 125 | + option.setNeedDeviceDirect(false); | ||
| 126 | + //设置打开自动回调位置模式,该开关打开后,期间只要定位SDK检测到位置变化就会主动回调给开发者 | ||
| 127 | + option.setOpenAutoNotifyMode(3000, 1, LocationClientOption.LOC_SENSITIVITY_HIGHT); | ||
| 114 | mLocClient.setLocOption(option); | 128 | mLocClient.setLocOption(option); |
| 115 | mLocClient.start(); | 129 | mLocClient.start(); |
| 116 | //地图加载完毕监听 | 130 | //地图加载完毕监听 |
| @@ -180,22 +194,34 @@ public class RunningMapFragmentView implements MvpView, SensorEventListener { | @@ -180,22 +194,34 @@ public class RunningMapFragmentView implements MvpView, SensorEventListener { | ||
| 180 | 194 | ||
| 181 | @Override | 195 | @Override |
| 182 | public void onReceiveLocation(BDLocation location) { | 196 | public void onReceiveLocation(BDLocation location) { |
| 197 | + Toast.makeText(getContext(), "aa", Toast.LENGTH_SHORT).show(); | ||
| 198 | + Log.e(TAG, "onReceiveLocation: 状态" + location.getGpsAccuracyStatus()); | ||
| 183 | // map view 销毁后不在处理新接收的位置 | 199 | // map view 销毁后不在处理新接收的位置 |
| 184 | if (location == null || mMapView == null) { | 200 | if (location == null || mMapView == null) { |
| 185 | return; | 201 | return; |
| 186 | } | 202 | } |
| 187 | -// mCurrentLat = location.getLatitude(); | ||
| 188 | -// mCurrentLon = location.getLongitude(); | 203 | + if (isFirstLoc) { |
| 204 | + isFirstLoc = false; | ||
| 205 | + if (location.getRadius() > 20) { | ||
| 206 | + Toast.makeText(getContext(), "当前定位精度为:" + location.getRadius() + "米,请您移动至空旷地带!", Toast.LENGTH_SHORT).show(); | ||
| 207 | + } | ||
| 208 | + | ||
| 209 | + | ||
| 210 | + } else { | ||
| 211 | + //过滤定位精度 | ||
| 212 | + if (location.getRadius() > 20) { | ||
| 213 | + return; | ||
| 214 | + } | ||
| 215 | + } | ||
| 189 | mCurrentAccracy = location.getRadius(); | 216 | mCurrentAccracy = location.getRadius(); |
| 190 | mylocation = new MyLocationData.Builder() | 217 | mylocation = new MyLocationData.Builder() |
| 191 | .accuracy(location.getRadius()) | 218 | .accuracy(location.getRadius()) |
| 192 | // 此处设置开发者获取到的方向信息,顺时针0-360 | 219 | // 此处设置开发者获取到的方向信息,顺时针0-360 |
| 193 | .direction(mCurrentDirection).latitude(location.getLatitude()) | 220 | .direction(mCurrentDirection).latitude(location.getLatitude()) |
| 194 | .longitude(location.getLongitude()).build(); | 221 | .longitude(location.getLongitude()).build(); |
| 195 | - if (mylocation == null) { | 222 | + if (mylocation == null || mylocation.latitude == 0 || mylocation.longitude == 0) { |
| 196 | return; | 223 | return; |
| 197 | } | 224 | } |
| 198 | - | ||
| 199 | MapStatus.Builder builder = new MapStatus.Builder(); | 225 | MapStatus.Builder builder = new MapStatus.Builder(); |
| 200 | 226 | ||
| 201 | // if (isFirstLoc) { | 227 | // if (isFirstLoc) { |
| @@ -203,9 +229,9 @@ public class RunningMapFragmentView implements MvpView, SensorEventListener { | @@ -203,9 +229,9 @@ public class RunningMapFragmentView implements MvpView, SensorEventListener { | ||
| 203 | firstLatLng = new LatLng(location.getLatitude(), | 229 | firstLatLng = new LatLng(location.getLatitude(), |
| 204 | location.getLongitude()); | 230 | location.getLongitude()); |
| 205 | baiduMap.setMyLocationData(mylocation); | 231 | baiduMap.setMyLocationData(mylocation); |
| 206 | - if (trackPoints!=null){ | ||
| 207 | - Log.e(TAG, "trackPoints: "+MyMapUtil.isInPolygon(firstLatLng,trackPoints) ); | ||
| 208 | - } | 232 | +// if (trackPoints!=null){ |
| 233 | +// Log.e(TAG, "trackPoints: "+MyMapUtil.isInPolygon(firstLatLng,trackPoints) ); | ||
| 234 | +// } | ||
| 209 | // if (isFirstLoc) { | 235 | // if (isFirstLoc) { |
| 210 | // builder.target(firstLatLng).zoom(DEFULT_ZOOM); | 236 | // builder.target(firstLatLng).zoom(DEFULT_ZOOM); |
| 211 | // isFirstLoc = false; | 237 | // isFirstLoc = false; |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/service/StepService.java
| @@ -22,6 +22,7 @@ import android.os.CountDownTimer; | @@ -22,6 +22,7 @@ import android.os.CountDownTimer; | ||
| 22 | import android.os.Handler; | 22 | import android.os.Handler; |
| 23 | import android.os.IBinder; | 23 | import android.os.IBinder; |
| 24 | import android.support.v4.app.NotificationCompat; | 24 | import android.support.v4.app.NotificationCompat; |
| 25 | +import android.text.TextUtils; | ||
| 25 | import android.util.Log; | 26 | import android.util.Log; |
| 26 | import android.widget.RemoteViews; | 27 | import android.widget.RemoteViews; |
| 27 | import android.widget.Toast; | 28 | import android.widget.Toast; |
| @@ -184,7 +185,6 @@ public class StepService extends Service implements SensorEventListener { | @@ -184,7 +185,6 @@ public class StepService extends Service implements SensorEventListener { | ||
| 184 | } | 185 | } |
| 185 | if (mTrace == null) { | 186 | if (mTrace == null) { |
| 186 | mTrace = new Trace(serviceId, entityName); | 187 | mTrace = new Trace(serviceId, entityName); |
| 187 | - | ||
| 188 | } | 188 | } |
| 189 | //初始化实时轨迹监听器 | 189 | //初始化实时轨迹监听器 |
| 190 | realTimeTraceListener = new OnTrackListener() { | 190 | realTimeTraceListener = new OnTrackListener() { |
| @@ -315,7 +315,7 @@ public class StepService extends Service implements SensorEventListener { | @@ -315,7 +315,7 @@ public class StepService extends Service implements SensorEventListener { | ||
| 315 | */ | 315 | */ |
| 316 | @Override | 316 | @Override |
| 317 | public void onPushCallback(byte messageType, PushMessage pushMessage) { | 317 | public void onPushCallback(byte messageType, PushMessage pushMessage) { |
| 318 | - Log.e(TAG, "onPushCallback: " ); | 318 | + Log.e(TAG, "onPushCallback: "); |
| 319 | if (messageType < 0x03 || messageType > 0x04) { | 319 | if (messageType < 0x03 || messageType > 0x04) { |
| 320 | return; | 320 | return; |
| 321 | } | 321 | } |
| @@ -323,7 +323,15 @@ public class StepService extends Service implements SensorEventListener { | @@ -323,7 +323,15 @@ public class StepService extends Service implements SensorEventListener { | ||
| 323 | if (null == alarmPushInfo) { | 323 | if (null == alarmPushInfo) { |
| 324 | return; | 324 | return; |
| 325 | } | 325 | } |
| 326 | - Toast.makeText(getApplicationContext(),"onPushCallback",Toast.LENGTH_SHORT).show(); | 326 | + //超出范围 |
| 327 | + if (alarmPushInfo.getMonitoredAction() == MonitoredAction.exit) { | ||
| 328 | + | ||
| 329 | + } | ||
| 330 | + //进入范围 | ||
| 331 | + else if (alarmPushInfo.getMonitoredAction() == MonitoredAction.enter) { | ||
| 332 | + | ||
| 333 | + } | ||
| 334 | + Toast.makeText(getApplicationContext(), "onPushCallback:" + alarmPushInfo.getMonitoredAction(), Toast.LENGTH_SHORT).show(); | ||
| 327 | 335 | ||
| 328 | } | 336 | } |
| 329 | 337 | ||
| @@ -351,10 +359,10 @@ public class StepService extends Service implements SensorEventListener { | @@ -351,10 +359,10 @@ public class StepService extends Service implements SensorEventListener { | ||
| 351 | @SuppressLint("WrongConstant") | 359 | @SuppressLint("WrongConstant") |
| 352 | @Override | 360 | @Override |
| 353 | public int onStartCommand(Intent intent, int flags, int startId) { | 361 | public int onStartCommand(Intent intent, int flags, int startId) { |
| 354 | - if (intent.getExtras().getString("userId") != null) { | ||
| 355 | - userId = intent.getExtras().getString("userId"); | 362 | +// userId=intent.getExtras().getString("userId"); |
| 363 | + userId = MySpHelper.getInstance(getApplicationContext(), Context.MODE_MULTI_PROCESS).getString("userId", ""); | ||
| 364 | + if (userId != null && !TextUtils.isEmpty(userId)) { | ||
| 356 | entityName = userId; | 365 | entityName = userId; |
| 357 | - Log.e(TAG, "onStartCommand: entityName" + entityName); | ||
| 358 | initTodayData(userId); | 366 | initTodayData(userId); |
| 359 | initTrace(); | 367 | initTrace(); |
| 360 | if (!EventBus.getDefault().isRegistered(this)) { | 368 | if (!EventBus.getDefault().isRegistered(this)) { |
| @@ -665,7 +673,7 @@ public class StepService extends Service implements SensorEventListener { | @@ -665,7 +673,7 @@ public class StepService extends Service implements SensorEventListener { | ||
| 665 | // isCall(); | 673 | // isCall(); |
| 666 | // Logger.d("重置步数" + StepDcretor.CURRENT_STEP); | 674 | // Logger.d("重置步数" + StepDcretor.CURRENT_STEP); |
| 667 | save(); | 675 | save(); |
| 668 | - isNewDay(); | 676 | +// isNewDay(); |
| 669 | } else if ("close.StepService".equals(action)) { | 677 | } else if ("close.StepService".equals(action)) { |
| 670 | Log.e("关闭StepService", "关闭"); | 678 | Log.e("关闭StepService", "关闭"); |
| 671 | onDestroy(); | 679 | onDestroy(); |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/utils/MyMapUtil.java
| @@ -13,6 +13,7 @@ import com.baidu.mapapi.map.Overlay; | @@ -13,6 +13,7 @@ import com.baidu.mapapi.map.Overlay; | ||
| 13 | import com.baidu.mapapi.map.OverlayOptions; | 13 | import com.baidu.mapapi.map.OverlayOptions; |
| 14 | import com.baidu.mapapi.map.PolylineOptions; | 14 | import com.baidu.mapapi.map.PolylineOptions; |
| 15 | import com.baidu.mapapi.model.LatLng; | 15 | import com.baidu.mapapi.model.LatLng; |
| 16 | +import com.baidu.mapapi.utils.DistanceUtil; | ||
| 16 | import com.baidu.trace.model.SortType; | 17 | import com.baidu.trace.model.SortType; |
| 17 | import com.example.moudle_pedometer.R; | 18 | import com.example.moudle_pedometer.R; |
| 18 | 19 | ||
| @@ -79,6 +80,53 @@ public class MyMapUtil { | @@ -79,6 +80,53 @@ public class MyMapUtil { | ||
| 79 | return baiduMap.addOverlay(polylineOptions); | 80 | return baiduMap.addOverlay(polylineOptions); |
| 80 | } | 81 | } |
| 81 | 82 | ||
| 83 | + /** | ||
| 84 | + * 绘制服务器传过来的轨迹 | ||
| 85 | + */ | ||
| 86 | + public static Overlay drawServerLineTrack(Context context, BaiduMap baiduMap, List<LatLng> points, SortType sortType, int lineColor, int startIconRes, int endIconRes) { | ||
| 87 | + // 绘制新覆盖物前,清空之前的覆盖物 | ||
| 88 | + baiduMap.clear(); | ||
| 89 | + if (points == null || points.size() == 0) { | ||
| 90 | + return null; | ||
| 91 | + } | ||
| 92 | + //只有一个点 | ||
| 93 | + if (points.size() == 1) { | ||
| 94 | + Bitmap pointBitmap = BitmapUtil.getBitmapFromDp(context, BitmapFactory.decodeResource(context.getResources(), startIconRes), 40, 40); | ||
| 95 | + OverlayOptions startOptions = new MarkerOptions().position(points.get(0)).icon(BitmapDescriptorFactory.fromBitmap(pointBitmap)); | ||
| 96 | +// .zIndex(9).draggable(true); | ||
| 97 | + return baiduMap.addOverlay(startOptions); | ||
| 98 | + } | ||
| 99 | + | ||
| 100 | + LatLng startPoint; | ||
| 101 | + LatLng endPoint; | ||
| 102 | + if (sortType == SortType.asc) { | ||
| 103 | + startPoint = points.get(0); | ||
| 104 | + endPoint = points.get(points.size() - 1); | ||
| 105 | + } else { | ||
| 106 | + startPoint = points.get(points.size() - 1); | ||
| 107 | + endPoint = points.get(0); | ||
| 108 | + } | ||
| 109 | + | ||
| 110 | + // 添加起点图标 | ||
| 111 | + Bitmap startPointBitmap = BitmapUtil.getBitmapFromDp(context, BitmapFactory.decodeResource(context.getResources(), startIconRes), 40, 40); | ||
| 112 | + OverlayOptions startOptions = new MarkerOptions() | ||
| 113 | + .position(startPoint).icon(BitmapDescriptorFactory.fromBitmap(startPointBitmap)); | ||
| 114 | +// .zIndex(9).draggable(true); | ||
| 115 | + // 添加终点图标 | ||
| 116 | + Bitmap endPointBitmap = BitmapUtil.getBitmapFromDp(context, BitmapFactory.decodeResource(context.getResources(), endIconRes), 40, 40); | ||
| 117 | + OverlayOptions endOptions = new MarkerOptions().position(endPoint) | ||
| 118 | + .icon(BitmapDescriptorFactory.fromBitmap(endPointBitmap)); | ||
| 119 | +// .zIndex(9).draggable(true); | ||
| 120 | + | ||
| 121 | + // 添加路线(轨迹) | ||
| 122 | + OverlayOptions polylineOptions = new PolylineOptions().width(10) | ||
| 123 | + .color(context.getResources().getColor(lineColor)).points(points); | ||
| 124 | + | ||
| 125 | + baiduMap.addOverlay(startOptions); | ||
| 126 | + baiduMap.addOverlay(endOptions); | ||
| 127 | + return baiduMap.addOverlay(polylineOptions); | ||
| 128 | + } | ||
| 129 | + | ||
| 82 | 130 | ||
| 83 | public static Overlay drawMapLine(Context context, BaiduMap baiduMap, List<LatLng> points, int lineColor) { | 131 | public static Overlay drawMapLine(Context context, BaiduMap baiduMap, List<LatLng> points, int lineColor) { |
| 84 | OverlayOptions polylineOptions = new PolylineOptions().width(10) | 132 | OverlayOptions polylineOptions = new PolylineOptions().width(10) |
| @@ -144,36 +192,36 @@ public class MyMapUtil { | @@ -144,36 +192,36 @@ public class MyMapUtil { | ||
| 144 | return ret; | 192 | return ret; |
| 145 | } | 193 | } |
| 146 | 194 | ||
| 147 | -// /** | ||
| 148 | -// * 根据经纬极值计算绽放级别 | ||
| 149 | -// */ | ||
| 150 | -// public static float getZoom(List<LatLng> points) { | ||
| 151 | -// double maxLng = points.get(points.size() - 1).longitude; | ||
| 152 | -// double minLng = points.get(0).longitude; | ||
| 153 | -// double maxLat = points.get(points.size() - 1).latitude; | ||
| 154 | -// double minLat = points.get(0).latitude; | ||
| 155 | -// LatLng tempLatLng; | ||
| 156 | -// | ||
| 157 | -// | ||
| 158 | -// for (LatLng latLng : points) { | ||
| 159 | -// tempLatLng = latLng; | ||
| 160 | -// if (tempLatLng.longitude > maxLng) maxLng = tempLatLng.longitude; | ||
| 161 | -// if (tempLatLng.longitude < minLng) minLng = tempLatLng.longitude; | ||
| 162 | -// if (tempLatLng.latitude > maxLat) maxLat = tempLatLng.latitude; | ||
| 163 | -// if (tempLatLng.latitude < minLat) minLat = tempLatLng.latitude; | ||
| 164 | -// } | ||
| 165 | -// | ||
| 166 | -// double[] zooms = {50, 100, 200, 500, 1000, 2000, 5000, 10000, 20000, 25000, 50000, 100000, 200000, 500000, 1000000, 2000000};//级别18到3。 | ||
| 167 | -// LatLng pointA = new LatLng(maxLat, maxLng); // 创建点坐标A | ||
| 168 | -// LatLng pointB = new LatLng(minLat, minLng); // 创建点坐标B | ||
| 169 | -//// double distance = DistanceUtil.getDistance(pointA, pointB); //获取两点距离,保留小数点后两位 | ||
| 170 | -// for (int i = 0, zoomLen = zooms.length; i < zoomLen; i++) { | ||
| 171 | -// if (zooms[i] - distance > 0) { | ||
| 172 | -// return 18 - i + 3;//之所以会多3,是因为地图范围常常是比例尺距离的10倍以上。所以级别会增加3。 | ||
| 173 | -// } | ||
| 174 | -// } | ||
| 175 | -// return 18; | ||
| 176 | -// } | 195 | + /** |
| 196 | + * 根据经纬极值计算绽放级别 | ||
| 197 | + */ | ||
| 198 | + public static float getZoom(List<LatLng> points) { | ||
| 199 | + double maxLng = points.get(points.size() - 1).longitude; | ||
| 200 | + double minLng = points.get(0).longitude; | ||
| 201 | + double maxLat = points.get(points.size() - 1).latitude; | ||
| 202 | + double minLat = points.get(0).latitude; | ||
| 203 | + LatLng tempLatLng; | ||
| 204 | + | ||
| 205 | + | ||
| 206 | + for (LatLng latLng : points) { | ||
| 207 | + tempLatLng = latLng; | ||
| 208 | + if (tempLatLng.longitude > maxLng) maxLng = tempLatLng.longitude; | ||
| 209 | + if (tempLatLng.longitude < minLng) minLng = tempLatLng.longitude; | ||
| 210 | + if (tempLatLng.latitude > maxLat) maxLat = tempLatLng.latitude; | ||
| 211 | + if (tempLatLng.latitude < minLat) minLat = tempLatLng.latitude; | ||
| 212 | + } | ||
| 213 | + | ||
| 214 | + double[] zooms = {50, 100, 200, 500, 1000, 2000, 5000, 10000, 20000, 25000, 50000, 100000, 200000, 500000, 1000000, 2000000};//级别18到3。 | ||
| 215 | + LatLng pointA = new LatLng(maxLat, maxLng); // 创建点坐标A | ||
| 216 | + LatLng pointB = new LatLng(minLat, minLng); // 创建点坐标B | ||
| 217 | + double distance = DistanceUtil.getDistance(pointA, pointB); //获取两点距离,保留小数点后两位 | ||
| 218 | + for (int i = 0, zoomLen = zooms.length; i < zoomLen; i++) { | ||
| 219 | + if (zooms[i] - distance > 0) { | ||
| 220 | + return 18 - i + 3;//之所以会多3,是因为地图范围常常是比例尺距离的10倍以上。所以级别会增加3。 | ||
| 221 | + } | ||
| 222 | + } | ||
| 223 | + return 18; | ||
| 224 | + } | ||
| 177 | 225 | ||
| 178 | /** | 226 | /** |
| 179 | * 获取经纬度中心点 | 227 | * 获取经纬度中心点 |
| @@ -212,6 +260,8 @@ public class MyMapUtil { | @@ -212,6 +260,8 @@ public class MyMapUtil { | ||
| 212 | } | 260 | } |
| 213 | 261 | ||
| 214 | 262 | ||
| 263 | + | ||
| 264 | + /*****************************************************地理围栏***************************************************************/ | ||
| 215 | /** | 265 | /** |
| 216 | * 地球半径 | 266 | * 地球半径 |
| 217 | */ | 267 | */ |
moudle_pedometer/src/main/res/drawable-hdpi/button_fab_white.png deleted
100644 → 0
5.99 KB
moudle_pedometer/src/main/res/drawable-hdpi/button_fab_white.webp
0 → 100644
No preview for this file type
moudle_pedometer/src/main/res/drawable-hdpi/default_bg.png deleted
100644 → 0
10.9 KB
moudle_pedometer/src/main/res/drawable-hdpi/default_bg.webp
0 → 100644
No preview for this file type
moudle_pedometer/src/main/res/drawable-hdpi/default_register.png deleted
100644 → 0
6.85 KB
moudle_pedometer/src/main/res/drawable-hdpi/default_register.webp
0 → 100644
No preview for this file type
moudle_pedometer/src/main/res/drawable-hdpi/defaults.png deleted
100644 → 0
15.8 KB
moudle_pedometer/src/main/res/drawable-hdpi/defaults.webp
0 → 100644
No preview for this file type
moudle_pedometer/src/main/res/drawable-hdpi/erwe.png deleted
100644 → 0
6.6 KB
moudle_pedometer/src/main/res/drawable-hdpi/erwe.webp
0 → 100644
No preview for this file type
moudle_pedometer/src/main/res/drawable-hdpi/ic_icon.png deleted
100644 → 0
9.25 KB
moudle_pedometer/src/main/res/drawable-hdpi/ic_icon.webp
0 → 100644
No preview for this file type
moudle_pedometer/src/main/res/drawable-hdpi/ic_portrait_training_left_on.png deleted
100644 → 0
241 Bytes
moudle_pedometer/src/main/res/drawable-hdpi/ic_portrait_training_left_on.webp
0 → 100644
No preview for this file type
moudle_pedometer/src/main/res/drawable-hdpi/ic_white_back.png deleted
100644 → 0
219 Bytes
moudle_pedometer/src/main/res/drawable-hdpi/ic_white_back.webp
0 → 100644
No preview for this file type
moudle_pedometer/src/main/res/drawable-hdpi/icon_end.png deleted
100644 → 0
2.2 KB
moudle_pedometer/src/main/res/drawable-hdpi/icon_end.webp
0 → 100644
No preview for this file type
moudle_pedometer/src/main/res/drawable-hdpi/icon_race_location_green.png deleted
100644 → 0
487 Bytes
moudle_pedometer/src/main/res/drawable-hdpi/icon_race_location_green.webp
0 → 100644
No preview for this file type
moudle_pedometer/src/main/res/drawable-hdpi/icon_right_close.png deleted
100644 → 0
2.29 KB
moudle_pedometer/src/main/res/drawable-hdpi/icon_right_close.webp
0 → 100644
No preview for this file type
moudle_pedometer/src/main/res/drawable-hdpi/icon_search.png deleted
100644 → 0
1.12 KB
moudle_pedometer/src/main/res/drawable-hdpi/icon_search.webp
0 → 100644
No preview for this file type
moudle_pedometer/src/main/res/drawable-hdpi/icon_share.png deleted
100644 → 0
1005 Bytes
moudle_pedometer/src/main/res/drawable-hdpi/icon_share.webp
0 → 100644
No preview for this file type
moudle_pedometer/src/main/res/drawable-hdpi/icon_start.png deleted
100644 → 0
2.02 KB
moudle_pedometer/src/main/res/drawable-hdpi/icon_start.webp
0 → 100644
No preview for this file type
moudle_pedometer/src/main/res/drawable-hdpi/location_message.png deleted
100644 → 0
270 Bytes
moudle_pedometer/src/main/res/drawable-hdpi/location_message.webp
0 → 100644
No preview for this file type
moudle_pedometer/src/main/res/drawable-hdpi/map.jpeg deleted
100644 → 0
70.8 KB
moudle_pedometer/src/main/res/drawable-hdpi/map.webp
0 → 100644
No preview for this file type
moudle_pedometer/src/main/res/drawable-hdpi/mo_ic_dialog_back.png deleted
100644 → 0
225 Bytes
moudle_pedometer/src/main/res/drawable-hdpi/mo_ic_dialog_back.webp
0 → 100644
No preview for this file type
moudle_pedometer/src/main/res/drawable-hdpi/rt_ic_home_map.png deleted
100644 → 0
4.96 KB
moudle_pedometer/src/main/res/drawable-hdpi/rt_ic_home_map.webp
0 → 100644
No preview for this file type
moudle_pedometer/src/main/res/drawable-hdpi/rt_ic_location.png deleted
100644 → 0
5.19 KB
moudle_pedometer/src/main/res/drawable-hdpi/rt_ic_location.webp
0 → 100644
No preview for this file type
moudle_pedometer/src/main/res/drawable-hdpi/rt_ic_location_blank.png deleted
100644 → 0
743 Bytes
moudle_pedometer/src/main/res/drawable-hdpi/rt_ic_location_blank.webp
0 → 100644
No preview for this file type
moudle_pedometer/src/main/res/drawable-hdpi/rt_outdoor_video_cal.png deleted
100644 → 0
2.36 KB
moudle_pedometer/src/main/res/drawable-hdpi/rt_outdoor_video_cal.webp
0 → 100644
No preview for this file type
moudle_pedometer/src/main/res/drawable-hdpi/rt_outdoor_video_pace.png deleted
100644 → 0
2.78 KB
moudle_pedometer/src/main/res/drawable-hdpi/rt_outdoor_video_pace.webp
0 → 100644
No preview for this file type
moudle_pedometer/src/main/res/drawable-hdpi/rt_outdoor_video_time.png deleted
100644 → 0
3.09 KB
moudle_pedometer/src/main/res/drawable-hdpi/rt_outdoor_video_time.webp
0 → 100644
No preview for this file type
moudle_pedometer/src/main/res/drawable-hdpi/rt_training_button_pause.png deleted
100644 → 0
118 Bytes
moudle_pedometer/src/main/res/drawable-hdpi/rt_training_button_pause.webp
0 → 100644
No preview for this file type
moudle_pedometer/src/main/res/drawable-hdpi/rt_training_button_resume.png deleted
100644 → 0
552 Bytes
moudle_pedometer/src/main/res/drawable-hdpi/rt_training_button_resume.webp
0 → 100644
No preview for this file type
moudle_pedometer/src/main/res/drawable-hdpi/rt_training_button_stop.png deleted
100644 → 0
98 Bytes
moudle_pedometer/src/main/res/drawable-hdpi/rt_training_button_stop.webp
0 → 100644
No preview for this file type
moudle_pedometer/src/main/res/drawable-hdpi/run_map_icon_end.png deleted
100644 → 0
1.6 KB
moudle_pedometer/src/main/res/drawable-hdpi/run_map_icon_end.webp
0 → 100644
No preview for this file type
moudle_pedometer/src/main/res/drawable-hdpi/run_map_icon_start.png deleted
100644 → 0
1.7 KB
moudle_pedometer/src/main/res/drawable-hdpi/run_map_icon_start.webp
0 → 100644
No preview for this file type
moudle_pedometer/src/main/res/drawable-hdpi/tc_ic_workout_level_adjust_coach.png deleted
100644 → 0
6.52 KB
moudle_pedometer/src/main/res/drawable-hdpi/tc_ic_workout_level_adjust_coach.webp
0 → 100644
No preview for this file type
moudle_pedometer/src/main/res/drawable-hdpi/tc_suit_right_arrow.png deleted
100644 → 0
538 Bytes
moudle_pedometer/src/main/res/drawable-hdpi/tc_suit_right_arrow.webp
0 → 100644
No preview for this file type
moudle_pedometer/src/main/res/drawable-hdpi/top_back_black.png deleted
100644 → 0
409 Bytes
moudle_pedometer/src/main/res/drawable-hdpi/top_back_black.webp
0 → 100644
No preview for this file type
moudle_pedometer/src/main/res/layout/fragment_run_race_detail.xml
| @@ -100,7 +100,7 @@ | @@ -100,7 +100,7 @@ | ||
| 100 | android:layout_width="match_parent" | 100 | android:layout_width="match_parent" |
| 101 | android:layout_height="40sp" | 101 | android:layout_height="40sp" |
| 102 | android:layout_gravity="bottom" | 102 | android:layout_gravity="bottom" |
| 103 | - android:background="@color/green" | 103 | + android:background="@color/green_round" |
| 104 | android:tag="0"> | 104 | android:tag="0"> |
| 105 | 105 | ||
| 106 | <TextView | 106 | <TextView |
| @@ -109,7 +109,7 @@ | @@ -109,7 +109,7 @@ | ||
| 109 | android:layout_height="wrap_content" | 109 | android:layout_height="wrap_content" |
| 110 | android:layout_centerInParent="true" | 110 | android:layout_centerInParent="true" |
| 111 | android:tag="0" | 111 | android:tag="0" |
| 112 | - android:text="立即报名" | 112 | + android:text="@string/run_race_btn_sign_up" |
| 113 | android:textColor="@color/white" | 113 | android:textColor="@color/white" |
| 114 | android:textSize="18sp" /> | 114 | android:textSize="18sp" /> |
| 115 | 115 |
moudle_pedometer/src/main/res/layout/layout_run_detail_rank.xml
| @@ -24,7 +24,7 @@ | @@ -24,7 +24,7 @@ | ||
| 24 | android:layout_height="wrap_content" | 24 | android:layout_height="wrap_content" |
| 25 | android:layout_marginLeft="10dp" | 25 | android:layout_marginLeft="10dp" |
| 26 | android:layout_weight="1" | 26 | android:layout_weight="1" |
| 27 | - android:text="排行榜" | 27 | + android:text="@string/layout_run_detail_rank_title" |
| 28 | android:textColor="@color/black" | 28 | android:textColor="@color/black" |
| 29 | android:textSize="18sp" | 29 | android:textSize="18sp" |
| 30 | android:textStyle="bold" /> | 30 | android:textStyle="bold" /> |
| @@ -33,7 +33,7 @@ | @@ -33,7 +33,7 @@ | ||
| 33 | android:layout_width="wrap_content" | 33 | android:layout_width="wrap_content" |
| 34 | android:layout_height="wrap_content" | 34 | android:layout_height="wrap_content" |
| 35 | android:layout_marginRight="10dp" | 35 | android:layout_marginRight="10dp" |
| 36 | - android:text="查看排行榜 >" | 36 | + android:text="@string/layout_run_detail_rank_see_rank" |
| 37 | android:textColor="@color/black" | 37 | android:textColor="@color/black" |
| 38 | android:textSize="13sp" /> | 38 | android:textSize="13sp" /> |
| 39 | </LinearLayout> | 39 | </LinearLayout> |
| @@ -73,7 +73,7 @@ | @@ -73,7 +73,7 @@ | ||
| 73 | android:layout_width="wrap_content" | 73 | android:layout_width="wrap_content" |
| 74 | android:layout_height="wrap_content" | 74 | android:layout_height="wrap_content" |
| 75 | android:layout_marginTop="5dp" | 75 | android:layout_marginTop="5dp" |
| 76 | - android:text="人已完成" | 76 | + android:text="@string/layout_run_detail_rank_person_finish" |
| 77 | android:textColor="@color/text_gray" | 77 | android:textColor="@color/text_gray" |
| 78 | android:textSize="15sp" /> | 78 | android:textSize="15sp" /> |
| 79 | </LinearLayout> | 79 | </LinearLayout> |
moudle_pedometer/src/main/res/layout/layout_run_detail_street.xml
| @@ -42,7 +42,7 @@ | @@ -42,7 +42,7 @@ | ||
| 42 | android:layout_width="wrap_content" | 42 | android:layout_width="wrap_content" |
| 43 | android:layout_height="wrap_content" | 43 | android:layout_height="wrap_content" |
| 44 | android:layout_marginLeft="5dp" | 44 | android:layout_marginLeft="5dp" |
| 45 | - android:text="活动地点" | 45 | + android:text="@string/layout_street_active_point" |
| 46 | android:textColor="@color/bottom_sheet_dialog_race_location_text" | 46 | android:textColor="@color/bottom_sheet_dialog_race_location_text" |
| 47 | android:textSize="14sp" /> | 47 | android:textSize="14sp" /> |
| 48 | </LinearLayout> | 48 | </LinearLayout> |
| @@ -77,75 +77,13 @@ | @@ -77,75 +77,13 @@ | ||
| 77 | android:textColor="@color/black" | 77 | android:textColor="@color/black" |
| 78 | android:textSize="15sp" /> | 78 | android:textSize="15sp" /> |
| 79 | </LinearLayout> | 79 | </LinearLayout> |
| 80 | - <!--起点--> | ||
| 81 | - <LinearLayout | ||
| 82 | - android:layout_width="match_parent" | ||
| 83 | - android:layout_height="wrap_content" | ||
| 84 | - android:layout_marginLeft="10dp" | ||
| 85 | - android:layout_marginTop="10dp" | ||
| 86 | - android:gravity="center_vertical"> | ||
| 87 | - | ||
| 88 | - <View | ||
| 89 | - android:layout_width="10dp" | ||
| 90 | - android:layout_height="10dp" | ||
| 91 | - android:layout_marginLeft="25dp" | ||
| 92 | - android:background="@drawable/shape_circle_green" /> | ||
| 93 | - | ||
| 94 | - <TextView | ||
| 95 | - android:layout_width="wrap_content" | ||
| 96 | - android:layout_height="wrap_content" | ||
| 97 | - android:layout_marginLeft="10dp" | ||
| 98 | - android:text="(起)" | ||
| 99 | - android:textColor="@color/bottom_sheet_dialog_race_location_text" | ||
| 100 | - android:textSize="14sp" /> | ||
| 101 | - | ||
| 102 | - <TextView | ||
| 103 | - android:layout_width="wrap_content" | ||
| 104 | - android:layout_height="wrap_content" | ||
| 105 | - android:layout_marginLeft="10dp" | ||
| 106 | - android:text="首都师范大学操场东门" | ||
| 107 | - android:textColor="@color/black" | ||
| 108 | - android:textSize="15sp" /> | ||
| 109 | - </LinearLayout> | ||
| 110 | - <!--终点--> | ||
| 111 | - <LinearLayout | ||
| 112 | - android:id="@+id/ll_end_point" | ||
| 113 | - android:layout_width="match_parent" | ||
| 114 | - android:layout_height="wrap_content" | ||
| 115 | - android:layout_marginLeft="10dp" | ||
| 116 | - android:layout_marginTop="10dp" | ||
| 117 | - android:gravity="center_vertical"> | ||
| 118 | - | ||
| 119 | - <View | ||
| 120 | - android:layout_width="10dp" | ||
| 121 | - android:layout_height="10dp" | ||
| 122 | - android:layout_marginLeft="25dp" | ||
| 123 | - android:background="@drawable/shape_circle_red" /> | ||
| 124 | - | ||
| 125 | - <TextView | ||
| 126 | - android:layout_width="wrap_content" | ||
| 127 | - android:layout_height="wrap_content" | ||
| 128 | - android:layout_marginLeft="10dp" | ||
| 129 | - android:text="(止)" | ||
| 130 | - android:textColor="@color/bottom_sheet_dialog_race_location_text" | ||
| 131 | - android:textSize="14sp" /> | ||
| 132 | - | ||
| 133 | - <TextView | ||
| 134 | - android:layout_width="wrap_content" | ||
| 135 | - android:layout_height="wrap_content" | ||
| 136 | - android:layout_marginLeft="10dp" | ||
| 137 | - android:text="首都师范大学操场西门" | ||
| 138 | - android:textColor="@color/black" | ||
| 139 | - android:textSize="15sp" /> | ||
| 140 | - </LinearLayout> | ||
| 141 | - | ||
| 142 | <!--按钮--> | 80 | <!--按钮--> |
| 143 | <RelativeLayout | 81 | <RelativeLayout |
| 144 | android:id="@+id/rl_start_btn" | 82 | android:id="@+id/rl_start_btn" |
| 145 | android:layout_width="match_parent" | 83 | android:layout_width="match_parent" |
| 146 | android:layout_height="40sp" | 84 | android:layout_height="40sp" |
| 147 | android:layout_marginTop="10dp" | 85 | android:layout_marginTop="10dp" |
| 148 | - android:background="@color/green" | 86 | + android:background="@color/green_round" |
| 149 | android:tag="0"> | 87 | android:tag="0"> |
| 150 | 88 | ||
| 151 | <TextView | 89 | <TextView |
| @@ -153,7 +91,7 @@ | @@ -153,7 +91,7 @@ | ||
| 153 | android:layout_width="wrap_content" | 91 | android:layout_width="wrap_content" |
| 154 | android:layout_height="wrap_content" | 92 | android:layout_height="wrap_content" |
| 155 | android:layout_centerInParent="true" | 93 | android:layout_centerInParent="true" |
| 156 | - android:text="立即报名" | 94 | + android:text="@string/run_race_btn_sign_up" |
| 157 | android:textColor="@color/white" | 95 | android:textColor="@color/white" |
| 158 | android:textSize="18sp" /> | 96 | android:textSize="18sp" /> |
| 159 | 97 | ||
| @@ -172,6 +110,69 @@ | @@ -172,6 +110,69 @@ | ||
| 172 | 110 | ||
| 173 | </RelativeLayout> | 111 | </RelativeLayout> |
| 174 | </LinearLayout> | 112 | </LinearLayout> |
| 113 | + <!--起点--> | ||
| 114 | + <LinearLayout | ||
| 115 | + android:layout_width="match_parent" | ||
| 116 | + android:layout_height="wrap_content" | ||
| 117 | + android:layout_marginLeft="10dp" | ||
| 118 | + android:layout_marginTop="10dp" | ||
| 119 | + android:gravity="center_vertical"> | ||
| 120 | + | ||
| 121 | + <View | ||
| 122 | + android:layout_width="10dp" | ||
| 123 | + android:layout_height="10dp" | ||
| 124 | + android:layout_marginLeft="25dp" | ||
| 125 | + android:background="@drawable/shape_circle_green" /> | ||
| 126 | + | ||
| 127 | + <TextView | ||
| 128 | + android:layout_width="wrap_content" | ||
| 129 | + android:layout_height="wrap_content" | ||
| 130 | + android:layout_marginLeft="10dp" | ||
| 131 | + android:text="@string/layout_street_start_point" | ||
| 132 | + android:textColor="@color/bottom_sheet_dialog_race_location_text" | ||
| 133 | + android:textSize="14sp" /> | ||
| 134 | + | ||
| 135 | + <TextView | ||
| 136 | + android:layout_width="wrap_content" | ||
| 137 | + android:layout_height="wrap_content" | ||
| 138 | + android:layout_marginLeft="10dp" | ||
| 139 | + android:text="首都师范大学操场东门" | ||
| 140 | + android:textColor="@color/black" | ||
| 141 | + android:textSize="15sp" /> | ||
| 142 | + </LinearLayout> | ||
| 143 | + <!--终点--> | ||
| 144 | + <LinearLayout | ||
| 145 | + android:id="@+id/ll_end_point" | ||
| 146 | + android:layout_width="match_parent" | ||
| 147 | + android:layout_height="wrap_content" | ||
| 148 | + android:layout_marginLeft="10dp" | ||
| 149 | + android:layout_marginTop="10dp" | ||
| 150 | + android:gravity="center_vertical"> | ||
| 151 | + | ||
| 152 | + <View | ||
| 153 | + android:layout_width="10dp" | ||
| 154 | + android:layout_height="10dp" | ||
| 155 | + android:layout_marginLeft="25dp" | ||
| 156 | + android:background="@drawable/shape_circle_red" /> | ||
| 157 | + | ||
| 158 | + <TextView | ||
| 159 | + android:layout_width="wrap_content" | ||
| 160 | + android:layout_height="wrap_content" | ||
| 161 | + android:layout_marginLeft="10dp" | ||
| 162 | + android:text="@string/layout_street_end_point" | ||
| 163 | + android:textColor="@color/bottom_sheet_dialog_race_location_text" | ||
| 164 | + android:textSize="14sp" /> | ||
| 165 | + | ||
| 166 | + <TextView | ||
| 167 | + android:layout_width="wrap_content" | ||
| 168 | + android:layout_height="wrap_content" | ||
| 169 | + android:layout_marginLeft="10dp" | ||
| 170 | + android:text="首都师范大学操场西门" | ||
| 171 | + android:textColor="@color/black" | ||
| 172 | + android:textSize="15sp" /> | ||
| 173 | + </LinearLayout> | ||
| 174 | + | ||
| 175 | + | ||
| 175 | <!--报名时间--> | 176 | <!--报名时间--> |
| 176 | <LinearLayout | 177 | <LinearLayout |
| 177 | android:layout_width="match_parent" | 178 | android:layout_width="match_parent" |
| @@ -188,7 +189,7 @@ | @@ -188,7 +189,7 @@ | ||
| 188 | android:layout_width="wrap_content" | 189 | android:layout_width="wrap_content" |
| 189 | android:layout_height="wrap_content" | 190 | android:layout_height="wrap_content" |
| 190 | android:layout_marginLeft="5dp" | 191 | android:layout_marginLeft="5dp" |
| 191 | - android:text="报名时间" | 192 | + android:text="@string/layout_street_sign_up_time" |
| 192 | android:textColor="@color/bottom_sheet_dialog_race_location_text" | 193 | android:textColor="@color/bottom_sheet_dialog_race_location_text" |
| 193 | android:textSize="14sp" /> | 194 | android:textSize="14sp" /> |
| 194 | </LinearLayout> | 195 | </LinearLayout> |
| @@ -245,7 +246,7 @@ | @@ -245,7 +246,7 @@ | ||
| 245 | android:layout_width="wrap_content" | 246 | android:layout_width="wrap_content" |
| 246 | android:layout_height="wrap_content" | 247 | android:layout_height="wrap_content" |
| 247 | android:layout_marginLeft="5dp" | 248 | android:layout_marginLeft="5dp" |
| 248 | - android:text="活动时间" | 249 | + android:text="@string/layout_street_active_time" |
| 249 | android:textColor="@color/bottom_sheet_dialog_race_location_text" | 250 | android:textColor="@color/bottom_sheet_dialog_race_location_text" |
| 250 | android:textSize="14sp" /> | 251 | android:textSize="14sp" /> |
| 251 | </LinearLayout> | 252 | </LinearLayout> |
| @@ -302,7 +303,7 @@ | @@ -302,7 +303,7 @@ | ||
| 302 | android:layout_width="wrap_content" | 303 | android:layout_width="wrap_content" |
| 303 | android:layout_height="wrap_content" | 304 | android:layout_height="wrap_content" |
| 304 | android:layout_marginLeft="5dp" | 305 | android:layout_marginLeft="5dp" |
| 305 | - android:text="参与人数" | 306 | + android:text="@string/layout_street_join_person_count" |
| 306 | android:textColor="@color/bottom_sheet_dialog_race_location_text" | 307 | android:textColor="@color/bottom_sheet_dialog_race_location_text" |
| 307 | android:textSize="14sp" /> | 308 | android:textSize="14sp" /> |
| 308 | </LinearLayout> | 309 | </LinearLayout> |
| @@ -339,7 +340,7 @@ | @@ -339,7 +340,7 @@ | ||
| 339 | android:layout_width="match_parent" | 340 | android:layout_width="match_parent" |
| 340 | android:layout_height="40dp" | 341 | android:layout_height="40dp" |
| 341 | android:layout_marginRight="10dp" | 342 | android:layout_marginRight="10dp" |
| 342 | - FivePersonIconView:showRightFlag="true"/> | 343 | + FivePersonIconView:showRightFlag="true" /> |
| 343 | 344 | ||
| 344 | 345 | ||
| 345 | </LinearLayout> | 346 | </LinearLayout> |
moudle_pedometer/src/main/res/layout/layout_run_detail_street_introduce.xml
| @@ -11,7 +11,7 @@ | @@ -11,7 +11,7 @@ | ||
| 11 | android:layout_width="wrap_content" | 11 | android:layout_width="wrap_content" |
| 12 | android:layout_height="wrap_content" | 12 | android:layout_height="wrap_content" |
| 13 | android:layout_marginTop="10dp" | 13 | android:layout_marginTop="10dp" |
| 14 | - android:text="路线介绍" | 14 | + android:text="@string/layout_run_detail_street_introduce_title" |
| 15 | android:textSize="18sp" | 15 | android:textSize="18sp" |
| 16 | android:textStyle="bold" /> | 16 | android:textStyle="bold" /> |
| 17 | 17 | ||
| @@ -28,7 +28,7 @@ | @@ -28,7 +28,7 @@ | ||
| 28 | android:layout_width="wrap_content" | 28 | android:layout_width="wrap_content" |
| 29 | android:layout_height="wrap_content" | 29 | android:layout_height="wrap_content" |
| 30 | android:layout_marginTop="10dp" | 30 | android:layout_marginTop="10dp" |
| 31 | - android:text="路线地图" | 31 | + android:text="@string/layout_run_detail_street_introduce_map" |
| 32 | android:textSize="18sp" | 32 | android:textSize="18sp" |
| 33 | android:textStyle="bold" /> | 33 | android:textStyle="bold" /> |
| 34 | 34 |
moudle_pedometer/src/main/res/values/colors.xml
| @@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
| 3 | <color name="run_main_bg">#3D3745</color> | 3 | <color name="run_main_bg">#3D3745</color> |
| 4 | <color name="run_main_time_bg">#5BC4A4</color> | 4 | <color name="run_main_time_bg">#5BC4A4</color> |
| 5 | <color name="text_gray">#8F8C95</color> | 5 | <color name="text_gray">#8F8C95</color> |
| 6 | - <color name="green_round">#5BC4A5</color> | 6 | + <color name="green_round">#29C48A</color> |
| 7 | <color name="red_round">#F97070</color> | 7 | <color name="red_round">#F97070</color> |
| 8 | <color name="gray_round">#D6D6D6</color> | 8 | <color name="gray_round">#D6D6D6</color> |
| 9 | <color name="circle_stop">#40000000</color> | 9 | <color name="circle_stop">#40000000</color> |
moudle_pedometer/src/main/res/values/strings.xml
| @@ -28,5 +28,21 @@ | @@ -28,5 +28,21 @@ | ||
| 28 | <string name="hello_blank_fragment">Hello blank fragment</string> | 28 | <string name="hello_blank_fragment">Hello blank fragment</string> |
| 29 | <string name="share">分享</string> | 29 | <string name="share">分享</string> |
| 30 | <string name="containuue">继续</string> | 30 | <string name="containuue">继续</string> |
| 31 | - | 31 | + <!--赛事详情--> |
| 32 | + <string name="run_race_btn_sign_up">立即报名</string> | ||
| 33 | + <string name="run_race_btn_start_now">现在开始</string> | ||
| 34 | + <string name="run_race_far_tip">您距离起点较远\n请到达起点附近再开始!</string> | ||
| 35 | + <!--layout_street--> | ||
| 36 | + <string name="layout_street_active_point">活动地点</string> | ||
| 37 | + <string name="layout_street_start_point">(起)</string> | ||
| 38 | + <string name="layout_street_end_point">(止)</string> | ||
| 39 | + <string name="layout_street_sign_up_time">报名时间</string> | ||
| 40 | + <string name="layout_street_active_time">活动时间</string> | ||
| 41 | + <string name="layout_street_join_person_count">参与人数</string> | ||
| 42 | + <string name="layout_run_detail_rank_title">排行榜</string> | ||
| 43 | + <string name="layout_run_detail_rank_see_rank"><![CDATA[查看排行榜 >]]></string> | ||
| 44 | + <string name="layout_run_detail_rank_person_finish">人已完成</string> | ||
| 45 | + <string name="layout_run_detail_street_introduce_title">路线介绍</string> | ||
| 46 | + <string name="layout_run_detail_street_introduce_map">路线地图</string> | ||
| 47 | + <!----> | ||
| 32 | </resources> | 48 | </resources> |