Commit 25fb8adbcd4f2c2426e3649a94a16ed8e119a557
1 parent
df666cc7
1.修改报名页面相关逻辑
Showing
5 changed files
with
30 additions
and
25 deletions
moudle_pedometer/src/main/AndroidManifest.xml
| ... | ... | @@ -59,7 +59,9 @@ |
| 59 | 59 | <activity android:name="com.cnlive.moudle.pedometer.ui.activity.MyRecordActivity" /> |
| 60 | 60 | <activity android:name="com.cnlive.moudle.pedometer.ui.activity.ShareRecordActivity" /> |
| 61 | 61 | <activity android:name="com.cnlive.moudle.pedometer.ui.activity.RaceRecordActivity" /> |
| 62 | - <activity android:name="com.cnlive.moudle.pedometer.ui.activity.RegistrationInfoActivity" /> | |
| 62 | + <activity | |
| 63 | + android:name="com.cnlive.moudle.pedometer.ui.activity.RegistrationInfoActivity" | |
| 64 | + android:process=":step" /> | |
| 63 | 65 | |
| 64 | 66 | <service |
| 65 | 67 | android:name="com.cnlive.moudle.pedometer.service.StepService" |
| ... | ... | @@ -169,6 +171,7 @@ |
| 169 | 171 | <action android:name="com.example.myservice.MyReceiver" /> |
| 170 | 172 | </intent-filter> |
| 171 | 173 | </receiver> |
| 174 | + | |
| 172 | 175 | <activity |
| 173 | 176 | android:name="com.cnlive.moudle.collectionTrace.ui.activity.CollPedometerMainActivity" |
| 174 | 177 | android:process=":step" /> | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RegistrationInfoView.java
| ... | ... | @@ -3,6 +3,8 @@ package com.cnlive.moudle.pedometer.frame.view; |
| 3 | 3 | import android.content.Intent; |
| 4 | 4 | import android.view.View; |
| 5 | 5 | |
| 6 | +import com.cnlive.moudle.pedometer.model.Constant; | |
| 7 | +import com.cnlive.moudle.pedometer.model.MessageEvent; | |
| 6 | 8 | import com.cnlive.moudle.pedometer.ui.activity.RunRaceDetailActivity; |
| 7 | 9 | import com.cnlive.moudle.pedometer.ui.fragment.RegistrationInfoFragment; |
| 8 | 10 | import com.cnlive.moudle.pedometer.utils.DateTimeUtil; |
| ... | ... | @@ -13,6 +15,8 @@ import com.jzxiang.pickerview.TimePickerDialog; |
| 13 | 15 | import com.jzxiang.pickerview.data.Type; |
| 14 | 16 | import com.jzxiang.pickerview.listener.OnDateSetListener; |
| 15 | 17 | |
| 18 | +import org.greenrobot.eventbus.EventBus; | |
| 19 | + | |
| 16 | 20 | import java.text.ParseException; |
| 17 | 21 | import java.text.SimpleDateFormat; |
| 18 | 22 | import java.util.Calendar; |
| ... | ... | @@ -32,13 +36,13 @@ public class RegistrationInfoView implements MvpView, OnDateSetListener { |
| 32 | 36 | this.fragment = fragment; |
| 33 | 37 | } |
| 34 | 38 | |
| 35 | - public void initView(){ | |
| 39 | + public void initView() { | |
| 36 | 40 | fragment.binding.topbar.addLeftImageButton(R.drawable.top_back_black, R.id.fragment_back).setOnClickListener(v -> { |
| 37 | 41 | goLineDetail(); |
| 38 | 42 | }); |
| 39 | 43 | fragment.binding.topbar.setTitle("填写报名信息"); |
| 40 | 44 | fragment.binding.commitInfo.setOnClickListener(v -> fragment.commitInfo()); |
| 41 | - fragment.binding.toLineDetail.setOnClickListener(v ->goLineDetail()); | |
| 45 | + fragment.binding.toLineDetail.setOnClickListener(v -> goLineDetail()); | |
| 42 | 46 | sex = new BottomMenuDialog.Builder(fragment.getActivity()) |
| 43 | 47 | .addMenu("男", new View.OnClickListener() { |
| 44 | 48 | @Override |
| ... | ... | @@ -90,15 +94,16 @@ public class RegistrationInfoView implements MvpView, OnDateSetListener { |
| 90 | 94 | return date.getTime(); |
| 91 | 95 | } |
| 92 | 96 | |
| 93 | - public void toResult(){ | |
| 97 | + public void toResult() { | |
| 94 | 98 | fragment.binding.registerLy.setVisibility(View.GONE); |
| 95 | 99 | fragment.binding.commitInfo.setVisibility(View.GONE); |
| 96 | 100 | fragment.binding.resultLy.setVisibility(View.VISIBLE); |
| 101 | + EventBus.getDefault().post(new MessageEvent(Constant.REGISTRATION_SUCCESS, "")); | |
| 97 | 102 | } |
| 98 | 103 | |
| 99 | - private void goLineDetail(){ | |
| 104 | + private void goLineDetail() { | |
| 100 | 105 | Intent intent = new Intent(fragment.getActivity(), RunRaceDetailActivity.class); |
| 101 | - intent.putExtra("isRegisterResult",true); | |
| 106 | + intent.putExtra("isRegisterResult", true); | |
| 102 | 107 | fragment.getActivity().setResult(1002, intent); |
| 103 | 108 | fragment.getActivity().finish(); |
| 104 | 109 | } |
| ... | ... | @@ -106,6 +111,6 @@ public class RegistrationInfoView implements MvpView, OnDateSetListener { |
| 106 | 111 | @Override |
| 107 | 112 | public void onDateSet(TimePickerDialog timePickerView, long millseconds) { |
| 108 | 113 | // 生日(非必填) 未选择 |
| 109 | - fragment.binding.birthday.setText("生日(非必填) "+DateTimeUtil.formatDateTime(millseconds, "yyyy年MM月dd日")); | |
| 114 | + fragment.binding.birthday.setText("生日(非必填) " + DateTimeUtil.formatDateTime(millseconds, "yyyy年MM月dd日")); | |
| 110 | 115 | } |
| 111 | 116 | } | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RunRaceDetailFragmentView.java
| ... | ... | @@ -367,25 +367,9 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { |
| 367 | 367 | public void onClick(View view) { |
| 368 | 368 | //立即报名 |
| 369 | 369 | if ("0".equals(fragment.binding.rlScrollViewStartBtn.getTag())) { |
| 370 | - fragment.binding.rlScrollViewStartBtn.setTag("1"); | |
| 371 | - fragment.binding.tvRunNow.setText("现在开始"); | |
| 372 | - fragment.binding.tvGoTip.setVisibility(View.VISIBLE); | |
| 373 | - //设置未滑动 | |
| 374 | - fragment.binding.includeStreet.rlStartBtn.setTag("1"); | |
| 375 | - fragment.binding.includeStreet.tvRunNow.setText("现在开始"); | |
| 376 | - fragment.binding.includeStreet.tvGoTip.setVisibility(View.VISIBLE); | |
| 377 | 370 | RegistrationInfoActivity.newInstance(fragment.getActivity(), 1001); |
| 378 | 371 | } else { |
| 379 | - //开始运动 | |
| 380 | - fragment.binding.rlScrollViewStartBtn.setTag("0"); | |
| 381 | - fragment.binding.tvRunNow.setText("立即报名"); | |
| 382 | - fragment.binding.tvGoTip.setVisibility(View.GONE); | |
| 383 | 372 | startStepService(getContext()); |
| 384 | - //设置未滑动 | |
| 385 | - fragment.binding.includeStreet.rlStartBtn.setTag("0"); | |
| 386 | - fragment.binding.includeStreet.tvRunNow.setText("立即报名"); | |
| 387 | - fragment.binding.includeStreet.tvGoTip.setVisibility(View.GONE); | |
| 388 | - | |
| 389 | 373 | } |
| 390 | 374 | } |
| 391 | 375 | }); |
| ... | ... | @@ -862,7 +846,6 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { |
| 862 | 846 | |
| 863 | 847 | /** |
| 864 | 848 | * 启动计步服务 |
| 865 | - * | |
| 866 | 849 | */ |
| 867 | 850 | public void startStepService(Context context) { |
| 868 | 851 | QMUITipDialogUtil.loadingDialog(getContext(), "请稍后", false); |
| ... | ... | @@ -878,4 +861,13 @@ public class RunRaceDetailFragmentView implements MvpView, SensorEventListener { |
| 878 | 861 | |
| 879 | 862 | } |
| 880 | 863 | |
| 864 | + | |
| 865 | + public void setRegistrationBtn() { | |
| 866 | + if (getContext() == null) { | |
| 867 | + return; | |
| 868 | + } | |
| 869 | + fragment.binding.rlScrollViewStartBtn.setTag("1"); | |
| 870 | + fragment.binding.tvRunNow.setText("现在开始"); | |
| 871 | + fragment.binding.tvGoTip.setVisibility(View.VISIBLE); | |
| 872 | + } | |
| 881 | 873 | } | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/fragment/RegistrationInfoFragment.java
| ... | ... | @@ -144,7 +144,6 @@ public class RegistrationInfoFragment extends MvpBindingFragment<RegistrationInf |
| 144 | 144 | QMUITipDialogUtil.dismessDialog(); |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | - Log.e(TAG, "onAddMonitoredPersonCallback: " + addMonitoredPersonResponse.getMessage() + "," + addMonitoredPersonResponse.getStatus()); | |
| 148 | 147 | } |
| 149 | 148 | |
| 150 | 149 | @Override | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/fragment/RunRaceDetailFragment.java
| ... | ... | @@ -199,5 +199,11 @@ public class RunRaceDetailFragment extends QMUIFragment<RunRaceDetailFragmentVie |
| 199 | 199 | QMUITipDialogUtil.textDialog(getContext(), "服务异常,请重试!", 1); |
| 200 | 200 | } |
| 201 | 201 | } |
| 202 | + //报名成功 | |
| 203 | + else if (messageEvent.getMessageType() == Constant.REGISTRATION_SUCCESS) { | |
| 204 | + if (getMvpView() != null) { | |
| 205 | + getMvpView().setRegistrationBtn(); | |
| 206 | + } | |
| 207 | + } | |
| 202 | 208 | } |
| 203 | 209 | } | ... | ... |