Commit a115868f1521282ae1b702456e0104ba71557849

Authored by 韩亚云
1 parent dca54c58

报名结果跳转

moudle_pedometer/src/main/AndroidManifest.xml
@@ -52,7 +52,7 @@ @@ -52,7 +52,7 @@
52 android:required="true" /> 52 android:required="true" />
53 53
54 <application android:persistent="true"> 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 <service 57 <service
58 android:name="com.baidu.location.f" 58 android:name="com.baidu.location.f"
@@ -98,13 +98,11 @@ @@ -98,13 +98,11 @@
98 android:process=":step" /> 98 android:process=":step" />
99 <activity 99 <activity
100 android:name="com.cnlive.moudle.pedometer.ui.activity.RunningMapActivity" 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 <activity 102 <activity
105 android:name="com.cnlive.moudle.pedometer.ui.activity.RunRaceDetailActivity" 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 </application> 106 </application>
109 107
110 </manifest> 108 </manifest>
111 \ No newline at end of file 109 \ No newline at end of file
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/presenter/RegistrationInfoPresenter.java
@@ -9,6 +9,6 @@ import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter; @@ -9,6 +9,6 @@ import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter;
9 */ 9 */
10 public class RegistrationInfoPresenter extends MvpBasePresenter<RegistrationInfoView> { 10 public class RegistrationInfoPresenter extends MvpBasePresenter<RegistrationInfoView> {
11 public void commitInfo(){ 11 public void commitInfo(){
12 - 12 + getView().toResult();
13 } 13 }
14 } 14 }
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RegistrationInfoView.java
1 package com.cnlive.moudle.pedometer.frame.view; 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 import com.cnlive.moudle.pedometer.ui.fragment.RegistrationInfoFragment; 7 import com.cnlive.moudle.pedometer.ui.fragment.RegistrationInfoFragment;
4 import com.example.moudle_pedometer.R; 8 import com.example.moudle_pedometer.R;
5 import com.hannesdorfmann.mosby3.mvp.MvpView; 9 import com.hannesdorfmann.mosby3.mvp.MvpView;
@@ -16,7 +20,23 @@ public class RegistrationInfoView implements MvpView { @@ -16,7 +20,23 @@ public class RegistrationInfoView implements MvpView {
16 } 20 }
17 21
18 public void initView(){ 22 public void initView(){
  23 + fragment.binding.topbar.addLeftImageButton(R.drawable.top_back_black, R.id.fragment_back).setOnClickListener(v -> {
  24 + goLineDetail();
  25 + });
19 fragment.binding.topbar.setTitle("填写报名信息"); 26 fragment.binding.topbar.setTitle("填写报名信息");
20 fragment.binding.commitInfo.setOnClickListener(v -> fragment.commitInfo()); 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,7 +62,7 @@ public class RunRaceDetailFragmentView implements MvpView {
62 fragment.binding.rlScrollViewStartBtn.setTag("1"); 62 fragment.binding.rlScrollViewStartBtn.setTag("1");
63 fragment.binding.tvRunNow.setText("现在开始"); 63 fragment.binding.tvRunNow.setText("现在开始");
64 fragment.binding.tvGoTip.setVisibility(View.VISIBLE); 64 fragment.binding.tvGoTip.setVisibility(View.VISIBLE);
65 - RegistrationInfoActivity.newInstance(fragment.getActivity()); 65 + RegistrationInfoActivity.newInstance(fragment.getActivity(),1001);
66 } else { 66 } else {
67 //开始运动 67 //开始运动
68 fragment.binding.includeStreet.rlStartBtn.setTag("0"); 68 fragment.binding.includeStreet.rlStartBtn.setTag("0");
@@ -89,7 +89,7 @@ public class RunRaceDetailFragmentView implements MvpView { @@ -89,7 +89,7 @@ public class RunRaceDetailFragmentView implements MvpView {
89 fragment.binding.includeStreet.rlStartBtn.setTag("1"); 89 fragment.binding.includeStreet.rlStartBtn.setTag("1");
90 fragment.binding.includeStreet.tvRunNow.setText("现在开始"); 90 fragment.binding.includeStreet.tvRunNow.setText("现在开始");
91 fragment.binding.includeStreet.tvGoTip.setVisibility(View.VISIBLE); 91 fragment.binding.includeStreet.tvGoTip.setVisibility(View.VISIBLE);
92 - RegistrationInfoActivity.newInstance(fragment.getActivity()); 92 + RegistrationInfoActivity.newInstance(fragment.getActivity(),1001);
93 } else { 93 } else {
94 //开始运动 94 //开始运动
95 fragment.binding.rlScrollViewStartBtn.setTag("0"); 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,10 +16,11 @@ import com.example.moudle_pedometer.R;
16 */ 16 */
17 public class RegistrationInfoActivity extends AppCompatActivity { 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 Intent intent = new Intent(context,RegistrationInfoActivity.class); 20 Intent intent = new Intent(context,RegistrationInfoActivity.class);
21 - context.startActivity(intent); 21 + context.startActivityForResult(intent,resultCode);
22 } 22 }
  23 +
23 @Override 24 @Override
24 protected void onCreate(Bundle savedInstanceState) { 25 protected void onCreate(Bundle savedInstanceState) {
25 super.onCreate(savedInstanceState); 26 super.onCreate(savedInstanceState);
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/activity/RunRaceDetailActivity.java
1 package com.cnlive.moudle.pedometer.ui.activity; 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 import android.os.Bundle; 6 import android.os.Bundle;
  7 +import android.support.annotation.Nullable;
4 import android.support.design.widget.BottomSheetDialog; 8 import android.support.design.widget.BottomSheetDialog;
5 import android.view.View; 9 import android.view.View;
6 import android.widget.FrameLayout; 10 import android.widget.FrameLayout;
@@ -27,6 +31,7 @@ import java.util.List; @@ -27,6 +31,7 @@ import java.util.List;
27 */ 31 */
28 @Route(path = "/moudle_pedometer/RunRaceDetailActivity") 32 @Route(path = "/moudle_pedometer/RunRaceDetailActivity")
29 public class RunRaceDetailActivity extends QMUIFragmentActivity { 33 public class RunRaceDetailActivity extends QMUIFragmentActivity {
  34 +
30 @Override 35 @Override
31 protected int getContextViewId() { 36 protected int getContextViewId() {
32 return R.id.fragment_run_trace_detail; 37 return R.id.fragment_run_trace_detail;
@@ -52,4 +57,12 @@ public class RunRaceDetailActivity extends QMUIFragmentActivity { @@ -52,4 +57,12 @@ public class RunRaceDetailActivity extends QMUIFragmentActivity {
52 .addToBackStack(fragment.getClass().getSimpleName()) 57 .addToBackStack(fragment.getClass().getSimpleName())
53 .commit(); 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,9 +4,12 @@ package com.cnlive.moudle.pedometer.ui.fragment;
4 import android.os.Bundle; 4 import android.os.Bundle;
5 import android.support.annotation.NonNull; 5 import android.support.annotation.NonNull;
6 import android.support.annotation.Nullable; 6 import android.support.annotation.Nullable;
  7 +import android.support.v4.app.Fragment;
  8 +import android.view.LayoutInflater;
7 import android.view.View; 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 import com.cnlive.moudle.pedometer.frame.presenter.RegistrationInfoPresenter; 13 import com.cnlive.moudle.pedometer.frame.presenter.RegistrationInfoPresenter;
11 import com.cnlive.moudle.pedometer.frame.view.RegistrationInfoView; 14 import com.cnlive.moudle.pedometer.frame.view.RegistrationInfoView;
12 import com.example.moudle_pedometer.R; 15 import com.example.moudle_pedometer.R;
@@ -15,7 +18,7 @@ import com.example.moudle_pedometer.databinding.FragmentRegistrationInfoBinding; @@ -15,7 +18,7 @@ import com.example.moudle_pedometer.databinding.FragmentRegistrationInfoBinding;
15 /** 18 /**
16 * Created by hanyayun 019/05/29. 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 public static RegistrationInfoFragment newInstance() { 24 public static RegistrationInfoFragment newInstance() {
@@ -37,14 +40,4 @@ public class RegistrationInfoFragment extends QMUIFragment&lt;RegistrationInfoView, @@ -37,14 +40,4 @@ public class RegistrationInfoFragment extends QMUIFragment&lt;RegistrationInfoView,
37 public void commitInfo(){ 40 public void commitInfo(){
38 getPresenter().commitInfo(); 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 <layout xmlns:android="http://schemas.android.com/apk/res/android"> 1 <layout xmlns:android="http://schemas.android.com/apk/res/android">
  2 +
2 <data> 3 <data>
3 4
4 </data> 5 </data>
5 6
6 - <LinearLayout 7 + <RelativeLayout
7 android:layout_width="match_parent" 8 android:layout_width="match_parent"
8 android:layout_height="match_parent" 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 <com.qmuiteam.qmui.widget.QMUITopBar 13 <com.qmuiteam.qmui.widget.QMUITopBar
14 android:id="@+id/topbar" 14 android:id="@+id/topbar"
15 android:layout_width="match_parent" 15 android:layout_width="match_parent"
16 android:layout_height="?attr/qmui_topbar_height" /> 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 <LinearLayout 18 <LinearLayout
  19 + android:id="@+id/register_ly"
48 android:layout_width="match_parent" 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 <EditText 31 <EditText
53 - android:id="@+id/year"  
54 - android:layout_width="50dp" 32 + android:id="@+id/name"
  33 + android:layout_width="match_parent"
55 android:layout_height="wrap_content" /> 34 android:layout_height="wrap_content" />
56 35
57 <TextView 36 <TextView
58 android:layout_width="wrap_content" 37 android:layout_width="wrap_content"
59 android:layout_height="wrap_content" 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 <EditText 42 <EditText
63 - android:id="@+id/month"  
64 - android:layout_width="50dp" 43 + android:id="@+id/sex"
  44 + android:layout_width="match_parent"
65 android:layout_height="wrap_content" /> 45 android:layout_height="wrap_content" />
66 46
67 <TextView 47 <TextView
68 android:layout_width="wrap_content" 48 android:layout_width="wrap_content"
69 android:layout_height="wrap_content" 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 <EditText 99 <EditText
73 - android:id="@+id/day"  
74 - android:layout_width="50dp" 100 + android:id="@+id/numPhone"
  101 + android:layout_width="match_parent"
75 android:layout_height="wrap_content" /> 102 android:layout_height="wrap_content" />
76 103
77 <TextView 104 <TextView
78 android:layout_width="wrap_content" 105 android:layout_width="wrap_content"
79 android:layout_height="wrap_content" 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 </LinearLayout> 122 </LinearLayout>
84 - <TextView 123 +
  124 + <LinearLayout
  125 + android:id="@+id/result_ly"
85 android:layout_width="wrap_content" 126 android:layout_width="wrap_content"
86 android:layout_height="wrap_content" 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 </layout> 155 </layout>
moudle_pedometer/src/main/res/values/ids.xml
@@ -3,5 +3,6 @@ @@ -3,5 +3,6 @@
3 <item name="fragment_run_main" type="id" /> 3 <item name="fragment_run_main" type="id" />
4 <item name="fragment_running_map" type="id" /> 4 <item name="fragment_running_map" type="id" />
5 <item name="fragment_run_trace_detail" type="id" /> 5 <item name="fragment_run_trace_detail" type="id" />
6 - 6 + <item name="fragment_back" type="id"/>
  7 + <item name="fragment_more" type="id" />
7 </resources> 8 </resources>