Commit 7243a5da592e2bb5e227a1299c780d7381db6f1f
1 parent
0ab1296a2e
Exists in
master
学生字段调整
Showing
7 changed files
with
66 additions
and
128 deletions
Show diff stats
.idea/inspectionProfiles/Project_Default.xml
1 | 1 | <component name="InspectionProjectProfileManager"> |
2 | 2 | <profile version="1.0"> |
3 | 3 | <option name="myName" value="Project Default" /> |
4 | + <inspection_tool class="Deprecation" enabled="false" level="WARNING" enabled_by_default="false" /> | |
4 | 5 | <inspection_tool class="IgnoreResultOfCall" enabled="false" level="WARNING" enabled_by_default="false"> |
5 | 6 | <option name="m_reportAllNonLibraryCalls" value="false" /> |
6 | 7 | <option name="callCheckString" value="java.io.File,.*,java.io.InputStream,read|skip|available|markSupported,java.io.Reader,read|skip|ready|markSupported,java.lang.AbstractStringBuilder,capacity|codePointAt|codePointBefore|codePointCount|indexOf|lastIndexOf|offsetByCodePoints|substring|subSequence,java.lang.Boolean,.*,java.lang.Byte,.*,java.lang.Character,.*,java.lang.Double,.*,java.lang.Float,.*,java.lang.Integer,.*,java.lang.Long,.*,java.lang.Math,.*,java.lang.Object,equals|hashCode|toString,java.lang.Short,.*,java.lang.StrictMath,.*,java.lang.String,.*,java.lang.Thread,interrupted,java.math.BigDecimal,.*,java.math.BigInteger,.*,java.net.InetAddress,.*,java.net.URI,.*,java.nio.channels.AsynchronousChannelGroup,.*,java.nio.channels.Channel,isOpen,java.nio.channels.FileChannel,open|map|lock|tryLock|write,java.nio.channels.ScatteringByteChannel,read,java.nio.channels.SocketChannel,open|socket|isConnected|isConnectionPending,java.util.Arrays,.*,java.util.Collections,(?!addAll).*,java.util.List,of,java.util.Map,of|ofEntries|entry,java.util.Set,of,java.util.UUID,.*,java.util.concurrent.BlockingQueue,offer|remove,java.util.concurrent.CountDownLatch,await|getCount,java.util.concurrent.ExecutorService,awaitTermination|isShutdown|isTerminated,java.util.concurrent.ForkJoinPool,awaitQuiescence,java.util.concurrent.Semaphore,tryAcquire|availablePermits|isFair|hasQueuedThreads|getQueueLength|getQueuedThreads,java.util.concurrent.locks.Condition,await|awaitNanos|awaitUntil,java.util.concurrent.locks.Lock,tryLock|newCondition,java.util.regex.Matcher,pattern|toMatchResult|start|end|group|groupCount|matches|find|lookingAt|quoteReplacement|replaceAll|replaceFirst|regionStart|regionEnd|hasTransparentBounds|hasAnchoringBounds|hitEnd|requireEnd,java.util.regex.Pattern,.*,java.util.stream.BaseStream,.*,java.util.stream.DoubleStream,.*,java.util.stream.IntStream,.*,java.util.stream.LongStream,.*,java.util.stream.Stream,.*" /> | ... | ... |
app/src/main/java/com/hjx/parent/ChooseActivity.java
... | ... | @@ -166,13 +166,13 @@ public class ChooseActivity extends BaseActivity { |
166 | 166 | item.setImageResource(R.id.iv_select, select == item.getAdapterPosition() ? R.mipmap.gx : R.mipmap.wsyq); |
167 | 167 | item.setVisible(R.id.rl_add, false); |
168 | 168 | if (TextUtils.isEmpty(studentBean.getPhoto())) { |
169 | - item.setImageResource(R.id.iv_avatar, studentBean.getGender() == 0 ? R.mipmap.ic_avatar_male : R.mipmap.ic_avatar_female); | |
169 | + item.setImageResource(R.id.iv_avatar, "男".equals(studentBean.getGender()) ? R.mipmap.ic_avatar_male : R.mipmap.ic_avatar_female); | |
170 | 170 | } else { |
171 | 171 | RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(ChooseActivity.this, 45)); |
172 | 172 | RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); |
173 | 173 | Glide.with(ChooseActivity.this).load(studentBean.getPhoto()).apply(options).into((ImageView) item.getView(R.id.iv_avatar)); |
174 | 174 | } |
175 | - item.setVisible(R.id.iv_vip, !"虚拟".equals(studentBean.getTeacherIdentity())); | |
175 | + item.setVisible(R.id.iv_vip, studentBean.getIsIntention() == 1); | |
176 | 176 | item.getConvertView().setOnClickListener(new View.OnClickListener() { |
177 | 177 | @Override |
178 | 178 | public void onClick(View view) { | ... | ... |
app/src/main/java/com/hjx/parent/EditStudentActivity.java
1 | 1 | package com.hjx.parent; |
2 | 2 | |
3 | +import android.annotation.SuppressLint; | |
3 | 4 | import android.content.DialogInterface; |
4 | 5 | import android.content.Intent; |
5 | 6 | import android.graphics.Bitmap; |
... | ... | @@ -111,6 +112,7 @@ public class EditStudentActivity extends BaseActivity { |
111 | 112 | btn_next = findViewById(R.id.btn_next); |
112 | 113 | } |
113 | 114 | |
115 | + @SuppressLint({"SetTextI18n", "UseCompatLoadingForDrawables"}) | |
114 | 116 | @Override |
115 | 117 | protected void onStart() { |
116 | 118 | super.onStart(); |
... | ... | @@ -126,11 +128,10 @@ public class EditStudentActivity extends BaseActivity { |
126 | 128 | studentBean.setNickName(name); |
127 | 129 | } |
128 | 130 | if (sex != null && sex.length() > 0) { |
129 | - studentBean.setGender("男".equals(sex) ? 0 : 1); | |
131 | + studentBean.setGender(sex); | |
130 | 132 | } |
131 | 133 | if (nian != null && nian.length() > 0) { |
132 | 134 | studentBean.setGrade(nian); |
133 | - studentBean.setGradeId((Integer) SharedPreferencesUtil.getData("grade", 1)); | |
134 | 135 | } |
135 | 136 | if (xueq != null && xueq.length() > 0) { |
136 | 137 | studentBean.setTerm(xueq); |
... | ... | @@ -140,16 +141,16 @@ public class EditStudentActivity extends BaseActivity { |
140 | 141 | } |
141 | 142 | tv_name.setText(studentBean.getNickName()); |
142 | 143 | tv_nian.setText(studentBean.getGrade() + studentBean.getTerm()); |
143 | - tv_sex.setText(studentBean.getGender() == 0 ? "男" : "女"); | |
144 | + tv_sex.setText(studentBean.getGender()); | |
144 | 145 | tv_shen.setText(studentBean.getParentIdentity()); |
145 | 146 | if (!TextUtils.isEmpty(studentBean.getPhoto())) { |
146 | 147 | RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(this, 45)); |
147 | 148 | RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); |
148 | 149 | Glide.with(this).load(studentBean.getPhoto()).apply(options).into(iv_avatar); |
149 | 150 | } else { |
150 | - iv_avatar.setImageResource(studentBean.getGender() == 0 ? R.mipmap.ic_avatar_male : R.mipmap.ic_avatar_female); | |
151 | + iv_avatar.setImageResource("男".equals(studentBean.getGender()) ? R.mipmap.ic_avatar_male : R.mipmap.ic_avatar_female); | |
151 | 152 | } |
152 | - if (!"虚拟".equals(studentBean.getTeacherIdentity())) { | |
153 | + if (studentBean.getIsIntention() == 1) { | |
153 | 154 | rl_teacher.setVisibility(View.VISIBLE); |
154 | 155 | tv_bind.setText("重新绑定"); |
155 | 156 | tv_teacher.setText(studentBean.getTeacherName()); |
... | ... | @@ -158,7 +159,7 @@ public class EditStudentActivity extends BaseActivity { |
158 | 159 | RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); |
159 | 160 | Glide.with(this).load(studentBean.getTeacherAvatar()).apply(options).into(iv_teacher); |
160 | 161 | } else { |
161 | - iv_teacher.setImageResource(studentBean.getSex() == 0 ? R.mipmap.ic_teacher_male : R.mipmap.ic_teacher_female); | |
162 | + iv_teacher.setImageResource(R.mipmap.ic_teacher_female); | |
162 | 163 | } |
163 | 164 | } else { |
164 | 165 | rl_teacher.setVisibility(View.GONE); |
... | ... | @@ -179,7 +180,7 @@ public class EditStudentActivity extends BaseActivity { |
179 | 180 | view_5.setOnClickListener(view -> startActivity(ShenActivity.class)); |
180 | 181 | findViewById(R.id.tv_cancel).setOnClickListener(view -> onBackPressed()); |
181 | 182 | btn_next.setOnClickListener(view -> { |
182 | - if (teacher != null || !"虚拟".equals(studentBean.getTeacherIdentity()) || (studentBean.getState() != null && studentBean.getState() == 0)) { | |
183 | + if (teacher != null || studentBean.getIsIntention() == 1 || (studentBean.getState() != null && studentBean.getState() == 0)) { | |
183 | 184 | editStudent(); |
184 | 185 | } else { |
185 | 186 | showDialog("温馨提示", "您还未绑定老师,是否绑定?", "去绑定", "暂不绑定", new DialogInterface.OnClickListener() { |
... | ... | @@ -211,10 +212,9 @@ public class EditStudentActivity extends BaseActivity { |
211 | 212 | } |
212 | 213 | |
213 | 214 | public void editStudent() { |
214 | - Map map = new HashMap(); | |
215 | + Map<String, Object> map = new HashMap<>(); | |
215 | 216 | map.put("nickName", studentBean.getNickName()); |
216 | 217 | map.put("gender", studentBean.getGender()); |
217 | - map.put("gradeId", studentBean.getGradeId()); | |
218 | 218 | map.put("parentIdentity", studentBean.getParentIdentity()); |
219 | 219 | map.put("term", studentBean.getTerm()); |
220 | 220 | if (teacher != null) { | ... | ... |
app/src/main/java/com/hjx/parent/TeacherChooseActivity.java
... | ... | @@ -86,7 +86,6 @@ public class TeacherChooseActivity extends BaseActivity { |
86 | 86 | NetWorks.listStudent(new Observer<ResponseBody>() { |
87 | 87 | @Override |
88 | 88 | public void onSubscribe(Disposable d) { |
89 | - | |
90 | 89 | } |
91 | 90 | |
92 | 91 | @Override |
... | ... | @@ -116,12 +115,10 @@ public class TeacherChooseActivity extends BaseActivity { |
116 | 115 | |
117 | 116 | @Override |
118 | 117 | public void onError(Throwable e) { |
119 | - | |
120 | 118 | } |
121 | 119 | |
122 | 120 | @Override |
123 | 121 | public void onComplete() { |
124 | - | |
125 | 122 | } |
126 | 123 | }); |
127 | 124 | } |
... | ... | @@ -153,13 +150,13 @@ public class TeacherChooseActivity extends BaseActivity { |
153 | 150 | item.setImageResource(R.id.iv_select, select == item.getAdapterPosition() ? R.mipmap.gx : R.mipmap.wsyq); |
154 | 151 | item.setVisible(R.id.rl_add, false); |
155 | 152 | if (TextUtils.isEmpty(studentBean.getPhoto())) { |
156 | - item.setImageResource(R.id.iv_avatar, studentBean.getGender() == 0 ? R.mipmap.ic_avatar_male : R.mipmap.ic_avatar_female); | |
153 | + item.setImageResource(R.id.iv_avatar, "男".equals(studentBean.getGender()) ? R.mipmap.ic_avatar_male : R.mipmap.ic_avatar_female); | |
157 | 154 | } else { |
158 | 155 | RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(TeacherChooseActivity.this, 45)); |
159 | 156 | RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); |
160 | 157 | Glide.with(TeacherChooseActivity.this).load(studentBean.getPhoto()).apply(options).into((ImageView) item.getView(R.id.iv_avatar)); |
161 | 158 | } |
162 | - item.setVisible(R.id.iv_vip, !"虚拟".equals(studentBean.getTeacherIdentity())); | |
159 | + item.setVisible(R.id.iv_vip, studentBean.getIsIntention() == 1); | |
163 | 160 | item.getConvertView().setOnClickListener(new View.OnClickListener() { |
164 | 161 | @Override |
165 | 162 | public void onClick(View view) { | ... | ... |
app/src/main/java/com/hjx/parent/bean/StudentBean.java
... | ... | @@ -2,94 +2,26 @@ package com.hjx.parent.bean; |
2 | 2 | |
3 | 3 | public class StudentBean { |
4 | 4 | |
5 | - String stuId; | |
6 | - String stuName; | |
7 | - int gender; | |
8 | - String term; | |
9 | - String account; | |
10 | - String nickName; | |
11 | - String address; | |
12 | - String phone; | |
13 | - String photo; | |
14 | - int fromType; | |
15 | - int gradeId; | |
16 | - String oriSchool; | |
17 | - String parentPhone; | |
18 | - String parentIdentity; | |
19 | - String teacherName; | |
20 | - int teacherId; | |
21 | - String teacherAvatar; | |
22 | - String grade; | |
23 | - String teacherIdentity; | |
24 | - int sex; | |
25 | - Integer state; | |
5 | + private String stuId; | |
6 | + private String stuName; | |
7 | + private String gender; | |
8 | + private String term; | |
9 | + private String account; | |
10 | + private String nickName; | |
11 | + private String address; | |
12 | + private String phone; | |
13 | + private String photo; | |
14 | + private String oriSchool; | |
15 | + private String parentPhone; | |
16 | + private String parentIdentity; | |
17 | + private String teacherName; | |
18 | + private String grade; | |
19 | + private int isIntention; | |
20 | + | |
21 | + // not exist | |
22 | + private String teacherAvatar; | |
23 | + private Integer state; | |
26 | 24 | |
27 | - public void setState(Integer state) { | |
28 | - this.state = state; | |
29 | - } | |
30 | - | |
31 | - public Integer getState() { | |
32 | - return state; | |
33 | - } | |
34 | - | |
35 | - @Override | |
36 | - public String toString() { | |
37 | - return "StudentBean{" + | |
38 | - "stuId='" + stuId + '\'' + | |
39 | - ", stuName='" + stuName + '\'' + | |
40 | - ", gender=" + gender + | |
41 | - ", term='" + term + '\'' + | |
42 | - ", account='" + account + '\'' + | |
43 | - ", nickName='" + nickName + '\'' + | |
44 | - ", address='" + address + '\'' + | |
45 | - ", phone='" + phone + '\'' + | |
46 | - ", photo='" + photo + '\'' + | |
47 | - ", fromType=" + fromType + | |
48 | - ", gradeId=" + gradeId + | |
49 | - ", oriSchool='" + oriSchool + '\'' + | |
50 | - ", parentPhone='" + parentPhone + '\'' + | |
51 | - ", parentIdentity='" + parentIdentity + '\'' + | |
52 | - ", teacherName='" + teacherName + '\'' + | |
53 | - ", teacherId=" + teacherId + | |
54 | - ", teacherAvatar=" + teacherAvatar + | |
55 | - ", grade=" + grade + | |
56 | - ", teacherIdentity=" + teacherIdentity + | |
57 | - ", sex=" + sex + | |
58 | - ", state=" + state + | |
59 | - '}'; | |
60 | - } | |
61 | - | |
62 | - public void setSex(int sex) { | |
63 | - this.sex = sex; | |
64 | - } | |
65 | - | |
66 | - public int getSex() { | |
67 | - return sex; | |
68 | - } | |
69 | - | |
70 | - public void setTeacherIdentity(String teacherIdentity) { | |
71 | - this.teacherIdentity = teacherIdentity; | |
72 | - } | |
73 | - | |
74 | - public String getTeacherIdentity() { | |
75 | - return teacherIdentity; | |
76 | - } | |
77 | - | |
78 | - public void setTeacherAvatar(String teacherAvatar) { | |
79 | - this.teacherAvatar = teacherAvatar; | |
80 | - } | |
81 | - | |
82 | - public void setGrade(String grade) { | |
83 | - this.grade = grade; | |
84 | - } | |
85 | - | |
86 | - public String getTeacherAvatar() { | |
87 | - return teacherAvatar; | |
88 | - } | |
89 | - | |
90 | - public String getGrade() { | |
91 | - return grade; | |
92 | - } | |
93 | 25 | |
94 | 26 | public String getStuId() { |
95 | 27 | return stuId; |
... | ... | @@ -107,11 +39,11 @@ public class StudentBean { |
107 | 39 | this.stuName = stuName; |
108 | 40 | } |
109 | 41 | |
110 | - public int getGender() { | |
42 | + public String getGender() { | |
111 | 43 | return gender; |
112 | 44 | } |
113 | 45 | |
114 | - public void setGender(int gender) { | |
46 | + public void setGender(String gender) { | |
115 | 47 | this.gender = gender; |
116 | 48 | } |
117 | 49 | |
... | ... | @@ -163,22 +95,6 @@ public class StudentBean { |
163 | 95 | this.photo = photo; |
164 | 96 | } |
165 | 97 | |
166 | - public int getFromType() { | |
167 | - return fromType; | |
168 | - } | |
169 | - | |
170 | - public void setFromType(int fromType) { | |
171 | - this.fromType = fromType; | |
172 | - } | |
173 | - | |
174 | - public int getGradeId() { | |
175 | - return gradeId; | |
176 | - } | |
177 | - | |
178 | - public void setGradeId(int gradeId) { | |
179 | - this.gradeId = gradeId; | |
180 | - } | |
181 | - | |
182 | 98 | public String getOriSchool() { |
183 | 99 | return oriSchool; |
184 | 100 | } |
... | ... | @@ -211,11 +127,35 @@ public class StudentBean { |
211 | 127 | this.teacherName = teacherName; |
212 | 128 | } |
213 | 129 | |
214 | - public int getTeacherId() { | |
215 | - return teacherId; | |
130 | + public String getGrade() { | |
131 | + return grade; | |
132 | + } | |
133 | + | |
134 | + public void setGrade(String grade) { | |
135 | + this.grade = grade; | |
136 | + } | |
137 | + | |
138 | + public int getIsIntention() { | |
139 | + return isIntention; | |
216 | 140 | } |
217 | 141 | |
218 | - public void setTeacherId(int teacherId) { | |
219 | - this.teacherId = teacherId; | |
142 | + public void setIsIntention(int isIntention) { | |
143 | + this.isIntention = isIntention; | |
144 | + } | |
145 | + | |
146 | + public String getTeacherAvatar() { | |
147 | + return teacherAvatar; | |
148 | + } | |
149 | + | |
150 | + public void setTeacherAvatar(String teacherAvatar) { | |
151 | + this.teacherAvatar = teacherAvatar; | |
152 | + } | |
153 | + | |
154 | + public Integer getState() { | |
155 | + return state; | |
156 | + } | |
157 | + | |
158 | + public void setState(Integer state) { | |
159 | + this.state = state; | |
220 | 160 | } |
221 | 161 | } | ... | ... |
app/src/main/java/com/hjx/parent/fragment/HomeFragment.java
... | ... | @@ -120,7 +120,7 @@ public class HomeFragment extends BaseFragment { |
120 | 120 | studentBean = new Gson().fromJson(student, StudentBean.class); |
121 | 121 | tv_name.setText(studentBean.getNickName()); |
122 | 122 | if (TextUtils.isEmpty(studentBean.getPhoto())) { |
123 | - iv_2.setImageResource(studentBean.getGender() == 0 ? R.mipmap.ic_avatar_male : R.mipmap.ic_avatar_female); | |
123 | + iv_2.setImageResource("男".equals(studentBean.getGender()) ? R.mipmap.ic_avatar_male : R.mipmap.ic_avatar_female); | |
124 | 124 | } else { |
125 | 125 | RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(getContext(), 30)); |
126 | 126 | RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); | ... | ... |
app/src/main/java/com/hjx/parent/fragment/MeFragment.java
... | ... | @@ -169,13 +169,13 @@ public class MeFragment extends BaseFragment { |
169 | 169 | }); |
170 | 170 | } else { |
171 | 171 | if (TextUtils.isEmpty(studentBean.getPhoto())) { |
172 | - item.setImageResource(R.id.iv_avatar, studentBean.getGender() == 0 ? R.mipmap.ic_avatar_male : R.mipmap.ic_avatar_female); | |
172 | + item.setImageResource(R.id.iv_avatar, "男".equals(studentBean.getGender()) ? R.mipmap.ic_avatar_male : R.mipmap.ic_avatar_female); | |
173 | 173 | } else { |
174 | 174 | RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(getContext(), 45)); |
175 | 175 | RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); |
176 | 176 | Glide.with(getActivity()).load(studentBean.getPhoto()).apply(options).into((ImageView) item.getView(R.id.iv_avatar)); |
177 | 177 | } |
178 | - item.setVisible(R.id.iv_vip, !"虚拟".equals(studentBean.getTeacherIdentity())); | |
178 | + item.setVisible(R.id.iv_vip, studentBean.getIsIntention() == 1); | |
179 | 179 | item.getConvertView().setOnClickListener(new View.OnClickListener() { |
180 | 180 | @Override |
181 | 181 | public void onClick(View view) { | ... | ... |