Commit a115868f1521282ae1b702456e0104ba71557849
1 parent
dca54c58
报名结果跳转
Showing
13 changed files
with
162 additions
and
96 deletions
moudle_pedometer/src/main/AndroidManifest.xml
| ... | ... | @@ -52,7 +52,7 @@ |
| 52 | 52 | android:required="true" /> |
| 53 | 53 | |
| 54 | 54 | <application android:persistent="true"> |
| 55 | - <activity android:name="com.cnlive.moudle.pedometer.ui.activity.RegistrationInfoActivity"></activity> | |
| 55 | + <activity android:name="com.cnlive.moudle.pedometer.ui.activity.RegistrationInfoActivity"/> | |
| 56 | 56 | |
| 57 | 57 | <service |
| 58 | 58 | android:name="com.baidu.location.f" |
| ... | ... | @@ -98,13 +98,11 @@ |
| 98 | 98 | android:process=":step" /> |
| 99 | 99 | <activity |
| 100 | 100 | android:name="com.cnlive.moudle.pedometer.ui.activity.RunningMapActivity" |
| 101 | - android:process=":step" /> | |
| 102 | - <!--android:theme="@style/Theme.AppCompat.Light.NoActionBar"--> | |
| 103 | - | |
| 101 | + android:process=":step" /> <!-- android:theme="@style/Theme.AppCompat.Light.NoActionBar" --> | |
| 104 | 102 | <activity |
| 105 | 103 | android:name="com.cnlive.moudle.pedometer.ui.activity.RunRaceDetailActivity" |
| 106 | - android:theme="@style/Theme.AppCompat.Light.NoActionBar" | |
| 107 | - android:process=":step" /> | |
| 104 | + android:process=":step" | |
| 105 | + android:theme="@style/Theme.AppCompat.Light.NoActionBar" /> | |
| 108 | 106 | </application> |
| 109 | 107 | |
| 110 | 108 | </manifest> |
| 111 | 109 | \ No newline at end of file | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/presenter/RegistrationInfoPresenter.java
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RegistrationInfoView.java
| 1 | 1 | package com.cnlive.moudle.pedometer.frame.view; |
| 2 | 2 | |
| 3 | +import android.content.Intent; | |
| 4 | +import android.view.View; | |
| 5 | + | |
| 6 | +import com.cnlive.moudle.pedometer.ui.activity.RunRaceDetailActivity; | |
| 3 | 7 | import com.cnlive.moudle.pedometer.ui.fragment.RegistrationInfoFragment; |
| 4 | 8 | import com.example.moudle_pedometer.R; |
| 5 | 9 | import com.hannesdorfmann.mosby3.mvp.MvpView; |
| ... | ... | @@ -16,7 +20,23 @@ public class RegistrationInfoView implements MvpView { |
| 16 | 20 | } |
| 17 | 21 | |
| 18 | 22 | public void initView(){ |
| 23 | + fragment.binding.topbar.addLeftImageButton(R.drawable.top_back_black, R.id.fragment_back).setOnClickListener(v -> { | |
| 24 | + goLineDetail(); | |
| 25 | + }); | |
| 19 | 26 | fragment.binding.topbar.setTitle("填写报名信息"); |
| 20 | 27 | fragment.binding.commitInfo.setOnClickListener(v -> fragment.commitInfo()); |
| 28 | + fragment.binding.toLineDetail.setOnClickListener(v ->goLineDetail()); | |
| 29 | + } | |
| 30 | + | |
| 31 | + public void toResult(){ | |
| 32 | + fragment.binding.registerLy.setVisibility(View.GONE); | |
| 33 | + fragment.binding.resultLy.setVisibility(View.VISIBLE); | |
| 34 | + } | |
| 35 | + | |
| 36 | + private void goLineDetail(){ | |
| 37 | + Intent intent = new Intent(fragment.getActivity(), RunRaceDetailActivity.class); | |
| 38 | + intent.putExtra("isRegisterResult",true); | |
| 39 | + fragment.getActivity().setResult(1002, intent); | |
| 40 | + fragment.getActivity().finish(); | |
| 21 | 41 | } |
| 22 | 42 | } | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RunRaceDetailFragmentView.java
| ... | ... | @@ -62,7 +62,7 @@ public class RunRaceDetailFragmentView implements MvpView { |
| 62 | 62 | fragment.binding.rlScrollViewStartBtn.setTag("1"); |
| 63 | 63 | fragment.binding.tvRunNow.setText("现在开始"); |
| 64 | 64 | fragment.binding.tvGoTip.setVisibility(View.VISIBLE); |
| 65 | - RegistrationInfoActivity.newInstance(fragment.getActivity()); | |
| 65 | + RegistrationInfoActivity.newInstance(fragment.getActivity(),1001); | |
| 66 | 66 | } else { |
| 67 | 67 | //开始运动 |
| 68 | 68 | fragment.binding.includeStreet.rlStartBtn.setTag("0"); |
| ... | ... | @@ -89,7 +89,7 @@ public class RunRaceDetailFragmentView implements MvpView { |
| 89 | 89 | fragment.binding.includeStreet.rlStartBtn.setTag("1"); |
| 90 | 90 | fragment.binding.includeStreet.tvRunNow.setText("现在开始"); |
| 91 | 91 | fragment.binding.includeStreet.tvGoTip.setVisibility(View.VISIBLE); |
| 92 | - RegistrationInfoActivity.newInstance(fragment.getActivity()); | |
| 92 | + RegistrationInfoActivity.newInstance(fragment.getActivity(),1001); | |
| 93 | 93 | } else { |
| 94 | 94 | //开始运动 |
| 95 | 95 | fragment.binding.rlScrollViewStartBtn.setTag("0"); | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/activity/RegistrationInfoActivity.java
| ... | ... | @@ -16,10 +16,11 @@ import com.example.moudle_pedometer.R; |
| 16 | 16 | */ |
| 17 | 17 | public class RegistrationInfoActivity extends AppCompatActivity { |
| 18 | 18 | |
| 19 | - public static void newInstance(Activity context){ | |
| 19 | + public static void newInstance(Activity context,int resultCode){ | |
| 20 | 20 | Intent intent = new Intent(context,RegistrationInfoActivity.class); |
| 21 | - context.startActivity(intent); | |
| 21 | + context.startActivityForResult(intent,resultCode); | |
| 22 | 22 | } |
| 23 | + | |
| 23 | 24 | @Override |
| 24 | 25 | protected void onCreate(Bundle savedInstanceState) { |
| 25 | 26 | super.onCreate(savedInstanceState); | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/activity/RunRaceDetailActivity.java
| 1 | 1 | package com.cnlive.moudle.pedometer.ui.activity; |
| 2 | 2 | |
| 3 | +import android.app.Activity; | |
| 4 | +import android.content.Context; | |
| 5 | +import android.content.Intent; | |
| 3 | 6 | import android.os.Bundle; |
| 7 | +import android.support.annotation.Nullable; | |
| 4 | 8 | import android.support.design.widget.BottomSheetDialog; |
| 5 | 9 | import android.view.View; |
| 6 | 10 | import android.widget.FrameLayout; |
| ... | ... | @@ -27,6 +31,7 @@ import java.util.List; |
| 27 | 31 | */ |
| 28 | 32 | @Route(path = "/moudle_pedometer/RunRaceDetailActivity") |
| 29 | 33 | public class RunRaceDetailActivity extends QMUIFragmentActivity { |
| 34 | + | |
| 30 | 35 | @Override |
| 31 | 36 | protected int getContextViewId() { |
| 32 | 37 | return R.id.fragment_run_trace_detail; |
| ... | ... | @@ -52,4 +57,12 @@ public class RunRaceDetailActivity extends QMUIFragmentActivity { |
| 52 | 57 | .addToBackStack(fragment.getClass().getSimpleName()) |
| 53 | 58 | .commit(); |
| 54 | 59 | } |
| 60 | + | |
| 61 | + @Override | |
| 62 | + protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { | |
| 63 | + super.onActivityResult(requestCode, resultCode, data); | |
| 64 | + if(resultCode == 1002){ | |
| 65 | + | |
| 66 | + } | |
| 67 | + } | |
| 55 | 68 | } | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/fragment/RegistrationInfoFragment.java
| ... | ... | @@ -4,9 +4,12 @@ package com.cnlive.moudle.pedometer.ui.fragment; |
| 4 | 4 | import android.os.Bundle; |
| 5 | 5 | import android.support.annotation.NonNull; |
| 6 | 6 | import android.support.annotation.Nullable; |
| 7 | +import android.support.v4.app.Fragment; | |
| 8 | +import android.view.LayoutInflater; | |
| 7 | 9 | import android.view.View; |
| 10 | +import android.view.ViewGroup; | |
| 8 | 11 | |
| 9 | -import com.cnlive.libs.base.ui.QMUIFragment; | |
| 12 | +import com.cnlive.libs.base.frame.fragment.MvpBindingFragment; | |
| 10 | 13 | import com.cnlive.moudle.pedometer.frame.presenter.RegistrationInfoPresenter; |
| 11 | 14 | import com.cnlive.moudle.pedometer.frame.view.RegistrationInfoView; |
| 12 | 15 | import com.example.moudle_pedometer.R; |
| ... | ... | @@ -15,7 +18,7 @@ import com.example.moudle_pedometer.databinding.FragmentRegistrationInfoBinding; |
| 15 | 18 | /** |
| 16 | 19 | * Created by hanyayun 019/05/29. |
| 17 | 20 | */ |
| 18 | -public class RegistrationInfoFragment extends QMUIFragment<RegistrationInfoView, RegistrationInfoPresenter, FragmentRegistrationInfoBinding> { | |
| 21 | +public class RegistrationInfoFragment extends MvpBindingFragment<RegistrationInfoView, RegistrationInfoPresenter,Object, FragmentRegistrationInfoBinding> { | |
| 19 | 22 | |
| 20 | 23 | |
| 21 | 24 | public static RegistrationInfoFragment newInstance() { |
| ... | ... | @@ -37,14 +40,4 @@ public class RegistrationInfoFragment extends QMUIFragment<RegistrationInfoView, |
| 37 | 40 | public void commitInfo(){ |
| 38 | 41 | getPresenter().commitInfo(); |
| 39 | 42 | } |
| 40 | - | |
| 41 | - @Override | |
| 42 | - protected int getToolbarId() { | |
| 43 | - return R.id.topbar; | |
| 44 | - } | |
| 45 | - | |
| 46 | - @Override | |
| 47 | - public String getTitle() { | |
| 48 | - return "填写报名信息"; | |
| 49 | - } | |
| 50 | 43 | } | ... | ... |
moudle_pedometer/src/main/res/drawable-hdpi/default_register.png
0 → 100644
6.85 KB
moudle_pedometer/src/main/res/drawable-hdpi/top_back_black.png
0 → 100644
409 Bytes
moudle_pedometer/src/main/res/drawable-xhdpi/top_back_black.png
0 → 100644
468 Bytes
moudle_pedometer/src/main/res/drawable-xxhdpi/top_back_black.png
0 → 100644
877 Bytes
moudle_pedometer/src/main/res/layout/fragment_registration_info.xml
| 1 | 1 | <layout xmlns:android="http://schemas.android.com/apk/res/android"> |
| 2 | + | |
| 2 | 3 | <data> |
| 3 | 4 | |
| 4 | 5 | </data> |
| 5 | 6 | |
| 6 | - <LinearLayout | |
| 7 | + <RelativeLayout | |
| 7 | 8 | android:layout_width="match_parent" |
| 8 | 9 | android:layout_height="match_parent" |
| 9 | - android:orientation="vertical" | |
| 10 | - android:padding="10dp" | |
| 11 | - android:background="@color/white"> | |
| 10 | + android:background="@color/white" | |
| 11 | + android:padding="10dp"> | |
| 12 | 12 | |
| 13 | 13 | <com.qmuiteam.qmui.widget.QMUITopBar |
| 14 | 14 | android:id="@+id/topbar" |
| 15 | 15 | android:layout_width="match_parent" |
| 16 | 16 | android:layout_height="?attr/qmui_topbar_height" /> |
| 17 | 17 | |
| 18 | - <TextView | |
| 19 | - android:layout_width="wrap_content" | |
| 20 | - android:layout_height="wrap_content" | |
| 21 | - android:text="@string/name" | |
| 22 | - android:padding="10dp" /> | |
| 23 | - | |
| 24 | - <EditText | |
| 25 | - android:id="@+id/name" | |
| 26 | - android:layout_width="match_parent" | |
| 27 | - android:layout_height="wrap_content" /> | |
| 28 | - | |
| 29 | - <TextView | |
| 30 | - android:layout_width="wrap_content" | |
| 31 | - android:layout_height="wrap_content" | |
| 32 | - android:text="@string/sex" | |
| 33 | - android:padding="10dp" /> | |
| 34 | - | |
| 35 | - <EditText | |
| 36 | - android:id="@+id/sex" | |
| 37 | - android:layout_width="match_parent" | |
| 38 | - android:layout_height="wrap_content" /> | |
| 39 | - | |
| 40 | - <TextView | |
| 41 | - android:layout_width="wrap_content" | |
| 42 | - android:layout_height="wrap_content" | |
| 43 | - android:text="@string/birth" | |
| 44 | - android:padding="10dp" | |
| 45 | - /> | |
| 46 | - | |
| 47 | 18 | <LinearLayout |
| 19 | + android:id="@+id/register_ly" | |
| 48 | 20 | android:layout_width="match_parent" |
| 49 | - android:layout_height="wrap_content" | |
| 50 | - android:orientation="horizontal"> | |
| 21 | + android:layout_height="match_parent" | |
| 22 | + android:layout_below="@id/topbar" | |
| 23 | + android:orientation="vertical"> | |
| 24 | + | |
| 25 | + <TextView | |
| 26 | + android:layout_width="wrap_content" | |
| 27 | + android:layout_height="wrap_content" | |
| 28 | + android:padding="10dp" | |
| 29 | + android:text="@string/name" /> | |
| 51 | 30 | |
| 52 | 31 | <EditText |
| 53 | - android:id="@+id/year" | |
| 54 | - android:layout_width="50dp" | |
| 32 | + android:id="@+id/name" | |
| 33 | + android:layout_width="match_parent" | |
| 55 | 34 | android:layout_height="wrap_content" /> |
| 56 | 35 | |
| 57 | 36 | <TextView |
| 58 | 37 | android:layout_width="wrap_content" |
| 59 | 38 | android:layout_height="wrap_content" |
| 60 | - android:text="@string/year" | |
| 61 | - android:padding="10dp" /> | |
| 39 | + android:padding="10dp" | |
| 40 | + android:text="@string/sex" /> | |
| 41 | + | |
| 62 | 42 | <EditText |
| 63 | - android:id="@+id/month" | |
| 64 | - android:layout_width="50dp" | |
| 43 | + android:id="@+id/sex" | |
| 44 | + android:layout_width="match_parent" | |
| 65 | 45 | android:layout_height="wrap_content" /> |
| 66 | 46 | |
| 67 | 47 | <TextView |
| 68 | 48 | android:layout_width="wrap_content" |
| 69 | 49 | android:layout_height="wrap_content" |
| 70 | - android:text="@string/month" | |
| 71 | - android:padding="10dp" /> | |
| 50 | + android:padding="10dp" | |
| 51 | + android:text="@string/birth" /> | |
| 52 | + | |
| 53 | + <LinearLayout | |
| 54 | + android:layout_width="match_parent" | |
| 55 | + android:layout_height="wrap_content" | |
| 56 | + android:orientation="horizontal"> | |
| 57 | + | |
| 58 | + <EditText | |
| 59 | + android:id="@+id/year" | |
| 60 | + android:layout_width="50dp" | |
| 61 | + android:layout_height="wrap_content" /> | |
| 62 | + | |
| 63 | + <TextView | |
| 64 | + android:layout_width="wrap_content" | |
| 65 | + android:layout_height="wrap_content" | |
| 66 | + android:padding="10dp" | |
| 67 | + android:text="@string/year" /> | |
| 68 | + | |
| 69 | + <EditText | |
| 70 | + android:id="@+id/month" | |
| 71 | + android:layout_width="50dp" | |
| 72 | + android:layout_height="wrap_content" /> | |
| 73 | + | |
| 74 | + <TextView | |
| 75 | + android:layout_width="wrap_content" | |
| 76 | + android:layout_height="wrap_content" | |
| 77 | + android:padding="10dp" | |
| 78 | + android:text="@string/month" /> | |
| 79 | + | |
| 80 | + <EditText | |
| 81 | + android:id="@+id/day" | |
| 82 | + android:layout_width="50dp" | |
| 83 | + android:layout_height="wrap_content" /> | |
| 84 | + | |
| 85 | + <TextView | |
| 86 | + android:layout_width="wrap_content" | |
| 87 | + android:layout_height="wrap_content" | |
| 88 | + android:padding="10dp" | |
| 89 | + android:text="@string/day" /> | |
| 90 | + | |
| 91 | + </LinearLayout> | |
| 92 | + | |
| 93 | + <TextView | |
| 94 | + android:layout_width="wrap_content" | |
| 95 | + android:layout_height="wrap_content" | |
| 96 | + android:padding="10dp" | |
| 97 | + android:text="@string/numPhone" /> | |
| 98 | + | |
| 72 | 99 | <EditText |
| 73 | - android:id="@+id/day" | |
| 74 | - android:layout_width="50dp" | |
| 100 | + android:id="@+id/numPhone" | |
| 101 | + android:layout_width="match_parent" | |
| 75 | 102 | android:layout_height="wrap_content" /> |
| 76 | 103 | |
| 77 | 104 | <TextView |
| 78 | 105 | android:layout_width="wrap_content" |
| 79 | 106 | android:layout_height="wrap_content" |
| 80 | - android:text="@string/day" | |
| 81 | - android:padding="10dp" /> | |
| 107 | + android:padding="10dp" | |
| 108 | + android:text="@string/importantNum" /> | |
| 82 | 109 | |
| 110 | + <EditText | |
| 111 | + android:id="@+id/importantNum" | |
| 112 | + android:layout_width="match_parent" | |
| 113 | + android:layout_height="wrap_content" /> | |
| 114 | + | |
| 115 | + <Button | |
| 116 | + android:id="@+id/commit_info" | |
| 117 | + android:layout_width="wrap_content" | |
| 118 | + android:layout_height="wrap_content" | |
| 119 | + android:layout_gravity="center_horizontal" | |
| 120 | + android:layout_marginTop="20dp" | |
| 121 | + android:text="立即报名" /> | |
| 83 | 122 | </LinearLayout> |
| 84 | - <TextView | |
| 123 | + | |
| 124 | + <LinearLayout | |
| 125 | + android:id="@+id/result_ly" | |
| 85 | 126 | android:layout_width="wrap_content" |
| 86 | 127 | android:layout_height="wrap_content" |
| 87 | - android:text="@string/numPhone" | |
| 88 | - android:padding="10dp" /> | |
| 128 | + android:layout_centerInParent="true" | |
| 129 | + android:visibility="gone" | |
| 130 | + android:orientation="vertical"> | |
| 89 | 131 | |
| 90 | - <EditText | |
| 91 | - android:id="@+id/numPhone" | |
| 92 | - android:layout_width="match_parent" | |
| 93 | - android:layout_height="wrap_content" /> | |
| 132 | + <ImageView | |
| 133 | + android:layout_width="wrap_content" | |
| 134 | + android:layout_height="wrap_content" | |
| 135 | + android:src="@drawable/default_register" /> | |
| 94 | 136 | |
| 95 | - <TextView | |
| 96 | - android:layout_width="wrap_content" | |
| 97 | - android:layout_height="wrap_content" | |
| 98 | - android:text="@string/importantNum" | |
| 99 | - android:padding="10dp" /> | |
| 137 | + <TextView | |
| 138 | + android:layout_width="wrap_content" | |
| 139 | + android:layout_height="wrap_content" | |
| 140 | + android:layout_gravity="center" | |
| 141 | + android:layout_marginTop="10dp" | |
| 142 | + android:text="@string/commit_success" /> | |
| 100 | 143 | |
| 101 | - <EditText | |
| 102 | - android:id="@+id/importantNum" | |
| 103 | - android:layout_width="match_parent" | |
| 104 | - android:layout_height="wrap_content" /> | |
| 144 | + <TextView | |
| 145 | + android:id="@+id/to_line_detail" | |
| 146 | + android:layout_width="wrap_content" | |
| 147 | + android:layout_height="wrap_content" | |
| 148 | + android:layout_gravity="center" | |
| 149 | + android:padding="10dp" | |
| 150 | + android:text="@string/to_line_detail" /> | |
| 105 | 151 | |
| 106 | - <Button | |
| 107 | - android:id="@+id/commit_info" | |
| 108 | - android:layout_width="wrap_content" | |
| 109 | - android:layout_height="wrap_content" | |
| 110 | - android:text="立即报名" | |
| 111 | - android:layout_gravity="center_horizontal" | |
| 112 | - android:layout_marginTop="20dp" | |
| 113 | - /> | |
| 114 | - </LinearLayout> | |
| 152 | + </LinearLayout> | |
| 153 | + | |
| 154 | + </RelativeLayout> | |
| 115 | 155 | </layout> | ... | ... |
moudle_pedometer/src/main/res/values/ids.xml