Commit f0088f9c7ca5b15038fecdce422a1ab5c12872bc

Authored by 韩亚云
2 parents 375a509b 654f65fb

Merge branch 'master' of bj.gitlab.cnlive.com:cnlive-team/ModulePedometer

Showing 25 changed files with 453 additions and 360 deletions
.idea/gradle.xml
@@ -3,20 +3,14 @@ @@ -3,20 +3,14 @@
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>  
9 <option name="distributionType" value="DEFAULT_WRAPPED" /> 6 <option name="distributionType" value="DEFAULT_WRAPPED" />
10 <option name="externalProjectPath" value="$PROJECT_DIR$" /> 7 <option name="externalProjectPath" value="$PROJECT_DIR$" />
11 <option name="modules"> 8 <option name="modules">
12 <set> 9 <set>
13 <option value="$PROJECT_DIR$" /> 10 <option value="$PROJECT_DIR$" />
14 <option value="$PROJECT_DIR$/app" /> 11 <option value="$PROJECT_DIR$/app" />
15 - <option value="$PROJECT_DIR$/app_user" />  
16 - <option value="$PROJECT_DIR$/lib_network" />  
17 <option value="$PROJECT_DIR$/library_baidumap" /> 12 <option value="$PROJECT_DIR$/library_baidumap" />
18 <option value="$PROJECT_DIR$/moudle_pedometer" /> 13 <option value="$PROJECT_DIR$/moudle_pedometer" />
19 - <option value="$PROJECT_DIR$/share" />  
20 </set> 14 </set>
21 </option> 15 </option>
22 <option name="resolveModulePerSourceSet" value="false" /> 16 <option name="resolveModulePerSourceSet" value="false" />
moudle_pedometer/build.gradle
@@ -109,5 +109,7 @@ dependencies { @@ -109,5 +109,7 @@ dependencies {
109 implementation 'com.sothree.slidinguppanel:library:3.4.0' 109 implementation 'com.sothree.slidinguppanel:library:3.4.0'
110 110
111 implementation project(':library_baidumap') 111 implementation project(':library_baidumap')
  112 + //加载动画
  113 + implementation 'com.wang.avi:library:2.1.3'
112 114
113 } 115 }
moudle_pedometer/proguard-rules.pro
@@ -19,3 +19,6 @@ @@ -19,3 +19,6 @@
19 # If you keep the line number information, uncomment this to 19 # If you keep the line number information, uncomment this to
20 # hide the original source file name. 20 # hide the original source file name.
21 #-renamesourcefileattribute SourceFile 21 #-renamesourcefileattribute SourceFile
  22 +#加载动画
  23 +-keep class com.wang.avi.** { *; }
  24 +-keep class com.wang.avi.indicators.** { *; }
22 \ No newline at end of file 25 \ No newline at end of file
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/ui/fragment/CollRunRaceDetailFragment.java
@@ -5,6 +5,7 @@ import android.hardware.Sensor; @@ -5,6 +5,7 @@ import android.hardware.Sensor;
5 import android.hardware.SensorManager; 5 import android.hardware.SensorManager;
6 import android.os.Bundle; 6 import android.os.Bundle;
7 import android.support.annotation.Nullable; 7 import android.support.annotation.Nullable;
  8 +import android.util.Log;
8 import android.view.View; 9 import android.view.View;
9 import android.widget.Button; 10 import android.widget.Button;
10 11
@@ -28,7 +29,7 @@ import static android.content.Context.SENSOR_SERVICE; @@ -28,7 +29,7 @@ import static android.content.Context.SENSOR_SERVICE;
28 * @author ShinnyYang 29 * @author ShinnyYang
29 */ 30 */
30 public class CollRunRaceDetailFragment extends QMUIFragment<CollRunRaceDetailFragmentView, CollRunRaceDetailFragmentPresenter, FragmentCollectRunRaceDetailBinding> { 31 public class CollRunRaceDetailFragment extends QMUIFragment<CollRunRaceDetailFragmentView, CollRunRaceDetailFragmentPresenter, FragmentCollectRunRaceDetailBinding> {
31 - private static final String TAG = "CollRunRaceDetailFragment"; 32 + private static final String TAG = "CollRunRaceDetail";
32 private SensorManager mSensorManager; 33 private SensorManager mSensorManager;
33 34
34 @Override 35 @Override
@@ -55,6 +56,7 @@ public class CollRunRaceDetailFragment extends QMUIFragment&lt;CollRunRaceDetailFra @@ -55,6 +56,7 @@ public class CollRunRaceDetailFragment extends QMUIFragment&lt;CollRunRaceDetailFra
55 @Override 56 @Override
56 public void onClick(View view) { 57 public void onClick(View view) {
57 //todo 自己测试用 58 //todo 自己测试用
  59 + getActivity().finish();
58 getActivity().startActivity(new Intent(getActivity(), RunLineActivity.class)); 60 getActivity().startActivity(new Intent(getActivity(), RunLineActivity.class));
59 } 61 }
60 }); 62 });
@@ -108,6 +110,7 @@ public class CollRunRaceDetailFragment extends QMUIFragment&lt;CollRunRaceDetailFra @@ -108,6 +110,7 @@ public class CollRunRaceDetailFragment extends QMUIFragment&lt;CollRunRaceDetailFra
108 @Override 110 @Override
109 public void onDestroy() { 111 public void onDestroy() {
110 super.onDestroy(); 112 super.onDestroy();
  113 +
111 if (getMvpView() != null) { 114 if (getMvpView() != null) {
112 getMvpView().onDestroy(); 115 getMvpView().onDestroy();
113 } 116 }
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/ui/fragment/StartTraceFragment.java
@@ -4,6 +4,7 @@ import android.hardware.Sensor; @@ -4,6 +4,7 @@ import android.hardware.Sensor;
4 import android.hardware.SensorManager; 4 import android.hardware.SensorManager;
5 import android.os.Bundle; 5 import android.os.Bundle;
6 import android.support.annotation.Nullable; 6 import android.support.annotation.Nullable;
  7 +import android.util.Log;
7 import android.view.View; 8 import android.view.View;
8 9
9 import com.cnlive.libs.base.ui.QMUIFragment; 10 import com.cnlive.libs.base.ui.QMUIFragment;
@@ -15,6 +16,7 @@ import com.example.moudle_pedometer.databinding.FragmentStartCollectTraceBinding @@ -15,6 +16,7 @@ import com.example.moudle_pedometer.databinding.FragmentStartCollectTraceBinding
15 import static android.content.Context.SENSOR_SERVICE; 16 import static android.content.Context.SENSOR_SERVICE;
16 17
17 public class StartTraceFragment extends QMUIFragment<StartTraceFragmentView, StartTraceFragmentPresenter, FragmentStartCollectTraceBinding> { 18 public class StartTraceFragment extends QMUIFragment<StartTraceFragmentView, StartTraceFragmentPresenter, FragmentStartCollectTraceBinding> {
  19 + private static final String TAG = "StartTraceFragment";
18 private SensorManager mSensorManager; 20 private SensorManager mSensorManager;
19 21
20 @Override 22 @Override
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/commonInfo/CommonInfo.java
@@ -143,6 +143,10 @@ public class CommonInfo { @@ -143,6 +143,10 @@ public class CommonInfo {
143 MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("writeUserStep"); 143 MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("writeUserStep");
144 MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("stepStartTime"); 144 MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("stepStartTime");
145 MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("runStepService"); 145 MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("runStepService");
  146 + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("stepStartTime");
  147 + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("KeepAliveService");
  148 + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("RunBaiduTraceService");
  149 + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("streetId");
146 150
147 } 151 }
148 152
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/presenter/RunningMapFragmentPresenter.java
@@ -228,7 +228,11 @@ public class RunningMapFragmentPresenter extends MvpBasePresenter&lt;RunningMapFrag @@ -228,7 +228,11 @@ public class RunningMapFragmentPresenter extends MvpBasePresenter&lt;RunningMapFrag
228 queryHistoryTrace(context, entityName, startTime, endTime); 228 queryHistoryTrace(context, entityName, startTime, endTime);
229 } else { 229 } else {
230 if (getView() != null) { 230 if (getView() != null) {
231 - 231 + if (trackPoints.size() == 1) {
  232 + getView().setHistoryLastPoint(trackPoints.get(0));
  233 + } else if (trackPoints.size() > 1) {
  234 + getView().setHistoryLastPoint(trackPoints.get(trackPoints.size() - 1));
  235 + }
232 //开始比较(杨帅的思路) 236 //开始比较(杨帅的思路)
233 // for (int i = 0; i < trackPoints.size(); i++) { 237 // for (int i = 0; i < trackPoints.size(); i++) {
234 // if (matchIndex < importPoints.size() - 1) { 238 // if (matchIndex < importPoints.size() - 1) {
@@ -262,9 +266,9 @@ public class RunningMapFragmentPresenter extends MvpBasePresenter&lt;RunningMapFrag @@ -262,9 +266,9 @@ public class RunningMapFragmentPresenter extends MvpBasePresenter&lt;RunningMapFrag
262 LatLng importLatLng = importPoints.get(i); 266 LatLng importLatLng = importPoints.get(i);
263 for (int j = index; j < trackPoints.size(); j++) { 267 for (int j = index; j < trackPoints.size(); j++) {
264 double distance = DistanceUtil.getDistance(importLatLng, trackPoints.get(j)); 268 double distance = DistanceUtil.getDistance(importLatLng, trackPoints.get(j));
265 - if (distance<100){  
266 - importHash.put(i,true);  
267 - index=j; 269 + if (distance < 50) {
  270 + importHash.put(i, true);
  271 + index = j;
268 } 272 }
269 } 273 }
270 } 274 }
@@ -284,6 +288,7 @@ public class RunningMapFragmentPresenter extends MvpBasePresenter&lt;RunningMapFrag @@ -284,6 +288,7 @@ public class RunningMapFragmentPresenter extends MvpBasePresenter&lt;RunningMapFrag
284 } 288 }
285 Log.e(TAG, "结果: " + result); 289 Log.e(TAG, "结果: " + result);
286 Log.e(TAG, "onHistoryTrackCallback: 轨迹点:" + trackPoints.size() + ",详情" + GsonUtil.GsonString(trackPoints)); 290 Log.e(TAG, "onHistoryTrackCallback: 轨迹点:" + trackPoints.size() + ",详情" + GsonUtil.GsonString(trackPoints));
  291 +
287 MyMapUtil.drawHistoryTrack(context, getView().baiduMap, trackPoints, SortType.asc, R.color.red, R.drawable.icon_start, R.drawable.icon_end); 292 MyMapUtil.drawHistoryTrack(context, getView().baiduMap, trackPoints, SortType.asc, R.color.red, R.drawable.icon_start, R.drawable.icon_end);
288 // MyMapUtil.drawMapLineRoutePoint(context, getView().baiduMap, MyMapUtil.optimizePoints(routePoints), R.color.red); 293 // MyMapUtil.drawMapLineRoutePoint(context, getView().baiduMap, MyMapUtil.optimizePoints(routePoints), R.color.red);
289 } 294 }
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RunMainFragmentView.java
@@ -25,6 +25,7 @@ import com.cnlive.moudle.pedometer.model.RunningFinishBean; @@ -25,6 +25,7 @@ import com.cnlive.moudle.pedometer.model.RunningFinishBean;
25 import com.cnlive.moudle.pedometer.model.RunningMapBean; 25 import com.cnlive.moudle.pedometer.model.RunningMapBean;
26 import com.cnlive.moudle.pedometer.model.Constant; 26 import com.cnlive.moudle.pedometer.model.Constant;
27 import com.cnlive.moudle.pedometer.model.MessageEvent; 27 import com.cnlive.moudle.pedometer.model.MessageEvent;
  28 +import com.cnlive.moudle.pedometer.service.KeepLiveService;
