Commit 40297dd4a4ce4e37907f104c31c58b9ba5ffaa68
1 parent
e73fb8ff90
Exists in
master
教师登录默认首页;
布局调整, 允许滚动;
Showing
3 changed files
with
242 additions
and
230 deletions
Show diff stats
app/src/main/java/com/hjx/parent/LoginActivity.java
... | ... | @@ -88,7 +88,9 @@ public class LoginActivity extends BaseActivity { |
88 | 88 | } |
89 | 89 | |
90 | 90 | findViewById(R.id.tvBack).setOnClickListener(v -> { |
91 | - startActivity(new Intent(this, SmsLoginActivity.class)); | |
91 | + Intent intent = new Intent(this, SmsLoginActivity.class); | |
92 | + intent.putExtra("fromLogin", true); | |
93 | + startActivity(intent); | |
92 | 94 | finish(); |
93 | 95 | }); |
94 | 96 | ... | ... |
app/src/main/java/com/hjx/parent/SmsLoginActivity.java
... | ... | @@ -79,6 +79,11 @@ public class SmsLoginActivity extends BaseRxActivity<ActivitySmsLoginBinding> { |
79 | 79 | binding.tv4.setOnClickListener(view -> { |
80 | 80 | startActivity(new Intent(this, UserAgreementActivity.class)); |
81 | 81 | }); |
82 | + | |
83 | + if (!getIntent().getBooleanExtra("fromLogin", false)) { | |
84 | + startActivity(new Intent(this, LoginActivity.class)); | |
85 | + finish(); | |
86 | + } | |
82 | 87 | } |
83 | 88 | |
84 | 89 | @SuppressLint("CheckResult") | ... | ... |
app/src/main/res/layout/dialog_add_error.xml
1 | -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
1 | +<androidx.core.widget.NestedScrollView | |
2 | + xmlns:android="http://schemas.android.com/apk/res/android" | |
2 | 3 | android:layout_width="match_parent" |
3 | - android:layout_height="wrap_content" | |
4 | - android:background="@drawable/bg_solid_white_10_top" | |
5 | - android:orientation="vertical"> | |
6 | - | |
7 | - <RelativeLayout | |
8 | - android:layout_width="match_parent" | |
9 | - android:layout_height="50dp"> | |
10 | - | |
11 | - <TextView | |
12 | - android:layout_width="wrap_content" | |
13 | - android:layout_height="wrap_content" | |
14 | - android:layout_centerInParent="true" | |
15 | - android:text="加入错题本" | |
16 | - android:textColor="@color/text_title" | |
17 | - android:textSize="17sp" | |
18 | - android:textStyle="bold" /> | |
19 | - | |
20 | - <ImageView | |
21 | - android:id="@+id/iv_back" | |
22 | - android:layout_width="35dp" | |
23 | - android:layout_height="35dp" | |
24 | - android:layout_alignParentRight="true" | |
25 | - android:layout_centerVertical="true" | |
26 | - android:layout_marginRight="10dp" | |
27 | - android:padding="10dp" | |
28 | - android:src="@mipmap/ic_close" /> | |
29 | - </RelativeLayout> | |
30 | - | |
31 | - <androidx.recyclerview.widget.RecyclerView | |
32 | - android:id="@+id/list_item" | |
33 | - android:layout_width="match_parent" | |
34 | - android:layout_height="30dp" | |
35 | - android:layout_marginLeft="20dp" | |
36 | - android:layout_marginTop="10dp" | |
37 | - android:layout_marginRight="20dp" /> | |
38 | - | |
39 | - <RelativeLayout | |
4 | + android:layout_height="match_parent"> | |
5 | + <LinearLayout | |
40 | 6 | android:layout_width="match_parent" |
41 | - android:layout_height="90dp" | |
42 | - android:layout_marginLeft="20dp" | |
43 | - android:layout_marginTop="20dp" | |
44 | - android:layout_marginRight="20dp"> | |
7 | + android:layout_height="wrap_content" | |
8 | + android:background="@drawable/bg_solid_white_10_top" | |
9 | + android:orientation="vertical"> | |
45 | 10 | |
46 | 11 | <RelativeLayout |
47 | 12 | android:layout_width="match_parent" |
48 | - android:layout_height="match_parent" | |
49 | - android:background="#F5F5F5"> | |
13 | + android:layout_height="50dp"> | |
50 | 14 | |
51 | - <ImageView | |
52 | - android:id="@+id/iv_topic" | |
15 | + <TextView | |
53 | 16 | android:layout_width="wrap_content" |
54 | 17 | android:layout_height="wrap_content" |
55 | - android:layout_centerVertical="true" /> | |
56 | - </RelativeLayout> | |
57 | - </RelativeLayout> | |
58 | - | |
59 | - <TextView | |
60 | - android:layout_width="wrap_content" | |
61 | - android:layout_height="wrap_content" | |
62 | - android:layout_centerVertical="true" | |
63 | - android:layout_marginLeft="20dp" | |
64 | - android:layout_marginTop="20dp" | |
65 | - android:text="年级" | |
66 | - android:textColor="@color/text_title" | |
67 | - android:textSize="15sp" | |
68 | - android:textStyle="bold" /> | |
18 | + android:layout_centerInParent="true" | |
19 | + android:text="加入错题本" | |
20 | + android:textColor="@color/text_title" | |
21 | + android:textSize="17sp" | |
22 | + android:textStyle="bold" /> | |
69 | 23 | |
70 | - <androidx.appcompat.widget.AppCompatSpinner | |
71 | - android:id="@+id/spinner_grade" | |
72 | - style="@style/customSpinnerStyle" | |
73 | - android:layout_width="match_parent" | |
74 | - android:layout_height="40dp" | |
75 | - android:layout_centerHorizontal="true" | |
76 | - android:layout_marginLeft="20dp" | |
77 | - android:layout_marginTop="10dp" | |
78 | - android:layout_marginRight="20dp" | |
79 | - android:background="@drawable/selector_for_custom_spinner" | |
80 | - android:popupBackground="@drawable/shape_for_custom_spinner" | |
81 | - android:scrollbars="none" /> | |
82 | - | |
83 | - <TextView | |
84 | - android:layout_width="wrap_content" | |
85 | - android:layout_height="wrap_content" | |
86 | - android:layout_centerVertical="true" | |
87 | - android:layout_marginLeft="20dp" | |
88 | - android:layout_marginTop="20dp" | |
89 | - android:text="学期" | |
90 | - android:textColor="@color/text_title" | |
91 | - android:textSize="15sp" | |
92 | - android:textStyle="bold" /> | |
24 | + <ImageView | |
25 | + android:id="@+id/iv_back" | |
26 | + android:layout_width="35dp" | |
27 | + android:layout_height="35dp" | |
28 | + android:layout_alignParentRight="true" | |
29 | + android:layout_centerVertical="true" | |
30 | + android:layout_marginRight="10dp" | |
31 | + android:padding="10dp" | |
32 | + android:src="@mipmap/ic_close" /> | |
33 | + </RelativeLayout> | |
93 | 34 | |
94 | - <androidx.appcompat.widget.AppCompatSpinner | |
95 | - android:id="@+id/spinner_grade1" | |
96 | - style="@style/customSpinnerStyle" | |
97 | - android:layout_width="match_parent" | |
98 | - android:layout_height="40dp" | |
99 | - android:layout_centerHorizontal="true" | |
100 | - android:layout_marginLeft="20dp" | |
101 | - android:layout_marginTop="10dp" | |
102 | - android:layout_marginRight="20dp" | |
103 | - android:background="@drawable/selector_for_custom_spinner" | |
104 | - android:entries="@array/grade_array" | |
105 | - android:popupBackground="@drawable/shape_for_custom_spinner" | |
106 | - android:scrollbars="none" /> | |
35 | + <androidx.recyclerview.widget.RecyclerView | |
36 | + android:id="@+id/list_item" | |
37 | + android:layout_width="match_parent" | |
38 | + android:layout_height="30dp" | |
39 | + android:layout_marginLeft="20dp" | |
40 | + android:layout_marginTop="10dp" | |
41 | + android:layout_marginRight="20dp" /> | |
107 | 42 | |
108 | - <TextView | |
109 | - android:layout_width="wrap_content" | |
110 | - android:layout_height="wrap_content" | |
111 | - android:layout_centerVertical="true" | |
112 | - android:layout_marginLeft="20dp" | |
113 | - android:layout_marginTop="20dp" | |
114 | - android:text="科目" | |
115 | - android:textColor="@color/text_title" | |
116 | - android:textSize="15sp" | |
117 | - android:textStyle="bold" /> | |
43 | + <RelativeLayout | |
44 | + android:layout_width="match_parent" | |
45 | + android:layout_height="90dp" | |
46 | + android:layout_marginLeft="20dp" | |
47 | + android:layout_marginTop="20dp" | |
48 | + android:layout_marginRight="20dp"> | |
118 | 49 | |
119 | - <androidx.appcompat.widget.AppCompatSpinner | |
120 | - android:id="@+id/spinner_subject" | |
121 | - style="@style/customSpinnerStyle" | |
122 | - android:layout_width="match_parent" | |
123 | - android:layout_height="40dp" | |
124 | - android:layout_centerHorizontal="true" | |
125 | - android:layout_marginLeft="20dp" | |
126 | - android:layout_marginTop="10dp" | |
127 | - android:layout_marginRight="20dp" | |
128 | - android:background="@drawable/selector_for_custom_spinner" | |
129 | - android:entries="@array/filter_subject" | |
130 | - android:popupBackground="@drawable/shape_for_custom_spinner" | |
131 | - android:scrollbars="none" /> | |
50 | + <RelativeLayout | |
51 | + android:layout_width="match_parent" | |
52 | + android:layout_height="match_parent" | |
53 | + android:background="#F5F5F5"> | |
132 | 54 | |
133 | - <TextView | |
134 | - android:layout_width="wrap_content" | |
135 | - android:layout_height="wrap_content" | |
136 | - android:layout_centerVertical="true" | |
137 | - android:layout_marginLeft="20dp" | |
138 | - android:layout_marginTop="20dp" | |
139 | - android:text="错误原因" | |
140 | - android:textColor="@color/text_title" | |
141 | - android:textSize="15sp" | |
142 | - android:textStyle="bold" /> | |
55 | + <ImageView | |
56 | + android:id="@+id/iv_topic" | |
57 | + android:layout_width="wrap_content" | |
58 | + android:layout_height="wrap_content" | |
59 | + android:layout_centerVertical="true" /> | |
60 | + </RelativeLayout> | |
61 | + </RelativeLayout> | |
143 | 62 | |
144 | - <androidx.appcompat.widget.AppCompatSpinner | |
145 | - android:id="@+id/spinner_reason" | |
146 | - style="@style/customSpinnerStyle" | |
147 | - android:layout_width="match_parent" | |
148 | - android:layout_height="40dp" | |
149 | - android:layout_centerHorizontal="true" | |
150 | - android:layout_marginLeft="20dp" | |
151 | - android:layout_marginTop="10dp" | |
152 | - android:layout_marginRight="20dp" | |
153 | - android:background="@drawable/selector_for_custom_spinner" | |
154 | - android:entries="@array/filter_subject" | |
155 | - android:popupBackground="@drawable/shape_for_custom_spinner" | |
156 | - android:scrollbars="none" /> | |
63 | + <TextView | |
64 | + android:layout_width="wrap_content" | |
65 | + android:layout_height="wrap_content" | |
66 | + android:layout_centerVertical="true" | |
67 | + android:layout_marginLeft="20dp" | |
68 | + android:layout_marginTop="20dp" | |
69 | + android:text="年级" | |
70 | + android:textColor="@color/text_title" | |
71 | + android:textSize="15sp" | |
72 | + android:textStyle="bold" /> | |
157 | 73 | |
158 | - <TextView | |
159 | - android:id="@+id/tv_student" | |
160 | - android:layout_width="wrap_content" | |
161 | - android:layout_height="wrap_content" | |
162 | - android:layout_centerVertical="true" | |
163 | - android:layout_marginLeft="20dp" | |
164 | - android:layout_marginTop="20dp" | |
165 | - android:text="学生" | |
166 | - android:textColor="@color/text_title" | |
167 | - android:visibility="gone" | |
168 | - android:textSize="15sp" | |
169 | - android:textStyle="bold" /> | |
74 | + <androidx.appcompat.widget.AppCompatSpinner | |
75 | + android:id="@+id/spinner_grade" | |
76 | + style="@style/customSpinnerStyle" | |
77 | + android:layout_width="match_parent" | |
78 | + android:layout_height="40dp" | |
79 | + android:layout_centerHorizontal="true" | |
80 | + android:layout_marginLeft="20dp" | |
81 | + android:layout_marginTop="10dp" | |
82 | + android:layout_marginRight="20dp" | |
83 | + android:background="@drawable/selector_for_custom_spinner" | |
84 | + android:popupBackground="@drawable/shape_for_custom_spinner" | |
85 | + android:scrollbars="none" /> | |
170 | 86 | |
171 | - <androidx.appcompat.widget.AppCompatSpinner | |
172 | - android:id="@+id/spinner_student" | |
173 | - style="@style/customSpinnerStyle" | |
174 | - android:layout_width="match_parent" | |
175 | - android:layout_height="40dp" | |
176 | - android:layout_centerHorizontal="true" | |
177 | - android:layout_marginLeft="20dp" | |
178 | - android:layout_marginTop="10dp" | |
179 | - android:layout_marginRight="20dp" | |
180 | - android:visibility="gone" | |
181 | - android:background="@drawable/selector_for_custom_spinner" | |
182 | - android:entries="@array/filter_subject" | |
183 | - android:popupBackground="@drawable/shape_for_custom_spinner" | |
184 | - android:scrollbars="none" /> | |
87 | + <TextView | |
88 | + android:layout_width="wrap_content" | |
89 | + android:layout_height="wrap_content" | |
90 | + android:layout_centerVertical="true" | |
91 | + android:layout_marginLeft="20dp" | |
92 | + android:layout_marginTop="20dp" | |
93 | + android:text="学期" | |
94 | + android:textColor="@color/text_title" | |
95 | + android:textSize="15sp" | |
96 | + android:textStyle="bold" /> | |
185 | 97 | |
186 | - <TextView | |
187 | - android:layout_width="wrap_content" | |
188 | - android:layout_height="wrap_content" | |
189 | - android:layout_centerVertical="true" | |
190 | - android:layout_marginLeft="20dp" | |
191 | - android:layout_marginTop="20dp" | |
192 | - android:text="来源" | |
193 | - android:textColor="@color/text_title" | |
194 | - android:textSize="15sp" | |
195 | - android:textStyle="bold" /> | |
98 | + <androidx.appcompat.widget.AppCompatSpinner | |
99 | + android:id="@+id/spinner_grade1" | |
100 | + style="@style/customSpinnerStyle" | |
101 | + android:layout_width="match_parent" | |
102 | + android:layout_height="40dp" | |
103 | + android:layout_centerHorizontal="true" | |
104 | + android:layout_marginLeft="20dp" | |
105 | + android:layout_marginTop="10dp" | |
106 | + android:layout_marginRight="20dp" | |
107 | + android:background="@drawable/selector_for_custom_spinner" | |
108 | + android:entries="@array/grade_array" | |
109 | + android:popupBackground="@drawable/shape_for_custom_spinner" | |
110 | + android:scrollbars="none" /> | |
196 | 111 | |
197 | - <RadioGroup | |
198 | - android:id="@+id/type_radio" | |
199 | - android:layout_width="match_parent" | |
200 | - android:layout_height="40dp" | |
201 | - android:layout_marginLeft="20dp" | |
202 | - android:layout_marginTop="10dp" | |
203 | - android:orientation="horizontal"> | |
112 | + <TextView | |
113 | + android:layout_width="wrap_content" | |
114 | + android:layout_height="wrap_content" | |
115 | + android:layout_centerVertical="true" | |
116 | + android:layout_marginLeft="20dp" | |
117 | + android:layout_marginTop="20dp" | |
118 | + android:text="科目" | |
119 | + android:textColor="@color/text_title" | |
120 | + android:textSize="15sp" | |
121 | + android:textStyle="bold" /> | |
204 | 122 | |
205 | - <RadioButton | |
206 | - android:layout_width="65dp" | |
207 | - android:layout_height="match_parent" | |
123 | + <androidx.appcompat.widget.AppCompatSpinner | |
124 | + android:id="@+id/spinner_subject" | |
125 | + style="@style/customSpinnerStyle" | |
126 | + android:layout_width="match_parent" | |
127 | + android:layout_height="40dp" | |
128 | + android:layout_centerHorizontal="true" | |
129 | + android:layout_marginLeft="20dp" | |
130 | + android:layout_marginTop="10dp" | |
208 | 131 | android:layout_marginRight="20dp" |
209 | - android:background="@drawable/radio_button_selector" | |
210 | - android:button="@null" | |
211 | - android:gravity="center" | |
212 | - android:text="课内" | |
213 | - android:textColor="@drawable/radio_text_selector" | |
214 | - android:textSize="14sp" /> | |
132 | + android:background="@drawable/selector_for_custom_spinner" | |
133 | + android:entries="@array/filter_subject" | |
134 | + android:popupBackground="@drawable/shape_for_custom_spinner" | |
135 | + android:scrollbars="none" /> | |
136 | + | |
137 | + <TextView | |
138 | + android:layout_width="wrap_content" | |
139 | + android:layout_height="wrap_content" | |
140 | + android:layout_centerVertical="true" | |
141 | + android:layout_marginLeft="20dp" | |
142 | + android:layout_marginTop="20dp" | |
143 | + android:text="错误原因" | |
144 | + android:textColor="@color/text_title" | |
145 | + android:textSize="15sp" | |
146 | + android:textStyle="bold" /> | |
215 | 147 | |
216 | - <RadioButton | |
217 | - android:layout_width="65dp" | |
218 | - android:layout_height="match_parent" | |
148 | + <androidx.appcompat.widget.AppCompatSpinner | |
149 | + android:id="@+id/spinner_reason" | |
150 | + style="@style/customSpinnerStyle" | |
151 | + android:layout_width="match_parent" | |
152 | + android:layout_height="40dp" | |
153 | + android:layout_centerHorizontal="true" | |
154 | + android:layout_marginLeft="20dp" | |
155 | + android:layout_marginTop="10dp" | |
219 | 156 | android:layout_marginRight="20dp" |
220 | - android:background="@drawable/radio_button_selector" | |
221 | - android:button="@null" | |
222 | - android:gravity="center" | |
223 | - android:text="课外" | |
224 | - android:textColor="@drawable/radio_text_selector" | |
225 | - android:textSize="14sp" /> | |
226 | - </RadioGroup> | |
157 | + android:background="@drawable/selector_for_custom_spinner" | |
158 | + android:entries="@array/filter_subject" | |
159 | + android:popupBackground="@drawable/shape_for_custom_spinner" | |
160 | + android:scrollbars="none" /> | |
227 | 161 | |
162 | + <TextView | |
163 | + android:id="@+id/tv_student" | |
164 | + android:layout_width="wrap_content" | |
165 | + android:layout_height="wrap_content" | |
166 | + android:layout_centerVertical="true" | |
167 | + android:layout_marginLeft="20dp" | |
168 | + android:layout_marginTop="20dp" | |
169 | + android:text="学生" | |
170 | + android:textColor="@color/text_title" | |
171 | + android:visibility="gone" | |
172 | + android:textSize="15sp" | |
173 | + android:textStyle="bold" /> | |
228 | 174 | |
229 | - <RelativeLayout | |
230 | - android:layout_width="match_parent" | |
231 | - android:layout_height="40dp" | |
232 | - android:layout_marginLeft="20dp" | |
233 | - android:layout_marginTop="20dp" | |
234 | - android:layout_marginRight="20dp" | |
235 | - android:layout_marginBottom="15dp"> | |
175 | + <androidx.appcompat.widget.AppCompatSpinner | |
176 | + android:id="@+id/spinner_student" | |
177 | + style="@style/customSpinnerStyle" | |
178 | + android:layout_width="match_parent" | |
179 | + android:layout_height="40dp" | |
180 | + android:layout_centerHorizontal="true" | |
181 | + android:layout_marginLeft="20dp" | |
182 | + android:layout_marginTop="10dp" | |
183 | + android:layout_marginRight="20dp" | |
184 | + android:visibility="gone" | |
185 | + android:background="@drawable/selector_for_custom_spinner" | |
186 | + android:entries="@array/filter_subject" | |
187 | + android:popupBackground="@drawable/shape_for_custom_spinner" | |
188 | + android:scrollbars="none" /> | |
236 | 189 | |
237 | 190 | <TextView |
238 | - android:id="@+id/add_topic" | |
239 | - android:layout_width="250dp" | |
240 | - android:layout_height="match_parent" | |
241 | - android:layout_alignParentRight="true" | |
242 | - android:background="@drawable/bg_soild_blue_5" | |
243 | - android:gravity="center" | |
244 | - android:textColor="@color/white" | |
245 | - android:textSize="17sp" /> | |
246 | - | |
247 | - <CheckBox | |
248 | - android:id="@+id/checkbox" | |
249 | 191 | android:layout_width="wrap_content" |
250 | - android:layout_height="30dp" | |
192 | + android:layout_height="wrap_content" | |
251 | 193 | android:layout_centerVertical="true" |
252 | - android:button="@drawable/checkbox_selector" | |
253 | - android:text="批量设置" | |
254 | - android:paddingLeft="8dp" | |
194 | + android:layout_marginLeft="20dp" | |
195 | + android:layout_marginTop="20dp" | |
196 | + android:text="来源" | |
255 | 197 | android:textColor="@color/text_title" |
256 | - android:textSize="14sp" /> | |
198 | + android:textSize="15sp" | |
199 | + android:textStyle="bold" /> | |
200 | + | |
201 | + <RadioGroup | |
202 | + android:id="@+id/type_radio" | |
203 | + android:layout_width="match_parent" | |
204 | + android:layout_height="40dp" | |
205 | + android:layout_marginLeft="20dp" | |
206 | + android:layout_marginTop="10dp" | |
207 | + android:orientation="horizontal"> | |
257 | 208 | |
258 | - </RelativeLayout> | |
259 | -</LinearLayout> | |
209 | + <RadioButton | |
210 | + android:layout_width="65dp" | |
211 | + android:layout_height="match_parent" | |
212 | + android:layout_marginRight="20dp" | |
213 | + android:background="@drawable/radio_button_selector" | |
214 | + android:button="@null" | |
215 | + android:gravity="center" | |
216 | + android:text="课内" | |
217 | + android:textColor="@drawable/radio_text_selector" | |
218 | + android:textSize="14sp" /> | |
219 | + | |
220 | + <RadioButton | |
221 | + android:layout_width="65dp" | |
222 | + android:layout_height="match_parent" | |
223 | + android:layout_marginRight="20dp" | |
224 | + android:background="@drawable/radio_button_selector" | |
225 | + android:button="@null" | |
226 | + android:gravity="center" | |
227 | + android:text="课外" | |
228 | + android:textColor="@drawable/radio_text_selector" | |
229 | + android:textSize="14sp" /> | |
230 | + </RadioGroup> | |
231 | + | |
232 | + | |
233 | + <RelativeLayout | |
234 | + android:layout_width="match_parent" | |
235 | + android:layout_height="40dp" | |
236 | + android:layout_marginLeft="20dp" | |
237 | + android:layout_marginTop="20dp" | |
238 | + android:layout_marginRight="20dp" | |
239 | + android:layout_marginBottom="15dp"> | |
240 | + | |
241 | + <TextView | |
242 | + android:id="@+id/add_topic" | |
243 | + android:layout_width="250dp" | |
244 | + android:layout_height="match_parent" | |
245 | + android:layout_alignParentRight="true" | |
246 | + android:background="@drawable/bg_soild_blue_5" | |
247 | + android:gravity="center" | |
248 | + android:textColor="@color/white" | |
249 | + android:textSize="17sp" /> | |
250 | + | |
251 | + <CheckBox | |
252 | + android:id="@+id/checkbox" | |
253 | + android:layout_width="wrap_content" | |
254 | + android:layout_height="30dp" | |
255 | + android:layout_centerVertical="true" | |
256 | + android:button="@drawable/checkbox_selector" | |
257 | + android:text="批量设置" | |
258 | + android:paddingLeft="8dp" | |
259 | + android:textColor="@color/text_title" | |
260 | + android:textSize="14sp" /> | |
261 | + | |
262 | + </RelativeLayout> | |
263 | + </LinearLayout> | |
264 | +</androidx.core.widget.NestedScrollView> | |
260 | 265 | ... | ... |