Commit 02c11a0c1f3eff82c9ec7722e94bf92145133551
1 parent
0648fe46aa
Exists in
master
BUG修改
Showing
7 changed files
with
31 additions
and
14 deletions
Show diff stats
.idea/misc.xml
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
1 | <project version="4"> | 2 | <project version="4"> |
2 | <component name="DesignSurface"> | 3 | <component name="DesignSurface"> |
3 | <option name="filePathToZoomLevelMap"> | 4 | <option name="filePathToZoomLevelMap"> |
4 | <map> | 5 | <map> |
5 | <entry key="app/src/main/res/drawable/bg_solid_btn.xml" value="0.29907407407407405" /> | 6 | <entry key="app/src/main/res/drawable/bg_solid_btn.xml" value="0.29907407407407405" /> |
6 | <entry key="app/src/main/res/drawable/bg_solid_btn_grad.xml" value="0.29907407407407405" /> | 7 | <entry key="app/src/main/res/drawable/bg_solid_btn_grad.xml" value="0.29907407407407405" /> |
7 | <entry key="app/src/main/res/drawable/bg_solid_white.xml" value="0.21851851851851853" /> | 8 | <entry key="app/src/main/res/drawable/bg_solid_white.xml" value="0.21851851851851853" /> |
8 | <entry key="app/src/main/res/drawable/bg_solid_white_10.xml" value="0.29907407407407405" /> | 9 | <entry key="app/src/main/res/drawable/bg_solid_white_10.xml" value="0.29907407407407405" /> |
9 | <entry key="app/src/main/res/drawable/bg_solid_white_10_bottom.xml" value="0.2388888888888889" /> | 10 | <entry key="app/src/main/res/drawable/bg_solid_white_10_bottom.xml" value="0.2388888888888889" /> |
10 | <entry key="app/src/main/res/drawable/bg_solid_white_10_or.xml" value="0.24814814814814815" /> | 11 | <entry key="app/src/main/res/drawable/bg_solid_white_10_or.xml" value="0.24814814814814815" /> |
11 | <entry key="app/src/main/res/drawable/bg_solid_white_10_top.xml" value="0.2388888888888889" /> | 12 | <entry key="app/src/main/res/drawable/bg_solid_white_10_top.xml" value="0.2388888888888889" /> |
12 | <entry key="app/src/main/res/drawable/bg_solid_white_20.xml" value="0.25555555555555554" /> | 13 | <entry key="app/src/main/res/drawable/bg_solid_white_20.xml" value="0.25555555555555554" /> |
13 | <entry key="app/src/main/res/drawable/checked_xc.xml" value="0.29907407407407405" /> | 14 | <entry key="app/src/main/res/drawable/checked_xc.xml" value="0.29907407407407405" /> |
14 | <entry key="app/src/main/res/drawable/select_b_1.xml" value="0.25555555555555554" /> | 15 | <entry key="app/src/main/res/drawable/select_b_1.xml" value="0.25555555555555554" /> |
15 | <entry key="app/src/main/res/drawable/select_b_2.xml" value="0.25555555555555554" /> | 16 | <entry key="app/src/main/res/drawable/select_b_2.xml" value="0.25555555555555554" /> |
16 | <entry key="app/src/main/res/drawable/select_t_1.xml" value="0.25555555555555554" /> | 17 | <entry key="app/src/main/res/drawable/select_t_1.xml" value="0.25555555555555554" /> |
17 | <entry key="app/src/main/res/drawable/welcome_bg.xml" value="0.38958333333333334" /> | 18 | <entry key="app/src/main/res/drawable/welcome_bg.xml" value="0.38958333333333334" /> |
18 | <entry key="app/src/main/res/layout/activity_add_stu.xml" value="0.3734375" /> | 19 | <entry key="app/src/main/res/layout/activity_add_stu.xml" value="0.3734375" /> |
19 | <entry key="app/src/main/res/layout/activity_changem.xml" value="0.3734375" /> | 20 | <entry key="app/src/main/res/layout/activity_changem.xml" value="0.3734375" /> |
20 | <entry key="app/src/main/res/layout/activity_login.xml" value="0.20064724919093851" /> | 21 | <entry key="app/src/main/res/layout/activity_login.xml" value="0.20064724919093851" /> |
21 | <entry key="app/src/main/res/layout/activity_main.xml" value="0.359375" /> | 22 | <entry key="app/src/main/res/layout/activity_main.xml" value="0.359375" /> |
22 | <entry key="app/src/main/res/layout/activity_me.xml" value="0.3734375" /> | 23 | <entry key="app/src/main/res/layout/activity_me.xml" value="0.3734375" /> |
23 | <entry key="app/src/main/res/layout/activity_qr.xml" value="0.1" /> | 24 | <entry key="app/src/main/res/layout/activity_qr.xml" value="0.1" /> |
24 | <entry key="app/src/main/res/layout/activity_register.xml" value="0.3734375" /> | 25 | <entry key="app/src/main/res/layout/activity_register.xml" value="0.3734375" /> |
25 | <entry key="app/src/main/res/layout/activity_sao.xml" value="0.3734375" /> | 26 | <entry key="app/src/main/res/layout/activity_sao.xml" value="0.3734375" /> |
26 | <entry key="app/src/main/res/layout/activity_select_stu.xml" value="0.3734375" /> | 27 | <entry key="app/src/main/res/layout/activity_select_stu.xml" value="0.3734375" /> |
27 | <entry key="app/src/main/res/layout/activity_set_jia.xml" value="0.3734375" /> | 28 | <entry key="app/src/main/res/layout/activity_set_jia.xml" value="0.3734375" /> |
28 | <entry key="app/src/main/res/layout/activity_set_nian.xml" value="0.31952662721893493" /> | 29 | <entry key="app/src/main/res/layout/activity_set_nian.xml" value="0.31952662721893493" /> |
29 | <entry key="app/src/main/res/layout/activity_set_nick.xml" value="0.3734375" /> | 30 | <entry key="app/src/main/res/layout/activity_set_nick.xml" value="0.3734375" /> |
30 | <entry key="app/src/main/res/layout/activity_set_sex.xml" value="0.2781065088757396" /> | 31 | <entry key="app/src/main/res/layout/activity_set_sex.xml" value="0.2781065088757396" /> |
31 | <entry key="app/src/main/res/layout/activity_setac.xml" value="0.3734375" /> | 32 | <entry key="app/src/main/res/layout/activity_setac.xml" value="0.3734375" /> |
32 | <entry key="app/src/main/res/layout/activity_yin.xml" value="0.3734375" /> | 33 | <entry key="app/src/main/res/layout/activity_yin.xml" value="0.3734375" /> |
33 | <entry key="app/src/main/res/layout/fragment_home.xml" value="0.1" /> | 34 | <entry key="app/src/main/res/layout/fragment_home.xml" value="0.1" /> |
34 | <entry key="app/src/main/res/layout/fragment_me.xml" value="0.13197430135483507" /> | 35 | <entry key="app/src/main/res/layout/fragment_me.xml" value="0.13197430135483507" /> |
35 | <entry key="app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml" value="0.3814814814814815" /> | 36 | <entry key="app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml" value="0.3814814814814815" /> |
36 | <entry key="app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml" value="0.3814814814814815" /> | 37 | <entry key="app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml" value="0.3814814814814815" /> |
37 | <entry key="libs/common/src/main/res/drawable/bg_solid_white.xml" value="0.21851851851851853" /> | 38 | <entry key="libs/common/src/main/res/drawable/bg_solid_white.xml" value="0.21851851851851853" /> |
38 | <entry key="libs/common/src/main/res/drawable/default_label_bg.xml" value="0.21851851851851853" /> | 39 | <entry key="libs/common/src/main/res/drawable/default_label_bg.xml" value="0.21851851851851853" /> |
39 | <entry key="libs/common/src/main/res/drawable/select_map_position_type.xml" value="0.21851851851851853" /> | 40 | <entry key="libs/common/src/main/res/drawable/select_map_position_type.xml" value="0.21851851851851853" /> |
40 | <entry key="libs/common/src/main/res/drawable/shape_dialog_bg.xml" value="0.21851851851851853" /> | 41 | <entry key="libs/common/src/main/res/drawable/shape_dialog_bg.xml" value="0.21851851851851853" /> |
41 | <entry key="libs/common/src/main/res/layout/dialog_auxiliary_point.xml" value="0.2791666666666667" /> | 42 | <entry key="libs/common/src/main/res/layout/dialog_auxiliary_point.xml" value="0.2791666666666667" /> |
42 | </map> | 43 | </map> |
43 | </option> | 44 | </option> |
44 | </component> | 45 | </component> |
45 | <component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="corretto-11" project-jdk-type="JavaSDK"> | 46 | <component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK"> |
46 | <output url="file://$PROJECT_DIR$/build/classes" /> | 47 | <output url="file://$PROJECT_DIR$/build/classes" /> |
47 | </component> | 48 | </component> |
48 | <component name="ProjectType"> | 49 | <component name="ProjectType"> |
49 | <option name="id" value="Android" /> | 50 | <option name="id" value="Android" /> |
50 | </component> | 51 | </component> |
51 | </project> | 52 | </project> |
app/src/main/java/com/hjx/parent/AddTeacherActivity.java
1 | package com.hjx.parent; | 1 | package com.hjx.parent; |
2 | 2 | ||
3 | import android.content.Intent; | 3 | import android.content.Intent; |
4 | import android.graphics.Color; | 4 | import android.graphics.Color; |
5 | import android.text.Editable; | 5 | import android.text.Editable; |
6 | import android.text.TextUtils; | 6 | import android.text.TextUtils; |
7 | import android.text.TextWatcher; | 7 | import android.text.TextWatcher; |
8 | import android.view.View; | 8 | import android.view.View; |
9 | import android.widget.Button; | 9 | import android.widget.Button; |
10 | import android.widget.EditText; | 10 | import android.widget.EditText; |
11 | import android.widget.ImageView; | 11 | import android.widget.ImageView; |
12 | import android.widget.RelativeLayout; | 12 | import android.widget.RelativeLayout; |
13 | import android.widget.TextView; | 13 | import android.widget.TextView; |
14 | 14 | ||
15 | import com.bumptech.glide.Glide; | 15 | import com.bumptech.glide.Glide; |
16 | import com.bumptech.glide.load.resource.bitmap.RoundedCorners; | 16 | import com.bumptech.glide.load.resource.bitmap.RoundedCorners; |
17 | import com.bumptech.glide.request.RequestOptions; | 17 | import com.bumptech.glide.request.RequestOptions; |
18 | import com.google.gson.Gson; | 18 | import com.google.gson.Gson; |
19 | import com.prws.common.base.BaseActivity; | 19 | import com.prws.common.base.BaseActivity; |
20 | import com.prws.common.base.BasePresenter; | 20 | import com.prws.common.base.BasePresenter; |
21 | import com.prws.common.bean.ResponseResult; | 21 | import com.prws.common.bean.ResponseResult; |
22 | import com.prws.common.bean.Teacher; | 22 | import com.prws.common.bean.Teacher; |
23 | import com.prws.common.net.NetWorks; | 23 | import com.prws.common.net.NetWorks; |
24 | import com.prws.common.utils.Common; | 24 | import com.prws.common.utils.Common; |
25 | import com.prws.common.utils.ScreenUtils; | 25 | import com.prws.common.utils.ScreenUtils; |
26 | 26 | ||
27 | import butterknife.BindView; | 27 | import butterknife.BindView; |
28 | import butterknife.OnClick; | 28 | import butterknife.OnClick; |
29 | import io.reactivex.Observer; | 29 | import io.reactivex.Observer; |
30 | import io.reactivex.disposables.Disposable; | 30 | import io.reactivex.disposables.Disposable; |
31 | 31 | ||
32 | public class AddTeacherActivity extends BaseActivity { | 32 | public class AddTeacherActivity extends BaseActivity { |
33 | @BindView(R.id.et_1) | 33 | @BindView(R.id.et_1) |
34 | EditText et_1; | 34 | EditText et_1; |
35 | @BindView(R.id.btn_next) | 35 | @BindView(R.id.btn_next) |
36 | Button btn_next; | 36 | Button btn_next; |
37 | @BindView(R.id.rl_teacher) | 37 | @BindView(R.id.rl_teacher) |
38 | RelativeLayout rl_teacher; | 38 | RelativeLayout rl_teacher; |
39 | @BindView(R.id.iv_teacher) | 39 | @BindView(R.id.iv_teacher) |
40 | ImageView iv_teacher; | 40 | ImageView iv_teacher; |
41 | @BindView(R.id.tv_teacher) | 41 | @BindView(R.id.tv_teacher) |
42 | TextView tv_teacher; | 42 | TextView tv_teacher; |
43 | Teacher teacher; | 43 | Teacher teacher; |
44 | 44 | ||
45 | @Override | 45 | @Override |
46 | protected int layoutResId() { | 46 | protected int layoutResId() { |
47 | return R.layout.activity_add_teacher; | 47 | return R.layout.activity_add_teacher; |
48 | } | 48 | } |
49 | 49 | ||
50 | @Override | 50 | @Override |
51 | public Object getContract() { | 51 | public Object getContract() { |
52 | return null; | 52 | return null; |
53 | } | 53 | } |
54 | 54 | ||
55 | @Override | 55 | @Override |
56 | public BasePresenter getPresenter() { | 56 | public BasePresenter getPresenter() { |
57 | return null; | 57 | return null; |
58 | } | 58 | } |
59 | 59 | ||
60 | @Override | 60 | @Override |
61 | protected void initView() { | 61 | protected void initView() { |
62 | btn_next.setEnabled(false); | ||
62 | et_1.addTextChangedListener(new TextWatcher() { | 63 | et_1.addTextChangedListener(new TextWatcher() { |
63 | @Override | 64 | @Override |
64 | public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { | 65 | public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { |
65 | 66 | ||
66 | } | 67 | } |
67 | 68 | ||
68 | @Override | 69 | @Override |
69 | public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { | 70 | public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { |
70 | 71 | ||
71 | } | 72 | } |
72 | 73 | ||
73 | @Override | 74 | @Override |
74 | public void afterTextChanged(Editable editable) { | 75 | public void afterTextChanged(Editable editable) { |
75 | if (editable.length() == 11) { | 76 | if (editable.length() == 11) { |
76 | if (Common.isValidPhoneNumber(editable.toString())) { | 77 | if (Common.isValidPhoneNumber(editable.toString())) { |
77 | searchTeacher(editable.toString()); | 78 | searchTeacher(editable.toString()); |
78 | } else { | 79 | } else { |
80 | btn_next.setEnabled(false); | ||
79 | rl_teacher.setVisibility(View.GONE); | 81 | rl_teacher.setVisibility(View.GONE); |
80 | showToast("请输入正确的手机号码"); | 82 | showToast("请输入正确的手机号码"); |
81 | btn_next.setTextColor(Color.parseColor("#999999")); | 83 | btn_next.setTextColor(Color.parseColor("#999999")); |
82 | btn_next.setBackgroundResource(R.drawable.bg_solid_btn_grad); | 84 | btn_next.setBackgroundResource(R.drawable.bg_solid_btn_grad); |
83 | btn_next.setEnabled(false); | 85 | btn_next.setEnabled(false); |
84 | } | 86 | } |
85 | } else { | 87 | } else { |
88 | btn_next.setEnabled(false); | ||
86 | rl_teacher.setVisibility(View.GONE); | 89 | rl_teacher.setVisibility(View.GONE); |
87 | btn_next.setBackgroundResource(R.drawable.bg_solid_btn_grad); | 90 | btn_next.setBackgroundResource(R.drawable.bg_solid_btn_grad); |
88 | btn_next.setTextColor(Color.parseColor("#999999")); | 91 | btn_next.setTextColor(Color.parseColor("#999999")); |
89 | btn_next.setEnabled(false); | 92 | btn_next.setEnabled(false); |
90 | } | 93 | } |
91 | } | 94 | } |
92 | }); | 95 | }); |
93 | } | 96 | } |
94 | 97 | ||
95 | 98 | ||
96 | public void searchTeacher(String phone) { | 99 | public void searchTeacher(String phone) { |
97 | NetWorks.searchTeacher(phone, new Observer<ResponseResult<Teacher>>() { | 100 | NetWorks.searchTeacher(phone, new Observer<ResponseResult<Teacher>>() { |
98 | @Override | 101 | @Override |
99 | public void onSubscribe(Disposable d) { | 102 | public void onSubscribe(Disposable d) { |
100 | 103 | ||
101 | } | 104 | } |
102 | 105 | ||
103 | @Override | 106 | @Override |
104 | public void onNext(ResponseResult<Teacher> result) { | 107 | public void onNext(ResponseResult<Teacher> result) { |
105 | if (result != null && result.getCode() == 200) { | 108 | if (result != null && result.getCode() == 200) { |
106 | teacher = result.getData(); | 109 | teacher = result.getData(); |
107 | rl_teacher.setVisibility(View.VISIBLE); | 110 | rl_teacher.setVisibility(View.VISIBLE); |
108 | if (!TextUtils.isEmpty(teacher.getPhoto())) { | 111 | if (!TextUtils.isEmpty(teacher.getPhoto())) { |
109 | RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(AddTeacherActivity.this, 20)); | 112 | RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(AddTeacherActivity.this, 20)); |
110 | RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); | 113 | RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); |
111 | Glide.with(AddTeacherActivity.this).load(teacher.getPhoto()).apply(options).into(iv_teacher); | 114 | Glide.with(AddTeacherActivity.this).load(teacher.getPhoto()).apply(options).into(iv_teacher); |
112 | } else { | 115 | } else { |
113 | iv_teacher.setImageResource(R.mipmap.ic_teacher_male); | 116 | iv_teacher.setImageResource(R.mipmap.ic_teacher_male); |
114 | } | 117 | } |
115 | tv_teacher.setText(teacher.getUserName()); | 118 | tv_teacher.setText(teacher.getUserName()); |
116 | btn_next.setBackgroundResource(R.drawable.bg_solid_btn); | 119 | btn_next.setBackgroundResource(R.drawable.bg_solid_btn); |
117 | btn_next.setTextColor(Color.WHITE); | 120 | btn_next.setTextColor(Color.WHITE); |
118 | btn_next.setEnabled(true); | 121 | btn_next.setEnabled(true); |
119 | } | 122 | } |
120 | } | 123 | } |
121 | 124 | ||
122 | @Override | 125 | @Override |
123 | public void onError(Throwable e) { | 126 | public void onError(Throwable e) { |
124 | 127 | ||
125 | } | 128 | } |
126 | 129 | ||
127 | @Override | 130 | @Override |
128 | public void onComplete() { | 131 | public void onComplete() { |
129 | 132 | ||
130 | } | 133 | } |
131 | }); | 134 | }); |
132 | } | 135 | } |
133 | 136 | ||
134 | @OnClick(R.id.btn_next) | 137 | @OnClick(R.id.btn_next) |
135 | public void confirm(View view) { | 138 | public void confirm(View view) { |
136 | Intent intent = new Intent(); | 139 | Intent intent = new Intent(); |
137 | intent.putExtra("teacher", new Gson().toJson(teacher)); | 140 | intent.putExtra("teacher", new Gson().toJson(teacher)); |
138 | setResult(1000,intent); | 141 | setResult(1000, intent); |
142 | finish(); | ||
143 | } | ||
144 | |||
145 | @OnClick(R.id.tv_cancel) | ||
146 | public void back(View view) { | ||
139 | finish(); | 147 | finish(); |
140 | } | 148 | } |
141 | 149 | ||
142 | @Override | 150 | @Override |
143 | protected void initListener() { | 151 | protected void initListener() { |
144 | 152 | ||
145 | } | 153 | } |
146 | 154 | ||
147 | @Override | 155 | @Override |
148 | protected void initData() { | 156 | protected void initData() { |
149 | 157 | ||
150 | } | 158 | } |
151 | 159 | ||
152 | @Override | 160 | @Override |
153 | public void onNetChanged(int netWorkState) { | 161 | public void onNetChanged(int netWorkState) { |
154 | 162 | ||
155 | } | 163 | } |
156 | 164 | ||
157 | } | 165 | } |
158 | 166 |
app/src/main/java/com/hjx/parent/YinsiActivity.java
1 | package com.hjx.parent; | 1 | package com.hjx.parent; |
2 | 2 | ||
3 | import android.view.View; | ||
4 | |||
3 | import com.prws.common.base.BaseActivity; | 5 | import com.prws.common.base.BaseActivity; |
4 | import com.prws.common.base.BasePresenter; | 6 | import com.prws.common.base.BasePresenter; |
5 | 7 | ||
8 | import butterknife.OnClick; | ||
9 | |||
6 | public class YinsiActivity extends BaseActivity { | 10 | public class YinsiActivity extends BaseActivity { |
7 | 11 | ||
8 | @Override | 12 | @Override |
9 | protected int layoutResId() { | 13 | protected int layoutResId() { |
10 | return R.layout.activity_yin; | 14 | return R.layout.activity_yin; |
11 | } | 15 | } |
12 | 16 | ||
13 | @Override | 17 | @Override |
14 | public Object getContract() { | 18 | public Object getContract() { |
15 | return null; | 19 | return null; |
16 | } | 20 | } |
17 | 21 | ||
18 | @Override | 22 | @Override |
19 | public BasePresenter getPresenter() { | 23 | public BasePresenter getPresenter() { |
20 | return null; | 24 | return null; |
21 | } | 25 | } |
22 | 26 | ||
23 | 27 | ||
24 | @Override | 28 | @Override |
25 | protected void initView() { | 29 | protected void initView() { |
26 | 30 | ||
27 | } | 31 | } |
28 | 32 | ||
29 | @Override | 33 | @Override |
30 | protected void initListener() { | 34 | protected void initListener() { |
31 | findViewById(R.id.iv_back).setOnClickListener(view -> onBackPressed()); | 35 | } |
36 | |||
37 | @OnClick(R.id.iv_back) | ||
38 | public void back(View view) { | ||
39 | finish(); | ||
32 | } | 40 | } |
33 | 41 | ||
34 | @Override | 42 | @Override |
35 | protected void initData() { | 43 | protected void initData() { |
36 | 44 | ||
37 | } | 45 | } |
38 | 46 | ||
39 | @Override | 47 | @Override |
40 | public void onNetChanged(int netWorkState) { | 48 | public void onNetChanged(int netWorkState) { |
41 | 49 | ||
42 | } | 50 | } |
43 | } | 51 | } |
app/src/main/java/com/hjx/parent/fragment/MeFragment.java
1 | package com.hjx.parent.fragment; | 1 | package com.hjx.parent.fragment; |
2 | 2 | ||
3 | import android.app.AlertDialog; | 3 | import android.app.AlertDialog; |
4 | import android.content.DialogInterface; | 4 | import android.content.DialogInterface; |
5 | import android.content.Intent; | 5 | import android.content.Intent; |
6 | import android.text.TextUtils; | 6 | import android.text.TextUtils; |
7 | import android.view.View; | 7 | import android.view.View; |
8 | import android.widget.ImageView; | 8 | import android.widget.ImageView; |
9 | import android.widget.TextView; | 9 | import android.widget.TextView; |
10 | import android.widget.Toast; | 10 | import android.widget.Toast; |
11 | 11 | ||
12 | import androidx.annotation.NonNull; | 12 | import androidx.annotation.NonNull; |
13 | import androidx.annotation.Nullable; | 13 | import androidx.annotation.Nullable; |
14 | import androidx.constraintlayout.widget.Group; | 14 | import androidx.constraintlayout.widget.Group; |
15 | import androidx.recyclerview.widget.LinearLayoutManager; | 15 | import androidx.recyclerview.widget.LinearLayoutManager; |
16 | import androidx.recyclerview.widget.RecyclerView; | 16 | import androidx.recyclerview.widget.RecyclerView; |
17 | 17 | ||
18 | import com.bumptech.glide.Glide; | 18 | import com.bumptech.glide.Glide; |
19 | import com.bumptech.glide.load.resource.bitmap.RoundedCorners; | 19 | import com.bumptech.glide.load.resource.bitmap.RoundedCorners; |
20 | import com.bumptech.glide.request.RequestOptions; | 20 | import com.bumptech.glide.request.RequestOptions; |
21 | import com.chad.library.adapter.base.BaseQuickAdapter; | 21 | import com.chad.library.adapter.base.BaseQuickAdapter; |
22 | import com.chad.library.adapter.base.BaseViewHolder; | 22 | import com.chad.library.adapter.base.BaseViewHolder; |
23 | import com.developer.wang.utils.PermissionUtils; | 23 | import com.developer.wang.utils.PermissionUtils; |
24 | import com.google.gson.Gson; | 24 | import com.google.gson.Gson; |
25 | import com.google.gson.JsonArray; | 25 | import com.google.gson.JsonArray; |
26 | import com.hjq.permissions.OnPermissionCallback; | 26 | import com.hjq.permissions.OnPermissionCallback; |
27 | import com.hjq.permissions.Permission; | 27 | import com.hjq.permissions.Permission; |
28 | import com.hjq.permissions.XXPermissions; | 28 | import com.hjq.permissions.XXPermissions; |
29 | import com.hjx.parent.AccountActivity; | 29 | import com.hjx.parent.AccountActivity; |
30 | import com.hjx.parent.AddStudentActivity; | 30 | import com.hjx.parent.AddStudentActivity; |
31 | import com.hjx.parent.EditStudentActivity; | 31 | import com.hjx.parent.EditStudentActivity; |
32 | import com.hjx.parent.LoginActivity; | 32 | import com.hjx.parent.LoginActivity; |
33 | import com.hjx.parent.MainActivity; | 33 | import com.hjx.parent.MainActivity; |
34 | import com.hjx.parent.QRActivity; | 34 | import com.hjx.parent.QRActivity; |
35 | import com.hjx.parent.R; | 35 | import com.hjx.parent.R; |
36 | import com.hjx.parent.UserActivity; | 36 | import com.hjx.parent.UserActivity; |
37 | import com.hjx.parent.YinsiActivity; | 37 | import com.hjx.parent.YinsiActivity; |
38 | import com.hjx.parent.bean.StudentBean; | 38 | import com.hjx.parent.bean.StudentBean; |
39 | import com.prws.common.base.BaseFragment; | 39 | import com.prws.common.base.BaseFragment; |
40 | import com.prws.common.net.NetWorks; | 40 | import com.prws.common.net.NetWorks; |
41 | import com.prws.common.utils.LogUtil; | 41 | import com.prws.common.utils.LogUtil; |
42 | import com.prws.common.utils.ScreenUtils; | 42 | import com.prws.common.utils.ScreenUtils; |
43 | import com.prws.common.utils.SharedPreferencesUtil; | 43 | import com.prws.common.utils.SharedPreferencesUtil; |
44 | 44 | ||
45 | import org.json.JSONArray; | 45 | import org.json.JSONArray; |
46 | import org.json.JSONObject; | 46 | import org.json.JSONObject; |
47 | 47 | ||
48 | import java.util.ArrayList; | 48 | import java.util.ArrayList; |
49 | import java.util.HashMap; | 49 | import java.util.HashMap; |
50 | import java.util.List; | 50 | import java.util.List; |
51 | import java.util.Map; | 51 | import java.util.Map; |
52 | 52 | ||
53 | import butterknife.BindView; | 53 | import butterknife.BindView; |
54 | import butterknife.OnClick; | 54 | import butterknife.OnClick; |
55 | import io.reactivex.Observer; | 55 | import io.reactivex.Observer; |
56 | import io.reactivex.disposables.Disposable; | 56 | import io.reactivex.disposables.Disposable; |
57 | import okhttp3.ResponseBody; | 57 | import okhttp3.ResponseBody; |
58 | 58 | ||
59 | public class MeFragment extends BaseFragment { | 59 | public class MeFragment extends BaseFragment { |
60 | @Override | 60 | @Override |
61 | protected int getLayoutRes() { | 61 | protected int getLayoutRes() { |
62 | return R.layout.fragment_me; | 62 | return R.layout.fragment_me; |
63 | } | 63 | } |
64 | 64 | ||
65 | Group group_1; | 65 | Group group_1; |
66 | TextView tv_name; | 66 | TextView tv_name; |
67 | TextView tv_phone; | 67 | TextView tv_phone; |
68 | ImageView iv_toux; | 68 | ImageView iv_toux; |
69 | RecyclerView recycle; | 69 | RecyclerView recycle; |
70 | 70 | ||
71 | @Override | 71 | @Override |
72 | protected void initDatas() { | 72 | protected void initDatas() { |
73 | super.initDatas(); | 73 | super.initDatas(); |
74 | recycle = mRootView.findViewById(R.id.recycle); | 74 | recycle = mRootView.findViewById(R.id.recycle); |
75 | group_1 = mRootView.findViewById(R.id.group_1); | 75 | group_1 = mRootView.findViewById(R.id.group_1); |
76 | String role = (String) SharedPreferencesUtil.getData("role", ""); | 76 | String role = (String) SharedPreferencesUtil.getData("role", ""); |
77 | String userId = (String) SharedPreferencesUtil.getData("userId", ""); | 77 | String userId = (String) SharedPreferencesUtil.getData("userId", ""); |
78 | String token = (String) SharedPreferencesUtil.getData("token", ""); | 78 | String token = (String) SharedPreferencesUtil.getData("token", ""); |
79 | String phone = (String) SharedPreferencesUtil.getData("phone", ""); | 79 | String phone = (String) SharedPreferencesUtil.getData("phone", ""); |
80 | group_1.setVisibility(View.VISIBLE); | 80 | group_1.setVisibility(View.VISIBLE); |
81 | iv_toux = mRootView.findViewById(R.id.iv_toux); | 81 | iv_toux = mRootView.findViewById(R.id.iv_toux); |
82 | tv_name = mRootView.findViewById(R.id.tv_name); | 82 | tv_name = mRootView.findViewById(R.id.tv_name); |
83 | tv_phone = mRootView.findViewById(R.id.tv_phone); | 83 | tv_phone = mRootView.findViewById(R.id.tv_phone); |
84 | tv_phone.setVisibility(View.GONE); | 84 | tv_phone.setVisibility(View.GONE); |
85 | // tv_phone.setText(phone); | 85 | // tv_phone.setText(phone); |
86 | tv_name.setText(phone); | 86 | tv_name.setText(phone); |
87 | } | 87 | } |
88 | 88 | ||
89 | @Override | 89 | @Override |
90 | public void onResume() { | 90 | public void onResume() { |
91 | super.onResume(); | 91 | super.onResume(); |
92 | String photo = (String) SharedPreferencesUtil.getData("photo", ""); | 92 | String photo = (String) SharedPreferencesUtil.getData("photo", ""); |
93 | if (!TextUtils.isEmpty(photo)) { | 93 | if (!TextUtils.isEmpty(photo)) { |
94 | RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(getContext(), 45)); | 94 | RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(getContext(), 45)); |
95 | RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); | 95 | RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); |
96 | Glide.with(getContext()).load(photo).apply(options).into(iv_toux); | 96 | Glide.with(getContext()).load(photo).apply(options).into(iv_toux); |
97 | } | 97 | } |
98 | loadChildList(); | 98 | loadChildList(); |
99 | } | 99 | } |
100 | 100 | ||
101 | ArrayList<StudentBean> alist = new ArrayList<>(); | 101 | ArrayList<StudentBean> alist = new ArrayList<>(); |
102 | 102 | ||
103 | public void loadChildList() { | 103 | public void loadChildList() { |
104 | NetWorks.listChildren(new Observer<ResponseBody>() { | 104 | NetWorks.listChildren(new Observer<ResponseBody>() { |
105 | @Override | 105 | @Override |
106 | public void onSubscribe(Disposable d) { | 106 | public void onSubscribe(Disposable d) { |
107 | 107 | ||
108 | } | 108 | } |
109 | 109 | ||
110 | @Override | 110 | @Override |
111 | public void onNext(ResponseBody responseBody) { | 111 | public void onNext(ResponseBody responseBody) { |
112 | try { | 112 | try { |
113 | 113 | ||
114 | String str = responseBody.string().toString(); | 114 | String str = responseBody.string().toString(); |
115 | 115 | ||
116 | 116 | ||
117 | LogUtil.e("TAG", "----" + str); | 117 | LogUtil.e("TAG", "----" + str); |
118 | JSONObject jo = new JSONObject(str); | 118 | JSONObject jo = new JSONObject(str); |
119 | boolean isSucceed = jo.getBoolean("success"); | 119 | boolean isSucceed = jo.getBoolean("success"); |
120 | if (isSucceed) { | 120 | if (isSucceed) { |
121 | JSONArray jarr = jo.getJSONArray("data"); | 121 | JSONArray jarr = jo.getJSONArray("data"); |
122 | alist.clear(); | 122 | alist.clear(); |
123 | for (int i = 0; i < jarr.length(); i++) { | 123 | for (int i = 0; i < jarr.length(); i++) { |
124 | JSONObject jo2 = jarr.getJSONObject(i); | 124 | JSONObject jo2 = jarr.getJSONObject(i); |
125 | Gson gson = new Gson(); | 125 | Gson gson = new Gson(); |
126 | StudentBean sb = gson.fromJson(jo2.toString(), StudentBean.class); | 126 | StudentBean sb = gson.fromJson(jo2.toString(), StudentBean.class); |
127 | alist.add(sb); | 127 | alist.add(sb); |
128 | } | 128 | } |
129 | if (alist.size() > 0) { | 129 | if (alist.size() > 0) { |
130 | loadList(); | 130 | loadList(); |
131 | } | 131 | } |
132 | 132 | ||
133 | } else { | 133 | } else { |
134 | 134 | ||
135 | } | 135 | } |
136 | } catch (Exception e) { | 136 | } catch (Exception e) { |
137 | e.printStackTrace(); | 137 | e.printStackTrace(); |
138 | } | 138 | } |
139 | } | 139 | } |
140 | 140 | ||
141 | @Override | 141 | @Override |
142 | public void onError(Throwable e) { | 142 | public void onError(Throwable e) { |
143 | 143 | ||
144 | } | 144 | } |
145 | 145 | ||
146 | @Override | 146 | @Override |
147 | public void onComplete() { | 147 | public void onComplete() { |
148 | 148 | ||
149 | } | 149 | } |
150 | }); | 150 | }); |
151 | mRootView.findViewById(R.id.view_4).setOnClickListener(view -> startActivity(new Intent(getActivity(), YinsiActivity.class))); | 151 | mRootView.findViewById(R.id.view_4).setOnClickListener(view -> startActivity(new Intent(getActivity(), YinsiActivity.class))); |
152 | mRootView.findViewById(R.id.view_5).setOnClickListener(view -> startActivity(new Intent(getActivity(), UserActivity.class))); | 152 | mRootView.findViewById(R.id.view_5).setOnClickListener(view -> startActivity(new Intent(getActivity(), UserActivity.class))); |
153 | mRootView.findViewById(R.id.view_3).setOnClickListener(view -> startActivityForResult(new Intent(getActivity(), AccountActivity.class), 1003)); | 153 | mRootView.findViewById(R.id.view_3).setOnClickListener(view -> startActivityForResult(new Intent(getActivity(), AccountActivity.class), 1003)); |
154 | } | 154 | } |
155 | 155 | ||
156 | @Override | 156 | // @Override |
157 | public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { | 157 | // public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { |
158 | super.onActivityResult(requestCode, resultCode, data); | 158 | // super.onActivityResult(requestCode, resultCode, data); |
159 | Intent intent = new Intent(getActivity(), LoginActivity.class); | 159 | // Intent intent = new Intent(getActivity(), LoginActivity.class); |
160 | startActivity(intent); | 160 | // startActivity(intent); |
161 | getActivity().finish(); | 161 | // getActivity().finish(); |
162 | } | 162 | // } |
163 | 163 | ||
164 | public void loadList() { | 164 | public void loadList() { |
165 | StudentBean sb = new StudentBean(); | 165 | StudentBean sb = new StudentBean(); |
166 | sb.setNickName("添加学生"); | 166 | sb.setNickName("添加学生"); |
167 | alist.add(0, sb); | 167 | alist.add(0, sb); |
168 | BaseQuickAdapter adapter = new BaseQuickAdapter(R.layout.item_child, alist) { | 168 | BaseQuickAdapter adapter = new BaseQuickAdapter(R.layout.item_child, alist) { |
169 | @Override | 169 | @Override |
170 | protected void convert(@NonNull BaseViewHolder item, Object o) { | 170 | protected void convert(@NonNull BaseViewHolder item, Object o) { |
171 | StudentBean studentBean = alist.get(item.getAdapterPosition()); | 171 | StudentBean studentBean = alist.get(item.getAdapterPosition()); |
172 | item.setText(R.id.tv_name, studentBean.getNickName()); | 172 | item.setText(R.id.tv_name, studentBean.getNickName()); |
173 | if (TextUtils.isEmpty(studentBean.getStuId())) { | 173 | if (TextUtils.isEmpty(studentBean.getStuId())) { |
174 | item.setImageResource(R.id.iv_avatar, R.mipmap.tjxss); | 174 | item.setImageResource(R.id.iv_avatar, R.mipmap.tjxss); |
175 | item.setVisible(R.id.iv_vip, false); | 175 | item.setVisible(R.id.iv_vip, false); |
176 | item.getConvertView().setOnClickListener(new View.OnClickListener() { | 176 | item.getConvertView().setOnClickListener(new View.OnClickListener() { |
177 | @Override | 177 | @Override |
178 | public void onClick(View view) { | 178 | public void onClick(View view) { |
179 | startActivity(new Intent(getActivity(), AddStudentActivity.class)); | 179 | startActivity(new Intent(getActivity(), AddStudentActivity.class)); |
180 | } | 180 | } |
181 | }); | 181 | }); |
182 | } else { | 182 | } else { |
183 | if (TextUtils.isEmpty(studentBean.getPhoto())) { | 183 | if (TextUtils.isEmpty(studentBean.getPhoto())) { |
184 | item.setImageResource(R.id.iv_avatar, studentBean.getGender() == 0 ? R.mipmap.ic_avatar_male : R.mipmap.ic_avatar_female); | 184 | item.setImageResource(R.id.iv_avatar, studentBean.getGender() == 0 ? R.mipmap.ic_avatar_male : R.mipmap.ic_avatar_female); |
185 | } else { | 185 | } else { |
186 | RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(getContext(), 45)); | 186 | RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(getContext(), 45)); |
187 | RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); | 187 | RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); |
188 | Glide.with(getActivity()).load(studentBean.getPhoto()).apply(options).into((ImageView) item.getView(R.id.iv_avatar)); | 188 | Glide.with(getActivity()).load(studentBean.getPhoto()).apply(options).into((ImageView) item.getView(R.id.iv_avatar)); |
189 | } | 189 | } |
190 | item.setVisible(R.id.iv_vip, !"虚拟".equals(studentBean.getTeacherIdentity())); | 190 | item.setVisible(R.id.iv_vip, !"虚拟".equals(studentBean.getTeacherIdentity())); |
191 | item.getConvertView().setOnClickListener(new View.OnClickListener() { | 191 | item.getConvertView().setOnClickListener(new View.OnClickListener() { |
192 | @Override | 192 | @Override |
193 | public void onClick(View view) { | 193 | public void onClick(View view) { |
194 | startActivity(new Intent(getActivity(), EditStudentActivity.class).putExtra("student", new Gson().toJson(studentBean))); | 194 | startActivity(new Intent(getActivity(), EditStudentActivity.class).putExtra("student", new Gson().toJson(studentBean))); |
195 | } | 195 | } |
196 | }); | 196 | }); |
197 | } | 197 | } |
198 | } | 198 | } |
199 | }; | 199 | }; |
200 | recycle.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false)); | 200 | recycle.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false)); |
201 | recycle.setAdapter(adapter); | 201 | recycle.setAdapter(adapter); |
202 | } | 202 | } |
203 | 203 | ||
204 | } | 204 | } |
205 | 205 |
app/src/main/res/layout/activity_login.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
4 | android:layout_width="match_parent" | 4 | android:layout_width="match_parent" |
5 | android:layout_height="match_parent" | 5 | android:layout_height="match_parent" |
6 | android:background="@mipmap/bg"> | 6 | android:background="@mipmap/bg"> |
7 | 7 | ||
8 | 8 | ||
9 | <TextView | 9 | <TextView |
10 | android:layout_width="wrap_content" | 10 | android:layout_width="wrap_content" |
11 | android:layout_height="wrap_content" | 11 | android:layout_height="wrap_content" |
12 | android:layout_marginLeft="30dp" | 12 | android:layout_marginLeft="30dp" |
13 | android:layout_marginTop="64dp" | 13 | android:layout_marginTop="64dp" |
14 | android:text="登陆" | 14 | android:text="登录" |
15 | android:textColor="#333333" | 15 | android:textColor="#333333" |
16 | android:textSize="25dp" | 16 | android:textSize="25dp" |
17 | android:textStyle="bold" | 17 | android:textStyle="bold" |
18 | app:layout_constraintLeft_toLeftOf="parent" | 18 | app:layout_constraintLeft_toLeftOf="parent" |
19 | app:layout_constraintTop_toTopOf="parent" /> | 19 | app:layout_constraintTop_toTopOf="parent" /> |
20 | 20 | ||
21 | <View | 21 | <View |
22 | android:id="@+id/view_1" | 22 | android:id="@+id/view_1" |
23 | android:layout_width="315dp" | 23 | android:layout_width="315dp" |
24 | android:layout_height="50dp" | 24 | android:layout_height="50dp" |
25 | android:layout_marginTop="166dp" | 25 | android:layout_marginTop="166dp" |
26 | android:background="@drawable/bg_solid_white" | 26 | android:background="@drawable/bg_solid_white" |
27 | app:layout_constraintLeft_toLeftOf="parent" | 27 | app:layout_constraintLeft_toLeftOf="parent" |
28 | app:layout_constraintRight_toRightOf="parent" | 28 | app:layout_constraintRight_toRightOf="parent" |
29 | app:layout_constraintTop_toTopOf="parent" /> | 29 | app:layout_constraintTop_toTopOf="parent" /> |
30 | 30 | ||
31 | <ImageView | 31 | <ImageView |
32 | android:id="@+id/iv_1" | 32 | android:id="@+id/iv_1" |
33 | android:layout_width="16dp" | 33 | android:layout_width="16dp" |
34 | android:layout_height="18dp" | 34 | android:layout_height="18dp" |
35 | android:layout_marginLeft="20dp" | 35 | android:layout_marginLeft="20dp" |
36 | android:background="@mipmap/sjh" | 36 | android:background="@mipmap/sjh" |
37 | app:layout_constraintBottom_toBottomOf="@id/view_1" | 37 | app:layout_constraintBottom_toBottomOf="@id/view_1" |
38 | app:layout_constraintLeft_toLeftOf="@id/view_1" | 38 | app:layout_constraintLeft_toLeftOf="@id/view_1" |
39 | app:layout_constraintTop_toTopOf="@id/view_1" /> | 39 | app:layout_constraintTop_toTopOf="@id/view_1" /> |
40 | 40 | ||
41 | <ImageView | 41 | <ImageView |
42 | android:id="@+id/iv_2" | 42 | android:id="@+id/iv_2" |
43 | android:layout_width="13dp" | 43 | android:layout_width="13dp" |
44 | android:layout_height="13dp" | 44 | android:layout_height="13dp" |
45 | android:layout_marginRight="20dp" | 45 | android:layout_marginRight="20dp" |
46 | android:background="@mipmap/sc" | 46 | android:background="@mipmap/sc" |
47 | app:layout_constraintBottom_toBottomOf="@id/view_1" | 47 | app:layout_constraintBottom_toBottomOf="@id/view_1" |
48 | app:layout_constraintRight_toRightOf="@id/view_1" | 48 | app:layout_constraintRight_toRightOf="@id/view_1" |
49 | app:layout_constraintTop_toTopOf="@id/view_1" /> | 49 | app:layout_constraintTop_toTopOf="@id/view_1" /> |
50 | 50 | ||
51 | <EditText | 51 | <EditText |
52 | android:id="@+id/et_phone" | 52 | android:id="@+id/et_phone" |
53 | android:layout_width="0dp" | 53 | android:layout_width="0dp" |
54 | android:layout_height="0dp" | 54 | android:layout_height="0dp" |
55 | android:layout_marginLeft="46dp" | 55 | android:layout_marginLeft="46dp" |
56 | android:background="@android:color/transparent" | 56 | android:background="@android:color/transparent" |
57 | android:gravity="left|center_vertical" | 57 | android:gravity="left|center_vertical" |
58 | android:hint="请输入手机号" | 58 | android:hint="请输入手机号" |
59 | android:inputType="number" | 59 | android:inputType="number" |
60 | android:maxLength="11" | 60 | android:maxLength="11" |
61 | android:textColorHint="#999999" | 61 | android:textColorHint="#999999" |
62 | android:textSize="16dp" | 62 | android:textSize="16dp" |
63 | app:layout_constraintBottom_toBottomOf="@id/view_1" | 63 | app:layout_constraintBottom_toBottomOf="@id/view_1" |
64 | app:layout_constraintLeft_toLeftOf="@id/view_1" | 64 | app:layout_constraintLeft_toLeftOf="@id/view_1" |
65 | app:layout_constraintRight_toLeftOf="@id/iv_2" | 65 | app:layout_constraintRight_toLeftOf="@id/iv_2" |
66 | app:layout_constraintTop_toTopOf="@id/view_1" /> | 66 | app:layout_constraintTop_toTopOf="@id/view_1" /> |
67 | 67 | ||
68 | 68 | ||
69 | <View | 69 | <View |
70 | android:id="@+id/view_2" | 70 | android:id="@+id/view_2" |
71 | android:layout_width="315dp" | 71 | android:layout_width="315dp" |
72 | android:layout_height="50dp" | 72 | android:layout_height="50dp" |
73 | android:layout_marginTop="241dp" | 73 | android:layout_marginTop="241dp" |
74 | android:background="@drawable/bg_solid_white" | 74 | android:background="@drawable/bg_solid_white" |
75 | app:layout_constraintLeft_toLeftOf="parent" | 75 | app:layout_constraintLeft_toLeftOf="parent" |
76 | app:layout_constraintRight_toRightOf="parent" | 76 | app:layout_constraintRight_toRightOf="parent" |
77 | app:layout_constraintTop_toTopOf="parent" /> | 77 | app:layout_constraintTop_toTopOf="parent" /> |
78 | 78 | ||
79 | <ImageView | 79 | <ImageView |
80 | android:id="@+id/iv_3" | 80 | android:id="@+id/iv_3" |
81 | android:layout_width="16dp" | 81 | android:layout_width="16dp" |
82 | android:layout_height="18dp" | 82 | android:layout_height="18dp" |
83 | android:layout_marginLeft="20dp" | 83 | android:layout_marginLeft="20dp" |
84 | android:background="@mipmap/mm" | 84 | android:background="@mipmap/mm" |
85 | app:layout_constraintBottom_toBottomOf="@id/view_2" | 85 | app:layout_constraintBottom_toBottomOf="@id/view_2" |
86 | app:layout_constraintLeft_toLeftOf="@id/view_2" | 86 | app:layout_constraintLeft_toLeftOf="@id/view_2" |
87 | app:layout_constraintTop_toTopOf="@id/view_2" /> | 87 | app:layout_constraintTop_toTopOf="@id/view_2" /> |
88 | 88 | ||
89 | <ImageView | 89 | <ImageView |
90 | android:id="@+id/iv_4" | 90 | android:id="@+id/iv_4" |
91 | android:layout_width="20dp" | 91 | android:layout_width="20dp" |
92 | android:layout_height="16dp" | 92 | android:layout_height="16dp" |
93 | android:layout_marginRight="20dp" | 93 | android:layout_marginRight="20dp" |
94 | android:background="@mipmap/xs" | 94 | android:background="@mipmap/xs" |
95 | app:layout_constraintBottom_toBottomOf="@id/view_2" | 95 | app:layout_constraintBottom_toBottomOf="@id/view_2" |
96 | app:layout_constraintRight_toRightOf="@id/view_2" | 96 | app:layout_constraintRight_toRightOf="@id/view_2" |
97 | app:layout_constraintTop_toTopOf="@id/view_2" /> | 97 | app:layout_constraintTop_toTopOf="@id/view_2" /> |
98 | 98 | ||
99 | <EditText | 99 | <EditText |
100 | android:id="@+id/et_pwd" | 100 | android:id="@+id/et_pwd" |
101 | android:layout_width="0dp" | 101 | android:layout_width="0dp" |
102 | android:layout_height="0dp" | 102 | android:layout_height="0dp" |
103 | android:layout_marginLeft="46dp" | 103 | android:layout_marginLeft="46dp" |
104 | android:layout_marginRight="20dp" | 104 | android:layout_marginRight="20dp" |
105 | android:background="@android:color/transparent" | 105 | android:background="@android:color/transparent" |
106 | android:gravity="left|center_vertical" | 106 | android:gravity="left|center_vertical" |
107 | android:hint="请输入密码" | 107 | android:hint="请输入密码" |
108 | android:inputType="textPassword" | 108 | android:inputType="textPassword" |
109 | android:textColorHint="#999999" | 109 | android:textColorHint="#999999" |
110 | android:textSize="16dp" | 110 | android:textSize="16dp" |
111 | app:layout_constraintBottom_toBottomOf="@id/view_2" | 111 | app:layout_constraintBottom_toBottomOf="@id/view_2" |
112 | app:layout_constraintLeft_toLeftOf="@id/view_2" | 112 | app:layout_constraintLeft_toLeftOf="@id/view_2" |
113 | app:layout_constraintRight_toLeftOf="@id/iv_4" | 113 | app:layout_constraintRight_toLeftOf="@id/iv_4" |
114 | app:layout_constraintTop_toTopOf="@id/view_2" /> | 114 | app:layout_constraintTop_toTopOf="@id/view_2" /> |
115 | 115 | ||
116 | 116 | ||
117 | <Button | 117 | <Button |
118 | android:id="@+id/btn_1" | 118 | android:id="@+id/btn_1" |
119 | android:layout_width="315dp" | 119 | android:layout_width="315dp" |
120 | android:layout_height="50dp" | 120 | android:layout_height="50dp" |
121 | android:layout_marginTop="331dp" | 121 | android:layout_marginTop="331dp" |
122 | android:background="@drawable/bg_solid_btn" | 122 | android:background="@drawable/bg_solid_btn" |
123 | android:text="登陆" | 123 | android:text="登录" |
124 | android:textColor="@color/white" | 124 | android:textColor="@color/white" |
125 | android:textSize="18dp" | 125 | android:textSize="18dp" |
126 | app:layout_constraintLeft_toLeftOf="parent" | 126 | app:layout_constraintLeft_toLeftOf="parent" |
127 | app:layout_constraintRight_toRightOf="parent" | 127 | app:layout_constraintRight_toRightOf="parent" |
128 | app:layout_constraintTop_toTopOf="parent" /> | 128 | app:layout_constraintTop_toTopOf="parent" /> |
129 | 129 | ||
130 | <TextView | 130 | <TextView |
131 | android:id="@+id/tv_1" | 131 | android:id="@+id/tv_1" |
132 | android:layout_width="wrap_content" | 132 | android:layout_width="wrap_content" |
133 | android:layout_height="wrap_content" | 133 | android:layout_height="wrap_content" |
134 | android:layout_marginLeft="85dp" | 134 | android:layout_marginLeft="85dp" |
135 | android:layout_marginTop="15dp" | 135 | android:layout_marginTop="15dp" |
136 | android:text="没有账号,立即" | 136 | android:text="没有账号,立即" |
137 | android:textColor="#666666" | 137 | android:textColor="#666666" |
138 | android:textSize="17dp" | 138 | android:textSize="17dp" |
139 | app:layout_constraintLeft_toLeftOf="@id/btn_1" | 139 | app:layout_constraintLeft_toLeftOf="@id/btn_1" |
140 | app:layout_constraintTop_toBottomOf="@id/btn_1" /> | 140 | app:layout_constraintTop_toBottomOf="@id/btn_1" /> |
141 | 141 | ||
142 | <TextView | 142 | <TextView |
143 | android:id="@+id/tv_2" | 143 | android:id="@+id/tv_2" |
144 | android:layout_width="wrap_content" | 144 | android:layout_width="wrap_content" |
145 | android:layout_height="wrap_content" | 145 | android:layout_height="wrap_content" |
146 | android:layout_marginTop="15dp" | 146 | android:layout_marginTop="15dp" |
147 | android:text="注册" | 147 | android:text="注册" |
148 | android:textColor="#FE5E09" | 148 | android:textColor="#FE5E09" |
149 | android:textSize="17dp" | 149 | android:textSize="17dp" |
150 | app:layout_constraintLeft_toRightOf="@id/tv_1" | 150 | app:layout_constraintLeft_toRightOf="@id/tv_1" |
151 | app:layout_constraintTop_toBottomOf="@id/btn_1" /> | 151 | app:layout_constraintTop_toBottomOf="@id/btn_1" /> |
152 | 152 | ||
153 | 153 | ||
154 | <CheckBox | 154 | <CheckBox |
155 | android:id="@+id/cb_1" | 155 | android:id="@+id/cb_1" |
156 | android:layout_width="wrap_content" | 156 | android:layout_width="wrap_content" |
157 | android:layout_height="wrap_content" | 157 | android:layout_height="wrap_content" |
158 | android:layout_marginLeft="67dp" | 158 | android:layout_marginLeft="67dp" |
159 | android:layout_marginBottom="50dp" | 159 | android:layout_marginBottom="50dp" |
160 | android:background="@android:color/transparent" | 160 | android:background="@android:color/transparent" |
161 | app:layout_constraintBottom_toBottomOf="parent" | 161 | app:layout_constraintBottom_toBottomOf="parent" |
162 | app:layout_constraintLeft_toLeftOf="parent" /> | 162 | app:layout_constraintLeft_toLeftOf="parent" /> |
163 | 163 | ||
164 | <TextView | 164 | <TextView |
165 | android:id="@+id/tv_3" | 165 | android:id="@+id/tv_3" |
166 | android:layout_width="wrap_content" | 166 | android:layout_width="wrap_content" |
167 | android:layout_height="wrap_content" | 167 | android:layout_height="wrap_content" |
168 | android:layout_marginLeft="5dp" | 168 | android:layout_marginLeft="5dp" |
169 | android:text="已阅读并同意《" | 169 | android:text="已阅读并同意《" |
170 | android:textColor="#999999" | 170 | android:textColor="#999999" |
171 | android:textSize="12dp" | 171 | android:textSize="12dp" |
172 | app:layout_constraintBottom_toBottomOf="@id/cb_1" | 172 | app:layout_constraintBottom_toBottomOf="@id/cb_1" |
173 | app:layout_constraintLeft_toRightOf="@id/cb_1" | 173 | app:layout_constraintLeft_toRightOf="@id/cb_1" |
174 | app:layout_constraintTop_toTopOf="@id/cb_1" /> | 174 | app:layout_constraintTop_toTopOf="@id/cb_1" /> |
175 | 175 | ||
176 | <TextView | 176 | <TextView |
177 | android:id="@+id/tv_4" | 177 | android:id="@+id/tv_4" |
178 | android:layout_width="wrap_content" | 178 | android:layout_width="wrap_content" |
179 | android:layout_height="wrap_content" | 179 | android:layout_height="wrap_content" |
180 | android:text="用户协议" | 180 | android:text="用户协议" |
181 | android:textColor="#FE5E09" | 181 | android:textColor="#FE5E09" |
182 | android:textSize="12dp" | 182 | android:textSize="12dp" |
183 | app:layout_constraintBottom_toBottomOf="@id/cb_1" | 183 | app:layout_constraintBottom_toBottomOf="@id/cb_1" |
184 | app:layout_constraintLeft_toRightOf="@id/tv_3" | 184 | app:layout_constraintLeft_toRightOf="@id/tv_3" |
185 | app:layout_constraintTop_toTopOf="@id/cb_1" /> | 185 | app:layout_constraintTop_toTopOf="@id/cb_1" /> |
186 | 186 | ||
187 | <TextView | 187 | <TextView |
188 | android:id="@+id/tv_5" | 188 | android:id="@+id/tv_5" |
189 | android:layout_width="wrap_content" | 189 | android:layout_width="wrap_content" |
190 | android:layout_height="wrap_content" | 190 | android:layout_height="wrap_content" |
191 | android:text="》和《" | 191 | android:text="》和《" |
192 | android:textColor="#999999" | 192 | android:textColor="#999999" |
193 | android:textSize="12dp" | 193 | android:textSize="12dp" |
194 | app:layout_constraintBottom_toBottomOf="@id/cb_1" | 194 | app:layout_constraintBottom_toBottomOf="@id/cb_1" |
195 | app:layout_constraintLeft_toRightOf="@id/tv_4" | 195 | app:layout_constraintLeft_toRightOf="@id/tv_4" |
196 | app:layout_constraintTop_toTopOf="@id/cb_1" /> | 196 | app:layout_constraintTop_toTopOf="@id/cb_1" /> |
197 | 197 | ||
198 | <TextView | 198 | <TextView |
199 | android:id="@+id/tv_6" | 199 | android:id="@+id/tv_6" |
200 | android:layout_width="wrap_content" | 200 | android:layout_width="wrap_content" |
201 | android:layout_height="wrap_content" | 201 | android:layout_height="wrap_content" |
202 | android:text="隐私政策" | 202 | android:text="隐私政策" |
203 | android:textColor="#FE5E09" | 203 | android:textColor="#FE5E09" |
204 | android:textSize="12dp" | 204 | android:textSize="12dp" |
205 | app:layout_constraintBottom_toBottomOf="@id/cb_1" | 205 | app:layout_constraintBottom_toBottomOf="@id/cb_1" |
206 | app:layout_constraintLeft_toRightOf="@id/tv_5" | 206 | app:layout_constraintLeft_toRightOf="@id/tv_5" |
207 | app:layout_constraintTop_toTopOf="@id/cb_1" /> | 207 | app:layout_constraintTop_toTopOf="@id/cb_1" /> |
208 | 208 | ||
209 | <TextView | 209 | <TextView |
210 | android:id="@+id/tv_7" | 210 | android:id="@+id/tv_7" |
211 | android:layout_width="wrap_content" | 211 | android:layout_width="wrap_content" |
212 | android:layout_height="wrap_content" | 212 | android:layout_height="wrap_content" |
213 | android:text="》" | 213 | android:text="》" |
214 | android:textColor="#999999" | 214 | android:textColor="#999999" |
215 | android:textSize="12dp" | 215 | android:textSize="12dp" |
216 | app:layout_constraintBottom_toBottomOf="@id/cb_1" | 216 | app:layout_constraintBottom_toBottomOf="@id/cb_1" |
217 | app:layout_constraintLeft_toRightOf="@id/tv_6" | 217 | app:layout_constraintLeft_toRightOf="@id/tv_6" |
218 | app:layout_constraintTop_toTopOf="@id/cb_1" /> | 218 | app:layout_constraintTop_toTopOf="@id/cb_1" /> |
219 | 219 | ||
220 | 220 | ||
221 | </androidx.constraintlayout.widget.ConstraintLayout> | 221 | </androidx.constraintlayout.widget.ConstraintLayout> |
app/src/main/res/layout/activity_qr.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
3 | android:layout_width="match_parent" | 3 | android:layout_width="match_parent" |
4 | android:layout_height="match_parent" | 4 | android:layout_height="match_parent" |
5 | xmlns:app="http://schemas.android.com/apk/res-auto" | 5 | xmlns:app="http://schemas.android.com/apk/res-auto" |
6 | android:background="#F4F6F8" | 6 | android:background="#F4F6F8" |
7 | > | 7 | > |
8 | 8 | ||
9 | <View | 9 | <View |
10 | android:id="@+id/view_1" | 10 | android:id="@+id/view_1" |
11 | android:layout_width="match_parent" | 11 | android:layout_width="match_parent" |
12 | android:layout_height="44dp" | 12 | android:layout_height="44dp" |
13 | app:layout_constraintTop_toTopOf="parent" | 13 | app:layout_constraintTop_toTopOf="parent" |
14 | android:background="@android:color/white" | 14 | android:background="@android:color/white" |
15 | /> | 15 | /> |
16 | <TextView | 16 | <TextView |
17 | android:layout_width="wrap_content" | 17 | android:layout_width="wrap_content" |
18 | android:layout_height="wrap_content" | 18 | android:layout_height="wrap_content" |
19 | android:text="扫码登陆" | 19 | android:text="扫码登录" |
20 | android:textColor="#333333" | 20 | android:textColor="#333333" |
21 | android:textSize="18dp" | 21 | android:textSize="18dp" |
22 | app:layout_constraintLeft_toLeftOf="@id/view_1" | 22 | app:layout_constraintLeft_toLeftOf="@id/view_1" |
23 | app:layout_constraintRight_toRightOf="@id/view_1" | 23 | app:layout_constraintRight_toRightOf="@id/view_1" |
24 | app:layout_constraintTop_toTopOf="@id/view_1" | 24 | app:layout_constraintTop_toTopOf="@id/view_1" |
25 | app:layout_constraintBottom_toBottomOf="@id/view_1" | 25 | app:layout_constraintBottom_toBottomOf="@id/view_1" |
26 | /> | 26 | /> |
27 | <ImageView | 27 | <ImageView |
28 | android:id="@+id/iv_back" | 28 | android:id="@+id/iv_back" |
29 | android:layout_width="10dp" | 29 | android:layout_width="10dp" |
30 | android:layout_height="16dp" | 30 | android:layout_height="16dp" |
31 | app:layout_constraintLeft_toLeftOf="parent" | 31 | app:layout_constraintLeft_toLeftOf="parent" |
32 | app:layout_constraintTop_toTopOf="@id/view_1" | 32 | app:layout_constraintTop_toTopOf="@id/view_1" |
33 | app:layout_constraintBottom_toBottomOf="@id/view_1" | 33 | app:layout_constraintBottom_toBottomOf="@id/view_1" |
34 | android:layout_marginLeft="15dp" | 34 | android:layout_marginLeft="15dp" |
35 | android:background="@mipmap/icon_back" | 35 | android:background="@mipmap/icon_back" |
36 | /> | 36 | /> |
37 | <View | 37 | <View |
38 | android:layout_width="match_parent" | 38 | android:layout_width="match_parent" |
39 | android:layout_height="1dp" | 39 | android:layout_height="1dp" |
40 | android:background="#EEEEEE" | 40 | android:background="#EEEEEE" |
41 | app:layout_constraintTop_toBottomOf="@id/view_1" | 41 | app:layout_constraintTop_toBottomOf="@id/view_1" |
42 | /> | 42 | /> |
43 | <FrameLayout | 43 | <FrameLayout |
44 | android:id="@+id/rl_content" | 44 | android:id="@+id/rl_content" |
45 | android:layout_width="match_parent" | 45 | android:layout_width="match_parent" |
46 | android:layout_height="0dp" | 46 | android:layout_height="0dp" |
47 | app:layout_constraintBottom_toBottomOf="parent" | 47 | app:layout_constraintBottom_toBottomOf="parent" |
48 | app:layout_constraintTop_toBottomOf="@id/view_1" | 48 | app:layout_constraintTop_toBottomOf="@id/view_1" |
49 | 49 | ||
50 | /> | 50 | /> |
51 | 51 | ||
52 | 52 | ||
53 | 53 | ||
54 | 54 | ||
55 | 55 | ||
56 | </androidx.constraintlayout.widget.ConstraintLayout> | 56 | </androidx.constraintlayout.widget.ConstraintLayout> |
app/src/main/res/layout/activity_sao.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
3 | android:layout_width="match_parent" | 3 | android:layout_width="match_parent" |
4 | android:layout_height="match_parent" | 4 | android:layout_height="match_parent" |
5 | xmlns:app="http://schemas.android.com/apk/res-auto" | 5 | xmlns:app="http://schemas.android.com/apk/res-auto" |
6 | android:background="#F4F6F8" | 6 | android:background="#F4F6F8" |
7 | > | 7 | > |
8 | 8 | ||
9 | <View | 9 | <View |
10 | android:id="@+id/view_1" | 10 | android:id="@+id/view_1" |
11 | android:layout_width="match_parent" | 11 | android:layout_width="match_parent" |
12 | android:layout_height="44dp" | 12 | android:layout_height="44dp" |
13 | app:layout_constraintTop_toTopOf="parent" | 13 | app:layout_constraintTop_toTopOf="parent" |
14 | android:background="@android:color/white" | 14 | android:background="@android:color/white" |
15 | /> | 15 | /> |
16 | <TextView | 16 | <TextView |
17 | android:layout_width="wrap_content" | 17 | android:layout_width="wrap_content" |
18 | android:layout_height="wrap_content" | 18 | android:layout_height="wrap_content" |
19 | android:text="扫码登陆" | 19 | android:text="扫码登录" |
20 | android:textColor="#333333" | 20 | android:textColor="#333333" |
21 | android:textSize="18dp" | 21 | android:textSize="18dp" |
22 | app:layout_constraintLeft_toLeftOf="@id/view_1" | 22 | app:layout_constraintLeft_toLeftOf="@id/view_1" |
23 | app:layout_constraintRight_toRightOf="@id/view_1" | 23 | app:layout_constraintRight_toRightOf="@id/view_1" |
24 | app:layout_constraintTop_toTopOf="@id/view_1" | 24 | app:layout_constraintTop_toTopOf="@id/view_1" |
25 | app:layout_constraintBottom_toBottomOf="@id/view_1" | 25 | app:layout_constraintBottom_toBottomOf="@id/view_1" |
26 | /> | 26 | /> |
27 | <ImageView | 27 | <ImageView |
28 | android:layout_width="10dp" | 28 | android:layout_width="10dp" |
29 | android:layout_height="16dp" | 29 | android:layout_height="16dp" |
30 | app:layout_constraintLeft_toLeftOf="parent" | 30 | app:layout_constraintLeft_toLeftOf="parent" |
31 | app:layout_constraintTop_toTopOf="@id/view_1" | 31 | app:layout_constraintTop_toTopOf="@id/view_1" |
32 | app:layout_constraintBottom_toBottomOf="@id/view_1" | 32 | app:layout_constraintBottom_toBottomOf="@id/view_1" |
33 | android:layout_marginLeft="15dp" | 33 | android:layout_marginLeft="15dp" |
34 | android:background="@mipmap/icon_back" | 34 | android:background="@mipmap/icon_back" |
35 | /> | 35 | /> |
36 | 36 | ||
37 | 37 | ||
38 | </androidx.constraintlayout.widget.ConstraintLayout> | 38 | </androidx.constraintlayout.widget.ConstraintLayout> |