Commit 13c3497590408cbf08274d119da3deb46741ffa1
1 parent
3a8301b9
1.修改计步服务启动逻辑
Showing
5 changed files
with
10 additions
and
5 deletions
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/frame/view/StartTraceFragmentView.java
| ... | ... | @@ -89,7 +89,6 @@ public class StartTraceFragmentView implements MvpView, SensorEventListener { |
| 89 | 89 | public void onClick(SelectDialog dialog) { |
| 90 | 90 | dialog.dismiss(); |
| 91 | 91 | isShowFollowAddress = false; |
| 92 | - QMUITipDialogUtil.loadingDialog(getContext(), "请稍后", false); | |
| 93 | 92 | //开启计步服务 |
| 94 | 93 | startStepService(getContext()); |
| 95 | 94 | |
| ... | ... | @@ -118,6 +117,7 @@ public class StartTraceFragmentView implements MvpView, SensorEventListener { |
| 118 | 117 | * 启动计步服务 |
| 119 | 118 | */ |
| 120 | 119 | public void startStepService(Context context) { |
| 120 | + QMUITipDialogUtil.loadingDialog(getContext(), "请稍后", false); | |
| 121 | 121 | if (CollCommonInfo.getStepStartTime(context) == 0) { |
| 122 | 122 | CollCommonInfo.setStepStartTime(context, TimeUtil.getNowTimeStamp()); |
| 123 | 123 | } | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RunMainFragmentView.java
| ... | ... | @@ -115,8 +115,7 @@ public class RunMainFragmentView implements MvpView { |
| 115 | 115 | * 初始化相关视图 |
| 116 | 116 | */ |
| 117 | 117 | public void initView() { |
| 118 | - uid = "yangshuai"; | |
| 119 | - CommonInfo.setUserId(getContext(), uid); | |
| 118 | + | |
| 120 | 119 | UserStepEntity userStepEntity = StepUtil.getUserStepData(getContext(), uid); |
| 121 | 120 | if (userStepEntity != null) { |
| 122 | 121 | StepUtil.clearRunData(getContext(), CommonInfo.getUserId(getContext())); | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RunRaceDetailFragmentView.java
| ... | ... | @@ -58,6 +58,7 @@ import com.cnlive.moudle.pedometer.ui.widget.TipDialog; |
| 58 | 58 | import com.cnlive.moudle.pedometer.utils.BitmapUtil; |
| 59 | 59 | import com.cnlive.moudle.pedometer.utils.GsonUtil; |
| 60 | 60 | import com.cnlive.moudle.pedometer.utils.MyMapUtil; |
| 61 | +import com.cnlive.moudle.pedometer.utils.QMUITipDialogUtil; | |
| 61 | 62 | import com.cnlive.moudle.pedometer.utils.ScreenUtil; |
| 62 | 63 | import com.cnlive.moudle.pedometer.utils.TimeUtil; |
| 63 | 64 | import com.cnlive.strike.application.GlideApp; |
| ... | ... | @@ -864,6 +865,7 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { |
| 864 | 865 | * |
| 865 | 866 | */ |
| 866 | 867 | public void startStepService(Context context) { |
| 868 | + QMUITipDialogUtil.loadingDialog(getContext(), "请稍后", false); | |
| 867 | 869 | if (CommonInfo.getStepStartTime(context) == 0) { |
| 868 | 870 | CommonInfo.setStepStartTime(context, TimeUtil.getNowTimeStamp()); |
| 869 | 871 | } | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/fragment/RunRaceDetailFragment.java
| ... | ... | @@ -71,7 +71,9 @@ public class RunRaceDetailFragment extends QMUIFragment<RunRaceDetailFragmentVie |
| 71 | 71 | super.onViewCreated(view, savedInstanceState); |
| 72 | 72 | QMUIStatusBarHelper.setStatusBarLightMode(getActivity()); |
| 73 | 73 | StatusBarUtil2.setColor(getActivity(), getResources().getColor(R.color.white), 0); |
| 74 | + EventBus.getDefault().register(this); | |
| 74 | 75 | mSensorManager = (SensorManager) getActivity().getSystemService(SENSOR_SERVICE);//获取传感器管理服务 |
| 76 | + CommonInfo.setUserId(getContext(), "yangshuai"); | |
| 75 | 77 | if (getMvpView() != null) { |
| 76 | 78 | getMvpView().initMap(); |
| 77 | 79 | ; |
| ... | ... | @@ -119,7 +121,9 @@ public class RunRaceDetailFragment extends QMUIFragment<RunRaceDetailFragmentVie |
| 119 | 121 | if (getMvpView() != null) { |
| 120 | 122 | getMvpView().onDestroy(); |
| 121 | 123 | } |
| 122 | - | |
| 124 | + if (EventBus.getDefault().isRegistered(this)) { | |
| 125 | + EventBus.getDefault().unregister(this); | |
| 126 | + } | |
| 123 | 127 | } |
| 124 | 128 | |
| 125 | 129 | /** | ... | ... |
moudle_pedometer/src/main/res/layout/fragment_collect_run_race_detail.xml
| ... | ... | @@ -10,7 +10,7 @@ |
| 10 | 10 | sothree:umanoDragView="@+id/dragView" |
| 11 | 11 | sothree:umanoFadeColor="@color/black_20" |
| 12 | 12 | sothree:umanoOverlay="true" |
| 13 | - sothree:umanoPanelHeight="141dp" | |
| 13 | + sothree:umanoPanelHeight="100dp" | |
| 14 | 14 | sothree:umanoParallaxOffset="250dp" |
| 15 | 15 | sothree:umanoScrollableView="@+id/scrollView" |
| 16 | 16 | sothree:umanoShadowHeight="0dp"> | ... | ... |