28 import com.cnlive.moudle.pedometer.service.StepService; 29 import com.cnlive.moudle.pedometer.service.StepService;
29 import com.cnlive.moudle.pedometer.sql.entity.UserStepEntity; 30 import com.cnlive.moudle.pedometer.sql.entity.UserStepEntity;
30 import com.cnlive.moudle.pedometer.ui.activity.RunRaceDetailActivity; 31 import com.cnlive.moudle.pedometer.ui.activity.RunRaceDetailActivity;
@@ -236,6 +237,7 @@ public class RunMainFragmentView implements MvpView { @@ -236,6 +237,7 @@ public class RunMainFragmentView implements MvpView {
236 public void onClick(View view) { 237 public void onClick(View view) {
237 //继续记录轨迹 238 //继续记录轨迹
238 if (StepService.mClient != null && StepService.traceListener != null) { 239 if (StepService.mClient != null && StepService.traceListener != null) {
  240 + CommonInfo.setTsRunBaiduTraceService(getContext(), true);
239 StepService.mClient.startTrace(StepService.mTrace, StepService.traceListener); 241 StepService.mClient.startTrace(StepService.mTrace, StepService.traceListener);
240 } 242 }
241 needWriteDataFlag = true; 243 needWriteDataFlag = true;
@@ -301,6 +303,7 @@ public class RunMainFragmentView implements MvpView { @@ -301,6 +303,7 @@ public class RunMainFragmentView implements MvpView {
301 SelectDialog selectDialog = new SelectDialog(fragment.getActivity(), "确定结束运动吗?", "确定", new SelectDialog.DialogInterface() { 303 SelectDialog selectDialog = new SelectDialog(fragment.getActivity(), "确定结束运动吗?", "确定", new SelectDialog.DialogInterface() {
302 @Override 304 @Override
303 public void onClick(SelectDialog dialog) { 305 public void onClick(SelectDialog dialog) {
  306 + CommonInfo.setIsRunKeepAliveService(getContext(), false);
304 CommonInfo.setIsWriteUserStep(getContext(), false); 307 CommonInfo.setIsWriteUserStep(getContext(), false);
305 fragment.binding.cpCurrent.setVisibility(View.GONE); 308 fragment.binding.cpCurrent.setVisibility(View.GONE);
306 ButtonAnimUtil.setViewDefault(fragment.binding.flStop); 309 ButtonAnimUtil.setViewDefault(fragment.binding.flStop);
@@ -374,6 +377,7 @@ public class RunMainFragmentView implements MvpView { @@ -374,6 +377,7 @@ public class RunMainFragmentView implements MvpView {
374 public void onClick(View view) { 377 public void onClick(View view) {
375 //暂停轨迹记录 378 //暂停轨迹记录
376 if (StepService.mClient != null && StepService.traceListener != null) { 379 if (StepService.mClient != null && StepService.traceListener != null) {
  380 + CommonInfo.setTsRunBaiduTraceService(getContext(), false);
377 StepService.mClient.stopGather(StepService.traceListener); 381 StepService.mClient.stopGather(StepService.traceListener);
378 } 382 }
379 //将当前计时器时间戳写入数据库 383 //将当前计时器时间戳写入数据库
@@ -457,8 +461,11 @@ public class RunMainFragmentView implements MvpView { @@ -457,8 +461,11 @@ public class RunMainFragmentView implements MvpView {
457 if (CommonInfo.getStepStartTime(context) == 0) { 461 if (CommonInfo.getStepStartTime(context) == 0) {
458 CommonInfo.setStepStartTime(context, TimeUtil.getNowTimeStamp()); 462 CommonInfo.setStepStartTime(context, TimeUtil.getNowTimeStamp());
459 } 463 }
460 - Intent intent = new Intent(fragment.getActivity(), StepService.class);  
461 - intent.putExtra("userId", userId); 464 + CommonInfo.setIsRunKeepAliveService(context, true);
  465 + CommonInfo.setIsRunStepService(context, true);
  466 + CommonInfo.setTsRunBaiduTraceService(context, true);
  467 + CommonInfo.setIsWriteUserStep(context, true);
  468 + Intent intent = new Intent(fragment.getActivity(), KeepLiveService.class);
462 ContextCompat.startForegroundService(fragment.getActivity(), intent); 469 ContextCompat.startForegroundService(fragment.getActivity(), intent);
463 470
464 } 471 }
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RunRaceDetailFragmentView.java
@@ -141,7 +141,7 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { @@ -141,7 +141,7 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener {
141 //隐藏空视图 141 //隐藏空视图
142 fragment.binding.emptyLayout.setVisibility(View.GONE); 142 fragment.binding.emptyLayout.setVisibility(View.GONE);
143 //显示立即报名按钮 143 //显示立即报名按钮
144 - fragment.binding.includeStreet.rlStartBtn.setVisibility(View.VISIBLE); 144 +// fragment.binding.includeStreet.rlStartBtn.setVisibility(View.VISIBLE);
145 //设置底部卡片第一次可滑动的位置 145 //设置底部卡片第一次可滑动的位置
146 fragment.binding.slidingLayout.setAnchorPoint(0.6f); 146 fragment.binding.slidingLayout.setAnchorPoint(0.6f);
147 fragment.binding.slidingLayout.addPanelSlideListener(new SlidingUpPanelLayout.PanelSlideListener() { 147 fragment.binding.slidingLayout.addPanelSlideListener(new SlidingUpPanelLayout.PanelSlideListener() {
@@ -170,18 +170,18 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { @@ -170,18 +170,18 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener {
170 170
171 } 171 }
172 172
173 - if (slideOffset == 0) {  
174 - //在初始位置  
175 - if (fragment.binding.includeStreet.rlStartBtn.getVisibility() == View.GONE) {  
176 - fragment.binding.includeStreet.rlStartBtn.setVisibility(View.VISIBLE);  
177 - }  
178 -  
179 - } else {  
180 - //用户进行滑动  
181 - if (fragment.binding.includeStreet.rlStartBtn.getVisibility() == View.VISIBLE) {  
182 - fragment.binding.includeStreet.rlStartBtn.setVisibility(View.GONE);  
183 - }  
184 - } 173 +// if (slideOffset == 0) {
  174 +// //在初始位置
  175 +// if (fragment.binding.includeStreet.rlStartBtn.getVisibility() == View.GONE) {
  176 +// fragment.binding.includeStreet.rlStartBtn.setVisibility(View.VISIBLE);
  177 +// }
  178 +//
  179 +// } else {
  180 +// //用户进行滑动
  181 +// if (fragment.binding.includeStreet.rlStartBtn.getVisibility() == View.VISIBLE) {
  182 +// fragment.binding.includeStreet.rlStartBtn.setVisibility(View.GONE);
  183 +// }
  184 +// }
185 } 185 }
186 186
187 @Override 187 @Override
@@ -244,7 +244,7 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { @@ -244,7 +244,7 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener {
244 } 244 }
245 245
246 //判断是否显示个人排行榜 246 //判断是否显示个人排行榜
247 - if (!TextUtils.isEmpty(runRaceDetailInfo.getUserMileage())) { 247 + if (runRaceDetailInfo.isIndividualAchievement()) {
248 //显示 248 //显示
249 fragment.binding.includePersonScore.llPersonScoreRoot.setVisibility(View.VISIBLE); 249 fragment.binding.includePersonScore.llPersonScoreRoot.setVisibility(View.VISIBLE);
250 //设置完成人数 250 //设置完成人数
@@ -272,7 +272,7 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { @@ -272,7 +272,7 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener {
272 fragment.binding.includePersonScore.llPersonScoreRoot.setVisibility(View.GONE); 272 fragment.binding.includePersonScore.llPersonScoreRoot.setVisibility(View.GONE);
273 } 273 }
274 //设置是否显示排行榜 274 //设置是否显示排行榜
275 - if (!TextUtils.isEmpty(runRaceDetailInfo.getFirstFaceUrl())) { 275 + if (runRaceDetailInfo.isRanking()) {
276 fragment.binding.includeRank.llRankRoot.setVisibility(View.VISIBLE); 276 fragment.binding.includeRank.llRankRoot.setVisibility(View.VISIBLE);
277 //设置第一名头像 277 //设置第一名头像
278 GlideApp.with(getContext()).load(runRaceDetailInfo.getFirstFaceUrl()).into(fragment.binding.includeRank.ivFirstPersonUrl); 278 GlideApp.with(getContext()).load(runRaceDetailInfo.getFirstFaceUrl()).into(fragment.binding.includeRank.ivFirstPersonUrl);
@@ -299,53 +299,64 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { @@ -299,53 +299,64 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener {
299 GlideApp.with(getContext()).load(runRaceDetailInfo.getRoadmap()).into(fragment.binding.includeStreetIntroduce.ivRoadMao); 299 GlideApp.with(getContext()).load(runRaceDetailInfo.getRoadmap()).into(fragment.binding.includeStreetIntroduce.ivRoadMao);
300 300
301 } 301 }
302 - //开始按钮点击事件(未滑动)  
303 - fragment.binding.includeStreet.rlStartBtn.setOnClickListener(new View.OnClickListener() {  
304 - @Override  
305 - public void onClick(View view) {  
306 - if (fragment.getActivity() == null) {  
307 - return;  
308 - }  
309 - //立即报名  
310 - if ("0".equals(fragment.binding.includeStreet.rlStartBtn.getTag())) {  
311 - fragment.binding.includeStreet.rlStartBtn.setTag("1");  
312 - fragment.binding.includeStreet.tvRunNow.setText(getContext().getResources().getString(R.string.run_race_btn_start_now));  
313 - fragment.binding.includeStreet.tvGoTip.setVisibility(View.VISIBLE); 302 + //判断用户是否报名
  303 + if (runRaceDetailInfo.isSignResult()){
  304 + fragment.binding.rlScrollViewStartBtn.setTag("1");
  305 + fragment.binding.tvRunNow.setText("现在开始");
  306 + fragment.binding.tvGoTip.setVisibility(View.VISIBLE);
  307 + }else {
  308 + fragment.binding.rlScrollViewStartBtn.setTag("0");
  309 + fragment.binding.tvRunNow.setText("立即报名");
  310 + fragment.binding.tvGoTip.setVisibility(View.GONE);
  311 + }
314 312
315 - //设置滑动  
316 - fragment.binding.rlScrollViewStartBtn.setTag("1");  
317 - fragment.binding.tvRunNow.setText(getContext().getResources().getString(R.string.run_race_btn_start_now));  
318 - fragment.binding.tvGoTip.setVisibility(View.VISIBLE);  
319 - RegistrationInfoActivity.newInstance(fragment.getActivity(), 1001);  
320 - } else {  
321 - //计算当前位置与起点坐标距离  
322 - if (firstLatLng != null && trackPoints != null && trackPoints.size() > 0) {  
323 - double distance = DistanceUtil.getDistance(firstLatLng, trackPoints.get(0));  
324 - if (distance < 20) {  
325 - //开始运动  
326 - fragment.binding.includeStreet.rlStartBtn.setTag("0");  
327 - fragment.binding.includeStreet.tvRunNow.setText(getContext().getResources().getString(R.string.run_race_btn_sign_up));  
328 - fragment.binding.includeStreet.tvGoTip.setVisibility(View.GONE);  
329 - fragment.getActivity().startActivity(new Intent(getContext(), PedometerMainActivity.class));  
330 - //设置滑动  
331 - fragment.binding.rlScrollViewStartBtn.setTag("0");  
332 - fragment.binding.tvRunNow.setText(getContext().getResources().getString(R.string.run_race_btn_sign_up));  
333 - fragment.binding.tvGoTip.setVisibility(View.GONE);  
334 - } else {  
335 - TipDialog tipDialog = new TipDialog(getContext(), getContext().getResources().getString(R.string.run_race_far_tip), "我知道了", R.color.green_round, new TipDialog.DialogInterface() {  
336 - @Override  
337 - public void onClick(TipDialog dialog) {  
338 - dialog.dismiss();  
339 - }  
340 - });  
341 - tipDialog.show();  
342 - tipDialog.setCancelable(false);  
343 - tipDialog.setCanceledOnTouchOutside(false);  
344 - }  
345 - }  
346 - }  
347 - }  
348 - }); 313 +// //开始按钮点击事件(未滑动)
  314 +// fragment.binding.includeStreet.rlStartBtn.setOnClickListener(new View.OnClickListener() {
  315 +// @Override
  316 +// public void onClick(View view) {
  317 +// if (fragment.getActivity() == null) {
  318 +// return;
  319 +// }
  320 +// //立即报名
  321 +// if ("0".equals(fragment.binding.includeStreet.rlStartBtn.getTag())) {
  322 +// fragment.binding.includeStreet.rlStartBtn.setTag("1");
  323 +// fragment.binding.includeStreet.tvRunNow.setText(getContext().getResources().getString(R.string.run_race_btn_start_now));
  324 +// fragment.binding.includeStreet.tvGoTip.setVisibility(View.VISIBLE);
  325 +//
  326 +// //设置滑动
  327 +// fragment.binding.rlScrollViewStartBtn.setTag("1");
  328 +// fragment.binding.tvRunNow.setText(getContext().getResources().getString(R.string.run_race_btn_start_now));
  329 +// fragment.binding.tvGoTip.setVisibility(View.VISIBLE);
  330 +// RegistrationInfoActivity.newInstance(fragment.getActivity(), 1001);
  331 +// } else {
  332 +// //计算当前位置与起点坐标距离
  333 +// if (firstLatLng != null && trackPoints != null && trackPoints.size() > 0) {
  334 +// double distance = DistanceUtil.getDistance(firstLatLng, trackPoints.get(0));
  335 +// if (distance < 20) {
  336 +// //开始运动
  337 +// fragment.binding.includeStreet.rlStartBtn.setTag("0");
  338 +// fragment.binding.includeStreet.tvRunNow.setText(getContext().getResources().getString(R.string.run_race_btn_sign_up));
  339 +// fragment.binding.includeStreet.tvGoTip.setVisibility(View.GONE);
  340 +// fragment.getActivity().startActivity(new Intent(getContext(), PedometerMainActivity.class));
  341 +// //设置滑动
  342 +// fragment.binding.rlScrollViewStartBtn.setTag("0");
  343 +// fragment.binding.tvRunNow.setText(getContext().getResources().getString(R.string.run_race_btn_sign_up));
  344 +// fragment.binding.tvGoTip.setVisibility(View.GONE);
  345 +// } else {
  346 +// TipDialog tipDialog = new TipDialog(getContext(), getContext().getResources().getString(R.string.run_race_far_tip), "我知道了", R.color.green_round, new TipDialog.DialogInterface() {
  347 +// @Override
  348 +// public void onClick(TipDialog dialog) {
  349 +// dialog.dismiss();
  350 +// }
  351 +// });
  352 +// tipDialog.show();
  353 +// tipDialog.setCancelable(false);
  354 +// tipDialog.setCanceledOnTouchOutside(false);
  355 +// }
  356 +// }
  357 +// }
  358 +// }
  359 +// });
349 //开始按钮点击事件(用户进行滑动滑动) 360 //开始按钮点击事件(用户进行滑动滑动)
350 fragment.binding.rlScrollViewStartBtn.setOnClickListener(new View.OnClickListener() { 361 fragment.binding.rlScrollViewStartBtn.setOnClickListener(new View.OnClickListener() {
351 @Override 362 @Override
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RunningMapFragmentView.java
@@ -441,6 +441,21 @@ public class RunningMapFragmentView implements MvpView, SensorEventListener { @@ -441,6 +441,21 @@ public class RunningMapFragmentView implements MvpView, SensorEventListener {
441 441
442 } 442 }
443 443
  444 + /**
  445 + * 设置从历史轨迹中查询到的最新点
  446 + *
  447 + * @param lastPoint
  448 + */
  449 + public void setHistoryLastPoint(LatLng lastPoint) {
  450 + if (currentPoints != null) {
  451 + currentPoints.clear();
  452 + currentPoints.add(lastPoint);
  453 + } else {
  454 + currentPoints = new ArrayList<>();
  455 + currentPoints.add(lastPoint);
  456 + }
  457 + }
  458 +
444 459
445 public void onResume() { 460 public void onResume() {
446 if (mMapView != null) { 461 if (mMapView != null) {
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/net/bean/RunRaceDetailInfo.java
@@ -17,6 +17,9 @@ public class RunRaceDetailInfo { @@ -17,6 +17,9 @@ public class RunRaceDetailInfo {
17 * endLocation : 首都师范大学操场西门 17 * endLocation : 首都师范大学操场西门
18 * end_time : 1571140800000 18 * end_time : 1571140800000
19 * eventType : 徒步 19 * eventType : 徒步
  20 + * ranking : true
  21 + * individualAchievement : true
  22 + * signResult : false
20 * faceUrl : ["http://yweb0.cnliveimg.com/images/headImg/2019/0505/1557039035723_small.jpg","http://yweb0.cnliveimg.com/images/headImg/2019/0505/1557034319038_small.jpg","http://yweb0.cnliveimg.com/images/headImg/2018/0902/1535858459612_small.jpg"] 23 * faceUrl : ["http://yweb0.cnliveimg.com/images/headImg/2019/0505/1557039035723_small.jpg","http://yweb0.cnliveimg.com/images/headImg/2019/0505/1557034319038_small.jpg","http://yweb0.cnliveimg.com/images/headImg/2018/0902/1535858459612_small.jpg"]
21 * finishFaceUrl : ["http://yweb0.cnliveimg.com/images/headImg/2019/0505/1557039035723_small.jpg","http://yweb0.cnliveimg.com/images/headImg/2019/0523/1558599016203_small.jpg","http://yweb0.cnliveimg.com/images/headImg/2019/0523/1558599016203_small.jpg","http://yweb0.cnliveimg.com/images/headImg/2019/0523/1558599016203_small.jpg","http://yweb0.cnliveimg.com/images/headImg/2019/0523/1558599016203_small.jpg"] 24 * finishFaceUrl : ["http://yweb0.cnliveimg.com/images/headImg/2019/0505/1557039035723_small.jpg","http://yweb0.cnliveimg.com/images/headImg/2019/0523/1558599016203_small.jpg","http://yweb0.cnliveimg.com/images/headImg/2019/0523/1558599016203_small.jpg","http://yweb0.cnliveimg.com/images/headImg/2019/0523/1558599016203_small.jpg","http://yweb0.cnliveimg.com/images/headImg/2019/0523/1558599016203_small.jpg"]
22 * finishNum : 33 25 * finishNum : 33
@@ -44,6 +47,9 @@ public class RunRaceDetailInfo { @@ -44,6 +47,9 @@ public class RunRaceDetailInfo {
44 private String endLocation; 47 private String endLocation;
45 private long end_time; 48 private long end_time;
46 private String eventType; 49 private String eventType;
  50 + private boolean ranking;
  51 + private boolean individualAchievement;
  52 + private boolean signResult;
47 private String finishNum; 53 private String finishNum;
48 private String firstEmployTime; 54 private String firstEmployTime;
49 private String firstFaceUrl; 55 private String firstFaceUrl;
@@ -112,6 +118,30 @@ public class RunRaceDetailInfo { @@ -112,6 +118,30 @@ public class RunRaceDetailInfo {
112 this.eventType = eventType; 118 this.eventType = eventType;
113 } 119 }
114 120
  121 + public boolean isRanking() {
  122 + return ranking;
  123 + }
  124 +
  125 + public void setRanking(boolean ranking) {
  126 + this.ranking = ranking;
  127 + }
  128 +
  129 + public boolean isIndividualAchievement() {
  130 + return individualAchievement;
  131 + }
  132 +
  133 + public void setIndividualAchievement(boolean individualAchievement) {
  134 + this.individualAchievement = individualAchievement;
  135 + }
  136 +
  137 + public boolean isSignResult() {
  138 + return signResult;
  139 + }
  140 +
  141 + public void setSignResult(boolean signResult) {
  142 + this.signResult = signResult;
  143 + }
  144 +
115 public String getFinishNum() { 145 public String getFinishNum() {
116 return finishNum; 146 return finishNum;
117 } 147 }
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/service/KeepLiveService.java
@@ -64,9 +64,6 @@ public class KeepLiveService extends Service implements MediaPlayer.OnCompletion @@ -64,9 +64,6 @@ public class KeepLiveService extends Service implements MediaPlayer.OnCompletion
64 public void onCreate() { 64 public void onCreate() {
65 super.onCreate(); 65 super.onCreate();
66 instance = this; 66 instance = this;
67 -// if (!ServiceUtils.isServiceRunning(getApplicationContext(), "com.cnlive.moudle.pedometer.service.StepService")) {  
68 -// startService(new Intent(getApplicationContext(), StepService.class));  
69 -// }  
70 init(); 67 init();
71 initBroadCastReceiver(); 68 initBroadCastReceiver();
72 handler = new Handler(); 69 handler = new Handler();
@@ -78,13 +75,13 @@ public class KeepLiveService extends Service implements MediaPlayer.OnCompletion @@ -78,13 +75,13 @@ public class KeepLiveService extends Service implements MediaPlayer.OnCompletion
78 if (isRun) { 75 if (isRun) {
79 handler.postDelayed(this, 5000); 76 handler.postDelayed(this, 5000);
80 } else { 77 } else {
81 -// try {  
82 -// if (myReceiver != null) {  
83 -// unregisterReceiver(myReceiver);  
84 -// }  
85 -// } catch (Exception e) {  
86 -// Log.e(TAG, "run: ");  
87 -// } 78 + try {
  79 + if (myReceiver != null) {
  80 + unregisterReceiver(myReceiver);
  81 + }
  82 + } catch (Exception e) {
  83 + Log.e(TAG, "run: ");
  84 + }
88 stopPlaySong(); 85 stopPlaySong();
89 stopForeground(true); 86 stopForeground(true);
90 } 87 }
@@ -94,11 +91,6 @@ public class KeepLiveService extends Service implements MediaPlayer.OnCompletion @@ -94,11 +91,6 @@ public class KeepLiveService extends Service implements MediaPlayer.OnCompletion
94 91
95 } 92 }
96 93
97 - @Override  
98 - public void onTaskRemoved(Intent rootIntent) {  
99 - super.onTaskRemoved(rootIntent);  
100 - Log.e("onTaskRemoved", "onTaskRemoved");  
101 - }  
102 94
103 /** 95 /**
104 * 初始化广播 96 * 初始化广播
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/service/StepService.java
@@ -48,6 +48,7 @@ import com.cnlive.moudle.pedometer.sql.entity.UserStepEntity; @@ -48,6 +48,7 @@ import com.cnlive.moudle.pedometer.sql.entity.UserStepEntity;
48 import com.cnlive.moudle.pedometer.ui.activity.PedometerMainActivity; 48 import com.cnlive.moudle.pedometer.ui.activity.PedometerMainActivity;
49 import com.cnlive.moudle.pedometer.utils.MySpHelper; 49 import com.cnlive.moudle.pedometer.utils.MySpHelper;
50 import com.cnlive.moudle.pedometer.utils.ServiceUtils; 50 import com.cnlive.moudle.pedometer.utils.ServiceUtils;
  51 +import com.cnlive.moudle.pedometer.utils.TimeUtil;
51 import com.example.moudle_pedometer.R; 52 import com.example.moudle_pedometer.R;
52 53
53 import org.greenrobot.eventbus.EventBus; 54 import org.greenrobot.eventbus.EventBus;
@@ -168,9 +169,7 @@ public class StepService extends Service implements SensorEventListener { @@ -168,9 +169,7 @@ public class StepService extends Service implements SensorEventListener {
168 public void onCreate() { 169 public void onCreate() {
169 super.onCreate(); 170 super.onCreate();
170 init(); 171 init();
171 - showStartForegroundNotification();  
172 initBroadcastReceiver(); 172 initBroadcastReceiver();
173 - CommonInfo.setIsRunKeepAliveService(getApplicationContext(), true);  
174 if (!ServiceUtils.isServiceRunning(getApplicationContext(), "com.cnlive.moudle.pedometer.service.KeepLiveService")) { 173 if (!ServiceUtils.isServiceRunning(getApplicationContext(), "com.cnlive.moudle.pedometer.service.KeepLiveService")) {
175 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { 174 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
176 startForegroundService(new Intent(getApplicationContext(), KeepLiveService.class)); 175 startForegroundService(new Intent(getApplicationContext(), KeepLiveService.class));
@@ -178,6 +177,7 @@ public class StepService extends Service implements SensorEventListener { @@ -178,6 +177,7 @@ public class StepService extends Service implements SensorEventListener {
178 startService(new Intent(getApplicationContext(), KeepLiveService.class)); 177 startService(new Intent(getApplicationContext(), KeepLiveService.class));
179 } 178 }
180 } 179 }
  180 + showStartForegroundNotification();
181 } 181 }
182 182
183 private void initTrace() { 183 private void initTrace() {
@@ -281,8 +281,6 @@ public class StepService extends Service implements SensorEventListener { @@ -281,8 +281,6 @@ public class StepService extends Service implements SensorEventListener {
281 public void onStartGatherCallback(int errorNo, String message) { 281 public void onStartGatherCallback(int errorNo, String message) {
282 if (StatusCodes.SUCCESS == errorNo || StatusCodes.GATHER_STARTED == errorNo) { 282 if (StatusCodes.SUCCESS == errorNo || StatusCodes.GATHER_STARTED == errorNo) {
283 Toast.makeText(getApplicationContext(), "开始采集", Toast.LENGTH_LONG).show(); 283 Toast.makeText(getApplicationContext(), "开始采集", Toast.LENGTH_LONG).show();
284 - CommonInfo.setTsRunBaiduTraceService(getApplicationContext(), true);  
285 -  
286 } 284 }
287 } 285 }
288 286
@@ -302,7 +300,6 @@ public class StepService extends Service implements SensorEventListener { @@ -302,7 +300,6 @@ public class StepService extends Service implements SensorEventListener {
302 Toast.makeText(getApplicationContext(), "停止采集", Toast.LENGTH_LONG).show(); 300 Toast.makeText(getApplicationContext(), "停止采集", Toast.LENGTH_LONG).show();
303 if (mClient != null) { 301 if (mClient != null) {
304 mClient.stopTrace(mTrace, traceListener); 302 mClient.stopTrace(mTrace, traceListener);
305 - CommonInfo.setTsRunBaiduTraceService(getApplicationContext(), false);  
306 } 303 }
307 } 304 }
308 } 305 }
@@ -353,7 +350,7 @@ public class StepService extends Service implements SensorEventListener { @@ -353,7 +350,7 @@ public class StepService extends Service implements SensorEventListener {
353 mClient.startTrace(mTrace, traceListener); 350 mClient.startTrace(mTrace, traceListener);
354 long stepStartTime = CommonInfo.getStepStartTime(getApplicationContext()); 351 long stepStartTime = CommonInfo.getStepStartTime(getApplicationContext());
355 if (stepStartTime == 0) { 352 if (stepStartTime == 0) {
356 - CommonInfo.getStepStartTime(getApplicationContext()); 353 + CommonInfo.setStepStartTime(getApplicationContext(), TimeUtil.getCurrentTime());
357 } 354 }
358 } 355 }
359 356
@@ -372,7 +369,7 @@ public class StepService extends Service implements SensorEventListener { @@ -372,7 +369,7 @@ public class StepService extends Service implements SensorEventListener {
372 if (!EventBus.getDefault().isRegistered(this)) { 369 if (!EventBus.getDefault().isRegistered(this)) {
373 EventBus.getDefault().register(this); 370 EventBus.getDefault().register(this);
374 } 371 }
375 - CommonInfo.setIsWriteUserStep(getApplicationContext(), true); 372 +
376 entityName = userId; 373 entityName = userId;
377 initTodayData(userId); 374 initTodayData(userId);
378 initTrace(); 375 initTrace();
@@ -449,7 +446,7 @@ public class StepService extends Service implements SensorEventListener { @@ -449,7 +446,7 @@ public class StepService extends Service implements SensorEventListener {
449 .setSmallIcon(R.mipmap.ic_launcher) 446 .setSmallIcon(R.mipmap.ic_launcher)
450 // .setCustomContentView(remoteViews) 447 // .setCustomContentView(remoteViews)
451 .setContentTitle(getResources().getString(R.string.app_name)) 448 .setContentTitle(getResources().getString(R.string.app_name))
452 - .setContentText("正在记录的运动") 449 + .setContentText("正在记录的运动")
453 .setCategory(Notification.CATEGORY_SERVICE) 450 .setCategory(Notification.CATEGORY_SERVICE)
454 .setSound(null) 451 .setSound(null)
455 .setWhen(System.currentTimeMillis()) 452 .setWhen(System.currentTimeMillis())
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/activity/PedometerMainActivity.java
@@ -22,6 +22,7 @@ import com.baidu.mapapi.CoordType; @@ -22,6 +22,7 @@ import com.baidu.mapapi.CoordType;
22 import com.baidu.mapapi.SDKInitializer; 22 import com.baidu.mapapi.SDKInitializer;
23 import com.cnlive.libs.base.ui.QMUIFragment; 23 import com.cnlive.libs.base.ui.QMUIFragment;
24 import com.cnlive.libs.base.ui.QMUIFragmentActivity; 24 import com.cnlive.libs.base.ui.QMUIFragmentActivity;
  25 +import com.cnlive.libs.base.util.StatusBarUtil;
25 import com.cnlive.libs.base.util.StatusBarUtil2; 26 import com.cnlive.libs.base.util.StatusBarUtil2;
26 import com.cnlive.moudle.pedometer.ui.fragment.RunMainFragment; 27 import com.cnlive.moudle.pedometer.ui.fragment.RunMainFragment;
27 import com.cnlive.moudle.pedometer.utils.MyMapUtil; 28 import com.cnlive.moudle.pedometer.utils.MyMapUtil;
@@ -53,7 +54,6 @@ public class PedometerMainActivity extends QMUIFragmentActivity { @@ -53,7 +54,6 @@ public class PedometerMainActivity extends QMUIFragmentActivity {
53 @Override 54 @Override
54 protected void onCreate(Bundle savedInstanceState) { 55 protected void onCreate(Bundle savedInstanceState) {
55 super.onCreate(savedInstanceState); 56 super.onCreate(savedInstanceState);
56 - StatusBarUtil2.setColor(this, getResources().getColor(R.color.run_main_bg), 0);  
57 // setContentView(R.layout.activity_pedometer_main); 57 // setContentView(R.layout.activity_pedometer_main);
58 58
59 } 59 }
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/activity/RunRaceDetailActivity.java
@@ -14,6 +14,7 @@ import com.baidu.mapapi.CoordType; @@ -14,6 +14,7 @@ import com.baidu.mapapi.CoordType;
14 import com.baidu.mapapi.SDKInitializer; 14 import com.baidu.mapapi.SDKInitializer;
15 import com.cnlive.libs.base.ui.QMUIFragment; 15 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.StatusBarUtil;
17 import com.cnlive.libs.base.util.StatusBarUtil2; 18 import com.cnlive.libs.base.util.StatusBarUtil2;
18 import com.cnlive.moudle.pedometer.commonInfo.CommonInfo; 19 import com.cnlive.moudle.pedometer.commonInfo.CommonInfo;
19 import com.cnlive.moudle.pedometer.model.RunningMapBean; 20 import com.cnlive.moudle.pedometer.model.RunningMapBean;
@@ -52,7 +53,6 @@ public class RunRaceDetailActivity extends QMUIFragmentActivity { @@ -52,7 +53,6 @@ public class RunRaceDetailActivity extends QMUIFragmentActivity {
52 @Override 53 @Override
53 protected void onCreate(Bundle savedInstanceState) { 54 protected void onCreate(Bundle savedInstanceState) {
54 super.onCreate(savedInstanceState); 55 super.onCreate(savedInstanceState);
55 - StatusBarUtil2.setColor(this, getResources().getColor(R.color.run_main_bg), 0);  
56 //判断用户是否结束运动 56 //判断用户是否结束运动
57 boolean isRunStep = CommonInfo.getIsRunStepService(this); 57 boolean isRunStep = CommonInfo.getIsRunStepService(this);
58 //没有找到相关记录 58 //没有找到相关记录
@@ -86,8 +86,8 @@ public class RunRaceDetailActivity extends QMUIFragmentActivity { @@ -86,8 +86,8 @@ public class RunRaceDetailActivity extends QMUIFragmentActivity {
86 @Override 86 @Override
87 public void onBackPressed() { 87 public void onBackPressed() {
88 super.onBackPressed(); 88 super.onBackPressed();
89 - if (fragment != null) {  
90 - if (fragment instanceof RunMainFragment) { 89 + if (getCurrentFragment()!=null) {
  90 + if (getCurrentFragment() instanceof RunMainFragment) {
91 return; 91 return;
92 } 92 }
93 } 93 }
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/fragment/RunMainFragment.java
@@ -8,6 +8,7 @@ import android.util.Log; @@ -8,6 +8,7 @@ import android.util.Log;
8 import android.view.View; 8 import android.view.View;
9 9
10 import com.cnlive.libs.base.ui.QMUIFragment; 10 import com.cnlive.libs.base.ui.QMUIFragment;
  11 +import com.cnlive.libs.base.util.StatusBarUtil;
11 import com.cnlive.libs.base.util.StatusBarUtil2; 12 import com.cnlive.libs.base.util.StatusBarUtil2;
12 import com.cnlive.moudle.pedometer.frame.presenter.RunMainFragmentPresenter; 13 import com.cnlive.moudle.pedometer.frame.presenter.RunMainFragmentPresenter;
13 import com.cnlive.moudle.pedometer.frame.view.RunMainFragmentView; 14 import com.cnlive.moudle.pedometer.frame.view.RunMainFragmentView;
@@ -17,6 +18,7 @@ import com.cnlive.moudle.pedometer.sql.entity.UserStepEntity; @@ -17,6 +18,7 @@ import com.cnlive.moudle.pedometer.sql.entity.UserStepEntity;
17 import com.cnlive.moudle.pedometer.utils.StepUtil; 18 import com.cnlive.moudle.pedometer.utils.StepUtil;
18 import com.example.moudle_pedometer.R; 19 import com.example.moudle_pedometer.R;
19 import com.example.moudle_pedometer.databinding.FragmentRunMainBinding; 20 import com.example.moudle_pedometer.databinding.FragmentRunMainBinding;
  21 +import com.qmuiteam.qmui.util.QMUIStatusBarHelper;
20 22
21 import org.greenrobot.eventbus.EventBus; 23 import org.greenrobot.eventbus.EventBus;
22 import org.greenrobot.eventbus.Subscribe; 24 import org.greenrobot.eventbus.Subscribe;
@@ -29,6 +31,8 @@ public class RunMainFragment extends QMUIFragment&lt;RunMainFragmentView, RunMainFr @@ -29,6 +31,8 @@ public class RunMainFragment extends QMUIFragment&lt;RunMainFragmentView, RunMainFr
29 @Override 31 @Override
30 public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { 32 public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
31 super.onViewCreated(view, savedInstanceState); 33 super.onViewCreated(view, savedInstanceState);
  34 + QMUIStatusBarHelper.setStatusBarDarkMode(getActivity());
  35 + StatusBarUtil2.setColor(getActivity(), getResources().getColor(R.color.run_main_bg), 0);
32 EventBus.getDefault().register(this); 36 EventBus.getDefault().register(this);
33 if (getMvpView() != null) { 37 if (getMvpView() != null) {
34 new Handler().postDelayed(new Runnable() { 38 new Handler().postDelayed(new Runnable() {
@@ -103,6 +107,7 @@ public class RunMainFragment extends QMUIFragment&lt;RunMainFragmentView, RunMainFr @@ -103,6 +107,7 @@ public class RunMainFragment extends QMUIFragment&lt;RunMainFragmentView, RunMainFr
103 } 107 }
104 } 108 }
105 } 109 }
  110 +
106 /** 111 /**
107 * 屏蔽边缘返回 112 * 屏蔽边缘返回
108 * 杨帅 113 * 杨帅
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/fragment/RunRaceDetailFragment.java
@@ -14,6 +14,7 @@ import android.widget.FrameLayout; @@ -14,6 +14,7 @@ import android.widget.FrameLayout;
14 import android.widget.LinearLayout; 14 import android.widget.LinearLayout;
15 15
16 import com.cnlive.libs.base.ui.QMUIFragment; 16 import com.cnlive.libs.base.ui.QMUIFragment;
  17 +import com.cnlive.libs.base.util.StatusBarUtil2;
17 import com.cnlive.moudle.pedometer.commonInfo.CommonInfo; 18 import com.cnlive.moudle.pedometer.commonInfo.CommonInfo;
18 import com.cnlive.moudle.pedometer.frame.presenter.RunRaceDetailFragmentPresenter; 19 import com.cnlive.moudle.pedometer.frame.presenter.RunRaceDetailFragmentPresenter;
19 import com.cnlive.moudle.pedometer.frame.view.RunRaceDetailFragmentView; 20 import com.cnlive.moudle.pedometer.frame.view.RunRaceDetailFragmentView;
@@ -24,6 +25,7 @@ import com.cnlive.moudle.pedometer.utils.ScreenUtil; @@ -24,6 +25,7 @@ import com.cnlive.moudle.pedometer.utils.ScreenUtil;
24 import com.cnlive.moudle.pedometer.utils.StepUtil; 25 import com.cnlive.moudle.pedometer.utils.StepUtil;
25 import com.example.moudle_pedometer.R; 26 import com.example.moudle_pedometer.R;
26 import com.example.moudle_pedometer.databinding.FragmentRunRaceDetailBinding; 27 import com.example.moudle_pedometer.databinding.FragmentRunRaceDetailBinding;
  28 +import com.qmuiteam.qmui.util.QMUIStatusBarHelper;
27 import com.sothree.slidinguppanel.SlidingUpPanelLayout; 29 import com.sothree.slidinguppanel.SlidingUpPanelLayout;
28 30
29 import org.greenrobot.eventbus.EventBus; 31 import org.greenrobot.eventbus.EventBus;
@@ -60,7 +62,8 @@ public class RunRaceDetailFragment extends QMUIFragment&lt;RunRaceDetailFragmentVie @@ -60,7 +62,8 @@ public class RunRaceDetailFragment extends QMUIFragment&lt;RunRaceDetailFragmentVie
60 @Override 62 @Override
61 public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { 63 public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
62 super.onViewCreated(view, savedInstanceState); 64 super.onViewCreated(view, savedInstanceState);
63 - 65 + QMUIStatusBarHelper.setStatusBarLightMode(getActivity());
  66 + StatusBarUtil2.setColor(getActivity(), getResources().getColor(R.color.white), 0);
64 mSensorManager = (SensorManager) getActivity().getSystemService(SENSOR_SERVICE);//获取传感器管理服务 67 mSensorManager = (SensorManager) getActivity().getSystemService(SENSOR_SERVICE);//获取传感器管理服务
65 if (getMvpView() != null) { 68 if (getMvpView() != null) {
66 getMvpView().initMap(); 69 getMvpView().initMap();
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/fragment/RunningFinishFragment.java
@@ -46,6 +46,8 @@ public class RunningFinishFragment extends QMUIFragment&lt;RunningFinishFragmentVie @@ -46,6 +46,8 @@ public class RunningFinishFragment extends QMUIFragment&lt;RunningFinishFragmentVie
46 public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { 46 public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
47 super.onViewCreated(view, savedInstanceState); 47 super.onViewCreated(view, savedInstanceState);
48 StepUtil.clearRunData(getActivity(), CommonInfo.getUserId(getActivity())); 48 StepUtil.clearRunData(getActivity(), CommonInfo.getUserId(getActivity()));
  49 + //todo测试用
  50 + CommonInfo.reset(getActivity());
49 if (getArguments() != null) { 51 if (getArguments() != null) {
50 runningFinishBean = (RunningFinishBean) getArguments().getSerializable("runningFinishBean"); 52 runningFinishBean = (RunningFinishBean) getArguments().getSerializable("runningFinishBean");
51 if (runningFinishBean != null) { 53 if (runningFinishBean != null) {
@@ -55,6 +57,7 @@ public class RunningFinishFragment extends QMUIFragment&lt;RunningFinishFragmentVie @@ -55,6 +57,7 @@ public class RunningFinishFragment extends QMUIFragment&lt;RunningFinishFragmentVie
55 } 57 }
56 } 58 }
57 } 59 }
  60 +
58 /** 61 /**
59 * 屏蔽边缘返回 62 * 屏蔽边缘返回
60 * 杨帅 63 * 杨帅
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/fragment/RunningMapFragment.java
@@ -121,7 +121,7 @@ public class RunningMapFragment extends QMUIFragment&lt;RunningMapFragmentView, Run @@ -121,7 +121,7 @@ public class RunningMapFragment extends QMUIFragment&lt;RunningMapFragmentView, Run
121 // long startTime = current - hour * 3600 * 1000 - minute * 60 * 1000 - second * 1000; 121 // long startTime = current - hour * 3600 * 1000 - minute * 60 * 1000 - second * 1000;
122 long endTime = current; 122 long endTime = current;
123 // Log.e(TAG, "onViewCreated: " + "hour:" + hour + ",minute" + minute + ",second:" + second); 123 // Log.e(TAG, "onViewCreated: " + "hour:" + hour + ",minute" + minute + ",second:" + second);
124 - getPresenter().queryHistoryTrace(getActivity(), StepService.entityName, startTime, endTime); 124 + getPresenter().queryHistoryTrace(getActivity(), StepService.entityName, 1560859257, endTime);
125 //查询实时轨迹 125 //查询实时轨迹
126 getPresenter().queryRealTimeTrace(getActivity(), StepService.entityName, startTime); 126 getPresenter().queryRealTimeTrace(getActivity(), StepService.entityName, startTime);
127 127
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/utils/TimeUtil.java
@@ -14,7 +14,7 @@ public class TimeUtil { @@ -14,7 +14,7 @@ public class TimeUtil {
14 * @return 14 * @return
15 */ 15 */
16 public static long getCurrentTime() { 16 public static long getCurrentTime() {
17 - return System.currentTimeMillis() / 1000; 17 + return System.currentTimeMillis();
18 } 18 }
19 19
20 /** 20 /**
@@ -73,7 +73,7 @@ public class TimeUtil { @@ -73,7 +73,7 @@ public class TimeUtil {
73 * 73 *
74 * @return 格式化后的日期 74 * @return 格式化后的日期
75 */ 75 */
76 - public static String getStampToTime(long time,String pattern) { 76 + public static String getStampToTime(long time, String pattern) {
77 SimpleDateFormat sdf = new SimpleDateFormat(pattern); 77 SimpleDateFormat sdf = new SimpleDateFormat(pattern);
78 Date date = new Date(time); 78 Date date = new Date(time);
79 return sdf.format(date); 79 return sdf.format(date);
moudle_pedometer/src/main/res/layout/fragment_finish_run_map.xml
@@ -2,132 +2,142 @@ @@ -2,132 +2,142 @@
2 <layout xmlns:android="http://schemas.android.com/apk/res/android" 2 <layout xmlns:android="http://schemas.android.com/apk/res/android"
3 xmlns:app="http://schemas.android.com/apk/res-auto"> 3 xmlns:app="http://schemas.android.com/apk/res-auto">
4 4
5 - <com.sothree.slidinguppanel.SlidingUpPanelLayout xmlns:sothree="http://schemas.android.com/apk/res-auto"  
6 - android:id="@+id/sliding_layout" 5 + <FrameLayout
7 android:layout_width="match_parent" 6 android:layout_width="match_parent"
8 - android:layout_height="match_parent"  
9 - android:gravity="bottom"  
10 - sothree:umanoDragView="@+id/dragView"  
11 - sothree:umanoFadeColor="@color/black_20"  
12 - sothree:umanoOverlay="true"  
13 - sothree:umanoPanelHeight="360dp"  
14 - sothree:umanoParallaxOffset="100dp"  
15 - sothree:umanoScrollableView="@+id/scrollView"  
16 - sothree:umanoShadowHeight="0dp">  
17 -  
18 - <!-- MAIN CONTENT -->  
19 - <FrameLayout  
20 - android:layout_width="match_parent"  
21 - android:layout_height="match_parent">  
22 -  
23 - <com.baidu.mapapi.map.MapView  
24 - android:id="@+id/mapView"  
25 - android:layout_width="match_parent"  
26 - android:layout_height="match_parent"></com.baidu.mapapi.map.MapView>  
27 - <!--地图上面加一层类似于全透明黑色蒙版-->  
28 - <LinearLayout  
29 - android:layout_width="match_parent"  
30 - android:layout_height="match_parent"  
31 - android:background="#0D000000"  
32 - android:clickable="false"  
33 - android:focusable="false"  
34 - android:focusableInTouchMode="false"></LinearLayout>  
35 -  
36 - <FrameLayout  
37 - android:id="@+id/fl_back"  
38 - android:layout_width="55dp"  
39 - android:layout_height="55dp"  
40 - android:background="@drawable/button_fab_white"  
41 - android:focusable="true">  
42 -  
43 - <ImageView  
44 - android:layout_width="12dp"  
45 - android:layout_height="20dp"  
46 - android:layout_gravity="center"  
47 - android:layout_marginLeft="-2dp"  
48 - android:background="@drawable/icon_back"  
49 - android:focusable="false" />  
50 - </FrameLayout> 7 + android:layout_height="match_parent">
51 8
  9 + <com.sothree.slidinguppanel.SlidingUpPanelLayout xmlns:sothree="http://schemas.android.com/apk/res-auto"
  10 + android:id="@+id/sliding_layout"
  11 + android:layout_width="match_parent"
  12 + android:layout_height="match_parent"
  13 + android:gravity="bottom"
  14 + sothree:umanoDragView="@+id/dragView"
  15 + sothree:umanoFadeColor="@color/black_20"
  16 + sothree:umanoOverlay="true"
  17 + sothree:umanoPanelHeight="310dp"
  18 + sothree:umanoParallaxOffset="100dp"
  19 + sothree:umanoScrollableView="@+id/scrollView"
  20 + sothree:umanoShadowHeight="0dp">
  21 +
  22 + <!-- MAIN CONTENT -->
52 <FrameLayout 23 <FrameLayout
53 - android:layout_width="55dp"  
54 - android:layout_height="55dp"  
55 - android:layout_gravity="right"  
56 - android:background="@drawable/button_fab_white"  
57 - android:focusable="true">  
58 -  
59 - <ImageView  
60 - android:layout_width="19dp"  
61 - android:layout_height="18dp"  
62 - android:layout_gravity="center"  
63 - android:background="@drawable/icon_share" />  
64 - </FrameLayout>  
65 - <!----> 24 + android:layout_width="match_parent"
  25 + android:layout_height="match_parent">
66 26
  27 + <com.baidu.mapapi.map.MapView
  28 + android:id="@+id/mapView"
  29 + android:layout_width="match_parent"
  30 + android:layout_height="match_parent"></com.baidu.mapapi.map.MapView>
  31 + <!--地图上面加一层类似于全透明黑色蒙版-->
  32 + <LinearLayout
  33 + android:layout_width="match_parent"
  34 + android:layout_height="match_parent"
  35 + android:background="#0D000000"
  36 + android:clickable="false"
  37 + android:focusable="false"
  38 + android:focusableInTouchMode="false"></LinearLayout>
  39 +
  40 + <FrameLayout
  41 + android:id="@+id/fl_back"
  42 + android:layout_width="55dp"
  43 + android:layout_height="55dp"
  44 + android:background="@drawable/button_fab_white"
  45 + android:focusable="true">
  46 +
  47 + <ImageView
  48 + android:layout_width="12dp"
  49 + android:layout_height="20dp"
  50 + android:layout_gravity="center"
  51 + android:layout_marginLeft="-2dp"
  52 + android:background="@drawable/icon_back"
  53 + android:focusable="false" />
  54 + </FrameLayout>
  55 +
  56 + <FrameLayout
  57 + android:layout_width="55dp"
  58 + android:layout_height="55dp"
  59 + android:layout_gravity="right"
  60 + android:background="@drawable/button_fab_white"
  61 + android:focusable="true">
  62 +
  63 + <ImageView
  64 + android:layout_width="19dp"
  65 + android:layout_height="18dp"
  66 + android:layout_gravity="center"
  67 + android:background="@drawable/icon_share" />
  68 + </FrameLayout>
  69 + <!---->
67 70
68 - </FrameLayout>  
69 71
70 - <!-- SLIDING LAYOUT -->  
71 - <FrameLayout  
72 - android:id="@+id/dragView"  
73 - android:layout_width="match_parent"  
74 - android:layout_height="wrap_content"  
75 - android:clickable="true"  
76 - android:focusable="false"  
77 - android:orientation="vertical"> 72 + </FrameLayout>
78 73
79 - <ScrollView  
80 - android:id="@+id/scrollView" 74 + <!-- SLIDING LAYOUT -->
  75 + <FrameLayout
  76 + android:id="@+id/dragView"
81 android:layout_width="match_parent" 77 android:layout_width="match_parent"
82 android:layout_height="wrap_content" 78 android:layout_height="wrap_content"
83 - android:layout_marginBottom="60dp"  
84 - android:scrollbars="none"> 79 + android:clickable="true"
  80 + android:focusable="false"
  81 + android:orientation="vertical">
85 82
86 - <LinearLayout  
87 - android:id="@+id/ll_root" 83 + <ScrollView
  84 + android:id="@+id/scrollView"
88 android:layout_width="match_parent" 85 android:layout_width="match_parent"
89 android:layout_height="wrap_content" 86 android:layout_height="wrap_content"
90 - android:orientation="vertical">  
91 - <!--用户个人信息-->  
92 - <include  
93 - android:id="@+id/include_finish_user_info"  
94 - layout="@layout/layout_finish_user_info" />  
95 - <!--总步数-->  
96 - <include  
97 - android:id="@+id/include_finish_step"  
98 - layout="@layout/layout_finish_step"  
99 - android:visibility="visible" />  
100 - <!--跑步路线-->  
101 - <include  
102 - android:id="@+id/include_finish_run_route"  
103 - layout="@layout/layout_finish_running_route"  
104 - android:visibility="visible" />  
105 - </LinearLayout>  
106 -  
107 - </ScrollView>  
108 - <!--按钮-->  
109 - <RelativeLayout  
110 - android:id="@+id/rl_scrollView_startBtn"  
111 - android:layout_width="match_parent"  
112 - android:layout_height="40sp"  
113 - android:layout_gravity="bottom"  
114 - android:background="@color/green_round"  
115 - android:tag="0">  
116 -  
117 - <TextView  
118 - android:id="@+id/tv_run_now"  
119 - android:layout_width="wrap_content"  
120 - android:layout_height="wrap_content"  
121 - android:layout_centerInParent="true"  
122 - android:tag="0"  
123 - android:text="保存中"  
124 - android:textColor="@color/white"  
125 - android:textSize="18sp" />  
126 -  
127 -  
128 - </RelativeLayout>  
129 - </FrameLayout>  
130 - </com.sothree.slidinguppanel.SlidingUpPanelLayout>  
131 - 87 + android:layout_marginBottom="60dp"
  88 + android:scrollbars="none">
  89 +
  90 + <LinearLayout
  91 + android:id="@+id/ll_root"
  92 + android:layout_width="match_parent"
  93 + android:layout_height="wrap_content"
  94 + android:orientation="vertical">
  95 + <!--用户个人信息-->
  96 + <include
  97 + android:id="@+id/include_finish_user_info"
  98 + layout="@layout/layout_finish_user_info" />
  99 + <!--总步数-->
  100 + <include
  101 + android:id="@+id/include_finish_step"
  102 + layout="@layout/layout_finish_step"
  103 + android:visibility="visible" />
  104 + <!--跑步路线-->
  105 + <include
  106 + android:id="@+id/include_finish_run_route"
  107 + layout="@layout/layout_finish_running_route"
  108 + android:visibility="visible" />
  109 + </LinearLayout>
  110 +
  111 + </ScrollView>
132 112
  113 + </FrameLayout>
  114 + </com.sothree.slidinguppanel.SlidingUpPanelLayout>
  115 + <!--按钮-->
  116 + <LinearLayout
  117 + android:id="@+id/rl_scrollView_startBtn"
  118 + android:layout_width="match_parent"
  119 + android:layout_height="40sp"
  120 + android:layout_gravity="bottom"
  121 + android:background="@color/green_round"
  122 + android:gravity="center"
  123 + android:tag="0">
  124 +
  125 + <com.wang.avi.AVLoadingIndicatorView
  126 + android:layout_width="20dp"
  127 + android:layout_height="20dp"
  128 + app:indicatorColor="@color/white"
  129 + app:indicatorName="BallSpinFadeLoaderIndicator" />
  130 +
  131 + <TextView
  132 + android:id="@+id/tv_run_now"
  133 + android:layout_width="wrap_content"
  134 + android:layout_height="wrap_content"
  135 + android:layout_centerInParent="true"
  136 + android:layout_marginLeft="5dp"
  137 + android:tag="0"
  138 + android:text="保存中"
  139 + android:textColor="@color/white"
  140 + android:textSize="18sp" />
  141 + </LinearLayout>
  142 + </FrameLayout>
133 </layout> 143 </layout>
134 \ No newline at end of file 144 \ No newline at end of file
moudle_pedometer/src/main/res/layout/fragment_run_main.xml
@@ -33,7 +33,7 @@ @@ -33,7 +33,7 @@
33 <LinearLayout 33 <LinearLayout
34 android:layout_width="match_parent" 34 android:layout_width="match_parent"
35 android:layout_height="0dp" 35 android:layout_height="0dp"
36 - android:layout_weight="1.5" 36 + android:layout_weight="1"
37 android:gravity="center" 37 android:gravity="center"
38 android:paddingLeft="50dp"> 38 android:paddingLeft="50dp">
39 39
@@ -260,19 +260,21 @@ @@ -260,19 +260,21 @@
260 android:id="@+id/ll_two_bottom_button" 260 android:id="@+id/ll_two_bottom_button"
261 android:layout_width="match_parent" 261 android:layout_width="match_parent"
262 android:layout_height="match_parent" 262 android:layout_height="match_parent"
263 - android:gravity="center"  
264 - android:visibility="gone"> 263 + android:gravity="center_horizontal"
  264 + android:visibility="gone"
  265 +
  266 + >
265 267
266 <LinearLayout 268 <LinearLayout
267 android:layout_width="wrap_content" 269 android:layout_width="wrap_content"
268 android:layout_height="match_parent" 270 android:layout_height="match_parent"
269 - android:layout_marginRight="70dp" 271 + android:layout_marginRight="50dp"
270 android:orientation="vertical"> 272 android:orientation="vertical">
271 273
272 <FrameLayout 274 <FrameLayout
273 android:layout_width="match_parent" 275 android:layout_width="match_parent"
274 android:layout_height="wrap_content" 276 android:layout_height="wrap_content"
275 - android:layout_marginTop="5dp" 277 + android:layout_marginTop="10dp"
276 android:visibility="invisible"> 278 android:visibility="invisible">
277 279
278 <ImageView 280 <ImageView
@@ -327,7 +329,7 @@ @@ -327,7 +329,7 @@
327 android:id="@+id/fl_stop_tip" 329 android:id="@+id/fl_stop_tip"
328 android:layout_width="match_parent" 330 android:layout_width="match_parent"
329 android:layout_height="wrap_content" 331 android:layout_height="wrap_content"
330 - android:layout_marginTop="5dp" 332 + android:layout_marginTop="10dp"
331 android:visibility="invisible"> 333 android:visibility="invisible">
332 334
333 <ImageView 335 <ImageView
moudle_pedometer/src/main/res/layout/fragment_run_race_detail.xml
@@ -2,147 +2,151 @@ @@ -2,147 +2,151 @@
2 <layout xmlns:android="http://schemas.android.com/apk/res/android" 2 <layout xmlns:android="http://schemas.android.com/apk/res/android"
3 xmlns:app="http://schemas.android.com/apk/res-auto"> 3 xmlns:app="http://schemas.android.com/apk/res-auto">
4 4
5 - <com.sothree.slidinguppanel.SlidingUpPanelLayout xmlns:sothree="http://schemas.android.com/apk/res-auto"  
6 - android:id="@+id/sliding_layout" 5 + <FrameLayout
7 android:layout_width="match_parent" 6 android:layout_width="match_parent"
8 - android:layout_height="match_parent"  
9 - android:gravity="bottom"  
10 - sothree:umanoDragView="@+id/dragView"  
11 - sothree:umanoFadeColor="@color/black_20"  
12 - sothree:umanoOverlay="true"  
13 - sothree:umanoPanelHeight="141dp"  
14 - sothree:umanoParallaxOffset="250dp"  
15 - sothree:umanoScrollableView="@+id/scrollView"  
16 - sothree:umanoShadowHeight="0dp">  
17 -  
18 - <!-- MAIN CONTENT -->  
19 - <FrameLayout  
20 - android:id="@+id/fl_root"  
21 - android:layout_width="match_parent"  
22 - android:layout_height="match_parent"> 7 + android:layout_height="match_parent">
23 8
24 - <com.baidu.mapapi.map.MapView  
25 - android:id="@+id/mapView" 9 + <com.sothree.slidinguppanel.SlidingUpPanelLayout xmlns:sothree="http://schemas.android.com/apk/res-auto"
  10 + android:id="@+id/sliding_layout"
  11 + android:layout_width="match_parent"
  12 + android:layout_height="match_parent"
  13 + android:gravity="bottom"
  14 + sothree:umanoDragView="@+id/dragView"
  15 + sothree:umanoFadeColor="@color/black_20"
  16 + sothree:umanoOverlay="true"
  17 + sothree:umanoPanelHeight="141dp"
  18 + sothree:umanoParallaxOffset="250dp"
  19 + sothree:umanoScrollableView="@+id/scrollView"
  20 + sothree:umanoShadowHeight="0dp">
  21 +
  22 + <!-- MAIN CONTENT -->
  23 + <FrameLayout
  24 + android:id="@+id/fl_root"
26 android:layout_width="match_parent" 25 android:layout_width="match_parent"
27 - android:layout_height="match_parent"></com.baidu.mapapi.map.MapView> 26 + android:layout_height="match_parent">
28 27
29 - <!--地图上面加一层类似于全透明黑色蒙版-->  
30 - <LinearLayout  
31 - android:layout_width="match_parent"  
32 - android:layout_height="match_parent"  
33 - android:background="#0D000000"  
34 - android:clickable="false"  
35 - android:focusable="false"  
36 - android:focusableInTouchMode="false"></LinearLayout>  
37 -  
38 - <ImageView  
39 - android:id="@+id/iv_back"  
40 - android:layout_width="35dp"  
41 - android:layout_height="35dp"  
42 - android:layout_margin="10dp"  
43 - android:background="@drawable/xqy_return" />  
44 -  
45 -  
46 - <ImageView  
47 - android:id="@+id/iv_share"  
48 - android:layout_width="35dp"  
49 - android:layout_height="35dp"  
50 - android:layout_gravity="right"  
51 - android:layout_margin="10dp"  
52 - android:background="@drawable/xqt_share"  
53 - android:visibility="gone" />  
54 - <!---->  
55 - <com.cnlive.strike.ui.widget.UIEmptyView  
56 - android:id="@+id/empty_layout"  
57 - android:layout_width="match_parent"  
58 - android:layout_height="match_parent"  
59 - android:background="@color/color_fff"  
60 - android:focusable="true"  
61 - android:focusableInTouchMode="true"  
62 - android:visibility="gone" /> 28 + <com.baidu.mapapi.map.MapView
  29 + android:id="@+id/mapView"
  30 + android:layout_width="match_parent"
  31 + android:layout_height="match_parent"></com.baidu.mapapi.map.MapView>
63 32
64 - </FrameLayout> 33 + <!--地图上面加一层类似于全透明黑色蒙版-->
  34 + <LinearLayout
  35 + android:layout_width="match_parent"
  36 + android:layout_height="match_parent"
  37 + android:background="#0D000000"
  38 + android:clickable="false"
  39 + android:focusable="false"
  40 + android:focusableInTouchMode="false"></LinearLayout>
  41 +
  42 + <ImageView
  43 + android:id="@+id/iv_back"
  44 + android:layout_width="35dp"
  45 + android:layout_height="35dp"
  46 + android:layout_margin="10dp"
  47 + android:background="@drawable/xqy_return" />
  48 +
  49 +
  50 + <ImageView
  51 + android:id="@+id/iv_share"
  52 + android:layout_width="35dp"
  53 + android:layout_height="35dp"
  54 + android:layout_gravity="right"
  55 + android:layout_margin="10dp"
  56 + android:background="@drawable/xqt_share"
  57 + android:visibility="gone" />
  58 + <!---->
  59 + <com.cnlive.strike.ui.widget.UIEmptyView
  60 + android:id="@+id/empty_layout"
  61 + android:layout_width="match_parent"
  62 + android:layout_height="match_parent"
  63 + android:background="@color/color_fff"
  64 + android:focusable="true"
  65 + android:focusableInTouchMode="true"
  66 + android:visibility="gone" />
65 67
66 - <!-- SLIDING LAYOUT -->  
67 - <FrameLayout  
68 - android:id="@+id/dragView"  
69 - android:layout_width="match_parent"  
70 - android:layout_height="match_parent"  
71 - android:clickable="false"  
72 - android:focusable="false"> 68 + </FrameLayout>
73 69
74 - <ScrollView  
75 - android:id="@+id/scrollView" 70 + <!-- SLIDING LAYOUT -->
  71 + <FrameLayout
  72 + android:id="@+id/dragView"
76 android:layout_width="match_parent" 73 android:layout_width="match_parent"
77 android:layout_height="match_parent" 74 android:layout_height="match_parent"
78 - android:scrollbars="none"> 75 + android:clickable="false"
  76 + android:focusable="false">
79 77
80 - <LinearLayout  
81 - android:id="@+id/ll_root" 78 + <ScrollView
  79 + android:id="@+id/scrollView"
82 android:layout_width="match_parent" 80 android:layout_width="match_parent"
83 - android:layout_height="wrap_content"  
84 - android:orientation="vertical">  
85 - <!--跑道-->  
86 - <include  
87 - android:id="@+id/include_street"  
88 - layout="@layout/layout_run_detail_street" />  
89 - <!--成绩-->  
90 - <include  
91 - android:id="@+id/include_person_score"  
92 - layout="@layout/layout_run_detail_person_score"  
93 - android:visibility="visible" />  
94 - <!--排行-->  
95 - <include  
96 - android:id="@+id/include_rank"  
97 - layout="@layout/layout_run_detail_rank"  
98 - android:visibility="visible" />  
99 - <!---->  
100 - <View  
101 - android:layout_width="match_parent"  
102 - android:layout_height="20dp"  
103 - android:background="#F4F4F4" />  
104 - <!--路线介绍-->  
105 - <include  
106 - android:id="@+id/include_street_introduce"  
107 - layout="@layout/layout_run_detail_street_introduce" />  
108 - </LinearLayout>  
109 -  
110 - </ScrollView>  
111 - <!--按钮-->  
112 - <RelativeLayout  
113 - android:id="@+id/rl_scrollView_startBtn"  
114 - android:layout_width="match_parent"  
115 - android:layout_height="40sp"  
116 - android:layout_gravity="bottom"  
117 - android:background="@color/green_round"  
118 - android:tag="0">  
119 -  
120 - <TextView  
121 - android:id="@+id/tv_run_now"  
122 - android:layout_width="wrap_content"  
123 - android:layout_height="wrap_content"  
124 - android:layout_centerInParent="true"  
125 - android:tag="0"  
126 - android:text="@string/run_race_btn_sign_up"  
127 - android:textColor="@color/white"  
128 - android:textSize="18sp" />  
129 -  
130 - <TextView  
131 - android:id="@+id/tv_go_tip"  
132 - android:layout_width="wrap_content"  
133 - android:layout_height="wrap_content"  
134 - android:layout_alignParentRight="true"  
135 - android:layout_centerInParent="true"  
136 - android:layout_centerVertical="true"  
137 - android:layout_marginRight="10dp"  
138 - android:text="Go!"  
139 - android:textColor="@color/white"  
140 - android:textSize="18sp"  
141 - android:visibility="gone" />  
142 -  
143 - </RelativeLayout>  
144 - </FrameLayout>  
145 - </com.sothree.slidinguppanel.SlidingUpPanelLayout> 81 + android:layout_height="match_parent"
  82 + android:scrollbars="none">
146 83
  84 + <LinearLayout
  85 + android:id="@+id/ll_root"
  86 + android:layout_width="match_parent"
  87 + android:layout_height="wrap_content"
  88 + android:orientation="vertical">
  89 + <!--跑道-->
  90 + <include
  91 + android:id="@+id/include_street"
  92 + layout="@layout/layout_run_detail_street" />
  93 + <!--成绩-->
  94 + <include
  95 + android:id="@+id/include_person_score"
  96 + layout="@layout/layout_run_detail_person_score"
  97 + android:visibility="visible" />
  98 + <!--排行-->
  99 + <include
  100 + android:id="@+id/include_rank"
  101 + layout="@layout/layout_run_detail_rank"
  102 + android:visibility="visible" />
  103 + <!---->
  104 + <View
  105 + android:layout_width="match_parent"
  106 + android:layout_height="20dp"
  107 + android:background="#F4F4F4" />
  108 + <!--路线介绍-->
  109 + <include
  110 + android:id="@+id/include_street_introduce"
  111 + layout="@layout/layout_run_detail_street_introduce" />
  112 + </LinearLayout>
  113 +
  114 + </ScrollView>
  115 +
  116 + </FrameLayout>
  117 + </com.sothree.slidinguppanel.SlidingUpPanelLayout>
  118 + <!--按钮-->
  119 + <RelativeLayout
  120 + android:id="@+id/rl_scrollView_startBtn"
  121 + android:layout_width="match_parent"
  122 + android:layout_height="40sp"
  123 + android:layout_gravity="bottom"
  124 + android:background="@color/green_round"
  125 + android:tag="0">
  126 +
  127 + <TextView
  128 + android:id="@+id/tv_run_now"
  129 + android:layout_width="wrap_content"
  130 + android:layout_height="wrap_content"
  131 + android:layout_centerInParent="true"
  132 + android:tag="0"
  133 + android:text="@string/run_race_btn_sign_up"
  134 + android:textColor="@color/white"
  135 + android:textSize="18sp" />
  136 +
  137 + <TextView
  138 + android:id="@+id/tv_go_tip"
  139 + android:layout_width="wrap_content"
  140 + android:layout_height="wrap_content"
  141 + android:layout_alignParentRight="true"
  142 + android:layout_centerInParent="true"
  143 + android:layout_centerVertical="true"
  144 + android:layout_marginRight="10dp"
  145 + android:text="Go!"
  146 + android:textColor="@color/white"
  147 + android:textSize="18sp"
  148 + android:visibility="gone" />
147 149
  150 + </RelativeLayout>
  151 + </FrameLayout>
148 </layout> 152 </layout>
149 \ No newline at end of file 153 \ No newline at end of file
moudle_pedometer/src/main/res/layout/fragment_running_map.xml
@@ -56,7 +56,7 @@ @@ -56,7 +56,7 @@
56 <TextView 56 <TextView
57 android:layout_width="wrap_content" 57 android:layout_width="wrap_content"
58 android:layout_height="wrap_content" 58 android:layout_height="wrap_content"
59 - android:layout_marginBottom="3dp" 59 + android:layout_marginBottom="4dp"
60 android:text="GPS" 60 android:text="GPS"
61 android:textColor="@color/text_black" 61 android:textColor="@color/text_black"
62 android:textSize="12sp" 62 android:textSize="12sp"
@@ -67,7 +67,7 @@ @@ -67,7 +67,7 @@
67 android:layout_width="18dp" 67 android:layout_width="18dp"
68 android:layout_height="5dp" 68 android:layout_height="5dp"
69 android:layout_marginLeft="5dp" 69 android:layout_marginLeft="5dp"
70 - android:layout_marginBottom="3dp" /> 70 + android:layout_marginBottom="4dp" />
71 </LinearLayout> 71 </LinearLayout>
72 <!----> 72 <!---->
73 <TextView 73 <TextView
@@ -104,7 +104,7 @@ @@ -104,7 +104,7 @@
104 android:layout_width="20dp" 104 android:layout_width="20dp"
105 android:layout_height="20dp" 105 android:layout_height="20dp"
106 android:layout_gravity="center" 106 android:layout_gravity="center"
107 - android:layout_marginBottom="3dp" 107 + android:layout_marginBottom="4dp"
108 android:background="@drawable/rt_ic_location_blank" 108 android:background="@drawable/rt_ic_location_blank"
109 android:focusable="false" /> 109 android:focusable="false" />
110 </FrameLayout> 110 </FrameLayout>
moudle_pedometer/src/main/res/layout/layout_run_detail_street.xml
@@ -84,7 +84,8 @@ @@ -84,7 +84,8 @@
84 android:layout_width="match_parent" 84 android:layout_width="match_parent"
85 android:layout_height="40sp" 85 android:layout_height="40sp"
86 android:background="@color/green_round" 86 android:background="@color/green_round"
87 - android:tag="0"> 87 + android:tag="0"
  88 + android:visibility="gone">
88 89
89 <TextView 90 <TextView
90 android:id="@+id/tv_run_now" 91 android:id="@+id/tv_run_now"