Commit b924538742e91e518780b6af57994f7dfda600a6
1 parent
0318846d
报名页面
Showing
8 changed files
with
271 additions
and
24 deletions
moudle_pedometer/src/main/AndroidManifest.xml
| ... | ... | @@ -9,28 +9,18 @@ |
| 9 | 9 | <uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" /> <!-- 计歩需要的权限 --> |
| 10 | 10 | <uses-permission android:name="android.permission.VIBRATE" /> |
| 11 | 11 | <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> |
| 12 | - <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> | |
| 13 | - <!--//获取设备网络状态,禁用后无法获取网络状态--> | |
| 14 | - <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | |
| 15 | - <!--//网络权限,当禁用后,无法进行检索等相关业务--> | |
| 16 | - <uses-permission android:name="android.permission.INTERNET" /> | |
| 17 | - <!--//读取设备硬件信息,统计数据--> | |
| 18 | - <uses-permission android:name="android.permission.READ_PHONE_STATE" /> | |
| 19 | - <!--//读取系统信息,包含系统版本等信息,用作统计--> | |
| 20 | - <uses-permission android:name="com.android.launcher.permission.READ_SETTINGS" /> | |
| 21 | - <!--//获取设备的网络状态,鉴权所需网络代理--> | |
| 22 | - <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> | |
| 23 | - <!--//允许sd卡写权限,需写入地图数据,禁用后无法显示地图--> | |
| 24 | - <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | |
| 25 | - <!--//这个权限用于进行网络定位--> | |
| 12 | + <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <!-- //获取设备网络状态,禁用后无法获取网络状态 --> | |
| 13 | + <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <!-- //网络权限,当禁用后,无法进行检索等相关业务 --> | |
| 14 | + <uses-permission android:name="android.permission.INTERNET" /> <!-- //读取设备硬件信息,统计数据 --> | |
| 15 | + <uses-permission android:name="android.permission.READ_PHONE_STATE" /> <!-- //读取系统信息,包含系统版本等信息,用作统计 --> | |
| 16 | + <uses-permission android:name="com.android.launcher.permission.READ_SETTINGS" /> <!-- //获取设备的网络状态,鉴权所需网络代理 --> | |
| 17 | + <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <!-- //允许sd卡写权限,需写入地图数据,禁用后无法显示地图 --> | |
| 18 | + <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <!-- //这个权限用于进行网络定位 --> | |
| 26 | 19 | <uses-permission |
| 27 | 20 | android:name="android.permission.WRITE_SETTINGS" |
| 28 | - tools:ignore="ProtectedPermissions" /> | |
| 29 | - <!--//这个权限用于访问GPS定位--> | |
| 30 | - <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> | |
| 31 | - <!--//获取统计数据--> | |
| 32 | - <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> | |
| 33 | - <!--//使用步行AR导航,配置Camera权限--> | |
| 21 | + tools:ignore="ProtectedPermissions" /> <!-- //这个权限用于访问GPS定位 --> | |
| 22 | + <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <!-- //获取统计数据 --> | |
| 23 | + <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <!-- //使用步行AR导航,配置Camera权限 --> | |
| 34 | 24 | <uses-permission android:name="android.permission.CAMERA" /> |
| 35 | 25 | <uses-permission |
| 36 | 26 | android:name="android.permission.SET_ALWAYS_FINISH" |
| ... | ... | @@ -62,12 +52,13 @@ |
| 62 | 52 | android:required="true" /> |
| 63 | 53 | |
| 64 | 54 | <application android:persistent="true"> |
| 55 | + <activity android:name="com.cnlive.moudle.pedometer.ui.activity.RegistrationInfoActivity"></activity> | |
| 56 | + | |
| 65 | 57 | <service |
| 66 | 58 | android:name="com.baidu.location.f" |
| 67 | 59 | android:enabled="true" |
| 68 | 60 | android:process=":remote" /> |
| 69 | 61 | <service |
| 70 | - | |
| 71 | 62 | android:name="com.cnlive.moudle.pedometer.service.StepService" |
| 72 | 63 | android:enabled="true" |
| 73 | 64 | android:exported="true" |
| ... | ... | @@ -75,6 +66,7 @@ |
| 75 | 66 | android:process=":step" |
| 76 | 67 | android:stopWithTask="false"> |
| 77 | 68 | <intent-filter> |
| 69 | + | |
| 78 | 70 | <!-- 系统启动完成后会调用 --> |
| 79 | 71 | <action android:name="android.intent.action.BOOT_COMPLETED" /> |
| 80 | 72 | <action android:name="android.intent.action.DATE_CHANGED" /> |
| ... | ... | @@ -91,7 +83,6 @@ |
| 91 | 83 | <service |
| 92 | 84 | android:name="com.cnlive.moudle.pedometer.service.JobSchedulerService" |
| 93 | 85 | android:permission="android.permission.BIND_JOB_SERVICE" /> |
| 94 | - | |
| 95 | 86 | <service |
| 96 | 87 | android:name="com.cnlive.moudle.pedometer.service.MyListenerService" |
| 97 | 88 | android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE" |
| ... | ... | @@ -101,7 +92,6 @@ |
| 101 | 92 | </intent-filter> |
| 102 | 93 | </service> |
| 103 | 94 | |
| 104 | - | |
| 105 | 95 | <activity |
| 106 | 96 | android:name="com.cnlive.moudle.pedometer.ui.activity.PedometerMainActivity" |
| 107 | 97 | android:launchMode="singleInstance" |
| ... | ... | @@ -109,7 +99,6 @@ |
| 109 | 99 | <activity |
| 110 | 100 | android:name="com.cnlive.moudle.pedometer.ui.activity.RunningMapActivity" |
| 111 | 101 | android:process=":step" /> |
| 112 | - | |
| 113 | 102 | <activity |
| 114 | 103 | android:name="com.cnlive.moudle.pedometer.ui.activity.RunRaceDetailActivity" |
| 115 | 104 | android:process=":step" /> | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/presenter/RegistrationInfoPresenter.java
0 → 100644
| 1 | +package com.cnlive.moudle.pedometer.frame.presenter; | |
| 2 | + | |
| 3 | +import com.cnlive.moudle.pedometer.frame.view.RegistrationInfoView; | |
| 4 | +import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter; | |
| 5 | + | |
| 6 | + | |
| 7 | +/** | |
| 8 | + * Created by hanyayun 019/05/29. | |
| 9 | + */ | |
| 10 | +public class RegistrationInfoPresenter extends MvpBasePresenter<RegistrationInfoView> { | |
| 11 | + public void commitInfo(){ | |
| 12 | + | |
| 13 | + } | |
| 14 | +} | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RegistrationInfoView.java
0 → 100644
| 1 | +package com.cnlive.moudle.pedometer.frame.view; | |
| 2 | + | |
| 3 | +import com.cnlive.moudle.pedometer.ui.fragment.RegistrationInfoFragment; | |
| 4 | +import com.example.moudle_pedometer.R; | |
| 5 | +import com.hannesdorfmann.mosby3.mvp.MvpView; | |
| 6 | + | |
| 7 | +/** | |
| 8 | + * Created by hanyayun 019/05/29. | |
| 9 | + */ | |
| 10 | +public class RegistrationInfoView implements MvpView { | |
| 11 | + | |
| 12 | + RegistrationInfoFragment fragment; | |
| 13 | + | |
| 14 | + public RegistrationInfoView(RegistrationInfoFragment fragment) { | |
| 15 | + this.fragment = fragment; | |
| 16 | + } | |
| 17 | + | |
| 18 | + public void initView(){ | |
| 19 | +// fragment.binding.topbar.addLeftImageButton(R.drawable.top_back_black, R.id.fragment_back).setOnClickListener(v -> { | |
| 20 | +// fragment.getActivity().finish(); | |
| 21 | +// }); | |
| 22 | + fragment.binding.topbar.setTitle("填写报名信息"); | |
| 23 | + fragment.binding.commitInfo.setOnClickListener(v -> fragment.commitInfo()); | |
| 24 | + } | |
| 25 | +} | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/activity/RegistrationInfoActivity.java
0 → 100644
| 1 | +package com.cnlive.moudle.pedometer.ui.activity; | |
| 2 | + | |
| 3 | +import android.app.Activity; | |
| 4 | +import android.content.Intent; | |
| 5 | +import android.support.v7.app.AppCompatActivity; | |
| 6 | +import android.os.Bundle; | |
| 7 | + | |
| 8 | +import com.cnlive.libs.base.util.StatusBarUtil; | |
| 9 | +import com.cnlive.libs.base.util.StatusBarUtil2; | |
| 10 | +import com.cnlive.moudle.pedometer.ui.fragment.RegistrationInfoFragment; | |
| 11 | +import com.example.moudle_pedometer.R; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + *填写报名信息 | |
| 15 | + * Created by hanyayun 019/05/29. | |
| 16 | + */ | |
| 17 | +public class RegistrationInfoActivity extends AppCompatActivity { | |
| 18 | + | |
| 19 | + public static void newInstance(Activity context){ | |
| 20 | + Intent intent = new Intent(context,RegistrationInfoActivity.class); | |
| 21 | + context.startActivity(intent); | |
| 22 | + } | |
| 23 | + @Override | |
| 24 | + protected void onCreate(Bundle savedInstanceState) { | |
| 25 | + super.onCreate(savedInstanceState); | |
| 26 | + StatusBarUtil.setStatusBarWrite(this); | |
| 27 | + StatusBarUtil2.setColor(this, getResources().getColor(R.color.color_fff), 0); | |
| 28 | + setContentView(R.layout.activity_registration_info); | |
| 29 | + getSupportFragmentManager().beginTransaction().replace(R.id.container, RegistrationInfoFragment.newInstance()).commit(); | |
| 30 | + setContentView(R.layout.activity_registration_info); | |
| 31 | + } | |
| 32 | +} | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/fragment/RegistrationInfoFragment.java
0 → 100644
| 1 | +package com.cnlive.moudle.pedometer.ui.fragment; | |
| 2 | + | |
| 3 | + | |
| 4 | +import android.os.Bundle; | |
| 5 | +import android.support.annotation.NonNull; | |
| 6 | +import android.support.annotation.Nullable; | |
| 7 | +import android.support.v4.app.Fragment; | |
| 8 | +import android.view.LayoutInflater; | |
| 9 | +import android.view.View; | |
| 10 | +import android.view.ViewGroup; | |
| 11 | + | |
| 12 | +import com.cnlive.libs.base.frame.fragment.MvpBindingFragment; | |
| 13 | +import com.cnlive.moudle.pedometer.frame.presenter.RegistrationInfoPresenter; | |
| 14 | +import com.cnlive.moudle.pedometer.frame.view.RegistrationInfoView; | |
| 15 | +import com.example.moudle_pedometer.R; | |
| 16 | +import com.example.moudle_pedometer.databinding.FragmentRegistrationInfoBinding; | |
| 17 | + | |
| 18 | +/** | |
| 19 | + * Created by hanyayun 019/05/29. | |
| 20 | + */ | |
| 21 | +public class RegistrationInfoFragment extends MvpBindingFragment<RegistrationInfoView, RegistrationInfoPresenter,Object, FragmentRegistrationInfoBinding> { | |
| 22 | + | |
| 23 | + | |
| 24 | + public static RegistrationInfoFragment newInstance() { | |
| 25 | + RegistrationInfoFragment fragment = new RegistrationInfoFragment(); | |
| 26 | + return fragment; | |
| 27 | + } | |
| 28 | + | |
| 29 | + @Override | |
| 30 | + protected int getLayoutId() { | |
| 31 | + return R.layout.fragment_registration_info; | |
| 32 | + } | |
| 33 | + | |
| 34 | + @Override | |
| 35 | + public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { | |
| 36 | + super.onViewCreated(view, savedInstanceState); | |
| 37 | + if(getMvpView() != null) getMvpView().initView(); | |
| 38 | + } | |
| 39 | + | |
| 40 | + public void commitInfo(){ | |
| 41 | + getPresenter().commitInfo(); | |
| 42 | + } | |
| 43 | +} | ... | ... |
moudle_pedometer/src/main/res/layout/activity_registration_info.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="utf-8"?> | |
| 2 | +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
| 3 | + xmlns:app="http://schemas.android.com/apk/res-auto" | |
| 4 | + xmlns:tools="http://schemas.android.com/tools" | |
| 5 | + android:layout_width="match_parent" | |
| 6 | + android:layout_height="match_parent" | |
| 7 | + tools:context="com.cnlive.moudle.pedometer.ui.activity.RegistrationInfoActivity"> | |
| 8 | + | |
| 9 | + <RelativeLayout | |
| 10 | + android:id="@+id/container" | |
| 11 | + android:layout_width="match_parent" | |
| 12 | + android:layout_height="match_parent"/> | |
| 13 | +</RelativeLayout> | |
| 0 | 14 | \ No newline at end of file | ... | ... |
moudle_pedometer/src/main/res/layout/fragment_registration_info.xml
0 → 100644
| 1 | +<layout xmlns:android="http://schemas.android.com/apk/res/android"> | |
| 2 | + <data> | |
| 3 | + | |
| 4 | + </data> | |
| 5 | + | |
| 6 | + <LinearLayout | |
| 7 | + android:layout_width="match_parent" | |
| 8 | + android:layout_height="match_parent" | |
| 9 | + android:orientation="vertical" | |
| 10 | + android:padding="10dp" | |
| 11 | + android:background="@color/white"> | |
| 12 | + | |
| 13 | + <com.qmuiteam.qmui.widget.QMUITopBar | |
| 14 | + android:id="@+id/topbar" | |
| 15 | + android:layout_width="match_parent" | |
| 16 | + android:layout_height="?attr/qmui_topbar_height" /> | |
| 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 | |
| 48 | + android:layout_width="match_parent" | |
| 49 | + android:layout_height="wrap_content" | |
| 50 | + android:orientation="horizontal"> | |
| 51 | + | |
| 52 | + <EditText | |
| 53 | + android:id="@+id/year" | |
| 54 | + android:layout_width="50dp" | |
| 55 | + android:layout_height="wrap_content" /> | |
| 56 | + | |
| 57 | + <TextView | |
| 58 | + android:layout_width="wrap_content" | |
| 59 | + android:layout_height="wrap_content" | |
| 60 | + android:text="@string/year" | |
| 61 | + android:padding="10dp" /> | |
| 62 | + <EditText | |
| 63 | + android:id="@+id/month" | |
| 64 | + android:layout_width="50dp" | |
| 65 | + android:layout_height="wrap_content" /> | |
| 66 | + | |
| 67 | + <TextView | |
| 68 | + android:layout_width="wrap_content" | |
| 69 | + android:layout_height="wrap_content" | |
| 70 | + android:text="@string/month" | |
| 71 | + android:padding="10dp" /> | |
| 72 | + <EditText | |
| 73 | + android:id="@+id/day" | |
| 74 | + android:layout_width="50dp" | |
| 75 | + android:layout_height="wrap_content" /> | |
| 76 | + | |
| 77 | + <TextView | |
| 78 | + android:layout_width="wrap_content" | |
| 79 | + android:layout_height="wrap_content" | |
| 80 | + android:text="@string/day" | |
| 81 | + android:padding="10dp" /> | |
| 82 | + | |
| 83 | + </LinearLayout> | |
| 84 | + <TextView | |
| 85 | + android:layout_width="wrap_content" | |
| 86 | + android:layout_height="wrap_content" | |
| 87 | + android:text="@string/numPhone" | |
| 88 | + android:padding="10dp" /> | |
| 89 | + | |
| 90 | + <EditText | |
| 91 | + android:id="@+id/numPhone" | |
| 92 | + android:layout_width="match_parent" | |
| 93 | + android:layout_height="wrap_content" /> | |
| 94 | + | |
| 95 | + <TextView | |
| 96 | + android:layout_width="wrap_content" | |
| 97 | + android:layout_height="wrap_content" | |
| 98 | + android:text="@string/importantNum" | |
| 99 | + android:padding="10dp" /> | |
| 100 | + | |
| 101 | + <EditText | |
| 102 | + android:id="@+id/importantNum" | |
| 103 | + android:layout_width="match_parent" | |
| 104 | + android:layout_height="wrap_content" /> | |
| 105 | + | |
| 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> | |
| 115 | +</layout> | ... | ... |
moudle_pedometer/src/main/res/values/strings.xml
| ... | ... | @@ -8,4 +8,20 @@ |
| 8 | 8 | <string name="md_dialog_cancel">取消</string> |
| 9 | 9 | <string name="md_dialog_content_head">我们需要以下权限为你工作,请点击“确定”开启权限</string> |
| 10 | 10 | |
| 11 | + <string name="name">姓名</string> | |
| 12 | + <string name="sex">性别</string> | |
| 13 | + <string name="birth">出生日期</string> | |
| 14 | + <string name="year">年</string> | |
| 15 | + <string name="month">月</string> | |
| 16 | + <string name="day">日</string> | |
| 17 | + <string name="numPhone">联系电话</string> | |
| 18 | + <string name="importantNum">紧急联系电话</string> | |
| 19 | + <string name="commit_success">报名成功</string> | |
| 20 | + <string name="to_line_detail">点击返回线路详情页</string> | |
| 21 | + <string name="kilometer">公里</string> | |
| 22 | + <string name="foot">步</string> | |
| 23 | + <string name="all_line_record">该路线全部成绩</string> | |
| 24 | + <string name="record_time">活动时间:</string> | |
| 25 | + <string name="record_place">活动地点</string> | |
| 26 | + | |
| 11 | 27 | </resources> | ... | ... |