Commit 50a62a39b04c4700bcc5fd9fa6c3099fbbbceb2a
Merge branch 'master' of bj.gitlab.cnlive.com:cnlive-team/ModulePedometer
# Conflicts: # moudle_pedometer/src/main/res/drawable-hdpi/more.png # moudle_pedometer/src/main/res/drawable-xhdpi/more.png # moudle_pedometer/src/main/res/drawable-xxhdpi/more.png
Showing
100 changed files
with
1306 additions
and
638 deletions
Too many changes to show.
To preserve performance only 100 of 105 files are displayed.
.idea/gradle.xml
| @@ -3,6 +3,9 @@ | @@ -3,6 +3,9 @@ | ||
| 3 | <component name="GradleSettings"> | 3 | <component name="GradleSettings"> |
| 4 | <option name="linkedExternalProjectsSettings"> | 4 | <option name="linkedExternalProjectsSettings"> |
| 5 | <GradleProjectSettings> | 5 | <GradleProjectSettings> |
| 6 | + <compositeConfiguration> | ||
| 7 | + <compositeBuild compositeDefinitionSource="SCRIPT" /> | ||
| 8 | + </compositeConfiguration> | ||
| 6 | <option name="distributionType" value="DEFAULT_WRAPPED" /> | 9 | <option name="distributionType" value="DEFAULT_WRAPPED" /> |
| 7 | <option name="externalProjectPath" value="$PROJECT_DIR$" /> | 10 | <option name="externalProjectPath" value="$PROJECT_DIR$" /> |
| 8 | <option name="modules"> | 11 | <option name="modules"> |
app/build.gradle
| @@ -28,15 +28,16 @@ android { | @@ -28,15 +28,16 @@ android { | ||
| 28 | buildConfigField("String", "APP_ID", stringValue("802_jhbqccxw08")) | 28 | buildConfigField("String", "APP_ID", stringValue("802_jhbqccxw08")) |
| 29 | buildConfigField("String", "APP_KEY", stringValue("9c5619e9be747bb3b925dd215ca5923d86f12c09b9394f")) | 29 | buildConfigField("String", "APP_KEY", stringValue("9c5619e9be747bb3b925dd215ca5923d86f12c09b9394f")) |
| 30 | buildConfigField("String", "APP_SCERET", stringValue("1e6380cb347255e777f72b5aa60f41daa68443a132aaea")) | 30 | buildConfigField("String", "APP_SCERET", stringValue("1e6380cb347255e777f72b5aa60f41daa68443a132aaea")) |
| 31 | - // BAIDU_MAP_APP_KEY : "2IIsTtvX2FA88yvDrPZedc2ZvMhxyDbN" | 31 | +// BAIDU_MAP_APP_KEY: "OeotXc38bbnU7WmyKGA0VMahk4v35VG2" |
| 32 | manifestPlaceholders = [ | 32 | manifestPlaceholders = [ |
| 33 | 33 | ||
| 34 | - BAIDU_MAP_APP_KEY: "OeotXc38bbnU7WmyKGA0VMahk4v35VG2" | 34 | + BAIDU_MAP_APP_KEY: "2IIsTtvX2FA88yvDrPZedc2ZvMhxyDbN" |
| 35 | 35 | ||
| 36 | 36 | ||
| 37 | ] | 37 | ] |
| 38 | } | 38 | } |
| 39 | // BAIDU_MAP_APP_KEY: "Q7y9SGcZVs0tmhbNTiaz0jHm4S1xGzE2" | 39 | // BAIDU_MAP_APP_KEY: "Q7y9SGcZVs0tmhbNTiaz0jHm4S1xGzE2" |
| 40 | +// BAIDU_MAP_APP_KEY: "0bWeo04KKKHqTwozcqgyLZVd0oVhv3rZ" | ||
| 40 | 41 | ||
| 41 | release { | 42 | release { |
| 42 | resValue("string", "app_name", "网++") | 43 | resValue("string", "app_name", "网++") |
| @@ -44,7 +45,7 @@ android { | @@ -44,7 +45,7 @@ android { | ||
| 44 | buildConfigField("String", "APP_KEY", stringValue("0d57b045ec0c3988a682d94c644e66b9b8e0d2b8ef937d")) | 45 | buildConfigField("String", "APP_KEY", stringValue("0d57b045ec0c3988a682d94c644e66b9b8e0d2b8ef937d")) |
| 45 | buildConfigField("String", "APP_SCERET", stringValue("275e8dc29274a1186d82f65bc607c231d02bcb3bfd8976")) | 46 | buildConfigField("String", "APP_SCERET", stringValue("275e8dc29274a1186d82f65bc607c231d02bcb3bfd8976")) |
| 46 | manifestPlaceholders = [ | 47 | manifestPlaceholders = [ |
| 47 | - BAIDU_MAP_APP_KEY: "0bWeo04KKKHqTwozcqgyLZVd0oVhv3rZ" | 48 | + BAIDU_MAP_APP_KEY: "Q7y9SGcZVs0tmhbNTiaz0jHm4S1xGzE2" |
| 48 | ] | 49 | ] |
| 49 | } | 50 | } |
| 50 | } | 51 | } |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/presenter/RunningMapFragmentPresenter.java
| @@ -59,6 +59,7 @@ import com.baidu.trace.model.TraceLocation; | @@ -59,6 +59,7 @@ import com.baidu.trace.model.TraceLocation; | ||
| 59 | import com.baidu.trace.model.TransportMode; | 59 | import com.baidu.trace.model.TransportMode; |
| 60 | import com.cnlive.moudle.pedometer.frame.view.RunningMapFragmentView; | 60 | import com.cnlive.moudle.pedometer.frame.view.RunningMapFragmentView; |
| 61 | import com.cnlive.moudle.pedometer.model.Constant; | 61 | import com.cnlive.moudle.pedometer.model.Constant; |
| 62 | +import com.cnlive.moudle.pedometer.model.RoutePoint; | ||
| 62 | import com.cnlive.moudle.pedometer.service.StepService; | 63 | import com.cnlive.moudle.pedometer.service.StepService; |
| 63 | import com.cnlive.moudle.pedometer.utils.BitmapUtil; | 64 | import com.cnlive.moudle.pedometer.utils.BitmapUtil; |
| 64 | import com.cnlive.moudle.pedometer.utils.CommonUtil; | 65 | import com.cnlive.moudle.pedometer.utils.CommonUtil; |
| @@ -127,9 +128,9 @@ public class RunningMapFragmentPresenter extends MvpBasePresenter<RunningMapFrag | @@ -127,9 +128,9 @@ public class RunningMapFragmentPresenter extends MvpBasePresenter<RunningMapFrag | ||
| 127 | //去噪:可设置是否需要去除角度、速度和方向异常的轨迹点 | 128 | //去噪:可设置是否需要去除角度、速度和方向异常的轨迹点 |
| 128 | processOption.setNeedDenoise(true); | 129 | processOption.setNeedDenoise(true); |
| 129 | //绑路:设置是否将轨迹点绑定至路网道路 | 130 | //绑路:设置是否将轨迹点绑定至路网道路 |
| 130 | - processOption.setNeedMapMatch(true); | 131 | + processOption.setNeedMapMatch(false); |
| 131 | //抽稀:设置是否进行抽稀处理,对冗余的轨迹点进行抽稀去除处理,如一条直线上除起终点外的多个轨迹点 | 132 | //抽稀:设置是否进行抽稀处理,对冗余的轨迹点进行抽稀去除处理,如一条直线上除起终点外的多个轨迹点 |
| 132 | -// processOption.setNeedVacuate(true); | 133 | + processOption.setNeedVacuate(true); |
| 133 | //自动判断交通方式 | 134 | //自动判断交通方式 |
| 134 | processOption.setTransportMode(TransportMode.walking); | 135 | processOption.setTransportMode(TransportMode.walking); |
| 135 | // 设置精度过滤值(定位精度大于100米的过滤掉) | 136 | // 设置精度过滤值(定位精度大于100米的过滤掉) |
| @@ -172,14 +173,12 @@ public class RunningMapFragmentPresenter extends MvpBasePresenter<RunningMapFrag | @@ -172,14 +173,12 @@ public class RunningMapFragmentPresenter extends MvpBasePresenter<RunningMapFrag | ||
| 172 | queryHistoryTrace(context, entityName, startTime, endTime); | 173 | queryHistoryTrace(context, entityName, startTime, endTime); |
| 173 | } else { | 174 | } else { |
| 174 | if (getView() != null) { | 175 | if (getView() != null) { |
| 175 | - List<com.baidu.trace.model.LatLng> fenceLatLngs = new ArrayList<>(); | ||
| 176 | -// for (LatLng latLng:trackPoints){ | ||
| 177 | -// com.baidu.trace.model.LatLng tempLatLng=new com.baidu.trace.model.LatLng(latLng.latitude,latLng.longitude); | ||
| 178 | -// fenceLatLngs.add(tempLatLng); | ||
| 179 | -// } | ||
| 180 | -// Log.e(TAG, "onHistoryTrackCallback: "+trackPoints.size()+","+ GsonUtil.GsonString(trackPoints)); | ||
| 181 | -// createFence(context, fenceLatLngs); | 176 | + List<RoutePoint> routePoints = new ArrayList<>(); |
| 177 | + for (LatLng latLng : trackPoints) { | ||
| 178 | + routePoints.add(new RoutePoint(latLng.latitude, latLng.longitude)); | ||
| 179 | + } | ||
| 182 | MyMapUtil.drawHistoryTrack(context, getView().baiduMap, trackPoints, SortType.asc, R.color.red, R.drawable.icon_start, R.drawable.icon_end); | 180 | MyMapUtil.drawHistoryTrack(context, getView().baiduMap, trackPoints, SortType.asc, R.color.red, R.drawable.icon_start, R.drawable.icon_end); |
| 181 | +// MyMapUtil.drawMapLineRoutePoint(context, getView().baiduMap, MyMapUtil.optimizePoints(routePoints), R.color.red); | ||
| 183 | } | 182 | } |
| 184 | } | 183 | } |
| 185 | } | 184 | } |
| @@ -335,9 +334,13 @@ public class RunningMapFragmentPresenter extends MvpBasePresenter<RunningMapFrag | @@ -335,9 +334,13 @@ public class RunningMapFragmentPresenter extends MvpBasePresenter<RunningMapFrag | ||
| 335 | // 监控状态回调 | 334 | // 监控状态回调 |
| 336 | @Override | 335 | @Override |
| 337 | public void onMonitoredStatusCallback(MonitoredStatusResponse monitoredStatusResponse) { | 336 | public void onMonitoredStatusCallback(MonitoredStatusResponse monitoredStatusResponse) { |
| 338 | - Toast.makeText(context, "围栏列表回调成功:onMonitoredStatusCallback", Toast.LENGTH_SHORT).show(); | ||
| 339 | - //查询监控对象状态响应结果 | 337 | + if (monitoredStatusResponse.getMonitoredStatusInfos() != null) { |
| 338 | + Toast.makeText(context, "围栏列表回调成功:个数:" + monitoredStatusResponse.getMonitoredStatusInfos().size(), Toast.LENGTH_SHORT).show(); | ||
| 339 | + } //查询监控对象状态响应结果 | ||
| 340 | List<MonitoredStatusInfo> monitoredStatusInfos = monitoredStatusResponse.getMonitoredStatusInfos(); | 340 | List<MonitoredStatusInfo> monitoredStatusInfos = monitoredStatusResponse.getMonitoredStatusInfos(); |
| 341 | + if (monitoredStatusInfos == null) { | ||
| 342 | + return; | ||
| 343 | + } | ||
| 341 | for (MonitoredStatusInfo monitoredStatusInfo : monitoredStatusInfos) { | 344 | for (MonitoredStatusInfo monitoredStatusInfo : monitoredStatusInfos) { |
| 342 | monitoredStatusInfo.getFenceId(); | 345 | monitoredStatusInfo.getFenceId(); |
| 343 | MonitoredStatus status = monitoredStatusInfo.getMonitoredStatus();//获取状态 | 346 | MonitoredStatus status = monitoredStatusInfo.getMonitoredStatus();//获取状态 |
| @@ -406,7 +409,7 @@ public class RunningMapFragmentPresenter extends MvpBasePresenter<RunningMapFrag | @@ -406,7 +409,7 @@ public class RunningMapFragmentPresenter extends MvpBasePresenter<RunningMapFrag | ||
| 406 | } | 409 | } |
| 407 | 410 | ||
| 408 | List<Long> fenid = new ArrayList<>(); | 411 | List<Long> fenid = new ArrayList<>(); |
| 409 | - fenid.add(111L); | 412 | + fenid.add(1L); |
| 410 | MonitoredStatusRequest request1 = MonitoredStatusRequest.buildServerRequest(1, | 413 | MonitoredStatusRequest request1 = MonitoredStatusRequest.buildServerRequest(1, |
| 411 | StepService.serviceId, "yangshuai", fenid); | 414 | StepService.serviceId, "yangshuai", fenid); |
| 412 | Handler handler = new Handler(); | 415 | Handler handler = new Handler(); |
| @@ -414,7 +417,6 @@ public class RunningMapFragmentPresenter extends MvpBasePresenter<RunningMapFrag | @@ -414,7 +417,6 @@ public class RunningMapFragmentPresenter extends MvpBasePresenter<RunningMapFrag | ||
| 414 | @Override | 417 | @Override |
| 415 | public void run() { | 418 | public void run() { |
| 416 | StepService.mClient.queryMonitoredStatus(request1, onFenceListener); | 419 | StepService.mClient.queryMonitoredStatus(request1, onFenceListener); |
| 417 | -// handler.postDelayed(this, 5000); | ||
| 418 | } | 420 | } |
| 419 | }; | 421 | }; |
| 420 | handler.postDelayed(runnable, 5000); | 422 | handler.postDelayed(runnable, 5000); |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RunMainFragmentView.java
| @@ -11,6 +11,7 @@ import android.view.MotionEvent; | @@ -11,6 +11,7 @@ import android.view.MotionEvent; | ||
| 11 | import android.view.View; | 11 | import android.view.View; |
| 12 | import android.widget.Chronometer; | 12 | import android.widget.Chronometer; |
| 13 | 13 | ||
| 14 | +import com.cnlive.moudle.pedometer.model.RunningFinishBean; | ||
| 14 | import com.cnlive.moudle.pedometer.model.RunningMapBean; | 15 | import com.cnlive.moudle.pedometer.model.RunningMapBean; |
| 15 | import com.cnlive.moudle.pedometer.model.Constant; | 16 | import com.cnlive.moudle.pedometer.model.Constant; |
| 16 | import com.cnlive.moudle.pedometer.model.MessageEvent; | 17 | import com.cnlive.moudle.pedometer.model.MessageEvent; |
| @@ -75,6 +76,9 @@ public class RunMainFragmentView implements MvpView { | @@ -75,6 +76,9 @@ public class RunMainFragmentView implements MvpView { | ||
| 75 | runnable = new Runnable() { | 76 | runnable = new Runnable() { |
| 76 | @Override | 77 | @Override |
| 77 | public void run() { | 78 | public void run() { |
| 79 | + if (fragment.getActivity() == null) { | ||
| 80 | + return; | ||
| 81 | + } | ||
| 78 | if (timeCountDown > 1) { | 82 | if (timeCountDown > 1) { |
| 79 | timeCountDown--; | 83 | timeCountDown--; |
| 80 | fragment.binding.tvTimeCountDown.setVisibility(View.VISIBLE); | 84 | fragment.binding.tvTimeCountDown.setVisibility(View.VISIBLE); |
| @@ -180,7 +184,7 @@ public class RunMainFragmentView implements MvpView { | @@ -180,7 +184,7 @@ public class RunMainFragmentView implements MvpView { | ||
| 180 | public void onClick(View view) { | 184 | public void onClick(View view) { |
| 181 | //继续记录轨迹 | 185 | //继续记录轨迹 |
| 182 | if (StepService.mClient != null && StepService.traceListener != null) { | 186 | if (StepService.mClient != null && StepService.traceListener != null) { |
| 183 | - StepService.mClient.startGather(StepService.traceListener); | 187 | + StepService.mClient.startTrace(StepService.mTrace, StepService.traceListener); |
| 184 | } | 188 | } |
| 185 | needWriteDataFlag = true; | 189 | needWriteDataFlag = true; |
| 186 | //将当前计时器时间戳写入数据库 | 190 | //将当前计时器时间戳写入数据库 |
| @@ -245,6 +249,7 @@ public class RunMainFragmentView implements MvpView { | @@ -245,6 +249,7 @@ public class RunMainFragmentView implements MvpView { | ||
| 245 | SelectDialog selectDialog = new SelectDialog(fragment.getActivity(), "确定结束运动吗?", "确定", new SelectDialog.DialogInterface() { | 249 | SelectDialog selectDialog = new SelectDialog(fragment.getActivity(), "确定结束运动吗?", "确定", new SelectDialog.DialogInterface() { |
| 246 | @Override | 250 | @Override |
| 247 | public void onClick(SelectDialog dialog) { | 251 | public void onClick(SelectDialog dialog) { |
| 252 | + MySpHelper.getInstance(getContext(), Context.MODE_MULTI_PROCESS).putBoolean("writeUserStep:" + uid, false); | ||
| 248 | fragment.binding.cpCurrent.setVisibility(View.GONE); | 253 | fragment.binding.cpCurrent.setVisibility(View.GONE); |
| 249 | ButtonAnimUtil.setViewDefault(fragment.binding.flStop); | 254 | ButtonAnimUtil.setViewDefault(fragment.binding.flStop); |
| 250 | //清空数据 | 255 | //清空数据 |
| @@ -256,8 +261,16 @@ public class RunMainFragmentView implements MvpView { | @@ -256,8 +261,16 @@ public class RunMainFragmentView implements MvpView { | ||
| 256 | MySpHelper.getInstance(getContext(), Context.MODE_MULTI_PROCESS).putLong("stepStartTime", 0); | 261 | MySpHelper.getInstance(getContext(), Context.MODE_MULTI_PROCESS).putLong("stepStartTime", 0); |
| 257 | fragment.getActivity().stopService(new Intent(fragment.getActivity(), StepService.class)); | 262 | fragment.getActivity().stopService(new Intent(fragment.getActivity(), StepService.class)); |
| 258 | MySpHelper.getInstance(getContext(), Context.MODE_MULTI_PROCESS).putString("userId", ""); | 263 | MySpHelper.getInstance(getContext(), Context.MODE_MULTI_PROCESS).putString("userId", ""); |
| 259 | - RunningFinishActivity.startActivity(fragment.getActivity()); | ||
| 260 | - // fragment.getActivity().finish(); | 264 | + RunningFinishBean runningFinishBean = new RunningFinishBean(); |
| 265 | + runningFinishBean.setStartPoint("开始地点"); | ||
| 266 | + runningFinishBean.setEndPoint("结束地点"); | ||
| 267 | + runningFinishBean.setRunDistance(fragment.binding.tvRunDistance.getText().toString()); | ||
| 268 | + runningFinishBean.setSpeed(fragment.binding.tvSpeed.getText().toString()); | ||
| 269 | + runningFinishBean.setStep(fragment.binding.tvStepCount.getText().toString()); | ||
| 270 | + runningFinishBean.setTime(fragment.binding.chronometer.getText().toString()); | ||
| 271 | + runningFinishBean.setDate(TimeUtil.getFormatNowTime()); | ||
| 272 | + RunningFinishActivity.startActivity(fragment.getActivity(), runningFinishBean); | ||
| 273 | + fragment.getActivity().finish(); | ||
| 261 | } | 274 | } |
| 262 | }, "取消", new SelectDialog.DialogInterface() { | 275 | }, "取消", new SelectDialog.DialogInterface() { |
| 263 | @Override | 276 | @Override |
| @@ -334,7 +347,7 @@ public class RunMainFragmentView implements MvpView { | @@ -334,7 +347,7 @@ public class RunMainFragmentView implements MvpView { | ||
| 334 | //暂停计步 | 347 | //暂停计步 |
| 335 | EventBus.getDefault().post(new MessageEvent(Constant.SERVICE_STEP_COUNT_PAUSE, "")); | 348 | EventBus.getDefault().post(new MessageEvent(Constant.SERVICE_STEP_COUNT_PAUSE, "")); |
| 336 | //重置速度 | 349 | //重置速度 |
| 337 | - resetSpeed(); | 350 | +// resetSpeed(); |
| 338 | } | 351 | } |
| 339 | }); | 352 | }); |
| 340 | //gps点击事件 | 353 | //gps点击事件 |
| @@ -406,7 +419,7 @@ public class RunMainFragmentView implements MvpView { | @@ -406,7 +419,7 @@ public class RunMainFragmentView implements MvpView { | ||
| 406 | //设置行走公里 | 419 | //设置行走公里 |
| 407 | fragment.binding.tvRunDistance.setText(StepUtil.getWalkDistanceKM(step) + ""); | 420 | fragment.binding.tvRunDistance.setText(StepUtil.getWalkDistanceKM(step) + ""); |
| 408 | //设置行走步数 | 421 | //设置行走步数 |
| 409 | - fragment.binding.tvStepCount.setText(step + "步"); | 422 | + fragment.binding.tvStepCount.setText(step+""); |
| 410 | //设置S速度 | 423 | //设置S速度 |
| 411 | int second = (int) ((SystemClock.elapsedRealtime() - fragment.binding.chronometer.getBase()) / 1000); | 424 | int second = (int) ((SystemClock.elapsedRealtime() - fragment.binding.chronometer.getBase()) / 1000); |
| 412 | if (second != 0) { | 425 | if (second != 0) { |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RunRaceDetailFragmentView.java
| @@ -257,6 +257,16 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { | @@ -257,6 +257,16 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { | ||
| 257 | fragment.binding.includeStreet.fiveJoinPerson.setOnClickListener(v -> { | 257 | fragment.binding.includeStreet.fiveJoinPerson.setOnClickListener(v -> { |
| 258 | TakePartActivity.newInstance(fragment.getActivity()); | 258 | TakePartActivity.newInstance(fragment.getActivity()); |
| 259 | }); | 259 | }); |
| 260 | + //返回按钮 | ||
| 261 | + fragment.binding.ivBack.setOnClickListener(new View.OnClickListener() { | ||
| 262 | + @Override | ||
| 263 | + public void onClick(View view) { | ||
| 264 | + if (fragment.getActivity()==null){ | ||
| 265 | + return; | ||
| 266 | + } | ||
| 267 | + fragment.getActivity().finish(); | ||
| 268 | + } | ||
| 269 | + }); | ||
| 260 | } | 270 | } |
| 261 | 271 | ||
| 262 | private void initMap() { | 272 | private void initMap() { |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RunningFinishFragmentView.java
| 1 | package com.cnlive.moudle.pedometer.frame.view; | 1 | package com.cnlive.moudle.pedometer.frame.view; |
| 2 | 2 | ||
| 3 | import android.content.Context; | 3 | import android.content.Context; |
| 4 | +import android.view.View; | ||
| 4 | 5 | ||
| 6 | +import com.cnlive.moudle.pedometer.model.RunningFinishBean; | ||
| 5 | import com.cnlive.moudle.pedometer.ui.fragment.RunningFinishFragment; | 7 | import com.cnlive.moudle.pedometer.ui.fragment.RunningFinishFragment; |
| 6 | import com.cnlive.moudle.pedometer.ui.fragment.RunningMapFragment; | 8 | import com.cnlive.moudle.pedometer.ui.fragment.RunningMapFragment; |
| 7 | import com.hannesdorfmann.mosby3.mvp.MvpView; | 9 | import com.hannesdorfmann.mosby3.mvp.MvpView; |
| @@ -16,4 +18,33 @@ public class RunningFinishFragmentView implements MvpView { | @@ -16,4 +18,33 @@ public class RunningFinishFragmentView implements MvpView { | ||
| 16 | public Context getContext() { | 18 | public Context getContext() { |
| 17 | return fragment == null ? null : fragment.getActivity(); | 19 | return fragment == null ? null : fragment.getActivity(); |
| 18 | } | 20 | } |
| 21 | + | ||
| 22 | + public void initView(RunningFinishBean runningFinishBean) { | ||
| 23 | + //设置距离 | ||
| 24 | + fragment.binding.includeFinishUserInfo.tvDistance.setText(runningFinishBean.getRunDistance()); | ||
| 25 | + //设置配速 | ||
| 26 | + fragment.binding.includeFinishUserInfo.tvSpeed.setText(runningFinishBean.getSpeed()); | ||
| 27 | + //设置用时 | ||
| 28 | + fragment.binding.includeFinishUserInfo.tvTimer.setText(runningFinishBean.getTime()); | ||
| 29 | + //设置日期 | ||
| 30 | + fragment.binding.includeFinishUserInfo.tvDate.setText(runningFinishBean.getDate()); | ||
| 31 | + //设置步数 | ||
| 32 | + fragment.binding.includeFinishStep.tvStep.setText(runningFinishBean.getStep()); | ||
| 33 | + //设置起点位置 | ||
| 34 | + fragment.binding.includeFinishRunRoute.tvStartPoint.setText(runningFinishBean.getStartPoint()); | ||
| 35 | + //设置终点位置 | ||
| 36 | + fragment.binding.includeFinishRunRoute.tvEndPoint.setText(runningFinishBean.getEndPoint()); | ||
| 37 | + //设置时间 | ||
| 38 | + fragment.binding.includeFinishRunRoute.tvTimer.setText(runningFinishBean.getTime()); | ||
| 39 | + //返回按钮点击 | ||
| 40 | + fragment.binding.flBack.setOnClickListener(new View.OnClickListener() { | ||
| 41 | + @Override | ||
| 42 | + public void onClick(View view) { | ||
| 43 | + if (fragment.getActivity() == null) { | ||
| 44 | + return; | ||
| 45 | + } | ||
| 46 | + fragment.getActivity().finish(); | ||
| 47 | + } | ||
| 48 | + }); | ||
| 49 | + } | ||
| 19 | } | 50 | } |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RunningMapFragmentView.java
| @@ -28,8 +28,11 @@ import com.baidu.mapapi.map.MapView; | @@ -28,8 +28,11 @@ import com.baidu.mapapi.map.MapView; | ||
| 28 | import com.baidu.mapapi.map.MarkerOptions; | 28 | import com.baidu.mapapi.map.MarkerOptions; |
| 29 | import com.baidu.mapapi.map.MyLocationConfiguration; | 29 | import com.baidu.mapapi.map.MyLocationConfiguration; |
| 30 | import com.baidu.mapapi.map.MyLocationData; | 30 | import com.baidu.mapapi.map.MyLocationData; |
| 31 | +import com.baidu.mapapi.map.Overlay; | ||
| 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.utils.DistanceUtil; | ||
| 35 | +import com.baidu.trace.model.SortType; | ||
| 33 | import com.cnlive.moudle.pedometer.model.RunningMapBean; | 36 | import com.cnlive.moudle.pedometer.model.RunningMapBean; |
| 34 | import com.cnlive.moudle.pedometer.ui.fragment.RunningMapFragment; | 37 | import com.cnlive.moudle.pedometer.ui.fragment.RunningMapFragment; |
| 35 | import com.cnlive.moudle.pedometer.utils.BitmapUtil; | 38 | import com.cnlive.moudle.pedometer.utils.BitmapUtil; |
| @@ -39,6 +42,7 @@ import com.cnlive.moudle.pedometer.utils.StepUtil; | @@ -39,6 +42,7 @@ import com.cnlive.moudle.pedometer.utils.StepUtil; | ||
| 39 | import com.example.moudle_pedometer.R; | 42 | import com.example.moudle_pedometer.R; |
| 40 | import com.hannesdorfmann.mosby3.mvp.MvpView; | 43 | import com.hannesdorfmann.mosby3.mvp.MvpView; |
| 41 | 44 | ||
| 45 | +import java.util.ArrayList; | ||
| 42 | import java.util.List; | 46 | import java.util.List; |
| 43 | 47 | ||
| 44 | public class RunningMapFragmentView implements MvpView, SensorEventListener { | 48 | public class RunningMapFragmentView implements MvpView, SensorEventListener { |
| @@ -54,7 +58,7 @@ public class RunningMapFragmentView implements MvpView, SensorEventListener { | @@ -54,7 +58,7 @@ public class RunningMapFragmentView implements MvpView, SensorEventListener { | ||
| 54 | private static MyLocationData mylocation; | 58 | private static MyLocationData mylocation; |
| 55 | boolean isFirstLoc = true; // 是否首次定位 | 59 | boolean isFirstLoc = true; // 是否首次定位 |
| 56 | private MarkerOptions currentMark; | 60 | private MarkerOptions currentMark; |
| 57 | - private LatLng firstLatLng; | 61 | + private LatLng myCurLatLng; |
| 58 | private Double lastX = 0.0; | 62 | private Double lastX = 0.0; |
| 59 | private int mCurrentDirection = 0; | 63 | private int mCurrentDirection = 0; |
| 60 | private double mCurrentLat = 0.0; | 64 | private double mCurrentLat = 0.0; |
| @@ -66,6 +70,8 @@ public class RunningMapFragmentView implements MvpView, SensorEventListener { | @@ -66,6 +70,8 @@ public class RunningMapFragmentView implements MvpView, SensorEventListener { | ||
| 66 | private final int DEFULT_ZOOM = 17; | 70 | private final int DEFULT_ZOOM = 17; |
| 67 | private boolean isFirstLoadMap = true; | 71 | private boolean isFirstLoadMap = true; |
| 68 | private List<LatLng> trackPoints; | 72 | private List<LatLng> trackPoints; |
| 73 | + private Overlay currentLine; | ||
| 74 | + private List<LatLng> currentPoints; | ||
| 69 | 75 | ||
| 70 | public RunningMapFragmentView(RunningMapFragment fragment) { | 76 | public RunningMapFragmentView(RunningMapFragment fragment) { |
| 71 | this.fragment = fragment; | 77 | this.fragment = fragment; |
| @@ -76,6 +82,7 @@ public class RunningMapFragmentView implements MvpView, SensorEventListener { | @@ -76,6 +82,7 @@ public class RunningMapFragmentView implements MvpView, SensorEventListener { | ||
| 76 | } | 82 | } |
| 77 | 83 | ||
| 78 | public void initView(List<LatLng> trackPoints) { | 84 | public void initView(List<LatLng> trackPoints) { |
| 85 | + currentPoints = new ArrayList<>(); | ||
| 79 | this.trackPoints = trackPoints; | 86 | this.trackPoints = trackPoints; |
| 80 | this.mMapView = fragment.binding.mapView; | 87 | this.mMapView = fragment.binding.mapView; |
| 81 | if (baiduMap == null) { | 88 | if (baiduMap == null) { |
| @@ -103,7 +110,7 @@ public class RunningMapFragmentView implements MvpView, SensorEventListener { | @@ -103,7 +110,7 @@ public class RunningMapFragmentView implements MvpView, SensorEventListener { | ||
| 103 | mMapView.showZoomControls(false); | 110 | mMapView.showZoomControls(false); |
| 104 | mUiSettings.setEnlargeCenterWithDoubleClickEnable(true); | 111 | mUiSettings.setEnlargeCenterWithDoubleClickEnable(true); |
| 105 | //隐藏自带的指南针,改用自定义指南针 杨帅 | 112 | //隐藏自带的指南针,改用自定义指南针 杨帅 |
| 106 | - baiduMap.getUiSettings().setCompassEnabled(true); | 113 | + mUiSettings.setCompassEnabled(false); |
| 107 | //显示定位图层 | 114 | //显示定位图层 |
| 108 | baiduMap.setMyLocationEnabled(true); | 115 | baiduMap.setMyLocationEnabled(true); |
| 109 | // 定位初始化 | 116 | // 定位初始化 |
| @@ -111,21 +118,36 @@ public class RunningMapFragmentView implements MvpView, SensorEventListener { | @@ -111,21 +118,36 @@ public class RunningMapFragmentView implements MvpView, SensorEventListener { | ||
| 111 | mLocClient.registerLocationListener(myListener); | 118 | mLocClient.registerLocationListener(myListener); |
| 112 | LocationClientOption option = new LocationClientOption(); | 119 | LocationClientOption option = new LocationClientOption(); |
| 113 | option.setOpenGps(true); // 打开gps | 120 | option.setOpenGps(true); // 打开gps |
| 121 | + //可选,设置返回经纬度坐标类型,默认GCJ02 | ||
| 122 | + //GCJ02:国测局坐标; | ||
| 123 | + //BD09ll:百度经纬度坐标; | ||
| 124 | + //BD09:百度墨卡托坐标; | ||
| 125 | + //海外地区定位,无需设置坐标类型,统一返回WGS84类型坐标 | ||
| 114 | option.setCoorType("gcj02"); // 设置坐标类型 | 126 | option.setCoorType("gcj02"); // 设置坐标类型 |
| 115 | //可选,默认false,设置是否开启Gps定位 | 127 | //可选,默认false,设置是否开启Gps定位 |
| 116 | option.setOpenGps(true); | 128 | option.setOpenGps(true); |
| 117 | //设置打开自动回调位置模式,该开关打开后,期间只要定位SDK检测到位置变化就会主动回调给开发者,该模式下开发者无需再关心定位间隔是多少,定位SDK本身发现位置变化就会及时回调给开发者 | 129 | //设置打开自动回调位置模式,该开关打开后,期间只要定位SDK检测到位置变化就会主动回调给开发者,该模式下开发者无需再关心定位间隔是多少,定位SDK本身发现位置变化就会及时回调给开发者 |
| 118 | option.setOpenAutoNotifyMode(); | 130 | option.setOpenAutoNotifyMode(); |
| 119 | //可选,默认高精度,设置定位模式,高精度,低功耗,仅设备 | 131 | //可选,默认高精度,设置定位模式,高精度,低功耗,仅设备 |
| 132 | + //LocationMode.Hight_Accuracy:高精度; | ||
| 133 | + //LocationMode. Battery_Saving:低功耗; | ||
| 134 | + //LocationMode. Device_Sensors:仅使用设备; | ||
| 120 | option.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy); | 135 | option.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy); |
| 121 | //可选,设置是否需要地址信息,默认不需要 | 136 | //可选,设置是否需要地址信息,默认不需要 |
| 122 | - option.setIsNeedAddress(true); | 137 | + option.setIsNeedAddress(false); |
| 123 | //可选,设置是否需要地址描述 | 138 | //可选,设置是否需要地址描述 |
| 124 | - option.setIsNeedLocationDescribe(true); | 139 | + option.setIsNeedLocationDescribe(false); |
| 125 | //可选,设置是否需要设备方向结果 | 140 | //可选,设置是否需要设备方向结果 |
| 126 | option.setNeedDeviceDirect(false); | 141 | option.setNeedDeviceDirect(false); |
| 127 | //设置打开自动回调位置模式,该开关打开后,期间只要定位SDK检测到位置变化就会主动回调给开发者 | 142 | //设置打开自动回调位置模式,该开关打开后,期间只要定位SDK检测到位置变化就会主动回调给开发者 |
| 143 | + //minTimeInterval - 最短定位时间间隔,单位毫秒,最小值0,开发者可以在设置希望的位置回调最短时间间隔 | ||
| 144 | + //minDistance - 最短定位距离间隔,单位米,最小值0,开发者可以设置希望的位置回调距离间隔 | ||
| 145 | + //locSensitivity - 定位变化敏感程度,LOC_SENSITIVITY_HIGHT,LOC_SENSITIVITY_MIDDLE,LOC_SENSITIVITY_LOW | ||
| 128 | option.setOpenAutoNotifyMode(3000, 1, LocationClientOption.LOC_SENSITIVITY_HIGHT); | 146 | option.setOpenAutoNotifyMode(3000, 1, LocationClientOption.LOC_SENSITIVITY_HIGHT); |
| 147 | + //可选,定位SDK内部是一个service,并放到了独立进程。 | ||
| 148 | + //设置是否在stop的时候杀死这个进程,默认(建议)不杀死,即setIgnoreKillProcess(true) | ||
| 149 | + option.setIgnoreKillProcess(true); | ||
| 150 | + | ||
| 129 | mLocClient.setLocOption(option); | 151 | mLocClient.setLocOption(option); |
| 130 | mLocClient.start(); | 152 | mLocClient.start(); |
| 131 | //地图加载完毕监听 | 153 | //地图加载完毕监听 |
| @@ -142,7 +164,11 @@ public class RunningMapFragmentView implements MvpView, SensorEventListener { | @@ -142,7 +164,11 @@ public class RunningMapFragmentView implements MvpView, SensorEventListener { | ||
| 142 | new Handler().postDelayed(new Runnable() { | 164 | new Handler().postDelayed(new Runnable() { |
| 143 | @Override | 165 | @Override |
| 144 | public void run() { | 166 | public void run() { |
| 145 | - MyMapUtil.drawMapLine(getContext(), baiduMap, trackPoints, R.color.green_50); | 167 | + //绘制赛道轨迹 |
| 168 | + if (getContext() == null) { | ||
| 169 | + return; | ||
| 170 | + } | ||
| 171 | + MyMapUtil.drawServerLineTrack(getContext(), baiduMap, trackPoints, SortType.asc, R.color.green_50, R.drawable.icon_start, R.drawable.icon_end); | ||
| 146 | } | 172 | } |
| 147 | }, 1500); | 173 | }, 1500); |
| 148 | } | 174 | } |
| @@ -197,6 +223,20 @@ public class RunningMapFragmentView implements MvpView, SensorEventListener { | @@ -197,6 +223,20 @@ public class RunningMapFragmentView implements MvpView, SensorEventListener { | ||
| 197 | * 定位SDK监听函数 | 223 | * 定位SDK监听函数 |
| 198 | */ | 224 | */ |
| 199 | public class MyLocationListenner extends BDAbstractLocationListener { | 225 | public class MyLocationListenner extends BDAbstractLocationListener { |
| 226 | + @Override | ||
| 227 | + public void onLocDiagnosticMessage(int i, int i1, String s) { | ||
| 228 | + super.onLocDiagnosticMessage(i, i1, s); | ||
| 229 | + if (getContext() == null) { | ||
| 230 | + return; | ||
| 231 | + } | ||
| 232 | + if (i == 67) { | ||
| 233 | + Toast.makeText(getContext(), getContext().getString(R.string.loc_check_internet), Toast.LENGTH_SHORT).show(); | ||
| 234 | + } else if (i == 161 && i1 == 1) { | ||
| 235 | + Toast.makeText(getContext(), getContext().getString(R.string.loc_open_gps), Toast.LENGTH_SHORT).show(); | ||
| 236 | + } else if (i == 161 && i1 == 2) { | ||
| 237 | + Toast.makeText(getContext(), getContext().getString(R.string.loc_open_wifi), Toast.LENGTH_SHORT).show(); | ||
| 238 | + } | ||
| 239 | + } | ||
| 200 | 240 | ||
| 201 | @Override | 241 | @Override |
| 202 | public void onReceiveLocation(BDLocation location) { | 242 | public void onReceiveLocation(BDLocation location) { |
| @@ -228,31 +268,37 @@ public class RunningMapFragmentView implements MvpView, SensorEventListener { | @@ -228,31 +268,37 @@ public class RunningMapFragmentView implements MvpView, SensorEventListener { | ||
| 228 | return; | 268 | return; |
| 229 | } | 269 | } |
| 230 | MapStatus.Builder builder = new MapStatus.Builder(); | 270 | MapStatus.Builder builder = new MapStatus.Builder(); |
| 271 | + //不是第一次定位 | ||
| 272 | + if (!isFirstLoc) { | ||
| 273 | + if (currentPoints.size() > 0) { | ||
| 274 | + //进行判断 | ||
| 275 | + LatLng lastLatLng = currentPoints.get(currentPoints.size() - 1); | ||
| 276 | + LatLng curLatLng = new LatLng(location.getLatitude(), | ||
| 277 | + location.getLongitude()); | ||
| 278 | + if (DistanceUtil.getDistance(lastLatLng, curLatLng) > 0.5) { | ||
| 279 | + currentPoints.add(curLatLng); | ||
| 280 | + } | ||
| 281 | + } else { | ||
| 282 | + currentPoints.add(new LatLng(location.getLatitude(), | ||
| 283 | + location.getLongitude())); | ||
| 284 | + } | ||
| 231 | 285 | ||
| 232 | -// if (isFirstLoc) { | ||
| 233 | -// isFirstLoc = false; | ||
| 234 | - firstLatLng = new LatLng(location.getLatitude(), | 286 | + //判断当前集合列表是否可以划线(至少两个点) |
| 287 | + if (currentPoints != null && currentPoints.size() > 1) { | ||
| 288 | + //判断当前是否已经在地图上画点 | ||
| 289 | + if (currentLine != null) { | ||
| 290 | + currentLine.remove(); | ||
| 291 | + } | ||
| 292 | + //开始划线 | ||
| 293 | + if (getContext() == null) { | ||
| 294 | + return; | ||
| 295 | + } | ||
| 296 | + currentLine = MyMapUtil.drawMapLine(getContext(), baiduMap, currentPoints, R.color.red); | ||
| 297 | + } | ||
| 298 | + } | ||
| 299 | + myCurLatLng = new LatLng(location.getLatitude(), | ||
| 235 | location.getLongitude()); | 300 | location.getLongitude()); |
| 236 | baiduMap.setMyLocationData(mylocation); | 301 | baiduMap.setMyLocationData(mylocation); |
| 237 | -// if (trackPoints!=null){ | ||
| 238 | -// Log.e(TAG, "trackPoints: "+MyMapUtil.isInPolygon(firstLatLng,trackPoints) ); | ||
| 239 | -// } | ||
| 240 | -// if (isFirstLoc) { | ||
| 241 | -// builder.target(firstLatLng).zoom(DEFULT_ZOOM); | ||
| 242 | -// isFirstLoc = false; | ||
| 243 | -// } else { | ||
| 244 | -// float current = baiduMap.getMapStatus().zoom; | ||
| 245 | -// builder.target(firstLatLng).zoom(current); | ||
| 246 | -// | ||
| 247 | -// } | ||
| 248 | -// baiduMap.animateMapStatus(MapStatusUpdateFactory.newMapStatus(builder.build())); | ||
| 249 | -// //显示当前位置图标 | ||
| 250 | -// Bitmap pointBitmap = BitmapUtil.getBitmapFromDp(getContext(), BitmapFactory.decodeResource(getContext().getResources(), R.drawable.rt_ic_location), 40, 40); | ||
| 251 | -// currentMark = new MarkerOptions().position(firstLatLng).icon(BitmapDescriptorFactory.fromBitmap(pointBitmap)); | ||
| 252 | -// baiduMap.addOverlay(currentMark); | ||
| 253 | - | ||
| 254 | - | ||
| 255 | -// } | ||
| 256 | } | 302 | } |
| 257 | } | 303 | } |
| 258 | 304 | ||
| @@ -342,6 +388,7 @@ public class RunningMapFragmentView implements MvpView, SensorEventListener { | @@ -342,6 +388,7 @@ public class RunningMapFragmentView implements MvpView, SensorEventListener { | ||
| 342 | 388 | ||
| 343 | } | 389 | } |
| 344 | 390 | ||
| 391 | + | ||
| 345 | public void onResume() { | 392 | public void onResume() { |
| 346 | if (mMapView != null) { | 393 | if (mMapView != null) { |
| 347 | mMapView.onResume(); | 394 | mMapView.onResume(); |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/model/Constant.java
| @@ -6,5 +6,7 @@ public class Constant { | @@ -6,5 +6,7 @@ public class Constant { | ||
| 6 | public static final int SERVICE_STEP_COUNT_CONTINUE = 2;//继续计步 | 6 | public static final int SERVICE_STEP_COUNT_CONTINUE = 2;//继续计步 |
| 7 | public static final int SERVICE_STEP_COUNT_RESET_SPEED = 3;//重置速度 | 7 | public static final int SERVICE_STEP_COUNT_RESET_SPEED = 3;//重置速度 |
| 8 | public static final int FRAGMENT_RUN_CHRONOMETER = 4;//同步计时器 | 8 | public static final int FRAGMENT_RUN_CHRONOMETER = 4;//同步计时器 |
| 9 | + public static final int EXIT_RANGE = 5;//超出范围 | ||
| 10 | + public static final int ENTER_RANGE = 6;//进入范围 | ||
| 9 | 11 | ||
| 10 | } | 12 | } |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/model/RoutePoint.java
0 → 100644
| 1 | +package com.cnlive.moudle.pedometer.model; | ||
| 2 | + | ||
| 3 | +public class RoutePoint { | ||
| 4 | + private double lat; | ||
| 5 | + private double lng; | ||
| 6 | + | ||
| 7 | + public RoutePoint() { | ||
| 8 | + } | ||
| 9 | + | ||
| 10 | + public RoutePoint(double lat, double lng) { | ||
| 11 | + this.lat = lat; | ||
| 12 | + this.lng = lng; | ||
| 13 | + } | ||
| 14 | + | ||
| 15 | + public double getLat() { | ||
| 16 | + return lat; | ||
| 17 | + } | ||
| 18 | + | ||
| 19 | + public void setLat(double lat) { | ||
| 20 | + this.lat = lat; | ||
| 21 | + } | ||
| 22 | + | ||
| 23 | + public double getLng() { | ||
| 24 | + return lng; | ||
| 25 | + } | ||
| 26 | + | ||
| 27 | + public void setLng(double lng) { | ||
| 28 | + this.lng = lng; | ||
| 29 | + } | ||
| 30 | +} |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/model/RunningFinishBean.java
0 → 100644
| 1 | +package com.cnlive.moudle.pedometer.model; | ||
| 2 | + | ||
| 3 | +import java.io.Serializable; | ||
| 4 | + | ||
| 5 | +/** | ||
| 6 | + * 跑步结束相关数据 | ||
| 7 | + * | ||
| 8 | + * @author ShinnyYang | ||
| 9 | + */ | ||
| 10 | +public class RunningFinishBean implements Serializable { | ||
| 11 | + private String runDistance; | ||
| 12 | + private String speed; | ||
| 13 | + private String time; | ||
| 14 | + private String step; | ||
| 15 | + private String startPoint; | ||
| 16 | + private String endPoint; | ||
| 17 | + private String date; | ||
| 18 | + | ||
| 19 | + public String getRunDistance() { | ||
| 20 | + return runDistance; | ||
| 21 | + } | ||
| 22 | + | ||
| 23 | + public void setRunDistance(String runDistance) { | ||
| 24 | + this.runDistance = runDistance; | ||
| 25 | + } | ||
| 26 | + | ||
| 27 | + public String getSpeed() { | ||
| 28 | + return speed; | ||
| 29 | + } | ||
| 30 | + | ||
| 31 | + public void setSpeed(String speed) { | ||
| 32 | + this.speed = speed; | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | + public String getTime() { | ||
| 36 | + return time; | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + public void setTime(String time) { | ||
| 40 | + this.time = time; | ||
| 41 | + } | ||
| 42 | + | ||
| 43 | + public String getStep() { | ||
| 44 | + return step; | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + public void setStep(String step) { | ||
| 48 | + this.step = step; | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + public String getStartPoint() { | ||
| 52 | + return startPoint; | ||
| 53 | + } | ||
| 54 | + | ||
| 55 | + public void setStartPoint(String startPoint) { | ||
| 56 | + this.startPoint = startPoint; | ||
| 57 | + } | ||
| 58 | + | ||
| 59 | + public String getEndPoint() { | ||
| 60 | + return endPoint; | ||
| 61 | + } | ||
| 62 | + | ||
| 63 | + public void setEndPoint(String endPoint) { | ||
| 64 | + this.endPoint = endPoint; | ||
| 65 | + } | ||
| 66 | + | ||
| 67 | + public String getDate() { | ||
| 68 | + return date; | ||
| 69 | + } | ||
| 70 | + | ||
| 71 | + public void setDate(String date) { | ||
| 72 | + this.date = date; | ||
| 73 | + } | ||
| 74 | +} |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/service/StepService.java
| @@ -147,9 +147,8 @@ public class StepService extends Service implements SensorEventListener { | @@ -147,9 +147,8 @@ public class StepService extends Service implements SensorEventListener { | ||
| 147 | //打包周期 | 147 | //打包周期 |
| 148 | private int packInterval = 10; | 148 | private int packInterval = 10; |
| 149 | // 轨迹服务ID | 149 | // 轨迹服务ID |
| 150 | -// public static final long serviceId = 213511; | ||
| 151 | -//杨帅 | ||
| 152 | - public static final long serviceId = 213553; | 150 | + public static final long serviceId = 213511;//杨帅 |
| 151 | +// public static final long serviceId = 213553; | ||
| 153 | 152 | ||
| 154 | // 设备标识 | 153 | // 设备标识 |
| 155 | public static String entityName = ""; | 154 | public static String entityName = ""; |
| @@ -161,7 +160,7 @@ public class StepService extends Service implements SensorEventListener { | @@ -161,7 +160,7 @@ public class StepService extends Service implements SensorEventListener { | ||
| 161 | /** | 160 | /** |
| 162 | * 轨迹服务 | 161 | * 轨迹服务 |
| 163 | */ | 162 | */ |
| 164 | - public Trace mTrace = null; | 163 | + public static Trace mTrace = null; |
| 165 | 164 | ||
| 166 | public StepService() { | 165 | public StepService() { |
| 167 | 166 | ||
| @@ -170,7 +169,6 @@ public class StepService extends Service implements SensorEventListener { | @@ -170,7 +169,6 @@ public class StepService extends Service implements SensorEventListener { | ||
| 170 | 169 | ||
| 171 | @Override | 170 | @Override |
| 172 | public void onCreate() { | 171 | public void onCreate() { |
| 173 | - Log.e("执行onCreate", "onCreate"); | ||
| 174 | super.onCreate(); | 172 | super.onCreate(); |
| 175 | init(); | 173 | init(); |
| 176 | showStartForegroundNotification(); | 174 | showStartForegroundNotification(); |
| @@ -325,11 +323,11 @@ public class StepService extends Service implements SensorEventListener { | @@ -325,11 +323,11 @@ public class StepService extends Service implements SensorEventListener { | ||
| 325 | } | 323 | } |
| 326 | //超出范围 | 324 | //超出范围 |
| 327 | if (alarmPushInfo.getMonitoredAction() == MonitoredAction.exit) { | 325 | if (alarmPushInfo.getMonitoredAction() == MonitoredAction.exit) { |
| 328 | - | 326 | + EventBus.getDefault().post(new MessageEvent(Constant.EXIT_RANGE, "")); |
| 329 | } | 327 | } |
| 330 | //进入范围 | 328 | //进入范围 |
| 331 | else if (alarmPushInfo.getMonitoredAction() == MonitoredAction.enter) { | 329 | else if (alarmPushInfo.getMonitoredAction() == MonitoredAction.enter) { |
| 332 | - | 330 | + EventBus.getDefault().post(new MessageEvent(Constant.ENTER_RANGE, "")); |
| 333 | } | 331 | } |
| 334 | Toast.makeText(getApplicationContext(), "onPushCallback:" + alarmPushInfo.getMonitoredAction(), Toast.LENGTH_SHORT).show(); | 332 | Toast.makeText(getApplicationContext(), "onPushCallback:" + alarmPushInfo.getMonitoredAction(), Toast.LENGTH_SHORT).show(); |
| 335 | 333 | ||
| @@ -362,12 +360,13 @@ public class StepService extends Service implements SensorEventListener { | @@ -362,12 +360,13 @@ public class StepService extends Service implements SensorEventListener { | ||
| 362 | // userId=intent.getExtras().getString("userId"); | 360 | // userId=intent.getExtras().getString("userId"); |
| 363 | userId = MySpHelper.getInstance(getApplicationContext(), Context.MODE_MULTI_PROCESS).getString("userId", ""); | 361 | userId = MySpHelper.getInstance(getApplicationContext(), Context.MODE_MULTI_PROCESS).getString("userId", ""); |
| 364 | if (userId != null && !TextUtils.isEmpty(userId)) { | 362 | if (userId != null && !TextUtils.isEmpty(userId)) { |
| 365 | - entityName = userId; | ||
| 366 | - initTodayData(userId); | ||
| 367 | - initTrace(); | ||
| 368 | if (!EventBus.getDefault().isRegistered(this)) { | 363 | if (!EventBus.getDefault().isRegistered(this)) { |
| 369 | EventBus.getDefault().register(this); | 364 | EventBus.getDefault().register(this); |
| 370 | } | 365 | } |
| 366 | + MySpHelper.getInstance(getApplicationContext(), Context.MODE_MULTI_PROCESS).putBoolean("writeUserStep:" + userId, true); | ||
| 367 | + entityName = userId; | ||
| 368 | + initTodayData(userId); | ||
| 369 | + initTrace(); | ||
| 371 | //显示计步通知 | 370 | //显示计步通知 |
| 372 | showStartForegroundNotification(); | 371 | showStartForegroundNotification(); |
| 373 | new Thread(new Runnable() { | 372 | new Thread(new Runnable() { |
| @@ -534,7 +533,7 @@ public class StepService extends Service implements SensorEventListener { | @@ -534,7 +533,7 @@ public class StepService extends Service implements SensorEventListener { | ||
| 534 | if (userId == null || CURRENT_DATE == null) { | 533 | if (userId == null || CURRENT_DATE == null) { |
| 535 | return; | 534 | return; |
| 536 | } | 535 | } |
| 537 | -// //获取当天的数据,用于展示 CURRENT_DATE | 536 | + //获取当天的数据,用于展示 CURRENT_DATE |
| 538 | List<UserStepEntity> list = DbCore.getDaoSession().getUserStepEntityDao().queryBuilder().where(UserStepEntityDao.Properties.UserId.eq(userId), UserStepEntityDao.Properties.Date.eq(CURRENT_DATE)).list(); | 537 | List<UserStepEntity> list = DbCore.getDaoSession().getUserStepEntityDao().queryBuilder().where(UserStepEntityDao.Properties.UserId.eq(userId), UserStepEntityDao.Properties.Date.eq(CURRENT_DATE)).list(); |
| 539 | if (list == null) { | 538 | if (list == null) { |
| 540 | return; | 539 | return; |
| @@ -897,10 +896,10 @@ public class StepService extends Service implements SensorEventListener { | @@ -897,10 +896,10 @@ public class StepService extends Service implements SensorEventListener { | ||
| 897 | * 保存记步数据 | 896 | * 保存记步数据 |
| 898 | */ | 897 | */ |
| 899 | private void save() { | 898 | private void save() { |
| 900 | -// boolean isWriteUserStep = MySpHelper.getInstance(getApplicationContext(), Context.MODE_MULTI_PROCESS).getBoolean("writeUserStep:" + userId, false); | ||
| 901 | -// if (!isWriteUserStep) { | ||
| 902 | -// return; | ||
| 903 | -// } | 899 | + boolean isWriteUserStep = MySpHelper.getInstance(getApplicationContext(), Context.MODE_MULTI_PROCESS).getBoolean("writeUserStep:" + userId, false); |
| 900 | + if (!isWriteUserStep) { | ||
| 901 | + return; | ||
| 902 | + } | ||
| 904 | int tempStep = CURRENT_STEP; | 903 | int tempStep = CURRENT_STEP; |
| 905 | List<UserStepEntity> list = DbCore.getDaoSession().getUserStepEntityDao().queryBuilder().where(UserStepEntityDao.Properties.UserId.eq(userId), UserStepEntityDao.Properties.Date.eq(CURRENT_DATE)).list(); | 904 | List<UserStepEntity> list = DbCore.getDaoSession().getUserStepEntityDao().queryBuilder().where(UserStepEntityDao.Properties.UserId.eq(userId), UserStepEntityDao.Properties.Date.eq(CURRENT_DATE)).list(); |
| 906 | if (list.size() == 0 || list.isEmpty()) { | 905 | if (list.size() == 0 || list.isEmpty()) { |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/activity/PedometerMainActivity.java
| 1 | package com.cnlive.moudle.pedometer.ui.activity; | 1 | package com.cnlive.moudle.pedometer.ui.activity; |
| 2 | 2 | ||
| 3 | import android.Manifest; | 3 | import android.Manifest; |
| 4 | +import android.app.Activity; | ||
| 4 | import android.content.Context; | 5 | import android.content.Context; |
| 5 | import android.content.Intent; | 6 | import android.content.Intent; |
| 6 | import android.content.pm.PackageInfo; | 7 | import android.content.pm.PackageInfo; |
| @@ -13,6 +14,7 @@ import android.support.annotation.NonNull; | @@ -13,6 +14,7 @@ import android.support.annotation.NonNull; | ||
| 13 | import android.support.v4.app.NotificationManagerCompat; | 14 | import android.support.v4.app.NotificationManagerCompat; |
| 14 | import android.support.v4.content.ContextCompat; | 15 | import android.support.v4.content.ContextCompat; |
| 15 | import android.util.Log; | 16 | import android.util.Log; |
| 17 | +import android.view.KeyEvent; | ||
| 16 | import android.widget.Toast; | 18 | import android.widget.Toast; |
| 17 | 19 | ||
| 18 | import com.alibaba.android.arouter.facade.annotation.Route; | 20 | import com.alibaba.android.arouter.facade.annotation.Route; |
| @@ -40,6 +42,7 @@ public class PedometerMainActivity extends QMUIFragmentActivity { | @@ -40,6 +42,7 @@ public class PedometerMainActivity extends QMUIFragmentActivity { | ||
| 40 | private NotificationManagerCompat notificationManagerCompat; | 42 | private NotificationManagerCompat notificationManagerCompat; |
| 41 | private boolean isOpen; | 43 | private boolean isOpen; |
| 42 | private PermissionsUtils mPermissionsUtils = new PermissionsUtils();//权限申请 | 44 | private PermissionsUtils mPermissionsUtils = new PermissionsUtils();//权限申请 |
| 45 | + private RunMainFragment fragment; | ||
| 43 | 46 | ||
| 44 | @Override | 47 | @Override |
| 45 | protected int getContextViewId() { | 48 | protected int getContextViewId() { |
| @@ -149,7 +152,7 @@ public class PedometerMainActivity extends QMUIFragmentActivity { | @@ -149,7 +152,7 @@ public class PedometerMainActivity extends QMUIFragmentActivity { | ||
| 149 | } | 152 | } |
| 150 | 153 | ||
| 151 | private void addFragment() { | 154 | private void addFragment() { |
| 152 | - QMUIFragment fragment = new RunMainFragment(); | 155 | + fragment = new RunMainFragment(); |
| 153 | getSupportFragmentManager().beginTransaction() | 156 | getSupportFragmentManager().beginTransaction() |
| 154 | .add(getContextViewId(), fragment, fragment.getClass().getSimpleName()) | 157 | .add(getContextViewId(), fragment, fragment.getClass().getSimpleName()) |
| 155 | .addToBackStack(fragment.getClass().getSimpleName()) | 158 | .addToBackStack(fragment.getClass().getSimpleName()) |
| @@ -236,4 +239,11 @@ public class PedometerMainActivity extends QMUIFragmentActivity { | @@ -236,4 +239,11 @@ public class PedometerMainActivity extends QMUIFragmentActivity { | ||
| 236 | super.onRequestPermissionsResult(requestCode, permissions, grantResults); | 239 | super.onRequestPermissionsResult(requestCode, permissions, grantResults); |
| 237 | mPermissionsUtils.dealResult(requestCode, permissions, grantResults); | 240 | mPermissionsUtils.dealResult(requestCode, permissions, grantResults); |
| 238 | } | 241 | } |
| 242 | + | ||
| 243 | + | ||
| 244 | + | ||
| 245 | + @Override | ||
| 246 | + public void onBackPressed() { | ||
| 247 | + return; | ||
| 248 | + } | ||
| 239 | } | 249 | } |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/activity/RunLineActivity.java
| @@ -23,6 +23,7 @@ public class RunLineActivity extends AppCompatActivity { | @@ -23,6 +23,7 @@ public class RunLineActivity extends AppCompatActivity { | ||
| 23 | setContentView(R.layout.activity_run_line); | 23 | setContentView(R.layout.activity_run_line); |
| 24 | 24 | ||
| 25 | getSupportFragmentManager().beginTransaction().replace(R.id.run_line_container, new RunLineFragment()).commit(); | 25 | getSupportFragmentManager().beginTransaction().replace(R.id.run_line_container, new RunLineFragment()).commit(); |
| 26 | +// getSupportFragmentManager().beginTransaction().replace(R.id.run_line_container, new RunningFinishFragment()).commit(); | ||
| 26 | 27 | ||
| 27 | } | 28 | } |
| 28 | } | 29 | } |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/activity/RunRaceDetailActivity.java
| @@ -16,9 +16,12 @@ import com.cnlive.libs.base.ui.QMUIFragment; | @@ -16,9 +16,12 @@ import com.cnlive.libs.base.ui.QMUIFragment; | ||
| 16 | import com.cnlive.libs.base.ui.QMUIFragmentActivity; | 16 | import com.cnlive.libs.base.ui.QMUIFragmentActivity; |
| 17 | import com.cnlive.libs.base.util.StatusBarUtil2; | 17 | import com.cnlive.libs.base.util.StatusBarUtil2; |
| 18 | import com.cnlive.moudle.pedometer.model.RunningMapBean; | 18 | import com.cnlive.moudle.pedometer.model.RunningMapBean; |
| 19 | +import com.cnlive.moudle.pedometer.sql.entity.UserStepEntity; | ||
| 20 | +import com.cnlive.moudle.pedometer.ui.fragment.RunMainFragment; | ||
| 19 | import com.cnlive.moudle.pedometer.ui.fragment.RunRaceDetailFragment; | 21 | import com.cnlive.moudle.pedometer.ui.fragment.RunRaceDetailFragment; |
| 20 | import com.cnlive.moudle.pedometer.ui.fragment.RunningMapFragment; | 22 | import com.cnlive.moudle.pedometer.ui.fragment.RunningMapFragment; |
| 21 | import com.cnlive.moudle.pedometer.ui.widget.FivePersonIconView; | 23 | import com.cnlive.moudle.pedometer.ui.widget.FivePersonIconView; |
| 24 | +import com.cnlive.moudle.pedometer.utils.StepUtil; | ||
| 22 | import com.example.moudle_pedometer.R; | 25 | import com.example.moudle_pedometer.R; |
| 23 | 26 | ||
| 24 | import java.util.ArrayList; | 27 | import java.util.ArrayList; |
| @@ -41,12 +44,20 @@ public class RunRaceDetailActivity extends QMUIFragmentActivity { | @@ -41,12 +44,20 @@ public class RunRaceDetailActivity extends QMUIFragmentActivity { | ||
| 41 | protected void onCreate(Bundle savedInstanceState) { | 44 | protected void onCreate(Bundle savedInstanceState) { |
| 42 | super.onCreate(savedInstanceState); | 45 | super.onCreate(savedInstanceState); |
| 43 | StatusBarUtil2.setColor(this, getResources().getColor(R.color.run_main_bg), 0); | 46 | StatusBarUtil2.setColor(this, getResources().getColor(R.color.run_main_bg), 0); |
| 44 | - addFragment(); | ||
| 45 | - | 47 | + //判断用户是否结束运动 |
| 48 | + String uid = "yangshuai"; | ||
| 49 | + UserStepEntity userStepEntity = StepUtil.getUserStepData(getApplicationContext(), uid); | ||
| 50 | + //没有在数据库中找到相关记录 | ||
| 51 | + if (userStepEntity == null) { | ||
| 52 | + addFragment(new RunRaceDetailFragment()); | ||
| 53 | + } | ||
| 54 | + //找到记录 | ||
| 55 | + else { | ||
| 56 | + addFragment(new RunMainFragment()); | ||
| 57 | + } | ||
| 46 | } | 58 | } |
| 47 | 59 | ||
| 48 | - private void addFragment() { | ||
| 49 | - QMUIFragment fragment = new RunRaceDetailFragment(); | 60 | + private void addFragment(QMUIFragment fragment) { |
| 50 | getSupportFragmentManager().beginTransaction() | 61 | getSupportFragmentManager().beginTransaction() |
| 51 | .add(getContextViewId(), fragment, fragment.getClass().getSimpleName()) | 62 | .add(getContextViewId(), fragment, fragment.getClass().getSimpleName()) |
| 52 | .addToBackStack(fragment.getClass().getSimpleName()) | 63 | .addToBackStack(fragment.getClass().getSimpleName()) |
| @@ -56,7 +67,7 @@ public class RunRaceDetailActivity extends QMUIFragmentActivity { | @@ -56,7 +67,7 @@ public class RunRaceDetailActivity extends QMUIFragmentActivity { | ||
| 56 | @Override | 67 | @Override |
| 57 | protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { | 68 | protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { |
| 58 | super.onActivityResult(requestCode, resultCode, data); | 69 | super.onActivityResult(requestCode, resultCode, data); |
| 59 | - if(resultCode == 1002){ | 70 | + if (resultCode == 1002) { |
| 60 | 71 | ||
| 61 | } | 72 | } |
| 62 | } | 73 | } |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/activity/RunningFinishActivity.java
| @@ -9,6 +9,7 @@ import com.alibaba.android.arouter.facade.annotation.Route; | @@ -9,6 +9,7 @@ import com.alibaba.android.arouter.facade.annotation.Route; | ||
| 9 | import com.cnlive.libs.base.ui.QMUIFragment; | 9 | import com.cnlive.libs.base.ui.QMUIFragment; |
| 10 | import com.cnlive.libs.base.ui.QMUIFragmentActivity; | 10 | import com.cnlive.libs.base.ui.QMUIFragmentActivity; |
| 11 | import com.cnlive.libs.base.util.StatusBarUtil2; | 11 | import com.cnlive.libs.base.util.StatusBarUtil2; |
| 12 | +import com.cnlive.moudle.pedometer.model.RunningFinishBean; | ||
| 12 | import com.cnlive.moudle.pedometer.model.RunningMapBean; | 13 | import com.cnlive.moudle.pedometer.model.RunningMapBean; |
| 13 | import com.cnlive.moudle.pedometer.ui.fragment.RunRaceDetailFragment; | 14 | import com.cnlive.moudle.pedometer.ui.fragment.RunRaceDetailFragment; |
| 14 | import com.cnlive.moudle.pedometer.ui.fragment.RunningFinishFragment; | 15 | import com.cnlive.moudle.pedometer.ui.fragment.RunningFinishFragment; |
| @@ -31,12 +32,15 @@ public class RunningFinishActivity extends QMUIFragmentActivity { | @@ -31,12 +32,15 @@ public class RunningFinishActivity extends QMUIFragmentActivity { | ||
| 31 | protected void onCreate(Bundle savedInstanceState) { | 32 | protected void onCreate(Bundle savedInstanceState) { |
| 32 | super.onCreate(savedInstanceState); | 33 | super.onCreate(savedInstanceState); |
| 33 | StatusBarUtil2.setColor(this, getResources().getColor(R.color.run_main_bg), 0); | 34 | StatusBarUtil2.setColor(this, getResources().getColor(R.color.run_main_bg), 0); |
| 34 | - addFragment(); | 35 | + if (getIntent().getSerializableExtra("runningFinishBean") != null) { |
| 36 | + addFragment((RunningFinishBean) getIntent().getSerializableExtra("runningFinishBean")); | ||
| 37 | + } | ||
| 38 | + | ||
| 35 | 39 | ||
| 36 | } | 40 | } |
| 37 | 41 | ||
| 38 | - private void addFragment() { | ||
| 39 | - QMUIFragment fragment = new RunningFinishFragment(); | 42 | + private void addFragment(RunningFinishBean runningFinishBean) { |
| 43 | + QMUIFragment fragment = RunningFinishFragment.instance(runningFinishBean); | ||
| 40 | getSupportFragmentManager().beginTransaction() | 44 | getSupportFragmentManager().beginTransaction() |
| 41 | .add(getContextViewId(), fragment, fragment.getClass().getSimpleName()) | 45 | .add(getContextViewId(), fragment, fragment.getClass().getSimpleName()) |
| 42 | .addToBackStack(fragment.getClass().getSimpleName()) | 46 | .addToBackStack(fragment.getClass().getSimpleName()) |
| @@ -51,8 +55,9 @@ public class RunningFinishActivity extends QMUIFragmentActivity { | @@ -51,8 +55,9 @@ public class RunningFinishActivity extends QMUIFragmentActivity { | ||
| 51 | } | 55 | } |
| 52 | } | 56 | } |
| 53 | 57 | ||
| 54 | - public static void startActivity(Activity activity) { | 58 | + public static void startActivity(Activity activity, RunningFinishBean runningFinishBean) { |
| 55 | Intent intent = new Intent(activity, RunningFinishActivity.class); | 59 | Intent intent = new Intent(activity, RunningFinishActivity.class); |
| 60 | + intent.putExtra("runningFinishBean", runningFinishBean); | ||
| 56 | activity.startActivity(intent); | 61 | activity.startActivity(intent); |
| 57 | } | 62 | } |
| 58 | } | 63 | } |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/fragment/RunMainFragment.java
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/fragment/RunRaceDetailFragment.java
| @@ -15,8 +15,11 @@ import android.widget.LinearLayout; | @@ -15,8 +15,11 @@ import android.widget.LinearLayout; | ||
| 15 | import com.cnlive.libs.base.ui.QMUIFragment; | 15 | import com.cnlive.libs.base.ui.QMUIFragment; |
| 16 | import com.cnlive.moudle.pedometer.frame.presenter.RunRaceDetailFragmentPresenter; | 16 | import com.cnlive.moudle.pedometer.frame.presenter.RunRaceDetailFragmentPresenter; |
| 17 | import com.cnlive.moudle.pedometer.frame.view.RunRaceDetailFragmentView; | 17 | import com.cnlive.moudle.pedometer.frame.view.RunRaceDetailFragmentView; |
| 18 | +import com.cnlive.moudle.pedometer.sql.entity.UserStepEntity; | ||
| 18 | import com.cnlive.moudle.pedometer.ui.widget.FivePersonIconView; | 19 | import com.cnlive.moudle.pedometer.ui.widget.FivePersonIconView; |
| 20 | +import com.cnlive.moudle.pedometer.utils.ChineseToSpeechUtil; | ||
| 19 | import com.cnlive.moudle.pedometer.utils.ScreenUtil; | 21 | import com.cnlive.moudle.pedometer.utils.ScreenUtil; |
| 22 | +import com.cnlive.moudle.pedometer.utils.StepUtil; | ||
| 20 | import com.example.moudle_pedometer.R; | 23 | import com.example.moudle_pedometer.R; |
| 21 | import com.example.moudle_pedometer.databinding.FragmentRunRaceDetailBinding; | 24 | import com.example.moudle_pedometer.databinding.FragmentRunRaceDetailBinding; |
| 22 | import com.sothree.slidinguppanel.SlidingUpPanelLayout; | 25 | import com.sothree.slidinguppanel.SlidingUpPanelLayout; |
| @@ -36,6 +39,7 @@ import static android.content.Context.SENSOR_SERVICE; | @@ -36,6 +39,7 @@ import static android.content.Context.SENSOR_SERVICE; | ||
| 36 | public class RunRaceDetailFragment extends QMUIFragment<RunRaceDetailFragmentView, RunRaceDetailFragmentPresenter, FragmentRunRaceDetailBinding> { | 39 | public class RunRaceDetailFragment extends QMUIFragment<RunRaceDetailFragmentView, RunRaceDetailFragmentPresenter, FragmentRunRaceDetailBinding> { |
| 37 | private static final String TAG = "RunRaceDetailFragment"; | 40 | private static final String TAG = "RunRaceDetailFragment"; |
| 38 | private SensorManager mSensorManager; | 41 | private SensorManager mSensorManager; |
| 42 | + | ||
| 39 | @Override | 43 | @Override |
| 40 | protected int getToolbarId() { | 44 | protected int getToolbarId() { |
| 41 | return 0; | 45 | return 0; |
| @@ -54,12 +58,14 @@ public class RunRaceDetailFragment extends QMUIFragment<RunRaceDetailFragmentVie | @@ -54,12 +58,14 @@ public class RunRaceDetailFragment extends QMUIFragment<RunRaceDetailFragmentVie | ||
| 54 | @Override | 58 | @Override |
| 55 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { | 59 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { |
| 56 | super.onViewCreated(view, savedInstanceState); | 60 | super.onViewCreated(view, savedInstanceState); |
| 57 | - mSensorManager = (SensorManager) getActivity().getSystemService(SENSOR_SERVICE);//获取传感器管理服务 | ||
| 58 | 61 | ||
| 62 | + mSensorManager = (SensorManager) getActivity().getSystemService(SENSOR_SERVICE);//获取传感器管理服务 | ||
| 59 | if (getMvpView() != null) { | 63 | if (getMvpView() != null) { |
| 60 | getMvpView().initView(); | 64 | getMvpView().initView(); |
| 61 | } | 65 | } |
| 66 | + | ||
| 62 | } | 67 | } |
| 68 | + | ||
| 63 | @Override | 69 | @Override |
| 64 | public void onResume() { | 70 | public void onResume() { |
| 65 | super.onResume(); | 71 | super.onResume(); |
| @@ -96,6 +102,7 @@ public class RunRaceDetailFragment extends QMUIFragment<RunRaceDetailFragmentVie | @@ -96,6 +102,7 @@ public class RunRaceDetailFragment extends QMUIFragment<RunRaceDetailFragmentVie | ||
| 96 | if (getMvpView() != null) { | 102 | if (getMvpView() != null) { |
| 97 | getMvpView().onDestroy(); | 103 | getMvpView().onDestroy(); |
| 98 | } | 104 | } |
| 105 | + | ||
| 99 | } | 106 | } |
| 100 | // private void test() { | 107 | // private void test() { |
| 101 | // BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(getActivity()); | 108 | // BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(getActivity()); |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/fragment/RunningFinishFragment.java
| 1 | package com.cnlive.moudle.pedometer.ui.fragment; | 1 | package com.cnlive.moudle.pedometer.ui.fragment; |
| 2 | 2 | ||
| 3 | +import android.os.Bundle; | ||
| 4 | +import android.support.annotation.Nullable; | ||
| 5 | +import android.view.View; | ||
| 6 | + | ||
| 3 | import com.cnlive.libs.base.ui.QMUIFragment; | 7 | import com.cnlive.libs.base.ui.QMUIFragment; |
| 4 | import com.cnlive.moudle.pedometer.frame.presenter.RunningFinishFragmetPresenter; | 8 | import com.cnlive.moudle.pedometer.frame.presenter.RunningFinishFragmetPresenter; |
| 5 | import com.cnlive.moudle.pedometer.frame.view.RunningFinishFragmentView; | 9 | import com.cnlive.moudle.pedometer.frame.view.RunningFinishFragmentView; |
| 10 | +import com.cnlive.moudle.pedometer.model.RunningFinishBean; | ||
| 6 | import com.example.moudle_pedometer.R; | 11 | import com.example.moudle_pedometer.R; |
| 7 | import com.example.moudle_pedometer.databinding.FragmentFinishRunMapBinding; | 12 | import com.example.moudle_pedometer.databinding.FragmentFinishRunMapBinding; |
| 8 | 13 | ||
| 9 | public class RunningFinishFragment extends QMUIFragment<RunningFinishFragmentView, RunningFinishFragmetPresenter, FragmentFinishRunMapBinding> { | 14 | public class RunningFinishFragment extends QMUIFragment<RunningFinishFragmentView, RunningFinishFragmetPresenter, FragmentFinishRunMapBinding> { |
| 15 | + private RunningFinishBean runningFinishBean; | ||
| 16 | + | ||
| 17 | + public static RunningFinishFragment instance(RunningFinishBean runningFinishBean) { | ||
| 18 | + RunningFinishFragment fragment = new RunningFinishFragment(); | ||
| 19 | + Bundle bundle = null; | ||
| 20 | + if (runningFinishBean != null) { | ||
| 21 | + bundle = new Bundle(); | ||
| 22 | + bundle.putSerializable("runningFinishBean", runningFinishBean); | ||
| 23 | + } | ||
| 24 | + fragment.setArguments(bundle); | ||
| 25 | + return fragment; | ||
| 26 | + } | ||
| 27 | + | ||
| 10 | @Override | 28 | @Override |
| 11 | protected int getToolbarId() { | 29 | protected int getToolbarId() { |
| 12 | return 0; | 30 | return 0; |
| @@ -21,4 +39,17 @@ public class RunningFinishFragment extends QMUIFragment<RunningFinishFragmentVie | @@ -21,4 +39,17 @@ public class RunningFinishFragment extends QMUIFragment<RunningFinishFragmentVie | ||
| 21 | protected int getLayoutId() { | 39 | protected int getLayoutId() { |
| 22 | return R.layout.fragment_finish_run_map; | 40 | return R.layout.fragment_finish_run_map; |
| 23 | } | 41 | } |
| 42 | + | ||
| 43 | + @Override | ||
| 44 | + public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { | ||
| 45 | + super.onViewCreated(view, savedInstanceState); | ||
| 46 | + if (getArguments() != null) { | ||
| 47 | + runningFinishBean = (RunningFinishBean) getArguments().getSerializable("runningFinishBean"); | ||
| 48 | + if (runningFinishBean != null) { | ||
| 49 | + if (getMvpView() != null) { | ||
| 50 | + getMvpView().initView(runningFinishBean); | ||
| 51 | + } | ||
| 52 | + } | ||
| 53 | + } | ||
| 54 | + } | ||
| 24 | } | 55 | } |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/fragment/RunningMapFragment.java
| 1 | package com.cnlive.moudle.pedometer.ui.fragment; | 1 | package com.cnlive.moudle.pedometer.ui.fragment; |
| 2 | 2 | ||
| 3 | +import android.app.Service; | ||
| 3 | import android.content.Context; | 4 | import android.content.Context; |
| 4 | import android.hardware.Sensor; | 5 | import android.hardware.Sensor; |
| 5 | import android.hardware.SensorManager; | 6 | import android.hardware.SensorManager; |
| 6 | import android.os.Bundle; | 7 | import android.os.Bundle; |
| 7 | import android.os.Handler; | 8 | import android.os.Handler; |
| 8 | import android.os.SystemClock; | 9 | import android.os.SystemClock; |
| 10 | +import android.os.Vibrator; | ||
| 9 | import android.support.annotation.Nullable; | 11 | import android.support.annotation.Nullable; |
| 10 | import android.text.TextUtils; | 12 | import android.text.TextUtils; |
| 11 | import android.util.Log; | 13 | import android.util.Log; |
| @@ -20,6 +22,8 @@ import com.cnlive.moudle.pedometer.model.RunningMapBean; | @@ -20,6 +22,8 @@ import com.cnlive.moudle.pedometer.model.RunningMapBean; | ||
| 20 | import com.cnlive.moudle.pedometer.model.Constant; | 22 | import com.cnlive.moudle.pedometer.model.Constant; |
| 21 | import com.cnlive.moudle.pedometer.model.MessageEvent; | 23 | import com.cnlive.moudle.pedometer.model.MessageEvent; |
| 22 | import com.cnlive.moudle.pedometer.service.StepService; | 24 | import com.cnlive.moudle.pedometer.service.StepService; |
| 25 | +import com.cnlive.moudle.pedometer.ui.widget.TipDialog; | ||
| 26 | +import com.cnlive.moudle.pedometer.utils.ChineseToSpeechUtil; | ||
| 23 | import com.cnlive.moudle.pedometer.utils.GsonUtil; | 27 | import com.cnlive.moudle.pedometer.utils.GsonUtil; |
| 24 | import com.cnlive.moudle.pedometer.utils.MyMapUtil; | 28 | import com.cnlive.moudle.pedometer.utils.MyMapUtil; |
| 25 | import com.cnlive.moudle.pedometer.utils.MySpHelper; | 29 | import com.cnlive.moudle.pedometer.utils.MySpHelper; |
| @@ -46,6 +50,9 @@ public class RunningMapFragment extends QMUIFragment<RunningMapFragmentView, Run | @@ -46,6 +50,9 @@ public class RunningMapFragment extends QMUIFragment<RunningMapFragmentView, Run | ||
| 46 | private RunningMapBean runningMapBean; | 50 | private RunningMapBean runningMapBean; |
| 47 | private SensorManager mSensorManager; | 51 | private SensorManager mSensorManager; |
| 48 | 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}]"; | 52 | 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}]"; |
| 53 | + //创建震动服务对象 | ||
| 54 | + private Vibrator mVibrator; | ||
| 55 | + private TipDialog tipDialog; | ||
| 49 | 56 | ||
| 50 | @Override | 57 | @Override |
| 51 | protected int getToolbarId() { | 58 | protected int getToolbarId() { |
| @@ -82,7 +89,12 @@ public class RunningMapFragment extends QMUIFragment<RunningMapFragmentView, Run | @@ -82,7 +89,12 @@ public class RunningMapFragment extends QMUIFragment<RunningMapFragmentView, Run | ||
| 82 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { | 89 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { |
| 83 | super.onViewCreated(view, savedInstanceState); | 90 | super.onViewCreated(view, savedInstanceState); |
| 84 | EventBus.getDefault().register(this); | 91 | EventBus.getDefault().register(this); |
| 85 | - mSensorManager = (SensorManager) getActivity().getSystemService(SENSOR_SERVICE);//获取传感器管理服务 | 92 | + //获取传感器管理服务 |
| 93 | + mSensorManager = (SensorManager) getActivity().getSystemService(SENSOR_SERVICE); | ||
| 94 | + //获取手机震动服务 | ||
| 95 | + mVibrator = (Vibrator) getActivity().getSystemService(Service.VIBRATOR_SERVICE); | ||
| 96 | + //初始化提示框 | ||
| 97 | + initTipDialog(); | ||
| 86 | List<LatLng> trackPoints = GsonUtil.jsonToList(test, LatLng.class); | 98 | List<LatLng> trackPoints = GsonUtil.jsonToList(test, LatLng.class); |
| 87 | if (getArguments() != null) { | 99 | if (getArguments() != null) { |
| 88 | runningMapBean = (RunningMapBean) getArguments().getSerializable("runningMapBean"); | 100 | runningMapBean = (RunningMapBean) getArguments().getSerializable("runningMapBean"); |
| @@ -113,6 +125,7 @@ public class RunningMapFragment extends QMUIFragment<RunningMapFragmentView, Run | @@ -113,6 +125,7 @@ public class RunningMapFragment extends QMUIFragment<RunningMapFragmentView, Run | ||
| 113 | getPresenter().queryHistoryTrace(getActivity(), StepService.entityName, startTime, endTime); | 125 | getPresenter().queryHistoryTrace(getActivity(), StepService.entityName, startTime, endTime); |
| 114 | //查询实时轨迹 | 126 | //查询实时轨迹 |
| 115 | getPresenter().queryRealTimeTrace(getActivity(), StepService.entityName, startTime); | 127 | getPresenter().queryRealTimeTrace(getActivity(), StepService.entityName, startTime); |
| 128 | + | ||
| 116 | } | 129 | } |
| 117 | 130 | ||
| 118 | 131 | ||
| @@ -144,6 +157,8 @@ public class RunningMapFragment extends QMUIFragment<RunningMapFragmentView, Run | @@ -144,6 +157,8 @@ public class RunningMapFragment extends QMUIFragment<RunningMapFragmentView, Run | ||
| 144 | //取消注册传感器监听 | 157 | //取消注册传感器监听 |
| 145 | mSensorManager.unregisterListener(getMvpView()); | 158 | mSensorManager.unregisterListener(getMvpView()); |
| 146 | } | 159 | } |
| 160 | + ChineseToSpeechUtil.destroy(); | ||
| 161 | + | ||
| 147 | } | 162 | } |
| 148 | 163 | ||
| 149 | @Override | 164 | @Override |
| @@ -152,6 +167,7 @@ public class RunningMapFragment extends QMUIFragment<RunningMapFragmentView, Run | @@ -152,6 +167,7 @@ public class RunningMapFragment extends QMUIFragment<RunningMapFragmentView, Run | ||
| 152 | if (getMvpView() != null) { | 167 | if (getMvpView() != null) { |
| 153 | getMvpView().onPause(); | 168 | getMvpView().onPause(); |
| 154 | } | 169 | } |
| 170 | + | ||
| 155 | } | 171 | } |
| 156 | 172 | ||
| 157 | @Override | 173 | @Override |
| @@ -179,5 +195,32 @@ public class RunningMapFragment extends QMUIFragment<RunningMapFragmentView, Run | @@ -179,5 +195,32 @@ public class RunningMapFragment extends QMUIFragment<RunningMapFragmentView, Run | ||
| 179 | getMvpView().resetSpeed(); | 195 | getMvpView().resetSpeed(); |
| 180 | } | 196 | } |
| 181 | } | 197 | } |
| 198 | + //超出范围 | ||
| 199 | + else if (messageEvent.getMessageType() == Constant.EXIT_RANGE) { | ||
| 200 | + ChineseToSpeechUtil.speech(getActivity().getApplicationContext(), "您已偏离预定轨迹!"); | ||
| 201 | + if (mVibrator != null) { | ||
| 202 | + //设置震动周期,数组表示时间:等待+执行,单位是毫秒,下面操作代表:等待100,执行100,等待100,执行1000, | ||
| 203 | + //后面的数字如果为-1代表不重复,之执行一次,其他代表会重复,0代表从数组的第0个位置开始 | ||
| 204 | + mVibrator.vibrate(new long[]{100, 1000, 100, 1000}, -1); | ||
| 205 | + } | ||
| 206 | + if (tipDialog != null) { | ||
| 207 | + tipDialog.show(); | ||
| 208 | + } | ||
| 209 | + } | ||
| 182 | } | 210 | } |
| 211 | + | ||
| 212 | + private void initTipDialog() { | ||
| 213 | + if (tipDialog == null) { | ||
| 214 | + tipDialog = new TipDialog(getActivity(), "您已偏离预定轨迹!", "我知道了", R.color.green_round, new TipDialog.DialogInterface() { | ||
| 215 | + @Override | ||
| 216 | + public void onClick(TipDialog dialog) { | ||
| 217 | + dialog.dismiss(); | ||
| 218 | + } | ||
| 219 | + }); | ||
| 220 | + tipDialog.setCancelable(false); | ||
| 221 | + tipDialog.setCanceledOnTouchOutside(false); | ||
| 222 | + } | ||
| 223 | + } | ||
| 224 | + | ||
| 225 | + | ||
| 183 | } | 226 | } |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/utils/ButtonAnimUtil.java
| @@ -21,106 +21,132 @@ public class ButtonAnimUtil { | @@ -21,106 +21,132 @@ public class ButtonAnimUtil { | ||
| 21 | 21 | ||
| 22 | //设置控件放大动画 | 22 | //设置控件放大动画 |
| 23 | public static void setViewZoomIn(View view) { | 23 | public static void setViewZoomIn(View view) { |
| 24 | - AnimatorSet animatorSetsuofang = new AnimatorSet();//组合动画 | ||
| 25 | - ObjectAnimator scaleX = ObjectAnimator.ofFloat(view, "scaleX", 1, 1.2f); | ||
| 26 | - ObjectAnimator scaleY = ObjectAnimator.ofFloat(view, "scaleY", 1, 1.2f); | ||
| 27 | - animatorSetsuofang.setDuration(DEFAULT_ZOOM_DURATION); | ||
| 28 | - animatorSetsuofang.setInterpolator(new DecelerateInterpolator()); | ||
| 29 | - animatorSetsuofang.play(scaleX).with(scaleY);//两个动画同时开始 | ||
| 30 | - animatorSetsuofang.start(); | 24 | + try { |
| 25 | + AnimatorSet animatorSetsuofang = new AnimatorSet();//组合动画 | ||
| 26 | + ObjectAnimator scaleX = ObjectAnimator.ofFloat(view, "scaleX", 1, 1.2f); | ||
| 27 | + ObjectAnimator scaleY = ObjectAnimator.ofFloat(view, "scaleY", 1, 1.2f); | ||
| 28 | + animatorSetsuofang.setDuration(DEFAULT_ZOOM_DURATION); | ||
| 29 | + animatorSetsuofang.setInterpolator(new DecelerateInterpolator()); | ||
| 30 | + animatorSetsuofang.play(scaleX).with(scaleY);//两个动画同时开始 | ||
| 31 | + animatorSetsuofang.start(); | ||
| 32 | + } catch (Exception e) { | ||
| 33 | + } | ||
| 31 | } | 34 | } |
| 32 | 35 | ||
| 33 | //设置控件缩小动画 | 36 | //设置控件缩小动画 |
| 34 | public static void setViewZoomOut(View view) { | 37 | public static void setViewZoomOut(View view) { |
| 35 | - AnimatorSet animatorSetsuofang = new AnimatorSet();//组合动画 | ||
| 36 | - ObjectAnimator scaleX = ObjectAnimator.ofFloat(view, "scaleX", 1.2f, 1); | ||
| 37 | - ObjectAnimator scaleY = ObjectAnimator.ofFloat(view, "scaleY", 1.2f, 1); | ||
| 38 | - animatorSetsuofang.setDuration(DEFAULT_ZOOM_DURATION); | ||
| 39 | - animatorSetsuofang.setInterpolator(new DecelerateInterpolator()); | ||
| 40 | - animatorSetsuofang.play(scaleX).with(scaleY);//两个动画同时开始 | ||
| 41 | - animatorSetsuofang.start(); | 38 | + try { |
| 39 | + AnimatorSet animatorSetsuofang = new AnimatorSet();//组合动画 | ||
| 40 | + ObjectAnimator scaleX = ObjectAnimator.ofFloat(view, "scaleX", 1.2f, 1); | ||
| 41 | + ObjectAnimator scaleY = ObjectAnimator.ofFloat(view, "scaleY", 1.2f, 1); | ||
| 42 | + animatorSetsuofang.setDuration(DEFAULT_ZOOM_DURATION); | ||
| 43 | + animatorSetsuofang.setInterpolator(new DecelerateInterpolator()); | ||
| 44 | + animatorSetsuofang.play(scaleX).with(scaleY);//两个动画同时开始 | ||
| 45 | + animatorSetsuofang.start(); | ||
| 46 | + } catch (Exception e) { | ||
| 47 | + } | ||
| 42 | } | 48 | } |
| 43 | 49 | ||
| 44 | //设置控件缩小动画 | 50 | //设置控件缩小动画 |
| 45 | public static void setViewDefault(View view) { | 51 | public static void setViewDefault(View view) { |
| 46 | - AnimatorSet animatorSetsuofang = new AnimatorSet();//组合动画 | ||
| 47 | - ObjectAnimator scaleX = ObjectAnimator.ofFloat(view, "scaleX", 1f, 1); | ||
| 48 | - ObjectAnimator scaleY = ObjectAnimator.ofFloat(view, "scaleY", 1f, 1); | ||
| 49 | - animatorSetsuofang.setDuration(DEFAULT_ZOOM_DURATION); | ||
| 50 | - animatorSetsuofang.setInterpolator(new DecelerateInterpolator()); | ||
| 51 | - animatorSetsuofang.play(scaleX).with(scaleY);//两个动画同时开始 | ||
| 52 | - animatorSetsuofang.start(); | 52 | + try { |
| 53 | + AnimatorSet animatorSetsuofang = new AnimatorSet();//组合动画 | ||
| 54 | + ObjectAnimator scaleX = ObjectAnimator.ofFloat(view, "scaleX", 1f, 1); | ||
| 55 | + ObjectAnimator scaleY = ObjectAnimator.ofFloat(view, "scaleY", 1f, 1); | ||
| 56 | + animatorSetsuofang.setDuration(DEFAULT_ZOOM_DURATION); | ||
| 57 | + animatorSetsuofang.setInterpolator(new DecelerateInterpolator()); | ||
| 58 | + animatorSetsuofang.play(scaleX).with(scaleY);//两个动画同时开始 | ||
| 59 | + animatorSetsuofang.start(); | ||
| 60 | + } catch (Exception e) { | ||
| 61 | + } | ||
| 53 | } | 62 | } |
| 54 | 63 | ||
| 55 | //设置控件显示放大动画 | 64 | //设置控件显示放大动画 |
| 56 | public static void setViewShowZoomIn(View view) { | 65 | public static void setViewShowZoomIn(View view) { |
| 57 | - AnimatorSet animatorSetsuofang = new AnimatorSet();//组合动画 | ||
| 58 | - ObjectAnimator scaleX = ObjectAnimator.ofFloat(view, "scaleX", 0, 1.2f); | ||
| 59 | - ObjectAnimator scaleY = ObjectAnimator.ofFloat(view, "scaleY", 0, 1.2f); | ||
| 60 | - animatorSetsuofang.setDuration(SHOW_VIEW_ZOOM_DURATION); | ||
| 61 | - animatorSetsuofang.setInterpolator(new DecelerateInterpolator()); | ||
| 62 | - animatorSetsuofang.play(scaleX).with(scaleY);//两个动画同时开始 | ||
| 63 | - animatorSetsuofang.start(); | ||
| 64 | - new Handler().postDelayed(new Runnable() { | ||
| 65 | - @Override | ||
| 66 | - public void run() { | ||
| 67 | - AnimatorSet animatorSetsuofang = new AnimatorSet();//组合动画 | ||
| 68 | - ObjectAnimator scaleX = ObjectAnimator.ofFloat(view, "scaleX", 1.2f, 1); | ||
| 69 | - ObjectAnimator scaleY = ObjectAnimator.ofFloat(view, "scaleY", 1.2f, 1); | ||
| 70 | - animatorSetsuofang.setDuration(SHOW_VIEW_ZOOM_DURATION); | ||
| 71 | - animatorSetsuofang.setInterpolator(new DecelerateInterpolator()); | ||
| 72 | - animatorSetsuofang.play(scaleX).with(scaleY);//两个动画同时开始 | ||
| 73 | - animatorSetsuofang.start(); | ||
| 74 | - } | ||
| 75 | - }, SHOW_VIEW_ZOOM_DURATION); | 66 | + try { |
| 67 | + AnimatorSet animatorSetsuofang = new AnimatorSet();//组合动画 | ||
| 68 | + ObjectAnimator scaleX = ObjectAnimator.ofFloat(view, "scaleX", 0, 1.2f); | ||
| 69 | + ObjectAnimator scaleY = ObjectAnimator.ofFloat(view, "scaleY", 0, 1.2f); | ||
| 70 | + animatorSetsuofang.setDuration(SHOW_VIEW_ZOOM_DURATION); | ||
| 71 | + animatorSetsuofang.setInterpolator(new DecelerateInterpolator()); | ||
| 72 | + animatorSetsuofang.play(scaleX).with(scaleY);//两个动画同时开始 | ||
| 73 | + animatorSetsuofang.start(); | ||
| 74 | + new Handler().postDelayed(new Runnable() { | ||
| 75 | + @Override | ||
| 76 | + public void run() { | ||
| 77 | + if (view == null) { | ||
| 78 | + return; | ||
| 79 | + } | ||
| 80 | + AnimatorSet animatorSetsuofang = new AnimatorSet();//组合动画 | ||
| 81 | + ObjectAnimator scaleX = ObjectAnimator.ofFloat(view, "scaleX", 1.2f, 1); | ||
| 82 | + ObjectAnimator scaleY = ObjectAnimator.ofFloat(view, "scaleY", 1.2f, 1); | ||
| 83 | + animatorSetsuofang.setDuration(SHOW_VIEW_ZOOM_DURATION); | ||
| 84 | + animatorSetsuofang.setInterpolator(new DecelerateInterpolator()); | ||
| 85 | + animatorSetsuofang.play(scaleX).with(scaleY);//两个动画同时开始 | ||
| 86 | + animatorSetsuofang.start(); | ||
| 87 | + } | ||
| 88 | + }, SHOW_VIEW_ZOOM_DURATION); | ||
| 89 | + } catch (Exception e) { | ||
| 90 | + } | ||
| 76 | } | 91 | } |
| 77 | 92 | ||
| 78 | //设置控件隐藏缩小动画 | 93 | //设置控件隐藏缩小动画 |
| 79 | public static void setViewHideZoomOut(View view) { | 94 | public static void setViewHideZoomOut(View view) { |
| 80 | - AnimatorSet animatorSetsuofang = new AnimatorSet();//组合动画 | ||
| 81 | - ObjectAnimator scaleX = ObjectAnimator.ofFloat(view, "scaleX", 1, 0); | ||
| 82 | - ObjectAnimator scaleY = ObjectAnimator.ofFloat(view, "scaleY", 1, 0); | ||
| 83 | - animatorSetsuofang.setDuration(HIDE_VIEW_ZOOM_DURATION); | ||
| 84 | - animatorSetsuofang.setInterpolator(new DecelerateInterpolator()); | ||
| 85 | - animatorSetsuofang.play(scaleX).with(scaleY);//两个动画同时开始 | ||
| 86 | - animatorSetsuofang.start(); | 95 | + try { |
| 96 | + AnimatorSet animatorSetsuofang = new AnimatorSet();//组合动画 | ||
| 97 | + ObjectAnimator scaleX = ObjectAnimator.ofFloat(view, "scaleX", 1, 0); | ||
| 98 | + ObjectAnimator scaleY = ObjectAnimator.ofFloat(view, "scaleY", 1, 0); | ||
| 99 | + animatorSetsuofang.setDuration(HIDE_VIEW_ZOOM_DURATION); | ||
| 100 | + animatorSetsuofang.setInterpolator(new DecelerateInterpolator()); | ||
| 101 | + animatorSetsuofang.play(scaleX).with(scaleY);//两个动画同时开始 | ||
| 102 | + animatorSetsuofang.start(); | ||
| 103 | + } catch (Exception e) { | ||
| 104 | + } | ||
| 87 | } | 105 | } |
| 88 | 106 | ||
| 89 | //设置时间显示放大动画 | 107 | //设置时间显示放大动画 |
| 90 | public static void setTimeShowZoomIn(View view) { | 108 | public static void setTimeShowZoomIn(View view) { |
| 91 | - ObjectAnimator scaleX = ObjectAnimator.ofFloat(view, "scaleX", 0, 1.4f); | ||
| 92 | - ObjectAnimator scaleY = ObjectAnimator.ofFloat(view, "scaleY", 0, 1.4f); | ||
| 93 | - ObjectAnimator scaleX1 = ObjectAnimator.ofFloat(view, "scaleX", 1.4f, 1); | ||
| 94 | - ObjectAnimator scaleY1 = ObjectAnimator.ofFloat(view, "scaleY", 1.4f, 1); | ||
| 95 | - ObjectAnimator scaleX2 = ObjectAnimator.ofFloat(view, "scaleX", 1, 0); | ||
| 96 | - ObjectAnimator scaleY2 = ObjectAnimator.ofFloat(view, "scaleY", 1, 0); | ||
| 97 | - AnimatorSet animatorSetsuofang = new AnimatorSet();//组合动画 | ||
| 98 | - animatorSetsuofang.setDuration(100); | ||
| 99 | - animatorSetsuofang.setInterpolator(new DecelerateInterpolator()); | ||
| 100 | - animatorSetsuofang.play(scaleX).with(scaleY); | ||
| 101 | - animatorSetsuofang.start(); | ||
| 102 | - new Handler().postDelayed(new Runnable() { | ||
| 103 | - @Override | ||
| 104 | - public void run() { | ||
| 105 | - AnimatorSet animatorSetsuofang2 = new AnimatorSet();//组合动画 | ||
| 106 | - animatorSetsuofang2.setDuration(100); | ||
| 107 | - animatorSetsuofang2.setInterpolator(new DecelerateInterpolator()); | ||
| 108 | - animatorSetsuofang2.play(scaleX1).with(scaleY1); | ||
| 109 | - animatorSetsuofang2.start(); | ||
| 110 | - } | ||
| 111 | - }, 100); | ||
| 112 | - | ||
| 113 | - new Handler().postDelayed(new Runnable() { | ||
| 114 | - @Override | ||
| 115 | - public void run() { | ||
| 116 | - AnimatorSet animatorSetsuofang3 = new AnimatorSet();//组合动画 | ||
| 117 | - animatorSetsuofang3.setDuration(10); | ||
| 118 | - animatorSetsuofang3.setInterpolator(new DecelerateInterpolator()); | ||
| 119 | - animatorSetsuofang3.play(scaleX2).with(scaleY2); | ||
| 120 | - animatorSetsuofang3.start(); | ||
| 121 | - } | ||
| 122 | - }, 300); | 109 | + try { |
| 110 | + ObjectAnimator scaleX = ObjectAnimator.ofFloat(view, "scaleX", 0, 1.4f); | ||
| 111 | + ObjectAnimator scaleY = ObjectAnimator.ofFloat(view, "scaleY", 0, 1.4f); | ||
| 112 | + ObjectAnimator scaleX1 = ObjectAnimator.ofFloat(view, "scaleX", 1.4f, 1); | ||
| 113 | + ObjectAnimator scaleY1 = ObjectAnimator.ofFloat(view, "scaleY", 1.4f, 1); | ||
| 114 | + ObjectAnimator scaleX2 = ObjectAnimator.ofFloat(view, "scaleX", 1, 0); | ||
| 115 | + ObjectAnimator scaleY2 = ObjectAnimator.ofFloat(view, "scaleY", 1, 0); | ||
| 116 | + AnimatorSet animatorSetsuofang = new AnimatorSet();//组合动画 | ||
| 117 | + animatorSetsuofang.setDuration(100); | ||
| 118 | + animatorSetsuofang.setInterpolator(new DecelerateInterpolator()); | ||
| 119 | + animatorSetsuofang.play(scaleX).with(scaleY); | ||
| 120 | + animatorSetsuofang.start(); | ||
| 121 | + new Handler().postDelayed(new Runnable() { | ||
| 122 | + @Override | ||
| 123 | + public void run() { | ||
| 124 | + if (view == null) { | ||
| 125 | + return; | ||
| 126 | + } | ||
| 127 | + AnimatorSet animatorSetsuofang2 = new AnimatorSet();//组合动画 | ||
| 128 | + animatorSetsuofang2.setDuration(100); | ||
| 129 | + animatorSetsuofang2.setInterpolator(new DecelerateInterpolator()); | ||
| 130 | + animatorSetsuofang2.play(scaleX1).with(scaleY1); | ||
| 131 | + animatorSetsuofang2.start(); | ||
| 132 | + } | ||
| 133 | + }, 100); | ||
| 123 | 134 | ||
| 135 | + new Handler().postDelayed(new Runnable() { | ||
| 136 | + @Override | ||
| 137 | + public void run() { | ||
| 138 | + if (view == null) { | ||
| 139 | + return; | ||
| 140 | + } | ||
| 141 | + AnimatorSet animatorSetsuofang3 = new AnimatorSet();//组合动画 | ||
| 142 | + animatorSetsuofang3.setDuration(10); | ||
| 143 | + animatorSetsuofang3.setInterpolator(new DecelerateInterpolator()); | ||
| 144 | + animatorSetsuofang3.play(scaleX2).with(scaleY2); | ||
| 145 | + animatorSetsuofang3.start(); | ||
| 146 | + } | ||
| 147 | + }, 300); | ||
| 148 | + } catch (Exception e) { | ||
| 149 | + } | ||
| 124 | } | 150 | } |
| 125 | 151 | ||
| 126 | 152 | ||
| @@ -131,46 +157,49 @@ public class ButtonAnimUtil { | @@ -131,46 +157,49 @@ public class ButtonAnimUtil { | ||
| 131 | * @param closeFlag | 157 | * @param closeFlag |
| 132 | */ | 158 | */ |
| 133 | public static void startAnimation(View view, boolean closeFlag) { | 159 | public static void startAnimation(View view, boolean closeFlag) { |
| 134 | - //因为CircularReveal动画是api21之后才有的,所以加个判断语句,免得崩溃 | ||
| 135 | - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { | ||
| 136 | - int cicular_R = view.getHeight() / 2 > view.getWidth() / 2 ? view.getHeight() / 2 : view.getWidth() / 2; | ||
| 137 | - Animator animator = null; | ||
| 138 | - if (!closeFlag) { | ||
| 139 | - animator = ViewAnimationUtils.createCircularReveal(view, (int) view.getWidth() / 2, (int) view.getHeight() / 2, 0, cicular_R); | ||
| 140 | - } else { | ||
| 141 | - animator = ViewAnimationUtils.createCircularReveal(view, (int) view.getWidth() / 2, (int) view.getHeight() / 2, cicular_R, 0); | ||
| 142 | - } | ||
| 143 | - animator.addListener(new Animator.AnimatorListener() { | ||
| 144 | - @Override | ||
| 145 | - public void onAnimationStart(Animator animator) { | ||
| 146 | - | 160 | + try { |
| 161 | + //因为CircularReveal动画是api21之后才有的,所以加个判断语句,免得崩溃 | ||
| 162 | + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { | ||
| 163 | + int cicular_R = view.getHeight() / 2 > view.getWidth() / 2 ? view.getHeight() / 2 : view.getWidth() / 2; | ||
| 164 | + Animator animator = null; | ||
| 165 | + if (!closeFlag) { | ||
| 166 | + animator = ViewAnimationUtils.createCircularReveal(view, (int) view.getWidth() / 2, (int) view.getHeight() / 2, 0, cicular_R); | ||
| 167 | + } else { | ||
| 168 | + animator = ViewAnimationUtils.createCircularReveal(view, (int) view.getWidth() / 2, (int) view.getHeight() / 2, cicular_R, 0); | ||
| 147 | } | 169 | } |
| 170 | + animator.addListener(new Animator.AnimatorListener() { | ||
| 171 | + @Override | ||
| 172 | + public void onAnimationStart(Animator animator) { | ||
| 148 | 173 | ||
| 149 | - @Override | ||
| 150 | - public void onAnimationEnd(Animator animator) { | ||
| 151 | - if (closeFlag) { | ||
| 152 | - view.setVisibility(View.GONE); | ||
| 153 | } | 174 | } |
| 154 | - } | ||
| 155 | 175 | ||
| 156 | - @Override | ||
| 157 | - public void onAnimationCancel(Animator animator) { | 176 | + @Override |
| 177 | + public void onAnimationEnd(Animator animator) { | ||
| 178 | + if (closeFlag) { | ||
| 179 | + view.setVisibility(View.GONE); | ||
| 180 | + } | ||
| 181 | + } | ||
| 158 | 182 | ||
| 159 | - } | 183 | + @Override |
| 184 | + public void onAnimationCancel(Animator animator) { | ||
| 160 | 185 | ||
| 161 | - @Override | ||
| 162 | - public void onAnimationRepeat(Animator animator) { | 186 | + } |
| 187 | + | ||
| 188 | + @Override | ||
| 189 | + public void onAnimationRepeat(Animator animator) { | ||
| 163 | 190 | ||
| 191 | + } | ||
| 192 | + }); | ||
| 193 | + animator.setDuration(350); | ||
| 194 | + animator.start(); | ||
| 195 | + } else { | ||
| 196 | + if (closeFlag) { | ||
| 197 | + view.setVisibility(View.GONE); | ||
| 164 | } | 198 | } |
| 165 | - }); | ||
| 166 | - animator.setDuration(350); | ||
| 167 | - animator.start(); | ||
| 168 | - } else { | ||
| 169 | - if (closeFlag) { | ||
| 170 | - view.setVisibility(View.GONE); | ||
| 171 | } | 199 | } |
| 172 | - } | ||
| 173 | 200 | ||
| 201 | + } catch (Exception e) { | ||
| 202 | + } | ||
| 174 | } | 203 | } |
| 175 | 204 | ||
| 176 | } | 205 | } |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/utils/ChineseToSpeechUtil.java
0 → 100644
| 1 | +package com.cnlive.moudle.pedometer.utils; | ||
| 2 | + | ||
| 3 | +import android.app.Application; | ||
| 4 | +import android.content.Context; | ||
| 5 | +import android.speech.tts.TextToSpeech; | ||
| 6 | + | ||
| 7 | +import java.util.Locale; | ||
| 8 | + | ||
| 9 | +public class ChineseToSpeechUtil { | ||
| 10 | + private static TextToSpeech textToSpeech; | ||
| 11 | + | ||
| 12 | + | ||
| 13 | + public static void speech(Context context, String text) { | ||
| 14 | + if (textToSpeech == null) { | ||
| 15 | + textToSpeech = new TextToSpeech(context, new TextToSpeech.OnInitListener() { | ||
| 16 | + @Override | ||
| 17 | + public void onInit(int status) { | ||
| 18 | + if (status == TextToSpeech.SUCCESS) { | ||
| 19 | + int result = textToSpeech.setLanguage(Locale.CHINA); | ||
| 20 | + if (result == TextToSpeech.LANG_MISSING_DATA | ||
| 21 | + || result == TextToSpeech.LANG_NOT_SUPPORTED) { | ||
| 22 | +// new CoolToast(Application.getContext()).show("不支持朗读功能"); | ||
| 23 | + } else { | ||
| 24 | + // 设置音调,值越大声音越尖(女生),值越小则变成男声,1.0是常规 | ||
| 25 | + textToSpeech.setPitch(1.0f); | ||
| 26 | + // 设置语速 | ||
| 27 | + textToSpeech.setSpeechRate(1f); | ||
| 28 | + textToSpeech.speak(text, TextToSpeech.QUEUE_FLUSH, null); | ||
| 29 | + } | ||
| 30 | + } | ||
| 31 | + } | ||
| 32 | + }); | ||
| 33 | + }else { | ||
| 34 | + textToSpeech.speak(text, TextToSpeech.QUEUE_FLUSH, null); | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + | ||
| 38 | + | ||
| 39 | + } | ||
| 40 | + | ||
| 41 | + public static void destroy() { | ||
| 42 | + if (textToSpeech != null) { | ||
| 43 | + textToSpeech.stop(); | ||
| 44 | + textToSpeech.shutdown(); | ||
| 45 | + textToSpeech=null; | ||
| 46 | + } | ||
| 47 | + } | ||
| 48 | + | ||
| 49 | +} |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/utils/MyMapUtil.java
| @@ -13,7 +13,9 @@ import com.baidu.mapapi.map.PolylineOptions; | @@ -13,7 +13,9 @@ import com.baidu.mapapi.map.PolylineOptions; | ||
| 13 | import com.baidu.mapapi.model.LatLng; | 13 | import com.baidu.mapapi.model.LatLng; |
| 14 | import com.baidu.mapapi.utils.DistanceUtil; | 14 | import com.baidu.mapapi.utils.DistanceUtil; |
| 15 | import com.baidu.trace.model.SortType; | 15 | import com.baidu.trace.model.SortType; |
| 16 | +import com.cnlive.moudle.pedometer.model.RoutePoint; | ||
| 16 | 17 | ||
| 18 | +import java.util.ArrayList; | ||
| 17 | import java.util.List; | 19 | import java.util.List; |
| 18 | 20 | ||
| 19 | /** | 21 | /** |
| @@ -35,16 +37,19 @@ public class MyMapUtil { | @@ -35,16 +37,19 @@ public class MyMapUtil { | ||
| 35 | */ | 37 | */ |
| 36 | public static Overlay drawHistoryTrack(Context context, BaiduMap baiduMap, List<LatLng> points, SortType sortType, int lineColor, int startIconRes, int endIconRes) { | 38 | public static Overlay drawHistoryTrack(Context context, BaiduMap baiduMap, List<LatLng> points, SortType sortType, int lineColor, int startIconRes, int endIconRes) { |
| 37 | // 绘制新覆盖物前,清空之前的覆盖物 | 39 | // 绘制新覆盖物前,清空之前的覆盖物 |
| 38 | - baiduMap.clear(); | ||
| 39 | if (points == null || points.size() == 0) { | 40 | if (points == null || points.size() == 0) { |
| 40 | return null; | 41 | return null; |
| 41 | } | 42 | } |
| 42 | //只有一个点 | 43 | //只有一个点 |
| 43 | if (points.size() == 1) { | 44 | if (points.size() == 1) { |
| 44 | - Bitmap pointBitmap = BitmapUtil.getBitmapFromDp(context, BitmapFactory.decodeResource(context.getResources(), startIconRes), 40, 40); | ||
| 45 | - OverlayOptions startOptions = new MarkerOptions().position(points.get(0)).icon(BitmapDescriptorFactory.fromBitmap(pointBitmap)); | 45 | + if (startIconRes != 0) { |
| 46 | + Bitmap pointBitmap = BitmapUtil.getBitmapFromDp(context, BitmapFactory.decodeResource(context.getResources(), startIconRes), 40, 40); | ||
| 47 | + OverlayOptions startOptions = new MarkerOptions().position(points.get(0)).icon(BitmapDescriptorFactory.fromBitmap(pointBitmap)); | ||
| 46 | // .zIndex(9).draggable(true); | 48 | // .zIndex(9).draggable(true); |
| 47 | - return baiduMap.addOverlay(startOptions); | 49 | + return baiduMap.addOverlay(startOptions); |
| 50 | + } else { | ||
| 51 | + return null; | ||
| 52 | + } | ||
| 48 | } | 53 | } |
| 49 | 54 | ||
| 50 | LatLng startPoint; | 55 | LatLng startPoint; |
| @@ -58,22 +63,33 @@ public class MyMapUtil { | @@ -58,22 +63,33 @@ public class MyMapUtil { | ||
| 58 | } | 63 | } |
| 59 | 64 | ||
| 60 | // 添加起点图标 | 65 | // 添加起点图标 |
| 61 | - Bitmap startPointBitmap = BitmapUtil.getBitmapFromDp(context, BitmapFactory.decodeResource(context.getResources(), startIconRes), 40, 40); | ||
| 62 | - OverlayOptions startOptions = new MarkerOptions() | ||
| 63 | - .position(startPoint).icon(BitmapDescriptorFactory.fromBitmap(startPointBitmap)); | 66 | + Bitmap startPointBitmap = null; |
| 67 | + OverlayOptions startOptions = null; | ||
| 68 | + if (startIconRes != 0) { | ||
| 69 | + startPointBitmap = BitmapUtil.getBitmapFromDp(context, BitmapFactory.decodeResource(context.getResources(), startIconRes), 40, 40); | ||
| 70 | + startOptions = new MarkerOptions().perspective(false).animateType(MarkerOptions.MarkerAnimateType.grow) | ||
| 71 | + .position(startPoint).icon(BitmapDescriptorFactory.fromBitmap(startPointBitmap)); | ||
| 72 | + } | ||
| 64 | // .zIndex(9).draggable(true); | 73 | // .zIndex(9).draggable(true); |
| 65 | // 添加终点图标 | 74 | // 添加终点图标 |
| 66 | - Bitmap endPointBitmap = BitmapUtil.getBitmapFromDp(context, BitmapFactory.decodeResource(context.getResources(), endIconRes), 40, 40); | ||
| 67 | - OverlayOptions endOptions = new MarkerOptions().position(endPoint) | ||
| 68 | - .icon(BitmapDescriptorFactory.fromBitmap(endPointBitmap)); | 75 | + Bitmap endPointBitmap = null; |
| 76 | + OverlayOptions endOptions = null; | ||
| 77 | + if (endIconRes != 0) { | ||
| 78 | + endPointBitmap = BitmapUtil.getBitmapFromDp(context, BitmapFactory.decodeResource(context.getResources(), endIconRes), 40, 40); | ||
| 79 | + endOptions = new MarkerOptions().position(endPoint).perspective(false).animateType(MarkerOptions.MarkerAnimateType.grow) | ||
| 80 | + .icon(BitmapDescriptorFactory.fromBitmap(endPointBitmap)); | ||
| 81 | + } | ||
| 69 | // .zIndex(9).draggable(true); | 82 | // .zIndex(9).draggable(true); |
| 70 | 83 | ||
| 71 | // 添加路线(轨迹) | 84 | // 添加路线(轨迹) |
| 72 | OverlayOptions polylineOptions = new PolylineOptions().width(10) | 85 | OverlayOptions polylineOptions = new PolylineOptions().width(10) |
| 73 | .color(context.getResources().getColor(lineColor)).points(points); | 86 | .color(context.getResources().getColor(lineColor)).points(points); |
| 74 | - | ||
| 75 | - baiduMap.addOverlay(startOptions); | ||
| 76 | - baiduMap.addOverlay(endOptions); | 87 | + if (startOptions != null) { |
| 88 | + baiduMap.addOverlay(startOptions); | ||
| 89 | + } | ||
| 90 | + if (endOptions != null) { | ||
| 91 | + baiduMap.addOverlay(endOptions); | ||
| 92 | + } | ||
| 77 | return baiduMap.addOverlay(polylineOptions); | 93 | return baiduMap.addOverlay(polylineOptions); |
| 78 | } | 94 | } |
| 79 | 95 | ||
| @@ -82,7 +98,6 @@ public class MyMapUtil { | @@ -82,7 +98,6 @@ public class MyMapUtil { | ||
| 82 | */ | 98 | */ |
| 83 | public static Overlay drawServerLineTrack(Context context, BaiduMap baiduMap, List<LatLng> points, SortType sortType, int lineColor, int startIconRes, int endIconRes) { | 99 | public static Overlay drawServerLineTrack(Context context, BaiduMap baiduMap, List<LatLng> points, SortType sortType, int lineColor, int startIconRes, int endIconRes) { |
| 84 | // 绘制新覆盖物前,清空之前的覆盖物 | 100 | // 绘制新覆盖物前,清空之前的覆盖物 |
| 85 | - baiduMap.clear(); | ||
| 86 | if (points == null || points.size() == 0) { | 101 | if (points == null || points.size() == 0) { |
| 87 | return null; | 102 | return null; |
| 88 | } | 103 | } |
| @@ -107,12 +122,19 @@ public class MyMapUtil { | @@ -107,12 +122,19 @@ public class MyMapUtil { | ||
| 107 | // 添加起点图标 | 122 | // 添加起点图标 |
| 108 | Bitmap startPointBitmap = BitmapUtil.getBitmapFromDp(context, BitmapFactory.decodeResource(context.getResources(), startIconRes), 40, 40); | 123 | Bitmap startPointBitmap = BitmapUtil.getBitmapFromDp(context, BitmapFactory.decodeResource(context.getResources(), startIconRes), 40, 40); |
| 109 | OverlayOptions startOptions = new MarkerOptions() | 124 | OverlayOptions startOptions = new MarkerOptions() |
| 110 | - .position(startPoint).icon(BitmapDescriptorFactory.fromBitmap(startPointBitmap)); | 125 | + .position(startPoint) |
| 126 | + .icon(BitmapDescriptorFactory.fromBitmap(startPointBitmap)) | ||
| 127 | + .perspective(false) | ||
| 128 | + .animateType(MarkerOptions.MarkerAnimateType.grow) | ||
| 129 | + ; | ||
| 111 | // .zIndex(9).draggable(true); | 130 | // .zIndex(9).draggable(true); |
| 112 | // 添加终点图标 | 131 | // 添加终点图标 |
| 113 | Bitmap endPointBitmap = BitmapUtil.getBitmapFromDp(context, BitmapFactory.decodeResource(context.getResources(), endIconRes), 40, 40); | 132 | Bitmap endPointBitmap = BitmapUtil.getBitmapFromDp(context, BitmapFactory.decodeResource(context.getResources(), endIconRes), 40, 40); |
| 114 | - OverlayOptions endOptions = new MarkerOptions().position(endPoint) | ||
| 115 | - .icon(BitmapDescriptorFactory.fromBitmap(endPointBitmap)); | 133 | + OverlayOptions endOptions = new MarkerOptions() |
| 134 | + .position(endPoint) | ||
| 135 | + .icon(BitmapDescriptorFactory.fromBitmap(endPointBitmap)) | ||
| 136 | + .perspective(false) | ||
| 137 | + .animateType(MarkerOptions.MarkerAnimateType.grow); | ||
| 116 | // .zIndex(9).draggable(true); | 138 | // .zIndex(9).draggable(true); |
| 117 | 139 | ||
| 118 | // 添加路线(轨迹) | 140 | // 添加路线(轨迹) |
| @@ -131,6 +153,18 @@ public class MyMapUtil { | @@ -131,6 +153,18 @@ public class MyMapUtil { | ||
| 131 | return baiduMap.addOverlay(polylineOptions); | 153 | return baiduMap.addOverlay(polylineOptions); |
| 132 | } | 154 | } |
| 133 | 155 | ||
| 156 | + public static Overlay drawMapLineRoutePoint(Context context, BaiduMap baiduMap, List<RoutePoint> points, int lineColor) { | ||
| 157 | + List<LatLng> latLngs = new ArrayList<>(); | ||
| 158 | + for (RoutePoint routePoint : points) { | ||
| 159 | + if (routePoint != null && routePoint.getLat() != 0 && routePoint.getLng() != 0) { | ||
| 160 | + latLngs.add(new LatLng(routePoint.getLat(), routePoint.getLng())); | ||
| 161 | + } | ||
| 162 | + } | ||
| 163 | + OverlayOptions polylineOptions = new PolylineOptions().width(10) | ||
| 164 | + .color(context.getResources().getColor(lineColor)).points(latLngs); | ||
| 165 | + return baiduMap.addOverlay(polylineOptions); | ||
| 166 | + } | ||
| 167 | + | ||
| 134 | public static double pi = 3.1415926535897932384626; | 168 | public static double pi = 3.1415926535897932384626; |
| 135 | public static double a = 6378245.0; | 169 | public static double a = 6378245.0; |
| 136 | public static double ee = 0.00669342162296594323; | 170 | public static double ee = 0.00669342162296594323; |
| @@ -257,7 +291,6 @@ public class MyMapUtil { | @@ -257,7 +291,6 @@ public class MyMapUtil { | ||
| 257 | } | 291 | } |
| 258 | 292 | ||
| 259 | 293 | ||
| 260 | - | ||
| 261 | /*****************************************************地理围栏***************************************************************/ | 294 | /*****************************************************地理围栏***************************************************************/ |
| 262 | /** | 295 | /** |
| 263 | * 地球半径 | 296 | * 地球半径 |
| @@ -437,36 +470,38 @@ public class MyMapUtil { | @@ -437,36 +470,38 @@ public class MyMapUtil { | ||
| 437 | /** | 470 | /** |
| 438 | * luming | 471 | * luming |
| 439 | * 点到边的最短距离 | 472 | * 点到边的最短距离 |
| 473 | + * | ||
| 440 | * @param pointP | 474 | * @param pointP |
| 441 | * @param pointA | 475 | * @param pointA |
| 442 | * @param pointB | 476 | * @param pointB |
| 443 | * @return | 477 | * @return |
| 444 | */ | 478 | */ |
| 445 | - public static double minDistanceToLine(LatLng pointP, LatLng pointA, LatLng pointB){ | ||
| 446 | - double pa = getDistance(pointP,pointA); | ||
| 447 | - double pb = getDistance(pointP,pointB); | ||
| 448 | - double ab = getDistance(pointA,pointB); | 479 | + public static double minDistanceToLine(LatLng pointP, LatLng pointA, LatLng pointB) { |
| 480 | + double pa = getDistance(pointP, pointA); | ||
| 481 | + double pb = getDistance(pointP, pointB); | ||
| 482 | + double ab = getDistance(pointA, pointB); | ||
| 449 | 483 | ||
| 450 | - if((Math.pow(pa,2) + Math.pow(ab,2)) <= Math.pow(pb,2) ){ | 484 | + if ((Math.pow(pa, 2) + Math.pow(ab, 2)) <= Math.pow(pb, 2)) { |
| 451 | return pa; | 485 | return pa; |
| 452 | } | 486 | } |
| 453 | - if((Math.pow(pb,2) + Math.pow(ab,2)) <= Math.pow(pa,2) ){ | 487 | + if ((Math.pow(pb, 2) + Math.pow(ab, 2)) <= Math.pow(pa, 2)) { |
| 454 | return pb; | 488 | return pb; |
| 455 | } | 489 | } |
| 456 | 490 | ||
| 457 | - double p = (pa + pb + ab) / 2 ; | ||
| 458 | - double s = Math.sqrt(p*(p-pa)*(p-pb)*(p-ab)); | 491 | + double p = (pa + pb + ab) / 2; |
| 492 | + double s = Math.sqrt(p * (p - pa) * (p - pb) * (p - ab)); | ||
| 459 | 493 | ||
| 460 | - return (2*s/ab); | 494 | + return (2 * s / ab); |
| 461 | } | 495 | } |
| 462 | 496 | ||
| 463 | /** | 497 | /** |
| 464 | * 通过经纬度获取距离(单位:米) | 498 | * 通过经纬度获取距离(单位:米) |
| 499 | + * | ||
| 465 | * @param location1 | 500 | * @param location1 |
| 466 | * @param location2 | 501 | * @param location2 |
| 467 | * @return | 502 | * @return |
| 468 | */ | 503 | */ |
| 469 | - public static double getDistance(LatLng location1,LatLng location2) { | 504 | + public static double getDistance(LatLng location1, LatLng location2) { |
| 470 | double lat1 = location1.latitude; | 505 | double lat1 = location1.latitude; |
| 471 | double lat2 = location2.latitude; | 506 | double lat2 = location2.latitude; |
| 472 | double lng1 = location1.longitude; | 507 | double lng1 = location1.longitude; |
| @@ -480,7 +515,67 @@ public class MyMapUtil { | @@ -480,7 +515,67 @@ public class MyMapUtil { | ||
| 480 | * Math.pow(Math.sin(b / 2), 2))); | 515 | * Math.pow(Math.sin(b / 2), 2))); |
| 481 | s = s * EARTH_RADIUS; | 516 | s = s * EARTH_RADIUS; |
| 482 | s = Math.round(s * 10000d) / 10000d; | 517 | s = Math.round(s * 10000d) / 10000d; |
| 483 | - s = s*1000; | 518 | + s = s * 1000; |
| 484 | return s; | 519 | return s; |
| 485 | } | 520 | } |
| 521 | + | ||
| 522 | + | ||
| 523 | + /** | ||
| 524 | + * 地图平滑算法 | ||
| 525 | + * | ||
| 526 | + * @param inPoint | ||
| 527 | + * @return | ||
| 528 | + */ | ||
| 529 | + public static List<RoutePoint> optimizePoints(List<RoutePoint> inPoint) { | ||
| 530 | + int size = inPoint.size(); | ||
| 531 | + List<RoutePoint> outPoint; | ||
| 532 | + | ||
| 533 | + int i; | ||
| 534 | + if (size < 5) { | ||
| 535 | + return inPoint; | ||
| 536 | + } else { | ||
| 537 | + // Latitude | ||
| 538 | + inPoint.get(0) | ||
| 539 | + .setLat((3.0 * inPoint.get(0).getLat() + 2.0 | ||
| 540 | + * inPoint.get(1).getLat() + inPoint.get(2).getLat() - inPoint | ||
| 541 | + .get(4).getLat()) / 5.0); | ||
| 542 | + inPoint.get(1) | ||
| 543 | + .setLat((4.0 * inPoint.get(0).getLat() + 3.0 | ||
| 544 | + * inPoint.get(1).getLat() + 2 | ||
| 545 | + * inPoint.get(2).getLat() + inPoint.get(3).getLat()) / 10.0); | ||
| 546 | + | ||
| 547 | + inPoint.get(size - 2).setLat( | ||
| 548 | + (4.0 * inPoint.get(size - 1).getLat() + 3.0 | ||
| 549 | + * inPoint.get(size - 2).getLat() + 2 | ||
| 550 | + * inPoint.get(size - 3).getLat() + inPoint.get( | ||
| 551 | + size - 4).getLat()) / 10.0); | ||
| 552 | + inPoint.get(size - 1).setLat( | ||
| 553 | + (3.0 * inPoint.get(size - 1).getLat() + 2.0 | ||
| 554 | + * inPoint.get(size - 2).getLat() | ||
| 555 | + + inPoint.get(size - 3).getLat() - inPoint.get( | ||
| 556 | + size - 5).getLat()) / 5.0); | ||
| 557 | + | ||
| 558 | + // Longitude | ||
| 559 | + inPoint.get(0) | ||
| 560 | + .setLng((3.0 * inPoint.get(0).getLng() + 2.0 | ||
| 561 | + * inPoint.get(1).getLng() + inPoint.get(2).getLng() - inPoint | ||
| 562 | + .get(4).getLng()) / 5.0); | ||
| 563 | + inPoint.get(1) | ||
| 564 | + .setLng((4.0 * inPoint.get(0).getLng() + 3.0 | ||
| 565 | + * inPoint.get(1).getLng() + 2 | ||
| 566 | + * inPoint.get(2).getLng() + inPoint.get(3).getLng()) / 10.0); | ||
| 567 | + | ||
| 568 | + inPoint.get(size - 2).setLng( | ||
| 569 | + (4.0 * inPoint.get(size - 1).getLng() + 3.0 | ||
| 570 | + * inPoint.get(size - 2).getLng() + 2 | ||
| 571 | + * inPoint.get(size - 3).getLng() + inPoint.get( | ||
| 572 | + size - 4).getLng()) / 10.0); | ||
| 573 | + inPoint.get(size - 1).setLng( | ||
| 574 | + (3.0 * inPoint.get(size - 1).getLng() + 2.0 | ||
| 575 | + * inPoint.get(size - 2).getLng() | ||
| 576 | + + inPoint.get(size - 3).getLng() - inPoint.get( | ||
| 577 | + size - 5).getLng()) / 5.0); | ||
| 578 | + } | ||
| 579 | + return inPoint; | ||
| 580 | + } | ||
| 486 | } | 581 | } |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/utils/StepUtil.java
| @@ -95,9 +95,8 @@ public class StepUtil { | @@ -95,9 +95,8 @@ public class StepUtil { | ||
| 95 | if (list != null && list.size() > 0) { | 95 | if (list != null && list.size() > 0) { |
| 96 | Log.e(TAG, "clearRunData: " + list.size()); | 96 | Log.e(TAG, "clearRunData: " + list.size()); |
| 97 | // for (int i = 0; i < list.size(); i++) { | 97 | // for (int i = 0; i < list.size(); i++) { |
| 98 | - DbCore.getDaoSession().getUserStepEntityDao().deleteInTx(list); | 98 | + DbCore.getDaoSession().getUserStepEntityDao().deleteByKey(list.get(0).getUuid()); |
| 99 | DbCore.getDaoSession().getUserStepEntityDao().detachAll(); | 99 | DbCore.getDaoSession().getUserStepEntityDao().detachAll(); |
| 100 | - DbCore.getDaoSession().clear(); | ||
| 101 | // } | 100 | // } |
| 102 | } | 101 | } |
| 103 | } | 102 | } |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/utils/TimeUtil.java
| 1 | package com.cnlive.moudle.pedometer.utils; | 1 | package com.cnlive.moudle.pedometer.utils; |
| 2 | 2 | ||
| 3 | +import java.text.ParseException; | ||
| 4 | +import java.text.SimpleDateFormat; | ||
| 5 | +import java.util.Date; | ||
| 6 | + | ||
| 7 | +/** | ||
| 8 | + * @author ShinnyYang | ||
| 9 | + */ | ||
| 3 | public class TimeUtil { | 10 | public class TimeUtil { |
| 4 | /** | 11 | /** |
| 5 | * 获取当前时间戳(单位:秒) | 12 | * 获取当前时间戳(单位:秒) |
| @@ -10,4 +17,84 @@ public class TimeUtil { | @@ -10,4 +17,84 @@ public class TimeUtil { | ||
| 10 | return System.currentTimeMillis() / 1000; | 17 | return System.currentTimeMillis() / 1000; |
| 11 | } | 18 | } |
| 12 | 19 | ||
| 20 | + /** | ||
| 21 | + * 日期格式字符串转换成时间戳 | ||
| 22 | + * | ||
| 23 | + * @param dateStr 字符串日期 | ||
| 24 | + * @return | ||
| 25 | + */ | ||
| 26 | + public static long DateToTimeStamp(String dateStr) { | ||
| 27 | + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
| 28 | + try { | ||
| 29 | + Date date = simpleDateFormat.parse(dateStr); | ||
| 30 | + long ts = date.getTime() / 1000; | ||
| 31 | + return ts; | ||
| 32 | + } catch (ParseException e) { | ||
| 33 | + return 0; | ||
| 34 | + } | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + /** | ||
| 38 | + * 取得当前时间戳(精确到秒) | ||
| 39 | + * | ||
| 40 | + * @return time(long型的时间) | ||
| 41 | + */ | ||
| 42 | + public static long getNowTimeStamp() { | ||
| 43 | + long time = System.currentTimeMillis() / 1000; | ||
| 44 | + return time; | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + | ||
| 48 | + /** | ||
| 49 | + * 取得当前格式化的时间戳 | ||
| 50 | + * | ||
| 51 | + * @return 格式化后的日期 | ||
| 52 | + */ | ||
| 53 | + public static String getFormatNowTime() { | ||
| 54 | + SimpleDateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm"); | ||
| 55 | + long time = System.currentTimeMillis(); | ||
| 56 | + return df.format(time); | ||
| 57 | + } | ||
| 58 | + | ||
| 59 | + /** | ||
| 60 | + * 取得指定时间的格式化的时间戳(精确到秒) | ||
| 61 | + * | ||
| 62 | + * @return 格式化后的日期 | ||
| 63 | + */ | ||
| 64 | + public static String getFormatTimeStamp(String timeType) { | ||
| 65 | + SimpleDateFormat df = new SimpleDateFormat(timeType); | ||
| 66 | + long time = System.currentTimeMillis(); | ||
| 67 | + return df.format(time); | ||
| 68 | + } | ||
| 69 | + | ||
| 70 | + /** | ||
| 71 | + * 取得指定时间的格式化的时间戳(精确到秒) | ||
| 72 | + * | ||
| 73 | + * @return 格式化后的日期 | ||
| 74 | + */ | ||
| 75 | + public static String getStampToTime(long time) { | ||
| 76 | + String res; | ||
| 77 | + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
| 78 | + long lt = new Long(time * 1000); | ||
| 79 | + Date date = new Date(lt); | ||
| 80 | + res = simpleDateFormat.format(date); | ||
| 81 | + return res; | ||
| 82 | + } | ||
| 83 | + | ||
| 84 | + /** | ||
| 85 | + * 计算时间差 | ||
| 86 | + * | ||
| 87 | + * @return | ||
| 88 | + */ | ||
| 89 | + public static String getWorkTime(long startTime, long workTime) { | ||
| 90 | + int days = (int) ((workTime - startTime) / (1000 * 60 * 60 * 24)); | ||
| 91 | + int hours = (int) ((workTime - startTime) / (1000 * 60 * 60)); | ||
| 92 | + int minute = (int) ((workTime - startTime) / (1000 * 60)); | ||
| 93 | + return "据上班时间还有:" + hours + "小时," + minute + "分钟"; | ||
| 94 | + } | ||
| 95 | + | ||
| 96 | + public static String getCurrentTimeStr(String formate) { | ||
| 97 | + SimpleDateFormat df = new SimpleDateFormat(formate); | ||
| 98 | + return df.format(new Date()); | ||
| 99 | + } | ||
| 13 | } | 100 | } |
moudle_pedometer/src/main/res/drawable-hdpi/bg_tips_bottom_center.9.png deleted
100644 → 0
2.04 KB
moudle_pedometer/src/main/res/drawable-hdpi/bg_tips_bottom_center.png
0 → 100644
765 Bytes
moudle_pedometer/src/main/res/drawable-hdpi/crown.png
0 → 100644
915 Bytes
moudle_pedometer/src/main/res/drawable-hdpi/icon_back.png
0 → 100644
702 Bytes
moudle_pedometer/src/main/res/drawable-hdpi/icon_end.png
0 → 100644
6.57 KB
moudle_pedometer/src/main/res/drawable-hdpi/icon_end.webp deleted
100644 → 0
No preview for this file type
moudle_pedometer/src/main/res/drawable-hdpi/icon_run_route.png
moudle_pedometer/src/main/res/drawable-hdpi/icon_share.png
0 → 100644
974 Bytes
moudle_pedometer/src/main/res/drawable-hdpi/icon_share.webp deleted
100644 → 0
No preview for this file type
moudle_pedometer/src/main/res/drawable-hdpi/icon_start.png
0 → 100644
5.93 KB
moudle_pedometer/src/main/res/drawable-hdpi/icon_start.webp deleted
100644 → 0
No preview for this file type
moudle_pedometer/src/main/res/drawable-hdpi/icon_step.png
moudle_pedometer/src/main/res/drawable-hdpi/more.png
moudle_pedometer/src/main/res/drawable-hdpi/rt_ic_home_map.png
0 → 100644
7.73 KB
moudle_pedometer/src/main/res/drawable-hdpi/rt_ic_home_map.webp deleted
100644 → 0
No preview for this file type
moudle_pedometer/src/main/res/drawable-hdpi/rt_ic_location_blank.png
0 → 100644
1.7 KB
moudle_pedometer/src/main/res/drawable-hdpi/rt_ic_location_blank.webp deleted
100644 → 0
No preview for this file type
moudle_pedometer/src/main/res/drawable-hdpi/rt_training_button_pause.png
0 → 100644
252 Bytes
moudle_pedometer/src/main/res/drawable-hdpi/rt_training_button_pause.webp deleted
100644 → 0
No preview for this file type
moudle_pedometer/src/main/res/drawable-hdpi/rt_training_button_resume.png
0 → 100644
443 Bytes
moudle_pedometer/src/main/res/drawable-hdpi/rt_training_button_resume.webp deleted
100644 → 0
No preview for this file type
moudle_pedometer/src/main/res/drawable-hdpi/rt_training_button_stop.png
moudle_pedometer/src/main/res/drawable-hdpi/sport_people.png
0 → 100644
903 Bytes
moudle_pedometer/src/main/res/drawable-hdpi/sport_speed.png
0 → 100644
1.8 KB
moudle_pedometer/src/main/res/drawable-hdpi/sport_step.png
0 → 100644
2.02 KB
moudle_pedometer/src/main/res/drawable-hdpi/sport_time_cost.png
0 → 100644
1.86 KB
moudle_pedometer/src/main/res/drawable-hdpi/xqt_share.png
0 → 100644
2.84 KB
moudle_pedometer/src/main/res/drawable-hdpi/xqy_return.png
0 → 100644
2.39 KB
moudle_pedometer/src/main/res/drawable-xhdpi/bg_tips_bottom_center.png
0 → 100644
968 Bytes
moudle_pedometer/src/main/res/drawable-xhdpi/crown.png
0 → 100644
1.07 KB
moudle_pedometer/src/main/res/drawable-xhdpi/icon_back.png
0 → 100644
855 Bytes
moudle_pedometer/src/main/res/drawable-xhdpi/icon_run_route.png
0 → 100644
1.36 KB
moudle_pedometer/src/main/res/drawable-xhdpi/icon_share.png
0 → 100644
1.08 KB
moudle_pedometer/src/main/res/drawable-xhdpi/icon_step.png
0 → 100644
1.31 KB
moudle_pedometer/src/main/res/drawable-xhdpi/more.png
moudle_pedometer/src/main/res/drawable-xhdpi/rt_ic_home_map.png
0 → 100644
7.52 KB
moudle_pedometer/src/main/res/drawable-xhdpi/rt_ic_location_blank.png
0 → 100644
2.04 KB
moudle_pedometer/src/main/res/drawable-xhdpi/rt_training_button_pause.png
0 → 100644
152 Bytes
moudle_pedometer/src/main/res/drawable-xhdpi/rt_training_button_resume.png
0 → 100644
555 Bytes
moudle_pedometer/src/main/res/drawable-xhdpi/rt_training_button_stop.png
0 → 100644
130 Bytes
moudle_pedometer/src/main/res/drawable-xhdpi/sport_people.png
0 → 100644
1.01 KB
moudle_pedometer/src/main/res/drawable-xhdpi/sport_speed.png
0 → 100644
1.9 KB
moudle_pedometer/src/main/res/drawable-xhdpi/sport_step.png
0 → 100644
2.15 KB
moudle_pedometer/src/main/res/drawable-xhdpi/sport_time_cost.png
0 → 100644
1.97 KB
moudle_pedometer/src/main/res/drawable-xhdpi/xqt_share.png
0 → 100644
2.34 KB
moudle_pedometer/src/main/res/drawable-xhdpi/xqy_return.png
0 → 100644
2.16 KB
moudle_pedometer/src/main/res/drawable-xxhdpi/bg_tips_bottom_center.png
0 → 100644
1.79 KB
moudle_pedometer/src/main/res/drawable-xxhdpi/crown.png
0 → 100644
1.85 KB
moudle_pedometer/src/main/res/drawable-xxhdpi/icon_back.png
0 → 100644
1.49 KB
moudle_pedometer/src/main/res/drawable-xxhdpi/icon_run_route.png
0 → 100644
2.61 KB
moudle_pedometer/src/main/res/drawable-xxhdpi/icon_share.png
0 → 100644
2.09 KB
moudle_pedometer/src/main/res/drawable-xxhdpi/icon_step.png
0 → 100644
2.81 KB
moudle_pedometer/src/main/res/drawable-xxhdpi/more.png
moudle_pedometer/src/main/res/drawable-xxhdpi/rt_ic_home_map.png
0 → 100644
23.2 KB
moudle_pedometer/src/main/res/drawable-xxhdpi/rt_ic_location_blank.png
0 → 100644
3.71 KB
moudle_pedometer/src/main/res/drawable-xxhdpi/rt_training_button_pause.png
0 → 100644
427 Bytes
moudle_pedometer/src/main/res/drawable-xxhdpi/rt_training_button_resume.png
0 → 100644
854 Bytes
moudle_pedometer/src/main/res/drawable-xxhdpi/rt_training_button_stop.png
0 → 100644
207 Bytes
moudle_pedometer/src/main/res/drawable-xxhdpi/sport_people.png
0 → 100644
1.84 KB
moudle_pedometer/src/main/res/drawable-xxhdpi/sport_speed.png
0 → 100644
3.74 KB
moudle_pedometer/src/main/res/drawable-xxhdpi/sport_step.png
0 → 100644
4.42 KB
moudle_pedometer/src/main/res/drawable-xxhdpi/sport_time_cost.png
0 → 100644
3.91 KB
moudle_pedometer/src/main/res/drawable-xxhdpi/xqt_share.png
0 → 100644
7.72 KB
moudle_pedometer/src/main/res/drawable-xxhdpi/xqy_return.png
0 → 100644
6.58 KB
moudle_pedometer/src/main/res/drawable/layer_shadow.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | ||
| 3 | + | ||
| 4 | + <!--边--> | ||
| 5 | + <item> | ||
| 6 | + <shape android:shape="rectangle"> | ||
| 7 | + <padding | ||
| 8 | + android:bottom="7px" | ||
| 9 | + android:left="7px" | ||
| 10 | + android:right="7px" | ||
| 11 | + android:top="5px" /> | ||
| 12 | + | ||
| 13 | + <solid android:color="#00eeeeee" /> | ||
| 14 | + | ||
| 15 | + <corners android:radius="5dp" /> | ||
| 16 | + </shape> | ||
| 17 | + </item> | ||
| 18 | + <item> | ||
| 19 | + <shape android:shape="rectangle"> | ||
| 20 | + <padding | ||
| 21 | + android:bottom="7px" | ||
| 22 | + android:left="7px" | ||
| 23 | + android:right="7px" | ||
| 24 | + android:top="5px" /> | ||
| 25 | + | ||
| 26 | + <solid android:color="#0Deeeeee" /> | ||
| 27 | + | ||
| 28 | + <corners android:radius="5dp" /> | ||
| 29 | + </shape> | ||
| 30 | + </item> | ||
| 31 | + <item> | ||
| 32 | + <shape android:shape="rectangle"> | ||
| 33 | + <padding | ||
| 34 | + android:bottom="7px" | ||
| 35 | + android:left="7px" | ||
| 36 | + android:right="7px" | ||
| 37 | + android:top="5px" /> | ||
| 38 | + <solid android:color="#0Deeeeee" /> | ||
| 39 | + <corners android:radius="5dp" /> | ||
| 40 | + </shape> | ||
| 41 | + </item> | ||
| 42 | + <item> | ||
| 43 | + <shape android:shape="rectangle"> | ||
| 44 | + <padding | ||
| 45 | + android:bottom="7px" | ||
| 46 | + android:left="7px" | ||
| 47 | + android:right="7px" | ||
| 48 | + android:top="5px" /> | ||
| 49 | + <solid android:color="#0Deeeeee" /> | ||
| 50 | + <corners android:radius="5dp" /> | ||
| 51 | + </shape> | ||
| 52 | + </item> | ||
| 53 | + <item> | ||
| 54 | + <shape android:shape="rectangle"> | ||
| 55 | + <padding | ||
| 56 | + android:bottom="7px" | ||
| 57 | + android:left="7px" | ||
| 58 | + android:right="7px" | ||
| 59 | + android:top="5px" /> | ||
| 60 | + | ||
| 61 | + <solid android:color="#0Deeeeee" /> | ||
| 62 | + <corners android:radius="5dp" /> | ||
| 63 | + </shape> | ||
| 64 | + </item> | ||
| 65 | + | ||
| 66 | + <!--中心背景 --> | ||
| 67 | + <item> | ||
| 68 | + <shape | ||
| 69 | + android:shape="rectangle" | ||
| 70 | + android:useLevel="false"> | ||
| 71 | + <!--实心 --> | ||
| 72 | + <solid android:color="@color/white" /> | ||
| 73 | + <corners android:radius="5dp" /> | ||
| 74 | + <size | ||
| 75 | + android:width="32dp" | ||
| 76 | + android:height="32dp" /> | ||
| 77 | + | ||
| 78 | + </shape> | ||
| 79 | + </item> | ||
| 80 | + | ||
| 81 | +</layer-list> | ||
| 0 | \ No newline at end of file | 82 | \ No newline at end of file |
moudle_pedometer/src/main/res/drawable/shape_10dp_white_raduis_bg.xml
| @@ -2,7 +2,4 @@ | @@ -2,7 +2,4 @@ | ||
| 2 | <shape xmlns:android="http://schemas.android.com/apk/res/android"> | 2 | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| 3 | <solid android:color="@color/white" /> | 3 | <solid android:color="@color/white" /> |
| 4 | <corners android:radius="10dp" /> | 4 | <corners android:radius="10dp" /> |
| 5 | - <stroke | ||
| 6 | - android:width="1dp" | ||
| 7 | - android:color="@color/line" /> | ||
| 8 | </shape> | 5 | </shape> |
| 9 | \ No newline at end of file | 6 | \ No newline at end of file |
moudle_pedometer/src/main/res/drawable/shape_gray_round.xml renamed to moudle_pedometer/src/main/res/drawable/shape_white_round.xml
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <shape xmlns:android="http://schemas.android.com/apk/res/android"> | 2 | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| 3 | <corners android:radius="100dp" /> | 3 | <corners android:radius="100dp" /> |
| 4 | - <solid android:color="@color/gray_round" /> | 4 | + <solid android:color="@color/white" /> |
| 5 | </shape> | 5 | </shape> |
| 6 | \ No newline at end of file | 6 | \ No newline at end of file |
moudle_pedometer/src/main/res/layout/five_persion_icon.xml
| @@ -51,5 +51,5 @@ | @@ -51,5 +51,5 @@ | ||
| 51 | android:layout_width="9dp" | 51 | android:layout_width="9dp" |
| 52 | android:layout_height="15dp" | 52 | android:layout_height="15dp" |
| 53 | android:layout_marginLeft="5dp" | 53 | android:layout_marginLeft="5dp" |
| 54 | - android:background="@drawable/tc_suit_right_arrow" /> | 54 | + android:background="@drawable/more" /> |
| 55 | </LinearLayout> | 55 | </LinearLayout> |
| 56 | \ No newline at end of file | 56 | \ No newline at end of file |
moudle_pedometer/src/main/res/layout/fragment_finish_run_map.xml
| @@ -10,7 +10,7 @@ | @@ -10,7 +10,7 @@ | ||
| 10 | sothree:umanoDragView="@+id/dragView" | 10 | sothree:umanoDragView="@+id/dragView" |
| 11 | sothree:umanoFadeColor="@color/black_20" | 11 | sothree:umanoFadeColor="@color/black_20" |
| 12 | sothree:umanoOverlay="true" | 12 | sothree:umanoOverlay="true" |
| 13 | - sothree:umanoPanelHeight="220dp" | 13 | + sothree:umanoPanelHeight="360dp" |
| 14 | sothree:umanoParallaxOffset="100dp" | 14 | sothree:umanoParallaxOffset="100dp" |
| 15 | sothree:umanoScrollableView="@+id/scrollView" | 15 | sothree:umanoScrollableView="@+id/scrollView" |
| 16 | sothree:umanoShadowHeight="0dp"> | 16 | sothree:umanoShadowHeight="0dp"> |
| @@ -26,28 +26,31 @@ | @@ -26,28 +26,31 @@ | ||
| 26 | android:layout_height="match_parent"></com.baidu.mapapi.map.MapView> | 26 | android:layout_height="match_parent"></com.baidu.mapapi.map.MapView> |
| 27 | 27 | ||
| 28 | <FrameLayout | 28 | <FrameLayout |
| 29 | - android:layout_width="40dp" | ||
| 30 | - android:layout_height="40dp" | ||
| 31 | - android:layout_margin="10dp" | ||
| 32 | - android:background="@drawable/shape_circle_50_black"> | 29 | + android:id="@+id/fl_back" |
| 30 | + android:layout_width="55dp" | ||
| 31 | + android:layout_height="55dp" | ||
| 32 | + android:background="@drawable/button_fab_white" | ||
| 33 | + android:focusable="true"> | ||
| 33 | 34 | ||
| 34 | <ImageView | 35 | <ImageView |
| 35 | - android:layout_width="10dp" | 36 | + android:layout_width="12dp" |
| 36 | android:layout_height="20dp" | 37 | android:layout_height="20dp" |
| 37 | android:layout_gravity="center" | 38 | android:layout_gravity="center" |
| 38 | - android:background="@drawable/ic_white_back" /> | 39 | + android:layout_marginLeft="-2dp" |
| 40 | + android:background="@drawable/icon_back" | ||
| 41 | + android:focusable="false" /> | ||
| 39 | </FrameLayout> | 42 | </FrameLayout> |
| 40 | 43 | ||
| 41 | <FrameLayout | 44 | <FrameLayout |
| 42 | - android:layout_width="40dp" | ||
| 43 | - android:layout_height="40dp" | 45 | + android:layout_width="55dp" |
| 46 | + android:layout_height="55dp" | ||
| 44 | android:layout_gravity="right" | 47 | android:layout_gravity="right" |
| 45 | - android:layout_margin="10dp" | ||
| 46 | - android:background="@drawable/shape_circle_50_black"> | 48 | + android:background="@drawable/button_fab_white" |
| 49 | + android:focusable="true"> | ||
| 47 | 50 | ||
| 48 | <ImageView | 51 | <ImageView |
| 49 | - android:layout_width="15dp" | ||
| 50 | - android:layout_height="15dp" | 52 | + android:layout_width="19dp" |
| 53 | + android:layout_height="18dp" | ||
| 51 | android:layout_gravity="center" | 54 | android:layout_gravity="center" |
| 52 | android:background="@drawable/icon_share" /> | 55 | android:background="@drawable/icon_share" /> |
| 53 | </FrameLayout> | 56 | </FrameLayout> |
moudle_pedometer/src/main/res/layout/fragment_run_main.xml
| @@ -51,10 +51,10 @@ | @@ -51,10 +51,10 @@ | ||
| 51 | android:layout_width="wrap_content" | 51 | android:layout_width="wrap_content" |
| 52 | android:layout_height="wrap_content" | 52 | android:layout_height="wrap_content" |
| 53 | android:layout_marginLeft="10dp" | 53 | android:layout_marginLeft="10dp" |
| 54 | - android:layout_marginTop="15dp" | 54 | + android:layout_marginTop="20dp" |
| 55 | android:text="公里" | 55 | android:text="公里" |
| 56 | android:textColor="@color/white" | 56 | android:textColor="@color/white" |
| 57 | - android:textSize="25sp" /> | 57 | + android:textSize="15sp" /> |
| 58 | </LinearLayout> | 58 | </LinearLayout> |
| 59 | <!--GPS信息--> | 59 | <!--GPS信息--> |
| 60 | <LinearLayout | 60 | <LinearLayout |
| @@ -73,10 +73,10 @@ | @@ -73,10 +73,10 @@ | ||
| 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_centerVertical="true" | 75 | android:layout_centerVertical="true" |
| 76 | - android:layout_marginLeft="15dp" | 76 | + android:layout_marginLeft="20dp" |
| 77 | android:text="GPS" | 77 | android:text="GPS" |
| 78 | android:textColor="@color/white" | 78 | android:textColor="@color/white" |
| 79 | - android:textSize="20sp" | 79 | + android:textSize="18sp" |
| 80 | android:textStyle="bold" /> | 80 | android:textStyle="bold" /> |
| 81 | 81 | ||
| 82 | <TextView | 82 | <TextView |
| @@ -88,7 +88,7 @@ | @@ -88,7 +88,7 @@ | ||
| 88 | android:layout_toRightOf="@id/tv_gps" | 88 | android:layout_toRightOf="@id/tv_gps" |
| 89 | android:text="(点击查看轨迹)" | 89 | android:text="(点击查看轨迹)" |
| 90 | android:textColor="@color/text_gray" | 90 | android:textColor="@color/text_gray" |
| 91 | - android:textSize="15sp" | 91 | + android:textSize="12sp" |
| 92 | android:textStyle="bold" /> | 92 | android:textStyle="bold" /> |
| 93 | 93 | ||
| 94 | <ImageView | 94 | <ImageView |
| @@ -102,7 +102,7 @@ | @@ -102,7 +102,7 @@ | ||
| 102 | <LinearLayout | 102 | <LinearLayout |
| 103 | android:layout_width="match_parent" | 103 | android:layout_width="match_parent" |
| 104 | android:layout_height="wrap_content" | 104 | android:layout_height="wrap_content" |
| 105 | - android:layout_marginTop="15dp"> | 105 | + android:layout_marginTop="35dp"> |
| 106 | 106 | ||
| 107 | <LinearLayout | 107 | <LinearLayout |
| 108 | android:layout_width="0dp" | 108 | android:layout_width="0dp" |
| @@ -112,10 +112,10 @@ | @@ -112,10 +112,10 @@ | ||
| 112 | android:orientation="vertical"> | 112 | android:orientation="vertical"> |
| 113 | 113 | ||
| 114 | <ImageView | 114 | <ImageView |
| 115 | - android:layout_width="30dp" | ||
| 116 | - android:layout_height="30dp" | 115 | + android:layout_width="26dp" |
| 116 | + android:layout_height="23dp" | ||
| 117 | android:layout_marginBottom="5dp" | 117 | android:layout_marginBottom="5dp" |
| 118 | - android:src="@drawable/rt_outdoor_video_pace" /> | 118 | + android:src="@drawable/sport_speed" /> |
| 119 | 119 | ||
| 120 | <LinearLayout | 120 | <LinearLayout |
| 121 | android:layout_width="match_parent" | 121 | android:layout_width="match_parent" |
| @@ -138,9 +138,9 @@ | @@ -138,9 +138,9 @@ | ||
| 138 | android:layout_height="wrap_content" | 138 | android:layout_height="wrap_content" |
| 139 | android:layout_marginTop="5dp" | 139 | android:layout_marginTop="5dp" |
| 140 | android:gravity="center" | 140 | android:gravity="center" |
| 141 | - android:text="时速" | 141 | + android:text="配速" |
| 142 | android:textColor="@color/text_gray" | 142 | android:textColor="@color/text_gray" |
| 143 | - android:textSize="17sp" | 143 | + android:textSize="15sp" |
| 144 | android:textStyle="bold" /> | 144 | android:textStyle="bold" /> |
| 145 | </LinearLayout> | 145 | </LinearLayout> |
| 146 | <!--用时--> | 146 | <!--用时--> |
| @@ -152,10 +152,10 @@ | @@ -152,10 +152,10 @@ | ||
| 152 | android:orientation="vertical"> | 152 | android:orientation="vertical"> |
| 153 | 153 | ||
| 154 | <ImageView | 154 | <ImageView |
| 155 | - android:layout_width="30dp" | ||
| 156 | - android:layout_height="30dp" | 155 | + android:layout_width="23dp" |
| 156 | + android:layout_height="25dp" | ||
| 157 | android:layout_marginBottom="5dp" | 157 | android:layout_marginBottom="5dp" |
| 158 | - android:src="@drawable/rt_outdoor_video_time" /> | 158 | + android:src="@drawable/sport_time_cost" /> |
| 159 | 159 | ||
| 160 | <Chronometer | 160 | <Chronometer |
| 161 | android:id="@+id/chronometer" | 161 | android:id="@+id/chronometer" |
| @@ -173,7 +173,7 @@ | @@ -173,7 +173,7 @@ | ||
| 173 | android:gravity="center" | 173 | android:gravity="center" |
| 174 | android:text="用时" | 174 | android:text="用时" |
| 175 | android:textColor="@color/text_gray" | 175 | android:textColor="@color/text_gray" |
| 176 | - android:textSize="17sp" | 176 | + android:textSize="15sp" |
| 177 | android:textStyle="bold" /> | 177 | android:textStyle="bold" /> |
| 178 | </LinearLayout> | 178 | </LinearLayout> |
| 179 | <!--热量--> | 179 | <!--热量--> |
| @@ -185,10 +185,10 @@ | @@ -185,10 +185,10 @@ | ||
| 185 | android:orientation="vertical"> | 185 | android:orientation="vertical"> |
| 186 | 186 | ||
| 187 | <ImageView | 187 | <ImageView |
| 188 | - android:layout_width="30dp" | ||
| 189 | - android:layout_height="30dp" | 188 | + android:layout_width="26dp" |
| 189 | + android:layout_height="24dp" | ||
| 190 | android:layout_marginBottom="5dp" | 190 | android:layout_marginBottom="5dp" |
| 191 | - android:src="@drawable/rt_outdoor_video_cal" /> | 191 | + android:src="@drawable/sport_step" /> |
| 192 | 192 | ||
| 193 | <TextView | 193 | <TextView |
| 194 | android:id="@+id/tv_step_count" | 194 | android:id="@+id/tv_step_count" |
| @@ -205,9 +205,9 @@ | @@ -205,9 +205,9 @@ | ||
| 205 | android:layout_height="wrap_content" | 205 | android:layout_height="wrap_content" |
| 206 | android:layout_marginTop="5dp" | 206 | android:layout_marginTop="5dp" |
| 207 | android:gravity="center" | 207 | android:gravity="center" |
| 208 | - android:text="步数" | 208 | + android:text="步" |
| 209 | android:textColor="@color/text_gray" | 209 | android:textColor="@color/text_gray" |
| 210 | - android:textSize="17sp" | 210 | + android:textSize="15sp" |
| 211 | android:textStyle="bold" /> | 211 | android:textStyle="bold" /> |
| 212 | </LinearLayout> | 212 | </LinearLayout> |
| 213 | </LinearLayout> | 213 | </LinearLayout> |
| @@ -248,26 +248,22 @@ | @@ -248,26 +248,22 @@ | ||
| 248 | 248 | ||
| 249 | <FrameLayout | 249 | <FrameLayout |
| 250 | android:layout_width="match_parent" | 250 | android:layout_width="match_parent" |
| 251 | - android:layout_height="wrap_content"> | ||
| 252 | - | 251 | + android:layout_height="wrap_content" |
| 252 | + android:layout_marginTop="5dp" | ||
| 253 | + android:visibility="invisible"> | ||
| 253 | 254 | ||
| 254 | <ImageView | 255 | <ImageView |
| 255 | - android:layout_width="70dp" | ||
| 256 | - android:layout_height="50dp" | ||
| 257 | - android:layout_gravity="center" | ||
| 258 | - android:layout_marginTop="-5dp" | ||
| 259 | - android:layout_marginBottom="-10dp" | ||
| 260 | - android:padding="0dp" | ||
| 261 | - android:scaleX="1.1" | ||
| 262 | - android:scaleY="0.8" /> | 256 | + android:layout_width="72dp" |
| 257 | + android:layout_height="33dp" | ||
| 258 | + android:layout_gravity="center" /> | ||
| 263 | 259 | ||
| 264 | <TextView | 260 | <TextView |
| 265 | android:layout_width="wrap_content" | 261 | android:layout_width="wrap_content" |
| 266 | android:layout_height="wrap_content" | 262 | android:layout_height="wrap_content" |
| 267 | android:layout_gravity="center" | 263 | android:layout_gravity="center" |
| 264 | + android:layout_marginBottom="5dp" | ||
| 268 | android:gravity="center" | 265 | android:gravity="center" |
| 269 | android:src="@drawable/bg_tips_bottom_center" | 266 | android:src="@drawable/bg_tips_bottom_center" |
| 270 | - android:text="" | ||
| 271 | android:textSize="12sp" /> | 267 | android:textSize="12sp" /> |
| 272 | </FrameLayout> | 268 | </FrameLayout> |
| 273 | 269 | ||
| @@ -280,8 +276,8 @@ | @@ -280,8 +276,8 @@ | ||
| 280 | android:focusable="true"> | 276 | android:focusable="true"> |
| 281 | 277 | ||
| 282 | <ImageView | 278 | <ImageView |
| 283 | - android:layout_width="35dp" | ||
| 284 | - android:layout_height="35dp" | 279 | + android:layout_width="17dp" |
| 280 | + android:layout_height="20dp" | ||
| 285 | android:layout_gravity="center" | 281 | android:layout_gravity="center" |
| 286 | android:layout_marginBottom="10dp" | 282 | android:layout_marginBottom="10dp" |
| 287 | android:background="@drawable/rt_training_button_resume" | 283 | android:background="@drawable/rt_training_button_resume" |
| @@ -308,23 +304,20 @@ | @@ -308,23 +304,20 @@ | ||
| 308 | android:id="@+id/fl_stop_tip" | 304 | android:id="@+id/fl_stop_tip" |
| 309 | android:layout_width="match_parent" | 305 | android:layout_width="match_parent" |
| 310 | android:layout_height="wrap_content" | 306 | android:layout_height="wrap_content" |
| 307 | + android:layout_marginTop="5dp" | ||
| 311 | android:visibility="invisible"> | 308 | android:visibility="invisible"> |
| 312 | 309 | ||
| 313 | <ImageView | 310 | <ImageView |
| 314 | - android:layout_width="70dp" | ||
| 315 | - android:layout_height="50dp" | 311 | + android:layout_width="72dp" |
| 312 | + android:layout_height="33dp" | ||
| 316 | android:layout_gravity="center" | 313 | android:layout_gravity="center" |
| 317 | - android:layout_marginTop="-5dp" | ||
| 318 | - android:layout_marginBottom="-10dp" | ||
| 319 | - android:background="@drawable/bg_tips_bottom_center" | ||
| 320 | - android:padding="0dp" | ||
| 321 | - android:scaleX="1.1" | ||
| 322 | - android:scaleY="0.8" /> | 314 | + android:background="@drawable/bg_tips_bottom_center" /> |
| 323 | 315 | ||
| 324 | <TextView | 316 | <TextView |
| 325 | android:layout_width="wrap_content" | 317 | android:layout_width="wrap_content" |
| 326 | android:layout_height="wrap_content" | 318 | android:layout_height="wrap_content" |
| 327 | android:layout_gravity="center" | 319 | android:layout_gravity="center" |
| 320 | + android:layout_marginBottom="3dp" | ||
| 328 | android:gravity="center" | 321 | android:gravity="center" |
| 329 | android:src="@drawable/bg_tips_bottom_center" | 322 | android:src="@drawable/bg_tips_bottom_center" |
| 330 | android:text="长按结束" | 323 | android:text="长按结束" |
| @@ -346,8 +339,8 @@ | @@ -346,8 +339,8 @@ | ||
| 346 | android:visibility="gone" /> | 339 | android:visibility="gone" /> |
| 347 | 340 | ||
| 348 | <ImageView | 341 | <ImageView |
| 349 | - android:layout_width="35dp" | ||
| 350 | - android:layout_height="35dp" | 342 | + android:layout_width="17dp" |
| 343 | + android:layout_height="17dp" | ||
| 351 | android:layout_gravity="center" | 344 | android:layout_gravity="center" |
| 352 | android:layout_marginBottom="10dp" | 345 | android:layout_marginBottom="10dp" |
| 353 | android:background="@drawable/rt_training_button_stop" | 346 | android:background="@drawable/rt_training_button_stop" |
| @@ -377,12 +370,12 @@ | @@ -377,12 +370,12 @@ | ||
| 377 | android:layout_width="85dp" | 370 | android:layout_width="85dp" |
| 378 | android:layout_height="85dp" | 371 | android:layout_height="85dp" |
| 379 | android:layout_marginBottom="12dp" | 372 | android:layout_marginBottom="12dp" |
| 380 | - android:background="@drawable/shape_gray_round" | 373 | + android:background="@drawable/shape_white_round" |
| 381 | android:focusable="true"> | 374 | android:focusable="true"> |
| 382 | 375 | ||
| 383 | <ImageView | 376 | <ImageView |
| 384 | - android:layout_width="35dp" | ||
| 385 | - android:layout_height="35dp" | 377 | + android:layout_width="15dp" |
| 378 | + android:layout_height="18dp" | ||
| 386 | android:layout_gravity="center" | 379 | android:layout_gravity="center" |
| 387 | android:layout_marginBottom="10dp" | 380 | android:layout_marginBottom="10dp" |
| 388 | android:background="@drawable/rt_training_button_pause" | 381 | android:background="@drawable/rt_training_button_pause" |
| @@ -408,7 +401,8 @@ | @@ -408,7 +401,8 @@ | ||
| 408 | android:layout_width="match_parent" | 401 | android:layout_width="match_parent" |
| 409 | android:layout_height="match_parent" | 402 | android:layout_height="match_parent" |
| 410 | android:background="@color/run_main_time_bg" | 403 | android:background="@color/run_main_time_bg" |
| 411 | - android:gravity="center"> | 404 | + android:gravity="center" |
| 405 | + android:visibility="visible"> | ||
| 412 | 406 | ||
| 413 | <TextView | 407 | <TextView |
| 414 | android:id="@+id/tv_time_count_down" | 408 | android:id="@+id/tv_time_count_down" |
moudle_pedometer/src/main/res/layout/fragment_run_race_detail.xml
| @@ -10,7 +10,7 @@ | @@ -10,7 +10,7 @@ | ||
| 10 | sothree:umanoDragView="@+id/dragView" | 10 | sothree:umanoDragView="@+id/dragView" |
| 11 | sothree:umanoFadeColor="@color/black_20" | 11 | sothree:umanoFadeColor="@color/black_20" |
| 12 | sothree:umanoOverlay="true" | 12 | sothree:umanoOverlay="true" |
| 13 | - sothree:umanoPanelHeight="142dp" | 13 | + sothree:umanoPanelHeight="141dp" |
| 14 | sothree:umanoParallaxOffset="250dp" | 14 | sothree:umanoParallaxOffset="250dp" |
| 15 | sothree:umanoScrollableView="@+id/scrollView" | 15 | sothree:umanoScrollableView="@+id/scrollView" |
| 16 | sothree:umanoShadowHeight="0dp"> | 16 | sothree:umanoShadowHeight="0dp"> |
| @@ -25,32 +25,22 @@ | @@ -25,32 +25,22 @@ | ||
| 25 | android:layout_width="match_parent" | 25 | android:layout_width="match_parent" |
| 26 | android:layout_height="match_parent"></com.baidu.mapapi.map.MapView> | 26 | android:layout_height="match_parent"></com.baidu.mapapi.map.MapView> |
| 27 | 27 | ||
| 28 | - <FrameLayout | ||
| 29 | - android:layout_width="40dp" | ||
| 30 | - android:layout_height="40dp" | 28 | + |
| 29 | + <ImageView | ||
| 30 | + android:id="@+id/iv_back" | ||
| 31 | + android:layout_width="35dp" | ||
| 32 | + android:layout_height="35dp" | ||
| 31 | android:layout_margin="10dp" | 33 | android:layout_margin="10dp" |
| 32 | - android:background="@drawable/shape_circle_50_black"> | ||
| 33 | - | ||
| 34 | - <ImageView | ||
| 35 | - android:layout_width="10dp" | ||
| 36 | - android:layout_height="20dp" | ||
| 37 | - android:layout_gravity="center" | ||
| 38 | - android:background="@drawable/ic_white_back" /> | ||
| 39 | - </FrameLayout> | ||
| 40 | - | ||
| 41 | - <FrameLayout | ||
| 42 | - android:layout_width="40dp" | ||
| 43 | - android:layout_height="40dp" | 34 | + android:background="@drawable/xqy_return" /> |
| 35 | + | ||
| 36 | + | ||
| 37 | + <ImageView | ||
| 38 | + android:id="@+id/iv_share" | ||
| 39 | + android:layout_width="35dp" | ||
| 40 | + android:layout_height="35dp" | ||
| 44 | android:layout_gravity="right" | 41 | android:layout_gravity="right" |
| 45 | android:layout_margin="10dp" | 42 | android:layout_margin="10dp" |
| 46 | - android:background="@drawable/shape_circle_50_black"> | ||
| 47 | - | ||
| 48 | - <ImageView | ||
| 49 | - android:layout_width="15dp" | ||
| 50 | - android:layout_height="15dp" | ||
| 51 | - android:layout_gravity="center" | ||
| 52 | - android:background="@drawable/icon_share" /> | ||
| 53 | - </FrameLayout> | 43 | + android:background="@drawable/xqt_share" /> |
| 54 | <!----> | 44 | <!----> |
| 55 | 45 | ||
| 56 | 46 | ||
| @@ -89,6 +79,11 @@ | @@ -89,6 +79,11 @@ | ||
| 89 | android:id="@+id/include_rank" | 79 | android:id="@+id/include_rank" |
| 90 | layout="@layout/layout_run_detail_rank" | 80 | layout="@layout/layout_run_detail_rank" |
| 91 | android:visibility="visible" /> | 81 | android:visibility="visible" /> |
| 82 | + <!----> | ||
| 83 | + <View | ||
| 84 | + android:layout_width="match_parent" | ||
| 85 | + android:layout_height="20dp" | ||
| 86 | + android:background="#F4F4F4" /> | ||
| 92 | <!--路线介绍--> | 87 | <!--路线介绍--> |
| 93 | <include | 88 | <include |
| 94 | android:id="@+id/include_street_introduce" | 89 | android:id="@+id/include_street_introduce" |
moudle_pedometer/src/main/res/layout/fragment_running_map.xml
| @@ -13,17 +13,17 @@ | @@ -13,17 +13,17 @@ | ||
| 13 | 13 | ||
| 14 | <FrameLayout | 14 | <FrameLayout |
| 15 | android:id="@+id/fl_back" | 15 | android:id="@+id/fl_back" |
| 16 | - android:layout_width="60dp" | ||
| 17 | - android:layout_height="60dp" | 16 | + android:layout_width="55dp" |
| 17 | + android:layout_height="55dp" | ||
| 18 | android:background="@drawable/button_fab_white" | 18 | android:background="@drawable/button_fab_white" |
| 19 | android:focusable="true"> | 19 | android:focusable="true"> |
| 20 | 20 | ||
| 21 | <ImageView | 21 | <ImageView |
| 22 | - android:layout_width="25dp" | ||
| 23 | - android:layout_height="25dp" | 22 | + android:layout_width="12dp" |
| 23 | + android:layout_height="20dp" | ||
| 24 | android:layout_gravity="center" | 24 | android:layout_gravity="center" |
| 25 | - android:layout_marginLeft="2dp" | ||
| 26 | - android:background="@drawable/mo_ic_dialog_back" | 25 | + android:layout_marginLeft="-2dp" |
| 26 | + android:background="@drawable/icon_back" | ||
| 27 | android:focusable="false" /> | 27 | android:focusable="false" /> |
| 28 | </FrameLayout> | 28 | </FrameLayout> |
| 29 | 29 | ||
| @@ -35,15 +35,15 @@ | @@ -35,15 +35,15 @@ | ||
| 35 | 35 | ||
| 36 | <FrameLayout | 36 | <FrameLayout |
| 37 | android:id="@+id/fl_location" | 37 | android:id="@+id/fl_location" |
| 38 | - android:layout_width="60dp" | ||
| 39 | - android:layout_height="60dp" | 38 | + android:layout_width="55dp" |
| 39 | + android:layout_height="55dp" | ||
| 40 | android:layout_marginBottom="20dp" | 40 | android:layout_marginBottom="20dp" |
| 41 | android:background="@drawable/button_fab_white" | 41 | android:background="@drawable/button_fab_white" |
| 42 | android:focusable="true"> | 42 | android:focusable="true"> |
| 43 | 43 | ||
| 44 | <ImageView | 44 | <ImageView |
| 45 | - android:layout_width="60dp" | ||
| 46 | - android:layout_height="60dp" | 45 | + android:layout_width="20dp" |
| 46 | + android:layout_height="20dp" | ||
| 47 | android:layout_gravity="center" | 47 | android:layout_gravity="center" |
| 48 | android:background="@drawable/rt_ic_location_blank" | 48 | android:background="@drawable/rt_ic_location_blank" |
| 49 | android:focusable="false" /> | 49 | android:focusable="false" /> |
moudle_pedometer/src/main/res/layout/layout_finish_running_route.xml
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 3 | - android:layout_width="match_parent" | ||
| 4 | - android:layout_height="match_parent" | ||
| 5 | - android:layout_margin="10dp" | ||
| 6 | - android:background="@drawable/shape_10dp_white_raduis_bg" | ||
| 7 | - android:orientation="vertical"> | ||
| 8 | - <!--跑步路线--> | ||
| 9 | - <LinearLayout | ||
| 10 | - android:layout_width="match_parent" | ||
| 11 | - android:layout_height="wrap_content" | ||
| 12 | - android:layout_marginTop="10dp" | ||
| 13 | - android:gravity="bottom"> | 2 | +<layout xmlns:android="http://schemas.android.com/apk/res/android"> |
| 14 | 3 | ||
| 15 | - <ImageView | ||
| 16 | - android:layout_width="30dp" | ||
| 17 | - android:layout_height="30dp" | ||
| 18 | - android:layout_marginLeft="10dp" | ||
| 19 | - android:background="@drawable/icon_run_route" /> | ||
| 20 | - | ||
| 21 | - <TextView | ||
| 22 | - android:layout_width="wrap_content" | ||
| 23 | - android:layout_height="wrap_content" | ||
| 24 | - android:layout_marginBottom="1dp" | ||
| 25 | - android:text="跑步路线" | ||
| 26 | - android:textColor="@color/black" | ||
| 27 | - android:textSize="12sp" /> | ||
| 28 | - </LinearLayout> | ||
| 29 | - <!--起点--> | ||
| 30 | <LinearLayout | 4 | <LinearLayout |
| 31 | android:layout_width="match_parent" | 5 | android:layout_width="match_parent" |
| 32 | android:layout_height="wrap_content" | 6 | android:layout_height="wrap_content" |
| 33 | - android:layout_marginTop="10dp" | ||
| 34 | - android:gravity="center_vertical"> | ||
| 35 | - | ||
| 36 | - <View | ||
| 37 | - android:layout_width="10dp" | ||
| 38 | - android:layout_height="10dp" | ||
| 39 | - android:layout_marginLeft="15dp" | ||
| 40 | - android:background="@drawable/shape_circle_green" /> | ||
| 41 | - | ||
| 42 | - <TextView | ||
| 43 | - android:layout_width="wrap_content" | ||
| 44 | - android:layout_height="wrap_content" | ||
| 45 | - android:layout_marginLeft="10dp" | ||
| 46 | - android:text="@string/layout_street_start_point" | ||
| 47 | - android:textColor="@color/text_gray" | ||
| 48 | - android:textSize="14sp" /> | ||
| 49 | - | ||
| 50 | - <TextView | ||
| 51 | - android:layout_width="wrap_content" | 7 | + android:layout_margin="10dp" |
| 8 | + android:background="@drawable/shape_10dp_white_raduis_bg" | ||
| 9 | + android:orientation="vertical"> | ||
| 10 | + <!--跑步路线--> | ||
| 11 | + <LinearLayout | ||
| 12 | + android:layout_width="match_parent" | ||
| 52 | android:layout_height="wrap_content" | 13 | android:layout_height="wrap_content" |
| 53 | - android:layout_marginLeft="10dp" | ||
| 54 | - android:text="首都师范大学操场东门" | ||
| 55 | - android:textColor="@color/black" | ||
| 56 | - android:textSize="15sp" /> | ||
| 57 | - </LinearLayout> | ||
| 58 | - <!--竖线--> | ||
| 59 | - <View | ||
| 60 | - android:layout_width="1dp" | ||
| 61 | - android:layout_height="30dp" | ||
| 62 | - android:layout_marginLeft="19dp" | ||
| 63 | - android:layout_marginTop="-3dp" | ||
| 64 | - android:background="@color/vertical_line" /> | ||
| 65 | - <!--终点--> | ||
| 66 | - <LinearLayout | ||
| 67 | - android:layout_width="match_parent" | ||
| 68 | - android:layout_height="wrap_content" | ||
| 69 | - android:layout_marginTop="-3dp" | ||
| 70 | - android:gravity="center_vertical"> | 14 | + android:layout_marginTop="10dp" |
| 15 | + android:gravity="bottom"> | ||
| 71 | 16 | ||
| 72 | - <View | ||
| 73 | - android:layout_width="10dp" | ||
| 74 | - android:layout_height="10dp" | ||
| 75 | - android:layout_marginLeft="15dp" | ||
| 76 | - android:background="@drawable/shape_circle_red" /> | 17 | + <ImageView |
| 18 | + android:layout_width="18dp" | ||
| 19 | + android:layout_height="18dp" | ||
| 20 | + android:layout_marginLeft="10dp" | ||
| 21 | + android:background="@drawable/icon_run_route" /> | ||
| 77 | 22 | ||
| 78 | - <TextView | ||
| 79 | - android:layout_width="wrap_content" | 23 | + <TextView |
| 24 | + android:layout_width="wrap_content" | ||
| 25 | + android:layout_height="match_parent" | ||
| 26 | + android:layout_marginLeft="5dp" | ||
| 27 | + android:layout_marginBottom="1dp" | ||
| 28 | + android:gravity="bottom" | ||
| 29 | + android:text="跑步路线" | ||
| 30 | + android:textColor="@color/text_black" | ||
| 31 | + android:textSize="12sp" /> | ||
| 32 | + </LinearLayout> | ||
| 33 | + <!--起点--> | ||
| 34 | + <LinearLayout | ||
| 35 | + android:layout_width="match_parent" | ||
| 80 | android:layout_height="wrap_content" | 36 | android:layout_height="wrap_content" |
| 81 | - android:layout_marginLeft="10dp" | ||
| 82 | - android:text="@string/layout_street_end_point" | ||
| 83 | - android:textColor="@color/text_gray" | ||
| 84 | - android:textSize="14sp" /> | 37 | + android:layout_marginTop="10dp" |
| 38 | + android:gravity="center_vertical"> | ||
| 85 | 39 | ||
| 86 | - <TextView | ||
| 87 | - android:layout_width="wrap_content" | ||
| 88 | - android:layout_height="wrap_content" | ||
| 89 | - android:layout_marginLeft="10dp" | ||
| 90 | - android:text="首都师范大学操场东门" | ||
| 91 | - android:textColor="@color/black" | ||
| 92 | - android:textSize="15sp" /> | ||
| 93 | - </LinearLayout> | ||
| 94 | - <!--竖线--> | ||
| 95 | - <View | ||
| 96 | - android:layout_width="1dp" | ||
| 97 | - android:layout_height="30dp" | ||
| 98 | - android:layout_marginLeft="19dp" | ||
| 99 | - android:layout_marginTop="-3dp" | ||
| 100 | - android:background="@color/vertical_line" /> | ||
| 101 | - <!--时间--> | ||
| 102 | - <LinearLayout | ||
| 103 | - android:layout_width="match_parent" | ||
| 104 | - android:layout_height="wrap_content" | ||
| 105 | - android:layout_marginTop="-17dp" | ||
| 106 | - android:gravity="center_vertical"> | 40 | + <View |
| 41 | + android:layout_width="6dp" | ||
| 42 | + android:layout_height="6dp" | ||
| 43 | + android:layout_marginLeft="15dp" | ||
| 44 | + android:background="@drawable/shape_circle_green" /> | ||
| 107 | 45 | ||
| 108 | - <View | ||
| 109 | - android:layout_width="7dp" | ||
| 110 | - android:layout_height="7dp" | ||
| 111 | - android:layout_marginLeft="16dp" | ||
| 112 | - android:background="@drawable/shape_circle_gray" /> | 46 | + <TextView |
| 47 | + android:layout_width="wrap_content" | ||
| 48 | + android:layout_height="wrap_content" | ||
| 49 | + android:layout_marginLeft="10dp" | ||
| 50 | + android:text="@string/layout_street_start_point" | ||
| 51 | + android:textColor="@color/text_gray" | ||
| 52 | + android:textSize="12sp" /> | ||
| 113 | 53 | ||
| 54 | + <TextView | ||
| 55 | + android:id="@+id/tv_start_point" | ||
| 56 | + android:layout_width="wrap_content" | ||
| 57 | + android:layout_height="wrap_content" | ||
| 58 | + android:layout_marginLeft="10dp" | ||
| 59 | + android:text="首都师范大学操场东门" | ||
| 60 | + android:textColor="@color/black" | ||
| 61 | + android:textSize="12sp" /> | ||
| 62 | + </LinearLayout> | ||
| 63 | + <!--竖线--> | ||
| 64 | + <View | ||
| 65 | + android:layout_width="1dp" | ||
| 66 | + android:layout_height="18dp" | ||
| 67 | + android:layout_marginLeft="17dp" | ||
| 68 | + android:layout_marginTop="-3dp" | ||
| 69 | + android:background="@color/vertical_line" /> | ||
| 70 | + <!--终点--> | ||
| 114 | <LinearLayout | 71 | <LinearLayout |
| 115 | android:layout_width="match_parent" | 72 | android:layout_width="match_parent" |
| 116 | android:layout_height="wrap_content" | 73 | android:layout_height="wrap_content" |
| 117 | - android:orientation="vertical"> | 74 | + android:layout_marginTop="-3dp" |
| 75 | + android:gravity="center_vertical"> | ||
| 76 | + | ||
| 77 | + <View | ||
| 78 | + android:layout_width="6dp" | ||
| 79 | + android:layout_height="6dp" | ||
| 80 | + android:layout_marginLeft="15dp" | ||
| 81 | + android:background="@drawable/shape_circle_red" /> | ||
| 118 | 82 | ||
| 119 | <TextView | 83 | <TextView |
| 120 | android:layout_width="wrap_content" | 84 | android:layout_width="wrap_content" |
| 121 | android:layout_height="wrap_content" | 85 | android:layout_height="wrap_content" |
| 122 | android:layout_marginLeft="10dp" | 86 | android:layout_marginLeft="10dp" |
| 123 | - android:text="00:27:23" | ||
| 124 | - android:textColor="@color/black" | ||
| 125 | - android:textSize="18sp" | ||
| 126 | - android:textStyle="bold" /> | 87 | + android:text="@string/layout_street_end_point" |
| 88 | + android:textColor="@color/text_gray" | ||
| 89 | + android:textSize="12sp" /> | ||
| 127 | 90 | ||
| 128 | <TextView | 91 | <TextView |
| 92 | + android:id="@+id/tv_end_point" | ||
| 129 | android:layout_width="wrap_content" | 93 | android:layout_width="wrap_content" |
| 130 | android:layout_height="wrap_content" | 94 | android:layout_height="wrap_content" |
| 131 | android:layout_marginLeft="10dp" | 95 | android:layout_marginLeft="10dp" |
| 132 | - android:text="跑步记录时长" | ||
| 133 | - android:textColor="@color/text_gray" | 96 | + android:text="首都师范大学操场东门" |
| 97 | + android:textColor="@color/black" | ||
| 134 | android:textSize="12sp" /> | 98 | android:textSize="12sp" /> |
| 135 | - <!----> | ||
| 136 | </LinearLayout> | 99 | </LinearLayout> |
| 137 | - </LinearLayout> | ||
| 138 | - <!--竖线--> | ||
| 139 | - <View | ||
| 140 | - android:layout_width="1dp" | ||
| 141 | - android:layout_height="30dp" | ||
| 142 | - android:layout_marginLeft="19dp" | ||
| 143 | - android:layout_marginTop="-15dp" | ||
| 144 | - android:background="@color/vertical_line" /> | ||
| 145 | - <!----> | ||
| 146 | - <LinearLayout | ||
| 147 | - android:layout_width="match_parent" | ||
| 148 | - android:layout_height="wrap_content" | ||
| 149 | - android:layout_marginTop="-5dp" | ||
| 150 | - android:layout_marginBottom="10dp" | ||
| 151 | - android:gravity="center_vertical"> | ||
| 152 | - | 100 | + <!--竖线--> |
| 153 | <View | 101 | <View |
| 154 | - android:layout_width="7dp" | ||
| 155 | - android:layout_height="7dp" | ||
| 156 | - android:layout_marginLeft="16dp" | ||
| 157 | - android:background="@drawable/shape_circle_gray" /> | 102 | + android:layout_width="1dp" |
| 103 | + android:layout_height="25dp" | ||
| 104 | + android:layout_marginLeft="17dp" | ||
| 105 | + android:layout_marginTop="-3dp" | ||
| 106 | + android:background="@color/vertical_line" /> | ||
| 107 | + <!--时间--> | ||
| 108 | + <LinearLayout | ||
| 109 | + android:layout_width="match_parent" | ||
| 110 | + android:layout_height="wrap_content" | ||
| 111 | + android:layout_marginTop="-15dp" | ||
| 112 | + android:gravity="center_vertical"> | ||
| 113 | + | ||
| 114 | + <View | ||
| 115 | + android:layout_width="4dp" | ||
| 116 | + android:layout_height="4dp" | ||
| 117 | + android:layout_marginLeft="16dp" | ||
| 118 | + android:background="@drawable/shape_circle_gray" /> | ||
| 119 | + | ||
| 120 | + <LinearLayout | ||
| 121 | + android:layout_width="match_parent" | ||
| 122 | + android:layout_height="wrap_content" | ||
| 123 | + android:orientation="vertical"> | ||
| 158 | 124 | ||
| 159 | - <TextView | ||
| 160 | - android:layout_width="wrap_content" | 125 | + <TextView |
| 126 | + android:id="@+id/tv_timer" | ||
| 127 | + android:layout_width="wrap_content" | ||
| 128 | + android:layout_height="wrap_content" | ||
| 129 | + android:layout_marginLeft="10dp" | ||
| 130 | + android:layout_marginTop="5dp" | ||
| 131 | + android:text="00:27:23" | ||
| 132 | + android:textColor="@color/text_black" | ||
| 133 | + android:textSize="18sp" | ||
| 134 | + android:textStyle="bold" /> | ||
| 135 | + | ||
| 136 | + <TextView | ||
| 137 | + android:layout_width="wrap_content" | ||
| 138 | + android:layout_height="wrap_content" | ||
| 139 | + android:layout_marginLeft="11dp" | ||
| 140 | + android:text="跑步记录时长" | ||
| 141 | + android:textColor="@color/text_gray" | ||
| 142 | + android:textSize="11sp" /> | ||
| 143 | + <!----> | ||
| 144 | + </LinearLayout> | ||
| 145 | + </LinearLayout> | ||
| 146 | + <!--竖线--> | ||
| 147 | + <View | ||
| 148 | + android:layout_width="1dp" | ||
| 149 | + android:layout_height="25dp" | ||
| 150 | + android:layout_marginLeft="17dp" | ||
| 151 | + android:layout_marginTop="-15dp" | ||
| 152 | + android:background="@color/vertical_line" /> | ||
| 153 | + <!----> | ||
| 154 | + <LinearLayout | ||
| 155 | + android:layout_width="match_parent" | ||
| 161 | android:layout_height="wrap_content" | 156 | android:layout_height="wrap_content" |
| 162 | - android:layout_marginLeft="10dp" | ||
| 163 | - android:text="路线完成" | ||
| 164 | - android:textColor="@color/black" | ||
| 165 | - android:textSize="15sp" | ||
| 166 | - android:textStyle="bold" /> | 157 | + android:layout_marginTop="-5dp" |
| 158 | + android:layout_marginBottom="10dp" | ||
| 159 | + android:gravity="center_vertical" | ||
| 160 | + android:paddingTop="5dp"> | ||
| 161 | + | ||
| 162 | + <View | ||
| 163 | + android:layout_width="4dp" | ||
| 164 | + android:layout_height="4dp" | ||
| 165 | + android:layout_marginLeft="16dp" | ||
| 166 | + android:background="@drawable/shape_circle_gray" /> | ||
| 167 | + | ||
| 168 | + <TextView | ||
| 169 | + android:layout_width="wrap_content" | ||
| 170 | + android:layout_height="wrap_content" | ||
| 171 | + android:layout_marginLeft="10dp" | ||
| 172 | + android:text="路线完成" | ||
| 173 | + android:textColor="@color/text_gray" | ||
| 174 | + android:textSize="11sp" /> | ||
| 175 | + </LinearLayout> | ||
| 176 | + <!----> | ||
| 167 | </LinearLayout> | 177 | </LinearLayout> |
| 168 | - <!----> | ||
| 169 | -</LinearLayout> | ||
| 170 | \ No newline at end of file | 178 | \ No newline at end of file |
| 179 | +</layout> | ||
| 171 | \ No newline at end of file | 180 | \ No newline at end of file |
moudle_pedometer/src/main/res/layout/layout_finish_step.xml
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 3 | - android:layout_width="match_parent" | ||
| 4 | - android:layout_height="80dp" | ||
| 5 | - android:layout_margin="10dp" | ||
| 6 | - android:background="@drawable/shape_10dp_white_raduis_bg" | ||
| 7 | - android:orientation="vertical"> | 2 | +<layout xmlns:android="http://schemas.android.com/apk/res/android"> |
| 8 | 3 | ||
| 9 | <LinearLayout | 4 | <LinearLayout |
| 10 | - android:layout_width="wrap_content" | ||
| 11 | - android:layout_height="wrap_content" | ||
| 12 | - android:layout_marginLeft="10dp" | ||
| 13 | - android:layout_marginTop="10dp" | ||
| 14 | - android:gravity="bottom"> | ||
| 15 | - | ||
| 16 | - <ImageView | ||
| 17 | - android:layout_width="25dp" | ||
| 18 | - android:layout_height="25dp" | ||
| 19 | - android:background="@drawable/icon_step" /> | 5 | + android:layout_width="match_parent" |
| 6 | + android:layout_height="80dp" | ||
| 7 | + android:layout_margin="10dp" | ||
| 8 | + android:background="@drawable/shape_10dp_white_raduis_bg" | ||
| 9 | + android:orientation="vertical"> | ||
| 20 | 10 | ||
| 21 | - <TextView | 11 | + <LinearLayout |
| 22 | android:layout_width="wrap_content" | 12 | android:layout_width="wrap_content" |
| 23 | android:layout_height="wrap_content" | 13 | android:layout_height="wrap_content" |
| 24 | android:layout_marginLeft="10dp" | 14 | android:layout_marginLeft="10dp" |
| 25 | - android:text="总步数" /> | ||
| 26 | - </LinearLayout> | ||
| 27 | - <!----> | ||
| 28 | - <LinearLayout | ||
| 29 | - android:layout_width="match_parent" | ||
| 30 | - android:layout_height="match_parent" | ||
| 31 | - android:paddingBottom="10dp" | ||
| 32 | - android:gravity="center"> | 15 | + android:layout_marginTop="10dp" |
| 16 | + android:gravity="bottom"> | ||
| 33 | 17 | ||
| 34 | - <TextView | ||
| 35 | - android:layout_width="wrap_content" | ||
| 36 | - android:layout_height="wrap_content" | ||
| 37 | - android:text="1233" | ||
| 38 | - android:textColor="@color/green_round" | ||
| 39 | - android:textSize="25sp" | ||
| 40 | - android:textStyle="bold" /> | 18 | + <ImageView |
| 19 | + android:layout_width="16dp" | ||
| 20 | + android:layout_height="18dp" | ||
| 21 | + android:background="@drawable/icon_step" /> | ||
| 41 | 22 | ||
| 42 | - <TextView | ||
| 43 | - android:layout_width="wrap_content" | ||
| 44 | - android:layout_height="wrap_content" | ||
| 45 | - android:layout_marginLeft="10dp" | ||
| 46 | - android:layout_marginTop="4dp" | ||
| 47 | - android:text="步" | ||
| 48 | - android:textColor="@color/black" | ||
| 49 | - android:textSize="12sp" | ||
| 50 | - android:textStyle="bold" /> | 23 | + <TextView |
| 24 | + android:layout_width="wrap_content" | ||
| 25 | + android:layout_height="wrap_content" | ||
| 26 | + android:layout_marginLeft="10dp" | ||
| 27 | + android:text="总步数" | ||
| 28 | + android:textSize="12sp" /> | ||
| 29 | + </LinearLayout> | ||
| 30 | + <!----> | ||
| 31 | + <LinearLayout | ||
| 32 | + android:layout_width="match_parent" | ||
| 33 | + android:layout_height="match_parent" | ||
| 34 | + android:gravity="center" | ||
| 35 | + android:paddingBottom="10dp"> | ||
| 36 | + | ||
| 37 | + <TextView | ||
| 38 | + android:id="@+id/tv_step" | ||
| 39 | + android:layout_width="wrap_content" | ||
| 40 | + android:layout_height="wrap_content" | ||
| 41 | + android:text="1233" | ||
| 42 | + android:textColor="@color/green_round" | ||
| 43 | + android:textSize="28sp" | ||
| 44 | + android:textStyle="bold" /> | ||
| 45 | + | ||
| 46 | + <TextView | ||
| 47 | + android:layout_width="wrap_content" | ||
| 48 | + android:layout_height="wrap_content" | ||
| 49 | + android:layout_marginLeft="10dp" | ||
| 50 | + android:layout_marginTop="4dp" | ||
| 51 | + android:text="步" | ||
| 52 | + android:textColor="@color/text_black" | ||
| 53 | + android:textSize="12sp" /> | ||
| 54 | + </LinearLayout> | ||
| 55 | + <!----> | ||
| 51 | </LinearLayout> | 56 | </LinearLayout> |
| 52 | - <!----> | ||
| 53 | -</LinearLayout> | ||
| 54 | \ No newline at end of file | 57 | \ No newline at end of file |
| 58 | +</layout> | ||
| 55 | \ No newline at end of file | 59 | \ No newline at end of file |
moudle_pedometer/src/main/res/layout/layout_finish_user_info.xml
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | -<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 3 | - xmlns:app="http://schemas.android.com/apk/res-auto" | ||
| 4 | - android:layout_width="match_parent" | ||
| 5 | - android:layout_height="match_parent" | ||
| 6 | - android:layout_margin="10dp"> | 2 | +<layout xmlns:android="http://schemas.android.com/apk/res/android"> |
| 7 | 3 | ||
| 8 | - <LinearLayout | 4 | + <FrameLayout xmlns:app="http://schemas.android.com/apk/res-auto" |
| 9 | android:layout_width="match_parent" | 5 | android:layout_width="match_parent" |
| 10 | - android:layout_height="170dp" | ||
| 11 | - android:layout_marginTop="30dp" | ||
| 12 | - android:background="@drawable/shape_10dp_white_raduis_bg" | ||
| 13 | - android:orientation="vertical"> | 6 | + android:layout_height="match_parent" |
| 7 | + android:layout_margin="10dp"> | ||
| 14 | 8 | ||
| 15 | - <TextView | ||
| 16 | - android:layout_width="wrap_content" | ||
| 17 | - android:layout_height="wrap_content" | ||
| 18 | - android:layout_marginLeft="80dp" | ||
| 19 | - android:layout_marginTop="10dp" | ||
| 20 | - android:text="用户昵称" | ||
| 21 | - android:textColor="@color/black" | ||
| 22 | - android:textSize="15sp" /> | ||
| 23 | - <!----> | ||
| 24 | <LinearLayout | 9 | <LinearLayout |
| 25 | android:layout_width="match_parent" | 10 | android:layout_width="match_parent" |
| 26 | - android:layout_height="wrap_content" | ||
| 27 | - android:gravity="center_vertical"> | 11 | + android:layout_height="170dp" |
| 12 | + android:layout_marginTop="30dp" | ||
| 13 | + android:background="@drawable/shape_10dp_white_raduis_bg" | ||
| 14 | + android:orientation="vertical"> | ||
| 28 | 15 | ||
| 29 | - <LinearLayout | ||
| 30 | - android:layout_width="0dp" | 16 | + <TextView |
| 17 | + android:id="@+id/tv_user_nickName" | ||
| 18 | + android:layout_width="wrap_content" | ||
| 31 | android:layout_height="wrap_content" | 19 | android:layout_height="wrap_content" |
| 32 | - android:layout_weight="1" | ||
| 33 | - android:orientation="vertical"> | ||
| 34 | - | ||
| 35 | - <TextView | ||
| 36 | - android:layout_width="wrap_content" | ||
| 37 | - android:layout_height="wrap_content" | ||
| 38 | - android:layout_marginLeft="15dp" | ||
| 39 | - android:layout_marginTop="15dp" | ||
| 40 | - android:text="奥森公园南路" | ||
| 41 | - android:textColor="@color/black" | ||
| 42 | - android:textSize="15sp" /> | ||
| 43 | - | ||
| 44 | - <TextView | ||
| 45 | - android:layout_width="wrap_content" | ||
| 46 | - android:layout_height="wrap_content" | ||
| 47 | - android:layout_marginLeft="15dp" | ||
| 48 | - android:layout_marginTop="5dp" | ||
| 49 | - android:text="2019/06/10 9:51" | ||
| 50 | - android:textColor="@color/text_gray" /> | ||
| 51 | - </LinearLayout> | 20 | + android:layout_marginLeft="80dp" |
| 21 | + android:layout_marginTop="10dp" | ||
| 22 | + android:text="用户昵称" | ||
| 23 | + android:textColor="@color/text_black" | ||
| 24 | + android:textSize="13sp" /> | ||
| 52 | <!----> | 25 | <!----> |
| 53 | <LinearLayout | 26 | <LinearLayout |
| 54 | - android:layout_width="0dp" | 27 | + android:layout_width="match_parent" |
| 55 | android:layout_height="wrap_content" | 28 | android:layout_height="wrap_content" |
| 56 | - android:layout_weight="1" | ||
| 57 | - android:gravity="right|bottom"> | 29 | + android:gravity="center_vertical"> |
| 58 | 30 | ||
| 59 | - <TextView | ||
| 60 | - android:layout_width="wrap_content" | 31 | + <LinearLayout |
| 32 | + android:layout_width="0dp" | ||
| 61 | android:layout_height="wrap_content" | 33 | android:layout_height="wrap_content" |
| 62 | - android:layout_marginRight="10dp" | ||
| 63 | - android:text="1.53" | ||
| 64 | - android:textColor="@color/black" | ||
| 65 | - android:textSize="35sp" | ||
| 66 | - android:textStyle="bold" /> | 34 | + android:layout_weight="1" |
| 35 | + android:orientation="vertical"> | ||
| 67 | 36 | ||
| 68 | - <TextView | ||
| 69 | - android:layout_width="wrap_content" | ||
| 70 | - android:layout_height="wrap_content" | ||
| 71 | - android:layout_marginRight="15dp" | ||
| 72 | - android:text="公里" | ||
| 73 | - android:textColor="@color/black" | ||
| 74 | - android:textSize="15sp" /> | ||
| 75 | - </LinearLayout> | ||
| 76 | - <!----> | ||
| 77 | - </LinearLayout> | ||
| 78 | - <!--横线--> | ||
| 79 | - <View | ||
| 80 | - android:layout_width="match_parent" | ||
| 81 | - android:layout_height="1dp" | ||
| 82 | - android:layout_marginTop="10dp" | ||
| 83 | - android:background="@color/line" /> | ||
| 84 | - <!--配速和用时--> | ||
| 85 | - <LinearLayout | ||
| 86 | - android:layout_width="match_parent" | ||
| 87 | - android:layout_height="wrap_content" | ||
| 88 | - android:layout_marginTop="10sp"> | ||
| 89 | - <!----> | ||
| 90 | - <LinearLayout | ||
| 91 | - android:layout_width="0dp" | ||
| 92 | - android:layout_height="wrap_content" | ||
| 93 | - android:layout_weight="1" | ||
| 94 | - android:gravity="center" | ||
| 95 | - android:orientation="vertical"> | 37 | + <TextView |
| 38 | + android:id="@+id/tv_street_name" | ||
| 39 | + android:layout_width="wrap_content" | ||
| 40 | + android:layout_height="wrap_content" | ||
| 41 | + android:layout_marginLeft="15dp" | ||
| 42 | + android:layout_marginTop="15dp" | ||
| 43 | + android:text="奥森公园南路" | ||
| 44 | + android:textColor="@color/text_black" | ||
| 45 | + android:textSize="15sp" /> | ||
| 96 | 46 | ||
| 97 | - <TextView | ||
| 98 | - android:layout_width="wrap_content" | 47 | + <TextView |
| 48 | + android:id="@+id/tv_date" | ||
| 49 | + android:layout_width="wrap_content" | ||
| 50 | + android:layout_height="wrap_content" | ||
| 51 | + android:layout_marginLeft="15dp" | ||
| 52 | + android:layout_marginTop="5dp" | ||
| 53 | + android:text="2019/06/10 9:51" | ||
| 54 | + android:textColor="@color/text_gray" | ||
| 55 | + android:textSize="10sp" /> | ||
| 56 | + </LinearLayout> | ||
| 57 | + <!----> | ||
| 58 | + <LinearLayout | ||
| 59 | + android:layout_width="0dp" | ||
| 99 | android:layout_height="wrap_content" | 60 | android:layout_height="wrap_content" |
| 100 | - android:text="34'33''" | ||
| 101 | - android:textColor="@color/black" | ||
| 102 | - android:textSize="20sp" | ||
| 103 | - android:textStyle="bold" /> | 61 | + android:layout_weight="1" |
| 62 | + android:gravity="right|bottom"> | ||
| 104 | 63 | ||
| 105 | - <TextView | ||
| 106 | - android:layout_width="wrap_content" | ||
| 107 | - android:layout_height="wrap_content" | ||
| 108 | - android:layout_marginTop="5dp" | ||
| 109 | - android:text="配速" | ||
| 110 | - android:textColor="@color/black" | ||
| 111 | - android:textSize="15sp" /> | 64 | + <TextView |
| 65 | + android:id="@+id/tv_distance" | ||
| 66 | + android:layout_width="wrap_content" | ||
| 67 | + android:layout_height="wrap_content" | ||
| 68 | + android:layout_marginRight="10dp" | ||
| 69 | + android:text="1.53" | ||
| 70 | + android:textColor="@color/text_black" | ||
| 71 | + android:textSize="45sp" | ||
| 72 | + android:textStyle="bold" /> | ||
| 73 | + | ||
| 74 | + <TextView | ||
| 75 | + android:layout_width="wrap_content" | ||
| 76 | + android:layout_height="wrap_content" | ||
| 77 | + android:layout_marginRight="15dp" | ||
| 78 | + android:text="公里" | ||
| 79 | + android:textColor="@color/text_black" | ||
| 80 | + android:textSize="15sp" /> | ||
| 81 | + </LinearLayout> | ||
| 82 | + <!----> | ||
| 112 | </LinearLayout> | 83 | </LinearLayout> |
| 113 | - <!----> | 84 | + <!--横线--> |
| 85 | + <View | ||
| 86 | + android:layout_width="match_parent" | ||
| 87 | + android:layout_height="1dp" | ||
| 88 | + android:layout_marginTop="10dp" | ||
| 89 | + android:background="@color/line" /> | ||
| 90 | + <!--配速和用时--> | ||
| 114 | <LinearLayout | 91 | <LinearLayout |
| 115 | - android:layout_width="0dp" | 92 | + android:layout_width="match_parent" |
| 116 | android:layout_height="wrap_content" | 93 | android:layout_height="wrap_content" |
| 117 | - android:layout_weight="1" | ||
| 118 | - android:gravity="center" | ||
| 119 | - android:orientation="vertical"> | ||
| 120 | - | ||
| 121 | - <TextView | ||
| 122 | - android:layout_width="wrap_content" | 94 | + android:layout_marginTop="10sp"> |
| 95 | + <!----> | ||
| 96 | + <LinearLayout | ||
| 97 | + android:layout_width="0dp" | ||
| 123 | android:layout_height="wrap_content" | 98 | android:layout_height="wrap_content" |
| 124 | - android:text="00:00:00" | ||
| 125 | - android:textColor="@color/black" | ||
| 126 | - android:textSize="20sp" | ||
| 127 | - android:textStyle="bold" /> | 99 | + android:layout_weight="1" |
| 100 | + android:gravity="center" | ||
| 101 | + android:orientation="vertical"> | ||
| 102 | + | ||
| 103 | + <TextView | ||
| 104 | + android:id="@+id/tv_speed" | ||
| 105 | + android:layout_width="wrap_content" | ||
| 106 | + android:layout_height="wrap_content" | ||
| 107 | + android:text="34'33''" | ||
| 108 | + android:textColor="@color/text_black" | ||
| 109 | + android:textSize="20sp" | ||
| 110 | + android:textStyle="bold" /> | ||
| 128 | 111 | ||
| 129 | - <TextView | ||
| 130 | - android:layout_width="wrap_content" | 112 | + <TextView |
| 113 | + android:layout_width="wrap_content" | ||
| 114 | + android:layout_height="wrap_content" | ||
| 115 | + android:layout_marginTop="5dp" | ||
| 116 | + android:text="配速" | ||
| 117 | + android:textColor="@color/text_black" | ||
| 118 | + android:textSize="15sp" /> | ||
| 119 | + </LinearLayout> | ||
| 120 | + <!----> | ||
| 121 | + <LinearLayout | ||
| 122 | + android:layout_width="0dp" | ||
| 131 | android:layout_height="wrap_content" | 123 | android:layout_height="wrap_content" |
| 132 | - android:layout_marginTop="5dp" | ||
| 133 | - android:text="用时" | ||
| 134 | - android:textColor="@color/black" | ||
| 135 | - android:textSize="15sp" /> | 124 | + android:layout_weight="1" |
| 125 | + android:gravity="center" | ||
| 126 | + android:orientation="vertical"> | ||
| 127 | + | ||
| 128 | + <TextView | ||
| 129 | + android:id="@+id/tv_timer" | ||
| 130 | + android:layout_width="wrap_content" | ||
| 131 | + android:layout_height="wrap_content" | ||
| 132 | + android:text="00:00:00" | ||
| 133 | + android:textColor="@color/text_black" | ||
| 134 | + android:textSize="20sp" | ||
| 135 | + android:textStyle="bold" /> | ||
| 136 | + | ||
| 137 | + <TextView | ||
| 138 | + android:layout_width="wrap_content" | ||
| 139 | + android:layout_height="wrap_content" | ||
| 140 | + android:layout_marginTop="5dp" | ||
| 141 | + android:text="用时" | ||
| 142 | + android:textColor="@color/text_black" | ||
| 143 | + android:textSize="15sp" /> | ||
| 144 | + </LinearLayout> | ||
| 145 | + <!----> | ||
| 136 | </LinearLayout> | 146 | </LinearLayout> |
| 137 | <!----> | 147 | <!----> |
| 138 | </LinearLayout> | 148 | </LinearLayout> |
| 139 | - <!----> | ||
| 140 | - </LinearLayout> | ||
| 141 | 149 | ||
| 142 | - <com.qmuiteam.qmui.widget.QMUIRadiusImageView | ||
| 143 | - android:id="@+id/qm_iv1" | ||
| 144 | - android:layout_width="60dp" | ||
| 145 | - android:layout_height="60dp" | ||
| 146 | - android:layout_marginLeft="10dp" | ||
| 147 | - android:background="@drawable/tc_ic_workout_level_adjust_coach" | ||
| 148 | - app:qmui_corner_radius="100dp" /> | ||
| 149 | -</FrameLayout> | ||
| 150 | \ No newline at end of file | 150 | \ No newline at end of file |
| 151 | + <com.qmuiteam.qmui.widget.QMUIRadiusImageView | ||
| 152 | + android:id="@+id/qm_iv_icon" | ||
| 153 | + android:layout_width="60dp" | ||
| 154 | + android:layout_height="60dp" | ||
| 155 | + android:layout_marginLeft="10dp" | ||
| 156 | + android:background="@drawable/tc_ic_workout_level_adjust_coach" | ||
| 157 | + app:qmui_corner_radius="100dp" /> | ||
| 158 | + </FrameLayout> | ||
| 159 | +</layout> | ||
| 151 | \ No newline at end of file | 160 | \ No newline at end of file |
moudle_pedometer/src/main/res/layout/layout_run_detail_person_score.xml
| @@ -6,12 +6,11 @@ | @@ -6,12 +6,11 @@ | ||
| 6 | <!--个人最佳成绩--> | 6 | <!--个人最佳成绩--> |
| 7 | <LinearLayout | 7 | <LinearLayout |
| 8 | android:layout_width="match_parent" | 8 | android:layout_width="match_parent" |
| 9 | - android:layout_height="150dp" | ||
| 10 | - android:layout_marginLeft="10dp" | ||
| 11 | - android:layout_marginTop="20dp" | ||
| 12 | - android:layout_marginRight="10dp" | ||
| 13 | - android:layout_marginBottom="10dp" | ||
| 14 | - android:background="@drawable/shape_10dp_white_raduis_bg" | 9 | + android:layout_height="180dp" |
| 10 | + android:layout_marginLeft="1dp" | ||
| 11 | + android:layout_marginRight="1dp" | ||
| 12 | + android:layout_marginBottom="5dp" | ||
| 13 | + android:background="@drawable/layer_shadow" | ||
| 15 | android:orientation="vertical"> | 14 | android:orientation="vertical"> |
| 16 | 15 | ||
| 17 | <LinearLayout | 16 | <LinearLayout |
| @@ -27,7 +26,7 @@ | @@ -27,7 +26,7 @@ | ||
| 27 | android:layout_marginLeft="10dp" | 26 | android:layout_marginLeft="10dp" |
| 28 | android:layout_weight="1" | 27 | android:layout_weight="1" |
| 29 | android:text="个人最佳成绩" | 28 | android:text="个人最佳成绩" |
| 30 | - android:textColor="@color/black" | 29 | + android:textColor="@color/text_black" |
| 31 | android:textSize="18sp" | 30 | android:textSize="18sp" |
| 32 | android:textStyle="bold" /> | 31 | android:textStyle="bold" /> |
| 33 | 32 | ||
| @@ -37,7 +36,7 @@ | @@ -37,7 +36,7 @@ | ||
| 37 | android:layout_height="wrap_content" | 36 | android:layout_height="wrap_content" |
| 38 | android:layout_marginRight="10dp" | 37 | android:layout_marginRight="10dp" |
| 39 | android:text="查看全部成绩 >" | 38 | android:text="查看全部成绩 >" |
| 40 | - android:textColor="@color/black" | 39 | + android:textColor="@color/text_black" |
| 41 | android:textSize="13sp" /> | 40 | android:textSize="13sp" /> |
| 42 | </LinearLayout> | 41 | </LinearLayout> |
| 43 | <!----> | 42 | <!----> |
| @@ -58,7 +57,7 @@ | @@ -58,7 +57,7 @@ | ||
| 58 | android:layout_marginLeft="15dp" | 57 | android:layout_marginLeft="15dp" |
| 59 | android:text="1.53" | 58 | android:text="1.53" |
| 60 | android:textColor="@color/black" | 59 | android:textColor="@color/black" |
| 61 | - android:textSize="25sp" | 60 | + android:textSize="30sp" |
| 62 | android:textStyle="bold" /> | 61 | android:textStyle="bold" /> |
| 63 | 62 | ||
| 64 | <TextView | 63 | <TextView |
| @@ -66,8 +65,8 @@ | @@ -66,8 +65,8 @@ | ||
| 66 | android:layout_height="wrap_content" | 65 | android:layout_height="wrap_content" |
| 67 | android:layout_marginLeft="5dp" | 66 | android:layout_marginLeft="5dp" |
| 68 | android:text="公里" | 67 | android:text="公里" |
| 69 | - android:textColor="@color/text_gray" | ||
| 70 | - android:textSize="15sp" /> | 68 | + android:textColor="@color/text_black" |
| 69 | + android:textSize="12sp" /> | ||
| 71 | </LinearLayout> | 70 | </LinearLayout> |
| 72 | </LinearLayout> | 71 | </LinearLayout> |
| 73 | 72 | ||
| @@ -88,15 +87,15 @@ | @@ -88,15 +87,15 @@ | ||
| 88 | android:layout_width="wrap_content" | 87 | android:layout_width="wrap_content" |
| 89 | android:layout_height="wrap_content" | 88 | android:layout_height="wrap_content" |
| 90 | android:text="步数" | 89 | android:text="步数" |
| 91 | - android:textColor="@color/text_gray" | ||
| 92 | - android:textSize="15sp" /> | 90 | + android:textColor="@color/text_black" |
| 91 | + android:textSize="12sp" /> | ||
| 93 | 92 | ||
| 94 | <TextView | 93 | <TextView |
| 95 | android:layout_width="wrap_content" | 94 | android:layout_width="wrap_content" |
| 96 | android:layout_height="wrap_content" | 95 | android:layout_height="wrap_content" |
| 97 | android:layout_marginTop="5dp" | 96 | android:layout_marginTop="5dp" |
| 98 | android:text="1234" | 97 | android:text="1234" |
| 99 | - android:textColor="@color/black" | 98 | + android:textColor="@color/text_black" |
| 100 | android:textSize="20sp" | 99 | android:textSize="20sp" |
| 101 | android:textStyle="bold" /> | 100 | android:textStyle="bold" /> |
| 102 | 101 | ||
| @@ -113,10 +112,9 @@ | @@ -113,10 +112,9 @@ | ||
| 113 | <TextView | 112 | <TextView |
| 114 | android:layout_width="wrap_content" | 113 | android:layout_width="wrap_content" |
| 115 | android:layout_height="wrap_content" | 114 | android:layout_height="wrap_content" |
| 116 | - | ||
| 117 | android:text="用时" | 115 | android:text="用时" |
| 118 | - android:textColor="@color/text_gray" | ||
| 119 | - android:textSize="15sp" /> | 116 | + android:textColor="@color/text_black" |
| 117 | + android:textSize="12sp" /> | ||
| 120 | 118 | ||
| 121 | <TextView | 119 | <TextView |
| 122 | android:layout_width="wrap_content" | 120 | android:layout_width="wrap_content" |
| @@ -141,15 +139,15 @@ | @@ -141,15 +139,15 @@ | ||
| 141 | android:layout_width="wrap_content" | 139 | android:layout_width="wrap_content" |
| 142 | android:layout_height="wrap_content" | 140 | android:layout_height="wrap_content" |
| 143 | android:text="配速" | 141 | android:text="配速" |
| 144 | - android:textColor="@color/text_gray" | ||
| 145 | - android:textSize="15sp" /> | 142 | + android:textColor="@color/text_black" |
| 143 | + android:textSize="12sp" /> | ||
| 146 | 144 | ||
| 147 | <TextView | 145 | <TextView |
| 148 | android:layout_width="wrap_content" | 146 | android:layout_width="wrap_content" |
| 149 | android:layout_height="wrap_content" | 147 | android:layout_height="wrap_content" |
| 150 | android:layout_marginTop="5dp" | 148 | android:layout_marginTop="5dp" |
| 151 | android:text="22'22''" | 149 | android:text="22'22''" |
| 152 | - android:textColor="@color/black" | 150 | + android:textColor="@color/text_black" |
| 153 | android:textSize="20sp" | 151 | android:textSize="20sp" |
| 154 | android:textStyle="bold" /> | 152 | android:textStyle="bold" /> |
| 155 | 153 |