Compare View
Commits (2)
Showing
3 changed files
Show diff stats
app/src/main/java/com/hjx/parent/fragment/TeacherFragment.java
1 | package com.hjx.parent.fragment; | 1 | package com.hjx.parent.fragment; |
2 | 2 | ||
3 | import static android.content.Intent.FLAG_ACTIVITY_CLEAR_TASK; | 3 | import static android.content.Intent.FLAG_ACTIVITY_CLEAR_TASK; |
4 | import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK; | 4 | import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK; |
5 | 5 | ||
6 | import android.app.AlertDialog; | 6 | import android.app.AlertDialog; |
7 | import android.content.DialogInterface; | 7 | import android.content.DialogInterface; |
8 | import android.content.Intent; | 8 | import android.content.Intent; |
9 | import android.graphics.drawable.Drawable; | 9 | import android.graphics.drawable.Drawable; |
10 | import android.os.Bundle; | 10 | import android.os.Bundle; |
11 | import android.text.TextUtils; | 11 | import android.text.TextUtils; |
12 | import android.view.LayoutInflater; | 12 | import android.view.LayoutInflater; |
13 | import android.view.MotionEvent; | 13 | import android.view.MotionEvent; |
14 | import android.view.View; | 14 | import android.view.View; |
15 | import android.view.ViewGroup; | 15 | import android.view.ViewGroup; |
16 | import android.webkit.WebSettings; | 16 | import android.webkit.WebSettings; |
17 | import android.webkit.WebView; | 17 | import android.webkit.WebView; |
18 | import android.widget.ImageView; | 18 | import android.widget.ImageView; |
19 | import android.widget.LinearLayout; | 19 | import android.widget.LinearLayout; |
20 | 20 | ||
21 | import androidx.annotation.NonNull; | 21 | import androidx.annotation.NonNull; |
22 | import androidx.annotation.Nullable; | 22 | import androidx.annotation.Nullable; |
23 | import androidx.recyclerview.widget.LinearLayoutManager; | 23 | import androidx.recyclerview.widget.LinearLayoutManager; |
24 | import androidx.recyclerview.widget.RecyclerView; | 24 | import androidx.recyclerview.widget.RecyclerView; |
25 | 25 | ||
26 | import com.bumptech.glide.Glide; | 26 | import com.bumptech.glide.Glide; |
27 | import com.bumptech.glide.load.resource.bitmap.RoundedCorners; | 27 | import com.bumptech.glide.load.resource.bitmap.RoundedCorners; |
28 | import com.bumptech.glide.request.RequestOptions; | 28 | import com.bumptech.glide.request.RequestOptions; |
29 | import com.bumptech.glide.request.target.SimpleTarget; | 29 | import com.bumptech.glide.request.target.SimpleTarget; |
30 | import com.bumptech.glide.request.transition.Transition; | 30 | import com.bumptech.glide.request.transition.Transition; |
31 | import com.chad.library.adapter.base.BaseQuickAdapter; | 31 | import com.chad.library.adapter.base.BaseQuickAdapter; |
32 | import com.chad.library.adapter.base.BaseViewHolder; | 32 | import com.chad.library.adapter.base.BaseViewHolder; |
33 | import com.google.gson.Gson; | 33 | import com.google.gson.Gson; |
34 | import com.hjx.parent.AccountActivity; | 34 | import com.hjx.parent.AccountActivity; |
35 | import com.hjx.parent.ErrorDetailActivity; | 35 | import com.hjx.parent.ErrorDetailActivity; |
36 | import com.hjx.parent.LoginActivity; | 36 | import com.hjx.parent.LoginActivity; |
37 | import com.hjx.parent.R; | 37 | import com.hjx.parent.R; |
38 | import com.hjx.parent.TeacherChooseActivity; | 38 | import com.hjx.parent.TeacherChooseActivity; |
39 | import com.hjx.parent.bean.StudentBean; | 39 | import com.hjx.parent.bean.StudentBean; |
40 | import com.hjx.parent.databinding.FragmentTeacherBinding; | 40 | import com.hjx.parent.databinding.FragmentTeacherBinding; |
41 | import com.prws.common.bean.Record; | 41 | import com.prws.common.bean.Record; |
42 | import com.prws.common.net.NetWorks; | 42 | import com.prws.common.net.NetWorks; |
43 | import com.prws.common.utils.CommonUtil; | 43 | import com.prws.common.utils.CommonUtil; |
44 | import com.prws.common.utils.LogUtil; | 44 | import com.prws.common.utils.LogUtil; |
45 | import com.prws.common.utils.ScreenUtils; | 45 | import com.prws.common.utils.ScreenUtils; |
46 | import com.prws.common.utils.SharedPreferencesUtil; | 46 | import com.prws.common.utils.SharedPreferencesUtil; |
47 | import com.prws.common.utils.StringUtils; | 47 | import com.prws.common.utils.StringUtils; |
48 | 48 | ||
49 | import org.json.JSONArray; | 49 | import org.json.JSONArray; |
50 | import org.json.JSONObject; | 50 | import org.json.JSONObject; |
51 | 51 | ||
52 | import java.text.SimpleDateFormat; | 52 | import java.text.SimpleDateFormat; |
53 | import java.util.ArrayList; | 53 | import java.util.ArrayList; |
54 | import java.util.logging.SimpleFormatter; | 54 | import java.util.logging.SimpleFormatter; |
55 | 55 | ||
56 | import io.reactivex.Observer; | 56 | import io.reactivex.Observer; |
57 | import io.reactivex.disposables.Disposable; | 57 | import io.reactivex.disposables.Disposable; |
58 | import okhttp3.ResponseBody; | 58 | import okhttp3.ResponseBody; |
59 | 59 | ||
60 | public class TeacherFragment extends BaseBindingFragment<FragmentTeacherBinding> { | 60 | public class TeacherFragment extends BaseBindingFragment<FragmentTeacherBinding> { |
61 | ArrayList<Record> alist = new ArrayList<>(); | 61 | ArrayList<Record> alist = new ArrayList<>(); |
62 | 62 | ||
63 | @Override | 63 | @Override |
64 | protected FragmentTeacherBinding onCreateViewBinding(@NonNull LayoutInflater inflater, @Nullable ViewGroup parent) { | 64 | protected FragmentTeacherBinding onCreateViewBinding(@NonNull LayoutInflater inflater, @Nullable ViewGroup parent) { |
65 | return FragmentTeacherBinding.inflate(inflater, parent, false); | 65 | return FragmentTeacherBinding.inflate(inflater, parent, false); |
66 | } | 66 | } |
67 | 67 | ||
68 | @Override | 68 | @Override |
69 | public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { | 69 | public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { |
70 | super.onViewCreated(view, savedInstanceState); | 70 | super.onViewCreated(view, savedInstanceState); |
71 | String photo = (String) SharedPreferencesUtil.getData("photo", ""); | 71 | String photo = (String) SharedPreferencesUtil.getData("photo", ""); |
72 | if (!TextUtils.isEmpty(photo)) { | 72 | if (!TextUtils.isEmpty(photo)) { |
73 | RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(getContext(), 45)); | 73 | RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(getContext(), 45)); |
74 | RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); | 74 | RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); |
75 | Glide.with(getContext()).load(photo).apply(options).into(getBinding().ivTeacher); | 75 | Glide.with(getContext()).load(photo).apply(options).into(getBinding().ivTeacher); |
76 | } | 76 | } |
77 | String name = (String) SharedPreferencesUtil.getData("name", ""); | 77 | String name = (String) SharedPreferencesUtil.getData("name", ""); |
78 | getBinding().tvTeacher.setText(name); | 78 | getBinding().tvTeacher.setText(name); |
79 | getBinding().tvAnswerName.setText("亲爱的" + name + "老师"); | 79 | getBinding().tvAnswerName.setText("亲爱的" + name + "老师"); |
80 | getBinding().logout.setOnClickListener(new View.OnClickListener() { | 80 | getBinding().logout.setOnClickListener(new View.OnClickListener() { |
81 | @Override | 81 | @Override |
82 | public void onClick(View v) { | 82 | public void onClick(View v) { |
83 | logout(); | 83 | logout(); |
84 | } | 84 | } |
85 | }); | 85 | }); |
86 | NetWorks.listRecord(new Observer<ResponseBody>() { | 86 | NetWorks.listRecord(new Observer<ResponseBody>() { |
87 | @Override | 87 | @Override |
88 | public void onSubscribe(Disposable d) { | 88 | public void onSubscribe(Disposable d) { |
89 | 89 | ||
90 | } | 90 | } |
91 | 91 | ||
92 | @Override | 92 | @Override |
93 | public void onNext(ResponseBody responseBody) { | 93 | public void onNext(ResponseBody responseBody) { |
94 | try { | 94 | try { |
95 | String str = responseBody.string().toString(); | 95 | String str = responseBody.string().toString(); |
96 | LogUtil.e("TAG", "----" + str); | 96 | LogUtil.e("TAG", "----" + str); |
97 | JSONObject jo = new JSONObject(str); | 97 | JSONObject jo = new JSONObject(str); |
98 | boolean isSucceed = jo.getBoolean("success"); | 98 | boolean isSucceed = jo.getBoolean("success"); |
99 | if (isSucceed) { | 99 | if (isSucceed) { |
100 | JSONArray jarr = jo.getJSONArray("data"); | 100 | JSONArray jarr = jo.getJSONArray("data"); |
101 | if (jarr.length() > 0) { | 101 | if (jarr.length() > 0) { |
102 | getBinding().tvNum.setText("您有" + jarr.length() + "个题目需要答疑"); | 102 | getBinding().tvNum.setText("您有" + jarr.length() + "个题目需要答疑"); |
103 | alist.clear(); | 103 | alist.clear(); |
104 | for (int i = 0; i < jarr.length(); i++) { | 104 | for (int i = 0; i < jarr.length(); i++) { |
105 | JSONObject jo2 = jarr.getJSONObject(i); | 105 | JSONObject jo2 = jarr.getJSONObject(i); |
106 | Gson gson = new Gson(); | 106 | Gson gson = new Gson(); |
107 | Record sb = gson.fromJson(jo2.toString(), Record.class); | 107 | Record sb = gson.fromJson(jo2.toString(), Record.class); |
108 | alist.add(sb); | 108 | alist.add(sb); |
109 | } | 109 | } |
110 | loadList(); | 110 | loadList(); |
111 | } else { | 111 | } else { |
112 | getBinding().tvNum.setText("您暂时没有题目需要答疑"); | 112 | getBinding().tvNum.setText("您暂时没有题目需要答疑"); |
113 | } | 113 | } |
114 | } else { | 114 | } else { |
115 | 115 | ||
116 | } | 116 | } |
117 | } catch (Exception e) { | 117 | } catch (Exception e) { |
118 | e.printStackTrace(); | 118 | e.printStackTrace(); |
119 | } | 119 | } |
120 | } | 120 | } |
121 | 121 | ||
122 | @Override | 122 | @Override |
123 | public void onError(Throwable e) { | 123 | public void onError(Throwable e) { |
124 | 124 | ||
125 | } | 125 | } |
126 | 126 | ||
127 | @Override | 127 | @Override |
128 | public void onComplete() { | 128 | public void onComplete() { |
129 | 129 | ||
130 | } | 130 | } |
131 | }); | 131 | }); |
132 | 132 | ||
133 | } | 133 | } |
134 | 134 | ||
135 | private void loadList() { | 135 | private void loadList() { |
136 | BaseQuickAdapter adapter = new BaseQuickAdapter(R.layout.item_record, alist) { | 136 | BaseQuickAdapter adapter = new BaseQuickAdapter(R.layout.item_record, alist) { |
137 | @Override | 137 | @Override |
138 | protected void convert(@NonNull BaseViewHolder item, Object o) { | 138 | protected void convert(@NonNull BaseViewHolder item, Object o) { |
139 | Record record = alist.get(item.getAdapterPosition()); | 139 | Record record = alist.get(item.getAdapterPosition()); |
140 | item.setText(R.id.tv_name, record.getStuName()); | 140 | item.setText(R.id.tv_name, record.getStuName()); |
141 | item.setText(R.id.tv_date, "提问时间:" + new SimpleDateFormat("yyyy-MM-dd HH:mm").format(record.getAskTime())); | 141 | item.setText(R.id.tv_date, "提问时间:" + new SimpleDateFormat("yyyy-MM-dd HH:mm").format(record.getAskTime())); |
142 | if (TextUtils.isEmpty(record.getPhoto())) { | 142 | if (TextUtils.isEmpty(record.getPhoto())) { |
143 | item.setImageResource(R.id.iv_student, record.getGender() == 0 ? R.mipmap.ic_avatar_male : R.mipmap.ic_avatar_female); | 143 | item.setImageResource(R.id.iv_student, "男".equals(record.getGender()) ? R.mipmap.ic_avatar_male : R.mipmap.ic_avatar_female); |
144 | } else { | 144 | } else { |
145 | RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(getContext(), 45)); | 145 | RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(getContext(), 45)); |
146 | RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); | 146 | RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); |
147 | Glide.with(getContext()).load(record.getPhoto()).apply(options).into((ImageView) item.getView(R.id.iv_student)); | 147 | Glide.with(getContext()).load(record.getPhoto()).apply(options).into((ImageView) item.getView(R.id.iv_student)); |
148 | } | 148 | } |
149 | if (TextUtils.isEmpty(record.getContent())) { | 149 | if (TextUtils.isEmpty(record.getContent())) { |
150 | item.setGone(R.id.iv_topic, true); | 150 | item.setGone(R.id.iv_topic, true); |
151 | item.setGone(R.id.webview, false); | 151 | item.setGone(R.id.webview, false); |
152 | int maxWidth = CommonUtil.getScreenWidth(getContext()) - CommonUtil.dpToPx(getContext(), 60); | 152 | int maxWidth = CommonUtil.getScreenWidth(getContext()) - CommonUtil.dpToPx(getContext(), 60); |
153 | Glide.with(getContext()).load(record.getQuestionUrl()).into(new SimpleTarget<Drawable>() { | 153 | Glide.with(getContext()).load(record.getQuestionUrl()).into(new SimpleTarget<Drawable>() { |
154 | @Override | 154 | @Override |
155 | public void onResourceReady(@NonNull Drawable resource, @Nullable Transition<? super Drawable> transition) { | 155 | public void onResourceReady(@NonNull Drawable resource, @Nullable Transition<? super Drawable> transition) { |
156 | int width = resource.getIntrinsicWidth(); | 156 | int width = resource.getIntrinsicWidth(); |
157 | int height = resource.getIntrinsicHeight(); | 157 | int height = resource.getIntrinsicHeight(); |
158 | int newHeight = maxWidth * height / width; | 158 | int newHeight = maxWidth * height / width; |
159 | LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) item.getView(R.id.iv_topic).getLayoutParams(); | 159 | LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) item.getView(R.id.iv_topic).getLayoutParams(); |
160 | layoutParams.width = maxWidth; | 160 | layoutParams.width = maxWidth; |
161 | layoutParams.height = newHeight; | 161 | layoutParams.height = newHeight; |
162 | item.getView(R.id.iv_topic).setLayoutParams(layoutParams); | 162 | item.getView(R.id.iv_topic).setLayoutParams(layoutParams); |
163 | ((ImageView) item.getView(R.id.iv_topic)).setImageDrawable(resource); | 163 | ((ImageView) item.getView(R.id.iv_topic)).setImageDrawable(resource); |
164 | } | 164 | } |
165 | }); | 165 | }); |
166 | } else { | 166 | } else { |
167 | item.setGone(R.id.iv_topic, false); | 167 | item.setGone(R.id.iv_topic, false); |
168 | item.setGone(R.id.webview, true); | 168 | item.setGone(R.id.webview, true); |
169 | WebView webView = item.getView(R.id.webview); | 169 | WebView webView = item.getView(R.id.webview); |
170 | String linkCss = "<link rel=\"stylesheet\" href=\"file:///android_asset/style.css\" type=\"text/css\">"; | 170 | String linkCss = "<link rel=\"stylesheet\" href=\"file:///android_asset/style.css\" type=\"text/css\">"; |
171 | StringBuilder sb = new StringBuilder(4096); | 171 | StringBuilder sb = new StringBuilder(4096); |
172 | if (!TextUtils.isEmpty(record.getLabel())) { | 172 | if (!TextUtils.isEmpty(record.getLabel())) { |
173 | sb.append(record.getLabel()); | 173 | sb.append(record.getLabel()); |
174 | } | 174 | } |
175 | sb.append(record.getContent()); | 175 | sb.append(record.getContent()); |
176 | if (record.getOptions() != null && record.getOptionsList().size() > 0) { | 176 | if (record.getOptions() != null && record.getOptionsList().size() > 0) { |
177 | sb.append("<div class='pt1'>"); | 177 | sb.append("<div class='pt1'>"); |
178 | sb.append(StringUtils.OptionsHtml(record.getOptionsList(), null)); | 178 | sb.append(StringUtils.OptionsHtml(record.getOptionsList(), null)); |
179 | sb.append("</div>"); | 179 | sb.append("</div>"); |
180 | } | 180 | } |
181 | String body = "<html><header>" + linkCss + "</header>" + sb.toString() + "</body></html>"; | 181 | String body = "<html><header>" + linkCss + "</header>" + sb.toString() + "</body></html>"; |
182 | WebSettings settings = webView.getSettings(); | 182 | WebSettings settings = webView.getSettings(); |
183 | settings.setUseWideViewPort(true);//设定支持 viewport | 183 | settings.setUseWideViewPort(true);//设定支持 viewport |
184 | settings.setLoadWithOverviewMode(true); //自适应屏幕 | 184 | settings.setLoadWithOverviewMode(true); //自适应屏幕 |
185 | webView.loadDataWithBaseURL(linkCss, body, "text/html", "UTF-8", null); | 185 | webView.loadDataWithBaseURL(linkCss, body, "text/html", "UTF-8", null); |
186 | webView.setVisibility(View.VISIBLE); | 186 | webView.setVisibility(View.VISIBLE); |
187 | webView.setOnTouchListener(new View.OnTouchListener() { | 187 | webView.setOnTouchListener(new View.OnTouchListener() { |
188 | @Override | 188 | @Override |
189 | public boolean onTouch(View v, MotionEvent event) { | 189 | public boolean onTouch(View v, MotionEvent event) { |
190 | return true; | 190 | return true; |
191 | } | 191 | } |
192 | }); | 192 | }); |
193 | } | 193 | } |
194 | } | 194 | } |
195 | 195 | ||
196 | @Override | 196 | @Override |
197 | public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { | 197 | public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { |
198 | 198 | ||
199 | } | 199 | } |
200 | }; | 200 | }; |
201 | getBinding().recycleError.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false)); | 201 | getBinding().recycleError.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false)); |
202 | getBinding().recycleError.setAdapter(adapter); | 202 | getBinding().recycleError.setAdapter(adapter); |
203 | } | 203 | } |
204 | 204 | ||
205 | public void logout() { | 205 | public void logout() { |
206 | AlertDialog.Builder builder = new AlertDialog.Builder(getContext(), android.R.style.Theme_DeviceDefault_Light_Dialog_Alert); | 206 | AlertDialog.Builder builder = new AlertDialog.Builder(getContext(), android.R.style.Theme_DeviceDefault_Light_Dialog_Alert); |
207 | builder.setTitle("温馨提示"); | 207 | builder.setTitle("温馨提示"); |
208 | builder.setMessage("是否退出登录?"); | 208 | builder.setMessage("是否退出登录?"); |
209 | builder.setCancelable(false); | 209 | builder.setCancelable(false); |
210 | builder.setNegativeButton("取消", new DialogInterface.OnClickListener() { | 210 | builder.setNegativeButton("取消", new DialogInterface.OnClickListener() { |
211 | @Override | 211 | @Override |
212 | public void onClick(DialogInterface dialogInterface, int i) { | 212 | public void onClick(DialogInterface dialogInterface, int i) { |
213 | dialogInterface.dismiss(); | 213 | dialogInterface.dismiss(); |
214 | } | 214 | } |
215 | }); | 215 | }); |
216 | builder.setPositiveButton("确认", new DialogInterface.OnClickListener() { | 216 | builder.setPositiveButton("确认", new DialogInterface.OnClickListener() { |
217 | @Override | 217 | @Override |
218 | public void onClick(DialogInterface dialogInterface, int i) { | 218 | public void onClick(DialogInterface dialogInterface, int i) { |
219 | SharedPreferencesUtil.clear(getContext()); | 219 | SharedPreferencesUtil.clear(getContext()); |
220 | restartApp(); | 220 | restartApp(); |
221 | } | 221 | } |
222 | }); | 222 | }); |
223 | builder.show(); | 223 | builder.show(); |
224 | } | 224 | } |
225 | 225 | ||
226 | private void restartApp() { | 226 | private void restartApp() { |
227 | //重启app,这一步一定要加上,如果不重启app,可能打开新的页面显示的语言会不正确 | 227 | //重启app,这一步一定要加上,如果不重启app,可能打开新的页面显示的语言会不正确 |
228 | Intent intent = new Intent(getContext(), LoginActivity.class); | 228 | Intent intent = new Intent(getContext(), LoginActivity.class); |
229 | intent.addFlags(FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_CLEAR_TASK); | 229 | intent.addFlags(FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_CLEAR_TASK); |
230 | startActivity(intent); | 230 | startActivity(intent); |
231 | android.os.Process.killProcess(android.os.Process.myPid()); | 231 | android.os.Process.killProcess(android.os.Process.myPid()); |
232 | System.exit(0); | 232 | System.exit(0); |
233 | } | 233 | } |
234 | 234 | ||
235 | } | 235 | } |
236 | 236 |
libs/common/src/main/java/com/prws/common/bean/Record.java
1 | package com.prws.common.bean; | 1 | package com.prws.common.bean; |
2 | 2 | ||
3 | import com.google.gson.annotations.SerializedName; | 3 | import com.google.gson.annotations.SerializedName; |
4 | 4 | ||
5 | import java.util.Date; | 5 | import java.util.Date; |
6 | import java.util.List; | 6 | import java.util.List; |
7 | 7 | ||
8 | public class Record { | 8 | public class Record { |
9 | 9 | ||
10 | @SerializedName("subject") | 10 | @SerializedName("subject") |
11 | private String subject; | 11 | private String subject; |
12 | @SerializedName("sid") | 12 | @SerializedName("sid") |
13 | private String sid; | 13 | private String sid; |
14 | @SerializedName("degree") | 14 | @SerializedName("degree") |
15 | private Double degree; | 15 | private Double degree; |
16 | @SerializedName("cate") | 16 | @SerializedName("cate") |
17 | private Integer cate; | 17 | private Integer cate; |
18 | @SerializedName("cateName") | 18 | @SerializedName("cateName") |
19 | private String cateName; | 19 | private String cateName; |
20 | @SerializedName("label") | 20 | @SerializedName("label") |
21 | private String label; | 21 | private String label; |
22 | @SerializedName("content") | 22 | @SerializedName("content") |
23 | private String content; | 23 | private String content; |
24 | @SerializedName("options") | 24 | @SerializedName("options") |
25 | private String options; | 25 | private String options; |
26 | @SerializedName("optionsList") | 26 | @SerializedName("optionsList") |
27 | private List<String> optionsList; | 27 | private List<String> optionsList; |
28 | @SerializedName("points") | 28 | @SerializedName("points") |
29 | private String points; | 29 | private String points; |
30 | @SerializedName("pointsList") | 30 | @SerializedName("pointsList") |
31 | private List<KeyValue> pointsList; | 31 | private List<KeyValue> pointsList; |
32 | @SerializedName("topics") | 32 | @SerializedName("topics") |
33 | private String topics; | 33 | private String topics; |
34 | @SerializedName("topicsList") | 34 | @SerializedName("topicsList") |
35 | private List<KeyValue> topicsList; | 35 | private List<KeyValue> topicsList; |
36 | @SerializedName("analyse") | 36 | @SerializedName("analyse") |
37 | private String analyse; | 37 | private String analyse; |
38 | @SerializedName("method") | 38 | @SerializedName("method") |
39 | private String method; | 39 | private String method; |
40 | @SerializedName("discuss") | 40 | @SerializedName("discuss") |
41 | private String discuss; | 41 | private String discuss; |
42 | @SerializedName("answers") | 42 | @SerializedName("answers") |
43 | private String answers; | 43 | private String answers; |
44 | @SerializedName("answersList") | 44 | @SerializedName("answersList") |
45 | private List<String> answersList; | 45 | private List<String> answersList; |
46 | @SerializedName("displayAnswer") | 46 | @SerializedName("displayAnswer") |
47 | private String displayAnswer; | 47 | private String displayAnswer; |
48 | @SerializedName("askId") | 48 | @SerializedName("askId") |
49 | private Integer askId; | 49 | private Integer askId; |
50 | @SerializedName("stuId") | 50 | @SerializedName("stuId") |
51 | private String stuId; | 51 | private String stuId; |
52 | @SerializedName("stuName") | 52 | @SerializedName("stuName") |
53 | private String stuName; | 53 | private String stuName; |
54 | @SerializedName("photo") | 54 | @SerializedName("photo") |
55 | private String photo; | 55 | private String photo; |
56 | @SerializedName("questionUrl") | 56 | @SerializedName("questionUrl") |
57 | private String questionUrl; | 57 | private String questionUrl; |
58 | @SerializedName("askTime") | 58 | @SerializedName("askTime") |
59 | private Date askTime; | 59 | private Date askTime; |
60 | private int gender; | 60 | private String gender; |
61 | 61 | ||
62 | public static class KeyValue { | 62 | public static class KeyValue { |
63 | @SerializedName("Key") | 63 | @SerializedName("Key") |
64 | private String key; | 64 | private String key; |
65 | @SerializedName("Value") | 65 | @SerializedName("Value") |
66 | private String value; | 66 | private String value; |
67 | 67 | ||
68 | public void setKey(String key) { | 68 | public void setKey(String key) { |
69 | this.key = key; | 69 | this.key = key; |
70 | } | 70 | } |
71 | 71 | ||
72 | public void setValue(String value) { | 72 | public void setValue(String value) { |
73 | this.value = value; | 73 | this.value = value; |
74 | } | 74 | } |
75 | 75 | ||
76 | public String getKey() { | 76 | public String getKey() { |
77 | return key; | 77 | return key; |
78 | } | 78 | } |
79 | 79 | ||
80 | public String getValue() { | 80 | public String getValue() { |
81 | return value; | 81 | return value; |
82 | } | 82 | } |
83 | } | 83 | } |
84 | 84 | ||
85 | public void setGender(int gender) { | 85 | public void setGender(String gender) { |
86 | this.gender = gender; | 86 | this.gender = gender; |
87 | } | 87 | } |
88 | 88 | ||
89 | public int getGender() { | 89 | public String getGender() { |
90 | return gender; | 90 | return gender; |
91 | } | 91 | } |
92 | 92 | ||
93 | public void setSubject(String subject) { | 93 | public void setSubject(String subject) { |
94 | this.subject = subject; | 94 | this.subject = subject; |
95 | } | 95 | } |
96 | 96 | ||
97 | public void setSid(String sid) { | 97 | public void setSid(String sid) { |
98 | this.sid = sid; | 98 | this.sid = sid; |
99 | } | 99 | } |
100 | 100 | ||
101 | public void setDegree(Double degree) { | 101 | public void setDegree(Double degree) { |
102 | this.degree = degree; | 102 | this.degree = degree; |
103 | } | 103 | } |
104 | 104 | ||
105 | public void setCate(Integer cate) { | 105 | public void setCate(Integer cate) { |
106 | this.cate = cate; | 106 | this.cate = cate; |
107 | } | 107 | } |
108 | 108 | ||
109 | public void setCateName(String cateName) { | 109 | public void setCateName(String cateName) { |
110 | this.cateName = cateName; | 110 | this.cateName = cateName; |
111 | } | 111 | } |
112 | 112 | ||
113 | public void setLabel(String label) { | 113 | public void setLabel(String label) { |
114 | this.label = label; | 114 | this.label = label; |
115 | } | 115 | } |
116 | 116 | ||
117 | public void setContent(String content) { | 117 | public void setContent(String content) { |
118 | this.content = content; | 118 | this.content = content; |
119 | } | 119 | } |
120 | 120 | ||
121 | public void setOptions(String options) { | 121 | public void setOptions(String options) { |
122 | this.options = options; | 122 | this.options = options; |
123 | } | 123 | } |
124 | 124 | ||
125 | public void setOptionsList(List<String> optionsList) { | 125 | public void setOptionsList(List<String> optionsList) { |
126 | this.optionsList = optionsList; | 126 | this.optionsList = optionsList; |
127 | } | 127 | } |
128 | 128 | ||
129 | public void setPoints(String points) { | 129 | public void setPoints(String points) { |
130 | this.points = points; | 130 | this.points = points; |
131 | } | 131 | } |
132 | 132 | ||
133 | public void setPointsList(List<KeyValue> pointsList) { | 133 | public void setPointsList(List<KeyValue> pointsList) { |
134 | this.pointsList = pointsList; | 134 | this.pointsList = pointsList; |
135 | } | 135 | } |
136 | 136 | ||
137 | public void setTopics(String topics) { | 137 | public void setTopics(String topics) { |
138 | this.topics = topics; | 138 | this.topics = topics; |
139 | } | 139 | } |
140 | 140 | ||
141 | public void setTopicsList(List<KeyValue> topicsList) { | 141 | public void setTopicsList(List<KeyValue> topicsList) { |
142 | this.topicsList = topicsList; | 142 | this.topicsList = topicsList; |
143 | } | 143 | } |
144 | 144 | ||
145 | public void setAnalyse(String analyse) { | 145 | public void setAnalyse(String analyse) { |
146 | this.analyse = analyse; | 146 | this.analyse = analyse; |
147 | } | 147 | } |
148 | 148 | ||
149 | public void setMethod(String method) { | 149 | public void setMethod(String method) { |
150 | this.method = method; | 150 | this.method = method; |
151 | } | 151 | } |
152 | 152 | ||
153 | public void setDiscuss(String discuss) { | 153 | public void setDiscuss(String discuss) { |
154 | this.discuss = discuss; | 154 | this.discuss = discuss; |
155 | } | 155 | } |
156 | 156 | ||
157 | public void setAnswers(String answers) { | 157 | public void setAnswers(String answers) { |
158 | this.answers = answers; | 158 | this.answers = answers; |
159 | } | 159 | } |
160 | 160 | ||
161 | public void setAnswersList(List<String> answersList) { | 161 | public void setAnswersList(List<String> answersList) { |
162 | this.answersList = answersList; | 162 | this.answersList = answersList; |
163 | } | 163 | } |
164 | 164 | ||
165 | public void setDisplayAnswer(String displayAnswer) { | 165 | public void setDisplayAnswer(String displayAnswer) { |
166 | this.displayAnswer = displayAnswer; | 166 | this.displayAnswer = displayAnswer; |
167 | } | 167 | } |
168 | 168 | ||
169 | public void setAskId(Integer askId) { | 169 | public void setAskId(Integer askId) { |
170 | this.askId = askId; | 170 | this.askId = askId; |
171 | } | 171 | } |
172 | 172 | ||
173 | public void setStuId(String stuId) { | 173 | public void setStuId(String stuId) { |
174 | this.stuId = stuId; | 174 | this.stuId = stuId; |
175 | } | 175 | } |
176 | 176 | ||
177 | public void setStuName(String stuName) { | 177 | public void setStuName(String stuName) { |
178 | this.stuName = stuName; | 178 | this.stuName = stuName; |
179 | } | 179 | } |
180 | 180 | ||
181 | public void setPhoto(String photo) { | 181 | public void setPhoto(String photo) { |
182 | this.photo = photo; | 182 | this.photo = photo; |
183 | } | 183 | } |
184 | 184 | ||
185 | public void setQuestionUrl(String questionUrl) { | 185 | public void setQuestionUrl(String questionUrl) { |
186 | this.questionUrl = questionUrl; | 186 | this.questionUrl = questionUrl; |
187 | } | 187 | } |
188 | 188 | ||
189 | public void setAskTime(Date askTime) { | 189 | public void setAskTime(Date askTime) { |
190 | this.askTime = askTime; | 190 | this.askTime = askTime; |
191 | } | 191 | } |
192 | 192 | ||
193 | public String getSubject() { | 193 | public String getSubject() { |
194 | return subject; | 194 | return subject; |
195 | } | 195 | } |
196 | 196 | ||
197 | public String getSid() { | 197 | public String getSid() { |
198 | return sid; | 198 | return sid; |
199 | } | 199 | } |
200 | 200 | ||
201 | public Double getDegree() { | 201 | public Double getDegree() { |
202 | return degree; | 202 | return degree; |
203 | } | 203 | } |
204 | 204 | ||
205 | public Integer getCate() { | 205 | public Integer getCate() { |
206 | return cate; | 206 | return cate; |
207 | } | 207 | } |
208 | 208 | ||
209 | public String getCateName() { | 209 | public String getCateName() { |
210 | return cateName; | 210 | return cateName; |
211 | } | 211 | } |
212 | 212 | ||
213 | public String getLabel() { | 213 | public String getLabel() { |
214 | return label; | 214 | return label; |
215 | } | 215 | } |
216 | 216 | ||
217 | public String getContent() { | 217 | public String getContent() { |
218 | return content; | 218 | return content; |
219 | } | 219 | } |
220 | 220 | ||
221 | public String getOptions() { | 221 | public String getOptions() { |
222 | return options; | 222 | return options; |
223 | } | 223 | } |
224 | 224 | ||
225 | public List<String> getOptionsList() { | 225 | public List<String> getOptionsList() { |
226 | return optionsList; | 226 | return optionsList; |
227 | } | 227 | } |
228 | 228 | ||
229 | public String getPoints() { | 229 | public String getPoints() { |
230 | return points; | 230 | return points; |
231 | } | 231 | } |
232 | 232 | ||
233 | public List<KeyValue> getPointsList() { | 233 | public List<KeyValue> getPointsList() { |
234 | return pointsList; | 234 | return pointsList; |
235 | } | 235 | } |
236 | 236 | ||
237 | public String getTopics() { | 237 | public String getTopics() { |
238 | return topics; | 238 | return topics; |
239 | } | 239 | } |
240 | 240 | ||
241 | public List<KeyValue> getTopicsList() { | 241 | public List<KeyValue> getTopicsList() { |
242 | return topicsList; | 242 | return topicsList; |
243 | } | 243 | } |
244 | 244 | ||
245 | public String getAnalyse() { | 245 | public String getAnalyse() { |
246 | return analyse; | 246 | return analyse; |
247 | } | 247 | } |
248 | 248 | ||
249 | public String getMethod() { | 249 | public String getMethod() { |
250 | return method; | 250 | return method; |
251 | } | 251 | } |
252 | 252 | ||
253 | public String getDiscuss() { | 253 | public String getDiscuss() { |
254 | return discuss; | 254 | return discuss; |
255 | } | 255 | } |
256 | 256 | ||
257 | public String getAnswers() { | 257 | public String getAnswers() { |
258 | return answers; | 258 | return answers; |
259 | } | 259 | } |
260 | 260 | ||
261 | public List<String> getAnswersList() { | 261 | public List<String> getAnswersList() { |
262 | return answersList; | 262 | return answersList; |
263 | } | 263 | } |
264 | 264 | ||
265 | public String getDisplayAnswer() { | 265 | public String getDisplayAnswer() { |
266 | return displayAnswer; | 266 | return displayAnswer; |
267 | } | 267 | } |
268 | 268 | ||
269 | public Integer getAskId() { | 269 | public Integer getAskId() { |
270 | return askId; | 270 | return askId; |
271 | } | 271 | } |
272 | 272 | ||
273 | public String getStuId() { | 273 | public String getStuId() { |
274 | return stuId; | 274 | return stuId; |
275 | } | 275 | } |
276 | 276 | ||
277 | public String getStuName() { | 277 | public String getStuName() { |
278 | return stuName; | 278 | return stuName; |
279 | } | 279 | } |
280 | 280 | ||
281 | public String getPhoto() { | 281 | public String getPhoto() { |
282 | return photo; | 282 | return photo; |
283 | } | 283 | } |
284 | 284 | ||
285 | public String getQuestionUrl() { | 285 | public String getQuestionUrl() { |
286 | return questionUrl; | 286 | return questionUrl; |
287 | } | 287 | } |
288 | 288 | ||
289 | public Date getAskTime() { | 289 | public Date getAskTime() { |
290 | return askTime; | 290 | return askTime; |
291 | } | 291 | } |
292 | } | 292 | } |
293 | 293 |
libs/common/src/main/java/com/prws/common/bean/Student.java
1 | package com.prws.common.bean; | 1 | package com.prws.common.bean; |
2 | 2 | ||
3 | import androidx.annotation.NonNull; | 3 | import androidx.annotation.NonNull; |
4 | 4 | ||
5 | import java.io.Serializable; | 5 | import java.io.Serializable; |
6 | 6 | ||
7 | public class Student implements Serializable { | 7 | public class Student implements Serializable { |
8 | 8 | ||
9 | public String stuId; | 9 | public String stuId; |
10 | public String stuName; | 10 | public String stuName; |
11 | public String gender; | 11 | public String gender; |
12 | public String term; | 12 | public String term; |
13 | public String account; | 13 | public String account; |
14 | public String nickName; | 14 | public String nickName; |
15 | public String address; | 15 | public String address; |
16 | public String phone; | 16 | public String phone; |
17 | public String photo; | 17 | public String photo; |
18 | public String oriSchool; | ||
19 | public String parentPhone; | ||
20 | public String parentIdentity; | 18 | public String oriSchool; |
21 | public String teacherName; | 19 | public String parentPhone; |
22 | public String grade; | 20 | public String parentIdentity; |
23 | public int isIntention; | 21 | public String teacherName; |
24 | |||
25 | // not exist | ||
26 | public String teacherAvatar; | 22 | public String grade; |
27 | public Integer state; | 23 | public int isIntention; |
28 | 24 | ||
25 | // not exist | ||
26 | public String teacherAvatar; | ||
29 | @NonNull | 27 | public Integer state; |
30 | @Override | 28 | |
31 | public String toString() { | 29 | @NonNull |
32 | return stuName; | 30 | @Override |
33 | } | 31 | public String toString() { |