Compare View

switch
from
...
to
 
Commits (5)
... ... @@ -24,8 +24,8 @@ android {
24 24 applicationId "com.hjx.parent"
25 25 minSdk 26
26 26 targetSdk 32
27   - versionCode 1007
28   - versionName "1.0.0.7"
  27 + versionCode 1010
  28 + versionName "1.0.10"
29 29  
30 30 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
31 31 }
... ...
app/src/main/java/com/hjx/parent/HomeworkDetailActivity.java
... ... @@ -51,10 +51,10 @@ public class HomeworkDetailActivity extends BaseRxActivity<ActivityHomeworkDetai
51 51  
52 52 binding.btnFeedback.setOnClickListener(v -> {
53 53 if (mAdapter.getData().size() == 0) return;
54   - if (mData.getCompleteFlag() == 0) {
55   - noAnalyseDialog.show();
56   - return;
57   - }
  54 +// if (mData.getCompleteFlag() == 0) {
  55 +// noAnalyseDialog.show();
  56 +// return;
  57 +// }
58 58 Intent intent = new Intent(this, HomeworkSelectActivity.class);
59 59 intent.putExtra("data", mData);
60 60 intent.putExtra("student", student);
... ...
app/src/main/java/com/hjx/parent/HomeworkFeedbackActivity.java
... ... @@ -21,6 +21,7 @@ import com.hjx.parent.rx.BaseRxActivity;
21 21 import com.prws.common.bean.Student;
22 22 import com.prws.common.bean.homework.Correction;
23 23 import com.prws.common.bean.homework.CorrectionPoint;
  24 +import com.prws.common.bean.homework.CorrectionSer;
24 25 import com.prws.common.bean.homework.HomeWork;
25 26 import com.prws.common.bean.homework.HomeworkList;
26 27 import com.prws.common.bean.homework.KeyValue;
... ... @@ -97,6 +98,7 @@ public class HomeworkFeedbackActivity extends BaseRxActivity<ActivityHomeworkFee
97 98 body.put("stuId", student.stuId);
98 99 body.put("points", countPoint());
99 100 body.put("correctionList", corrections);
  101 + body.put("extra", buildExtra());
100 102 NetWorks.service_url.uploadHomeworkFeedback(NetWorks.getHeader(), body)
101 103 .compose(transformSingle())
102 104 .subscribe((response, th) -> {
... ... @@ -121,6 +123,16 @@ public class HomeworkFeedbackActivity extends BaseRxActivity<ActivityHomeworkFee
121 123 });
122 124 }
123 125  
  126 + private String buildExtra() {
  127 + if (mList == null || mList.isEmpty()) return null;
  128 + List<CorrectionSer> maps = new ArrayList<>();
  129 + for (HomeWork item: mList) {
  130 + maps.add(item.toSer());
  131 + }
  132 + Gson gson = new Gson();
  133 + return gson.toJson(maps);
  134 + }
  135 +
124 136 @SuppressLint("CheckResult")
125 137 private List<CorrectionPoint> countPoint() {
126 138 Set<KeyValue> set = new HashSet<>();
... ...
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&lt;ActivitySmsLoginBinding&gt; {
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  
... ...
libs/common/src/main/java/com/prws/common/bean/homework/CorrectionSer.java
... ... @@ -0,0 +1,16 @@
  1 +package com.prws.common.bean.homework;
  2 +
  3 +public class CorrectionSer {
  4 + public String brief;
  5 + public int correction; // 0 对, 1 错
  6 + public int state; // 1: 已听懂; 2: 基本听懂; 3: 一般听懂
  7 +
  8 + public CorrectionSer() {
  9 + }
  10 +
  11 + public CorrectionSer(String brief, int correction, int state) {
  12 + this.brief = brief;
  13 + this.correction = correction;
  14 + this.state = state;
  15 + }
  16 +}
... ...
libs/common/src/main/java/com/prws/common/bean/homework/HomeWork.java
... ... @@ -38,4 +38,7 @@ public class HomeWork implements Serializable {
38 38 }
39 39 }
40 40  
  41 + public CorrectionSer toSer() {
  42 + return new CorrectionSer(brief, check ? 1 : 0, state);
  43 + }
41 44 }
... ...
libs/common/src/main/java/com/prws/common/widget/MarkSizeView.java
... ... @@ -158,6 +158,7 @@ public class MarkSizeView extends View {
158 158 markPaint.setStyle(Paint.Style.STROKE);//不填充
159 159 markPaint.setColor(strokeColor);
160 160 canvas.drawRect(markedArea, markPaint);
  161 + setTranslationZ(8);
161 162 }
162 163 if (!isEnabled()) {
163 164 return;
... ... @@ -172,10 +173,8 @@ public class MarkSizeView extends View {
172 173  
173 174 //draw button
174 175 if (isValid && isUp) {
175   - if (markedArea.width() >= CommonUtil.dpToPx(context, 30) && markedArea.height() >= CommonUtil.dpToPx(context, 30)) {
176   - canvas.drawBitmap(confirmBitmap, null, confirmArea, mBitPaint);
177   - canvas.drawBitmap(cancelBitmap, null, cancelArea, mBitPaint);
178   - }
  176 + canvas.drawBitmap(confirmBitmap, null, confirmArea, mBitPaint);
  177 + canvas.drawBitmap(cancelBitmap, null, cancelArea, mBitPaint);
179 178 }
180 179 super.onDraw(canvas);
181 180 }
... ... @@ -216,6 +215,7 @@ public class MarkSizeView extends View {
216 215 if (mOnClickListener != null) {
217 216 mOnClickListener.onConfirm(markedArea);
218 217 }
  218 + setTranslationZ(0);
219 219 } else if (isAreaContainPoint(cancelArea, x, y)) {
220 220 isButtonClicked = true;
221 221 isValid = true;
... ... @@ -225,6 +225,7 @@ public class MarkSizeView extends View {
225 225 startX = startY = endX = endY = 0;
226 226 adjustMark(0, 0);
227 227 }
  228 + setTranslationZ(0);
228 229 } else if (isAreaContainPoint(ltVer, x, y)) {
229 230 isAdjustMode = true;
230 231 adjustNum = 1;
... ... @@ -255,64 +256,63 @@ public class MarkSizeView extends View {
255 256 break;
256 257 case MotionEvent.ACTION_UP:
257 258 isUp = true;
258   - if (markedArea.width() >= CommonUtil.dpToPx(context, 30) && markedArea.height() >= CommonUtil.dpToPx(context, 30)) {
259   - if (isButtonClicked) {
260   - break;
261   - }
262   - adjustMark(x, y);
263   - startX = markedArea.left;
264   - startY = markedArea.top;
265   - endX = markedArea.right;
266   - endY = markedArea.bottom;
267   -
268   - if (markedArea.width() > confirmBitmap.getWidth() * 3 + mActionGap * 3 && markedArea.height() > confirmBitmap.getHeight() * 5) {
269   - //显示在选区的内底部
270   - confirmArea.set(endX - confirmBitmap.getWidth() - mActionGap,
271   - endY - confirmBitmap.getHeight() - mActionGap,
272   - endX - mActionGap,
273   - endY - mActionGap);
274   -
275   - cancelArea.set(endX - 2 * confirmBitmap.getWidth() - mActionGap * 2 - CommonUtil.dpToPx(context, 15),
276   - endY - confirmBitmap.getHeight() - mActionGap,
277   - endX - confirmBitmap.getWidth() - mActionGap * 2 - CommonUtil.dpToPx(context, 15),
278   - endY - mActionGap);
279   - } else if (endY > getHeight() - confirmBitmap.getHeight() * 3) {
280   - //显示在选区的上面
281   - confirmArea.set(endX - confirmBitmap.getWidth() - mActionGap,
282   - startY - confirmBitmap.getHeight() - mActionGap,
283   - endX - mActionGap,
284   - startY - mActionGap);
285   -
286   - cancelArea.set(endX - 2 * confirmBitmap.getWidth() - mActionGap * 2 - CommonUtil.dpToPx(context, 15),
287   - startY - confirmBitmap.getHeight() - mActionGap,
288   - endX - confirmBitmap.getWidth() - mActionGap * 2 - CommonUtil.dpToPx(context, 15),
289   - startY - mActionGap);
290   - } else {
291   - //显示在选区的下面
292   - confirmArea.set(endX - confirmBitmap.getWidth() - mActionGap,
293   - endY + mActionGap,
294   - endX - mActionGap,
295   - endY + confirmBitmap.getHeight() + mActionGap);
296   -
297   - cancelArea.set(endX - 2 * confirmBitmap.getWidth() - mActionGap * 2 - CommonUtil.dpToPx(context, 15),
298   - endY + mActionGap,
299   - endX - confirmBitmap.getWidth() - mActionGap * 2 - CommonUtil.dpToPx(context, 15),
300   - endY + confirmBitmap.getHeight() + mActionGap);
301   - }
  259 + if (isButtonClicked) {
  260 + break;
  261 + }
  262 + adjustMark(x, y);
  263 + startX = markedArea.left;
  264 + startY = markedArea.top;
  265 + endX = markedArea.right;
  266 + endY = markedArea.bottom;
  267 +
  268 + if (markedArea.width() > confirmBitmap.getWidth() * 3 + mActionGap * 3 && markedArea.height() > confirmBitmap.getHeight() * 5) {
  269 + //显示在选区的内底部
  270 + confirmArea.set(endX - confirmBitmap.getWidth() - mActionGap,
  271 + endY - confirmBitmap.getHeight() - mActionGap,
  272 + endX - mActionGap,
  273 + endY - mActionGap);
  274 +
  275 + cancelArea.set(endX - 2 * confirmBitmap.getWidth() - mActionGap * 2 - CommonUtil.dpToPx(context, 15),
  276 + endY - confirmBitmap.getHeight() - mActionGap,
  277 + endX - confirmBitmap.getWidth() - mActionGap * 2 - CommonUtil.dpToPx(context, 15),
  278 + endY - mActionGap);
  279 + } else if (endY > getHeight() - confirmBitmap.getHeight() * 3) {
  280 + //显示在选区的上面
  281 + confirmArea.set(endX - confirmBitmap.getWidth() - mActionGap,
  282 + startY - confirmBitmap.getHeight() - mActionGap,
  283 + endX - mActionGap,
  284 + startY - mActionGap);
  285 +
  286 + cancelArea.set(endX - 2 * confirmBitmap.getWidth() - mActionGap * 2 - CommonUtil.dpToPx(context, 15),
  287 + startY - confirmBitmap.getHeight() - mActionGap,
  288 + endX - confirmBitmap.getWidth() - mActionGap * 2 - CommonUtil.dpToPx(context, 15),
  289 + startY - mActionGap);
  290 + } else {
  291 + //显示在选区的下面
  292 + confirmArea.set(endX - confirmBitmap.getWidth() - mActionGap,
  293 + endY + mActionGap,
  294 + endX - mActionGap,
  295 + endY + confirmBitmap.getHeight() + mActionGap);
  296 +
  297 + cancelArea.set(endX - 2 * confirmBitmap.getWidth() - mActionGap * 2 - CommonUtil.dpToPx(context, 15),
  298 + endY + mActionGap,
  299 + endX - confirmBitmap.getWidth() - mActionGap * 2 - CommonUtil.dpToPx(context, 15),
  300 + endY + confirmBitmap.getHeight() + mActionGap);
  301 + }
302 302  
303   - if (cancelArea.left < 0) {
304   - int cancelAreaLeftMargin = Math.abs(cancelArea.left) + mActionGap;
305   - cancelArea.left = cancelArea.left + cancelAreaLeftMargin;
306   - cancelArea.right = cancelArea.right + cancelAreaLeftMargin;
307   - confirmArea.left = confirmArea.left + cancelAreaLeftMargin;
308   - confirmArea.right = confirmArea.right + cancelAreaLeftMargin;
309   - }
  303 + if (cancelArea.left < 0) {
  304 + int cancelAreaLeftMargin = Math.abs(cancelArea.left) + mActionGap;
  305 + cancelArea.left = cancelArea.left + cancelAreaLeftMargin;
  306 + cancelArea.right = cancelArea.right + cancelAreaLeftMargin;
  307 + confirmArea.left = confirmArea.left + cancelAreaLeftMargin;
  308 + confirmArea.right = confirmArea.right + cancelAreaLeftMargin;
  309 + }
310 310  
311   - if (!isValid) {
312   - if (mOnClickListener != null) {
313   - mOnClickListener.onCancel();
314   - }
  311 + if (!isValid) {
  312 + if (mOnClickListener != null) {
  313 + mOnClickListener.onCancel();
315 314 }
  315 + setTranslationZ(0);
316 316 }
317 317 break;
318 318 case MotionEvent.ACTION_CANCEL:
... ...