Commit 9d34943f451ba91ce6269ed487c13f37a83e02a8
1 parent
e88528e7ad
Exists in
master
bugfix: 初始状态下保存按钮
Showing
1 changed file
with
2 additions
and
0 deletions
Show diff stats
app/src/main/java/com/hjx/parent/ImageActivity.java
1 | package com.hjx.parent; | 1 | package com.hjx.parent; |
2 | 2 | ||
3 | import android.annotation.SuppressLint; | 3 | import android.annotation.SuppressLint; |
4 | import android.app.Dialog; | 4 | import android.app.Dialog; |
5 | import android.content.Intent; | 5 | import android.content.Intent; |
6 | import android.graphics.Bitmap; | 6 | import android.graphics.Bitmap; |
7 | import android.graphics.BitmapFactory; | 7 | import android.graphics.BitmapFactory; |
8 | import android.graphics.Rect; | 8 | import android.graphics.Rect; |
9 | import android.net.Uri; | 9 | import android.net.Uri; |
10 | import android.os.Bundle; | 10 | import android.os.Bundle; |
11 | import android.os.Handler; | 11 | import android.os.Handler; |
12 | import android.provider.MediaStore; | 12 | import android.provider.MediaStore; |
13 | import android.text.TextUtils; | 13 | import android.text.TextUtils; |
14 | import android.util.Log; | 14 | import android.util.Log; |
15 | import android.view.KeyEvent; | 15 | import android.view.KeyEvent; |
16 | import android.view.View; | 16 | import android.view.View; |
17 | 17 | ||
18 | 18 | ||
19 | import androidx.annotation.Nullable; | 19 | import androidx.annotation.Nullable; |
20 | import androidx.core.content.FileProvider; | 20 | import androidx.core.content.FileProvider; |
21 | import androidx.viewpager2.widget.ViewPager2; | 21 | import androidx.viewpager2.widget.ViewPager2; |
22 | 22 | ||
23 | import com.google.gson.Gson; | 23 | import com.google.gson.Gson; |
24 | import com.google.gson.JsonObject; | 24 | import com.google.gson.JsonObject; |
25 | import com.hjx.parent.adapter.ImageAdapter; | 25 | import com.hjx.parent.adapter.ImageAdapter; |
26 | import com.hjx.parent.databinding.ActivityImageBinding; | 26 | import com.hjx.parent.databinding.ActivityImageBinding; |
27 | import com.hjx.parent.databinding.ItemImageBinding; | 27 | import com.hjx.parent.databinding.ItemImageBinding; |
28 | import com.hjx.parent.dialog.AddHomeworkDialog; | 28 | import com.hjx.parent.dialog.AddHomeworkDialog; |
29 | import com.hjx.parent.dialog.ErrorInputDialog; | 29 | import com.hjx.parent.dialog.ErrorInputDialog; |
30 | import com.hjx.parent.dialog.PhotoViewDialog; | 30 | import com.hjx.parent.dialog.PhotoViewDialog; |
31 | import com.hjx.parent.dialog.TipDialog; | 31 | import com.hjx.parent.dialog.TipDialog; |
32 | import com.hjx.parent.rx.BaseRxActivity; | 32 | import com.hjx.parent.rx.BaseRxActivity; |
33 | import com.hjx.parent.utils.CutUtil; | 33 | import com.hjx.parent.utils.CutUtil; |
34 | import com.prws.common.bean.CutPicBean; | 34 | import com.prws.common.bean.CutPicBean; |
35 | import com.prws.common.bean.ImageBean; | 35 | import com.prws.common.bean.ImageBean; |
36 | import com.prws.common.bean.TopicBean; | 36 | import com.prws.common.bean.TopicBean; |
37 | import com.prws.common.net.NetWorks; | 37 | import com.prws.common.net.NetWorks; |
38 | import com.prws.common.utils.BitmapUtils; | 38 | import com.prws.common.utils.BitmapUtils; |
39 | import com.prws.common.utils.CommonUtil; | 39 | import com.prws.common.utils.CommonUtil; |
40 | import com.xiasuhuei321.loadingdialog.view.LoadingDialog; | 40 | import com.xiasuhuei321.loadingdialog.view.LoadingDialog; |
41 | 41 | ||
42 | import java.io.File; | 42 | import java.io.File; |
43 | import java.util.ArrayList; | 43 | import java.util.ArrayList; |
44 | import java.util.List; | 44 | import java.util.List; |
45 | import java.util.stream.Collectors; | 45 | import java.util.stream.Collectors; |
46 | 46 | ||
47 | import io.reactivex.Observer; | 47 | import io.reactivex.Observer; |
48 | import io.reactivex.Single; | 48 | import io.reactivex.Single; |
49 | import io.reactivex.disposables.Disposable; | 49 | import io.reactivex.disposables.Disposable; |
50 | 50 | ||
51 | public class ImageActivity extends BaseRxActivity<ActivityImageBinding> implements View.OnClickListener { | 51 | public class ImageActivity extends BaseRxActivity<ActivityImageBinding> implements View.OnClickListener { |
52 | 52 | ||
53 | private final List<String> images = new ArrayList<>(); | 53 | private final List<String> images = new ArrayList<>(); |
54 | private ImageAdapter imageAdapter; | 54 | private ImageAdapter imageAdapter; |
55 | private List<ImageBean> list = new ArrayList<>(); | 55 | private List<ImageBean> list = new ArrayList<>(); |
56 | private String filePath; | 56 | private String filePath; |
57 | 57 | ||
58 | private int type = 0; | 58 | private int type = 0; |
59 | private AddHomeworkDialog addHomeworkDialog; | 59 | private AddHomeworkDialog addHomeworkDialog; |
60 | 60 | ||
61 | @SuppressLint("CheckResult") | 61 | @SuppressLint("CheckResult") |
62 | @Override | 62 | @Override |
63 | public void initView(Bundle savedInstanceState) { | 63 | public void initView(Bundle savedInstanceState) { |
64 | type = getIntent().getIntExtra("type", 0); | 64 | type = getIntent().getIntExtra("type", 0); |
65 | binding.tvSave.setText(type == 0 ? "保存错题" : "录入题目"); | 65 | binding.tvSave.setText(type == 0 ? "保存错题" : "录入题目"); |
66 | 66 | ||
67 | List<String> originList = getIntent().getStringArrayListExtra("images"); | 67 | List<String> originList = getIntent().getStringArrayListExtra("images"); |
68 | List<String> originListFinal = originList == null ? new ArrayList<>() : originList; | 68 | List<String> originListFinal = originList == null ? new ArrayList<>() : originList; |
69 | Single.fromCallable(() -> CutUtil.compressAllSync(this, originListFinal, 200)) | 69 | Single.fromCallable(() -> CutUtil.compressAllSync(this, originListFinal, 200)) |
70 | .map(it -> it.stream().map(File::getAbsolutePath).collect(Collectors.toList())) | 70 | .map(it -> it.stream().map(File::getAbsolutePath).collect(Collectors.toList())) |
71 | .compose(transformSingle()) | 71 | .compose(transformSingle()) |
72 | .subscribe((it, throwable) -> { | 72 | .subscribe((it, throwable) -> { |
73 | if (throwable != null) Log.e(getClass().getName(), "", throwable); | 73 | if (throwable != null) Log.e(getClass().getName(), "", throwable); |
74 | images.clear(); | 74 | images.clear(); |
75 | if (it == null) { | 75 | if (it == null) { |
76 | images.addAll(originListFinal); | 76 | images.addAll(originListFinal); |
77 | } else { | 77 | } else { |
78 | images.addAll(it); | 78 | images.addAll(it); |
79 | } | 79 | } |
80 | start(); | 80 | start(); |
81 | }); | 81 | }); |
82 | } | 82 | } |
83 | 83 | ||
84 | private void start() { | 84 | private void start() { |
85 | if (images == null || images.size() <= 1) { | 85 | if (images == null || images.size() <= 1) { |
86 | binding.rlPrevious.setVisibility(View.GONE); | 86 | binding.rlPrevious.setVisibility(View.GONE); |
87 | binding.rlNext.setVisibility(View.GONE); | 87 | binding.rlNext.setVisibility(View.GONE); |
88 | } | 88 | } |
89 | for (String s : images) { | 89 | for (String s : images) { |
90 | String filepath = context.getExternalFilesDir("images").getPath() + "/" + System.currentTimeMillis() + CommonUtil.getStr() + ".jpg"; | 90 | String filepath = context.getExternalFilesDir("images").getPath() + "/" + System.currentTimeMillis() + CommonUtil.getStr() + ".jpg"; |
91 | ImageBean imageBean = new ImageBean(); | 91 | ImageBean imageBean = new ImageBean(); |
92 | Bitmap bitmap = BitmapUtils.getimage(s); | 92 | Bitmap bitmap = BitmapUtils.getimage(s); |
93 | CommonUtil.saveBitmapToUri(bitmap, filepath); | 93 | CommonUtil.saveBitmapToUri(bitmap, filepath); |
94 | imageBean.setPath(filepath); | 94 | imageBean.setPath(filepath); |
95 | imageBean.source = filepath; | 95 | imageBean.source = filepath; |
96 | list.add(imageBean); | 96 | list.add(imageBean); |
97 | } | 97 | } |
98 | imageAdapter = new ImageAdapter(this, list); | 98 | imageAdapter = new ImageAdapter(this, list); |
99 | binding.viewPager.setAdapter(imageAdapter); | 99 | binding.viewPager.setAdapter(imageAdapter); |
100 | binding.viewPager.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() { | 100 | binding.viewPager.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() { |
101 | @Override | 101 | @Override |
102 | public void onPageSelected(int position) { | 102 | public void onPageSelected(int position) { |
103 | if (list.get(position).getCuts() == null) { | 103 | if (list.get(position).getCuts() == null) { |
104 | clearText(); | 104 | clearText(); |
105 | } | 105 | } |
106 | binding.tvTitle.setText((binding.viewPager.getCurrentItem() + 1) + "/" + list.size()); | 106 | binding.tvTitle.setText((binding.viewPager.getCurrentItem() + 1) + "/" + list.size()); |
107 | if (position == 0) { | 107 | if (position == 0) { |
108 | binding.ivPrevious.setImageResource(R.mipmap.ic_previous_gray); | 108 | binding.ivPrevious.setImageResource(R.mipmap.ic_previous_gray); |
109 | } else { | 109 | } else { |
110 | binding.ivPrevious.setImageResource(R.mipmap.ic_previous); | 110 | binding.ivPrevious.setImageResource(R.mipmap.ic_previous); |
111 | } | 111 | } |
112 | if (position == list.size() - 1) { | 112 | if (position == list.size() - 1) { |
113 | binding.ivNext.setImageResource(R.mipmap.ic_next_gray); | 113 | binding.ivNext.setImageResource(R.mipmap.ic_next_gray); |
114 | } else { | 114 | } else { |
115 | binding.ivNext.setImageResource(R.mipmap.ic_next); | 115 | binding.ivNext.setImageResource(R.mipmap.ic_next); |
116 | } | 116 | } |
117 | super.onPageSelected(position); | 117 | super.onPageSelected(position); |
118 | } | 118 | } |
119 | }); | 119 | }); |
120 | binding.rlNext.setOnClickListener(this); | 120 | binding.rlNext.setOnClickListener(this); |
121 | binding.rlPrevious.setOnClickListener(this); | 121 | binding.rlPrevious.setOnClickListener(this); |
122 | binding.ivBack.setOnClickListener(this); | 122 | binding.ivBack.setOnClickListener(this); |
123 | binding.tvPhoto.setOnClickListener(this); | 123 | binding.tvPhoto.setOnClickListener(this); |
124 | binding.tvAdd.setOnClickListener(this); | 124 | binding.tvAdd.setOnClickListener(this); |
125 | binding.llEdit.setOnClickListener(this); | 125 | binding.llEdit.setOnClickListener(this); |
126 | binding.tvSave.setOnClickListener(this); | 126 | binding.tvSave.setOnClickListener(this); |
127 | binding.btnShowSource.setOnClickListener(v -> { | 127 | binding.btnShowSource.setOnClickListener(v -> { |
128 | if (list.isEmpty()) return; | 128 | if (list.isEmpty()) return; |
129 | ImageBean data = list.get(binding.viewPager.getCurrentItem()); | 129 | ImageBean data = list.get(binding.viewPager.getCurrentItem()); |
130 | new PhotoViewDialog(this).show(data.source); | 130 | new PhotoViewDialog(this).show(data.source); |
131 | }); | 131 | }); |
132 | 132 | ||
133 | binding.btnJudge.setVisibility(type == 0 ? View.VISIBLE : View.GONE); | 133 | binding.btnJudge.setVisibility(type == 0 ? View.VISIBLE : View.GONE); |
134 | binding.btnJudge.setOnClickListener(v -> { | 134 | binding.btnJudge.setOnClickListener(v -> { |
135 | goJudge(); | 135 | goJudge(); |
136 | }); | 136 | }); |
137 | } | 137 | } |
138 | 138 | ||
139 | private void goJudge() { | 139 | private void goJudge() { |
140 | if (list.isEmpty()) return; | 140 | if (list.isEmpty()) return; |
141 | int position = binding.viewPager.getCurrentItem(); | 141 | int position = binding.viewPager.getCurrentItem(); |
142 | ImageBean imageBean = list.get(position); | 142 | ImageBean imageBean = list.get(position); |
143 | Bitmap bitmap = BitmapFactory.decodeFile(imageBean.getPath()); | 143 | Bitmap bitmap = BitmapFactory.decodeFile(imageBean.getPath()); |
144 | if (bitmap == null || imageBean.getCuts() == null) { | 144 | if (bitmap == null || imageBean.getCuts() == null) { |
145 | showToast("请先框选题目"); | 145 | showToast("请先框选题目"); |
146 | return; | 146 | return; |
147 | } | 147 | } |
148 | ItemImageBinding ib = imageAdapter.viewArray.get(position); | 148 | ItemImageBinding ib = imageAdapter.viewArray.get(position); |
149 | if (ib == null) { | 149 | if (ib == null) { |
150 | showToast("出错"); | 150 | showToast("出错"); |
151 | return; | 151 | return; |
152 | } | 152 | } |
153 | View view = ib.ivPic; | 153 | View view = ib.ivPic; |
154 | float[] size = CutUtil.measureBitmap(view, bitmap); | 154 | float[] size = CutUtil.measureBitmap(view, bitmap); |
155 | 155 | ||
156 | ArrayList<Rect> rects = new ArrayList<>(); | 156 | ArrayList<Rect> rects = new ArrayList<>(); |
157 | for (ImageBean.Cut cut: imageBean.getCuts()) { | 157 | for (ImageBean.Cut cut: imageBean.getCuts()) { |
158 | if (cut.getRect1() == null || !cut.isSelect()) continue; | 158 | if (cut.getRect1() == null || !cut.isSelect()) continue; |
159 | Rect rectV = cut.getRect1(); | 159 | Rect rectV = cut.getRect1(); |
160 | rects.add(getRectB(rectV, bitmap, size)); | 160 | rects.add(getRectB(rectV, bitmap, size)); |
161 | } | 161 | } |
162 | if (list.isEmpty()) { | 162 | if (list.isEmpty()) { |
163 | showToast("请选择要批改的题目"); | 163 | showToast("请选择要批改的题目"); |
164 | return; | 164 | return; |
165 | } | 165 | } |
166 | 166 | ||
167 | Intent intent = new Intent(this, JudgeActivity.class); | 167 | Intent intent = new Intent(this, JudgeActivity.class); |
168 | intent.putExtra("path", imageBean.getPath()); | 168 | intent.putExtra("path", imageBean.getPath()); |
169 | intent.putParcelableArrayListExtra("rects", rects); | 169 | intent.putParcelableArrayListExtra("rects", rects); |
170 | 170 | ||
171 | startActivity(intent); | 171 | startActivity(intent); |
172 | } | 172 | } |
173 | 173 | ||
174 | private Rect getRectB(Rect rectV, Bitmap bitmap, float[] measuredSize) { | 174 | private Rect getRectB(Rect rectV, Bitmap bitmap, float[] measuredSize) { |
175 | float realW = measuredSize[0]; | 175 | float realW = measuredSize[0]; |
176 | float realH = measuredSize[1]; | 176 | float realH = measuredSize[1]; |
177 | float offsetX = measuredSize[2]; | 177 | float offsetX = measuredSize[2]; |
178 | float offsetY = measuredSize[3]; | 178 | float offsetY = measuredSize[3]; |
179 | float percentX = bitmap.getWidth() / realW; | 179 | float percentX = bitmap.getWidth() / realW; |
180 | float percentY = bitmap.getHeight() / realH; | 180 | float percentY = bitmap.getHeight() / realH; |
181 | 181 | ||
182 | float left = (rectV.left - offsetX) * percentX; | 182 | float left = (rectV.left - offsetX) * percentX; |
183 | float right = (rectV.right - offsetX) * percentX; | 183 | float right = (rectV.right - offsetX) * percentX; |
184 | float top = (rectV.top - offsetY) * percentY; | 184 | float top = (rectV.top - offsetY) * percentY; |
185 | float bottom = (rectV.bottom - offsetY) * percentY; | 185 | float bottom = (rectV.bottom - offsetY) * percentY; |
186 | Rect rectB = new Rect((int) left, (int) top, (int) right, (int) bottom); | 186 | Rect rectB = new Rect((int) left, (int) top, (int) right, (int) bottom); |
187 | return rectB; | 187 | return rectB; |
188 | } | 188 | } |
189 | 189 | ||
190 | public void clearText() { | 190 | public void clearText() { |
191 | int index = binding.viewPager.getCurrentItem(); | 191 | int index = binding.viewPager.getCurrentItem(); |
192 | showLoadingDialog(getString(R.string.loading_text), new LoadingDialog.DismissListener() { | 192 | showLoadingDialog(getString(R.string.loading_text), new LoadingDialog.DismissListener() { |
193 | @Override | 193 | @Override |
194 | public void dimiss() { | 194 | public void dimiss() { |
195 | // binding.ivPrevious.setEnabled(index != 0); | 195 | // binding.ivPrevious.setEnabled(index != 0); |
196 | // binding.ivNext.setEnabled(index != list.size() - 1); | 196 | // binding.ivNext.setEnabled(index != list.size() - 1); |
197 | } | 197 | } |
198 | }); | 198 | }); |
199 | Log.i("clearText", list.get(index).getPath()); | 199 | Log.i("clearText", list.get(index).getPath()); |
200 | String base64 = BitmapUtils.imageToBase64(list.get(index).getPath(), false); | 200 | String base64 = BitmapUtils.imageToBase64(list.get(index).getPath(), false); |
201 | NetWorks.baiduEnhance(base64, new Observer<JsonObject>() { | 201 | NetWorks.baiduEnhance(base64, new Observer<JsonObject>() { |
202 | @Override | 202 | @Override |
203 | public void onSubscribe(Disposable d) { | 203 | public void onSubscribe(Disposable d) { |
204 | 204 | ||
205 | } | 205 | } |
206 | 206 | ||
207 | @Override | 207 | @Override |
208 | public void onNext(JsonObject jsonObject) { | 208 | public void onNext(JsonObject jsonObject) { |
209 | if (jsonObject != null && jsonObject.get("image_processed") != null) { | 209 | if (jsonObject != null && jsonObject.get("image_processed") != null) { |
210 | String image = jsonObject.get("image_processed").getAsString(); | 210 | String image = jsonObject.get("image_processed").getAsString(); |
211 | if (image != null) { | 211 | if (image != null) { |
212 | String filepath = context.getExternalFilesDir("images").getPath() + "/" + String.valueOf(System.currentTimeMillis()) + CommonUtil.getStr() + ".jpg"; | 212 | String filepath = context.getExternalFilesDir("images").getPath() + "/" + String.valueOf(System.currentTimeMillis()) + CommonUtil.getStr() + ".jpg"; |
213 | CommonUtil.saveBitmapToUri(BitmapUtils.stringToBitmap(image), filepath); | 213 | CommonUtil.saveBitmapToUri(BitmapUtils.stringToBitmap(image), filepath); |
214 | list.get(index).setPath(filepath); | 214 | list.get(index).setPath(filepath); |
215 | if (list.get(index).getCuts() == null) { | 215 | if (list.get(index).getCuts() == null) { |
216 | list.get(index).setCuts(new ArrayList<>()); | 216 | list.get(index).setCuts(new ArrayList<>()); |
217 | } | 217 | } |
218 | imageAdapter.notifyItemChanged(index); | 218 | imageAdapter.notifyItemChanged(index); |
219 | cut(filepath); | 219 | cut(filepath); |
220 | } else { | 220 | } else { |
221 | loadFail("去除字迹失败"); | 221 | loadFail("去除字迹失败"); |
222 | } | 222 | } |
223 | } else { | 223 | } else { |
224 | loadFail("去除字迹失败"); | 224 | loadFail("去除字迹失败"); |
225 | } | 225 | } |
226 | } | 226 | } |
227 | 227 | ||
228 | @Override | 228 | @Override |
229 | public void onError(Throwable e) { | 229 | public void onError(Throwable e) { |
230 | e.printStackTrace(); | 230 | e.printStackTrace(); |
231 | loadFail("去除字迹失败"); | 231 | loadFail("去除字迹失败"); |
232 | } | 232 | } |
233 | 233 | ||
234 | @Override | 234 | @Override |
235 | public void onComplete() { | 235 | public void onComplete() { |
236 | 236 | ||
237 | } | 237 | } |
238 | }); | 238 | }); |
239 | } | 239 | } |
240 | 240 | ||
241 | public void cut(String path) { | 241 | public void cut(String path) { |
242 | String base64 = BitmapUtils.imageToBase64WithUrlEncode(path); | 242 | String base64 = BitmapUtils.imageToBase64WithUrlEncode(path); |
243 | Log.i("figLoaction", path); | 243 | Log.i("figLoaction", path); |
244 | NetWorks.cut(base64, new Observer<CutPicBean>() { | 244 | NetWorks.cut(base64, new Observer<CutPicBean>() { |
245 | @Override | 245 | @Override |
246 | public void onSubscribe(Disposable d) { | 246 | public void onSubscribe(Disposable d) { |
247 | 247 | ||
248 | } | 248 | } |
249 | 249 | ||
250 | @Override | 250 | @Override |
251 | public void onNext(CutPicBean cutPicBean) { | 251 | public void onNext(CutPicBean cutPicBean) { |
252 | if (cutPicBean != null) { | 252 | if (cutPicBean != null) { |
253 | if (cutPicBean.getDirection() != 0) { | 253 | if (cutPicBean.getDirection() != 0) { |
254 | rotatingImage(cutPicBean); | 254 | rotatingImage(cutPicBean); |
255 | } else { | 255 | } else { |
256 | if (cutPicBean.getQus_figure() != null && cutPicBean.getQus_figure().size() > 0) { | 256 | if (cutPicBean.getQus_figure() != null && cutPicBean.getQus_figure().size() > 0) { |
257 | List<CutPicBean.FigLoaction> figLoactions = new ArrayList<>(); | 257 | List<CutPicBean.FigLoaction> figLoactions = new ArrayList<>(); |
258 | for (CutPicBean.CutLocation cutLocation : cutPicBean.getQus_figure()) { | 258 | for (CutPicBean.CutLocation cutLocation : cutPicBean.getQus_figure()) { |
259 | figLoactions.add(cutLocation.getFig_location()); | 259 | figLoactions.add(cutLocation.getFig_location()); |
260 | } | 260 | } |
261 | new Handler().postDelayed(new Runnable() { | 261 | new Handler().postDelayed(new Runnable() { |
262 | @Override | 262 | @Override |
263 | public void run() { | 263 | public void run() { |
264 | getRects(figLoactions); | 264 | getRects(figLoactions); |
265 | } | 265 | } |
266 | }, 1000); | 266 | }, 1000); |
267 | } else { | 267 | } else { |
268 | cancelLoadingDialog(); | 268 | cancelLoadingDialog(); |
269 | } | 269 | } |
270 | } | 270 | } |
271 | } else { | 271 | } else { |
272 | loadFail("自动切题失败"); | 272 | loadFail("自动切题失败"); |
273 | } | 273 | } |
274 | } | 274 | } |
275 | 275 | ||
276 | @Override | 276 | @Override |
277 | public void onError(Throwable e) { | 277 | public void onError(Throwable e) { |
278 | loadFail("自动切题失败"); | 278 | loadFail("自动切题失败"); |
279 | } | 279 | } |
280 | 280 | ||
281 | @Override | 281 | @Override |
282 | public void onComplete() { | 282 | public void onComplete() { |
283 | 283 | ||
284 | } | 284 | } |
285 | }); | 285 | }); |
286 | } | 286 | } |
287 | 287 | ||
288 | private void getRects(List<CutPicBean.FigLoaction> figLoactions) { | 288 | private void getRects(List<CutPicBean.FigLoaction> figLoactions) { |
289 | Log.i("figLoaction", new Gson().toJson(figLoactions)); | 289 | Log.i("figLoaction", new Gson().toJson(figLoactions)); |
290 | int index = binding.viewPager.getCurrentItem(); | 290 | int index = binding.viewPager.getCurrentItem(); |
291 | List<ImageBean.Cut> cuts = new ArrayList<>(); | 291 | List<ImageBean.Cut> cuts = new ArrayList<>(); |
292 | for (CutPicBean.FigLoaction figLoaction : figLoactions) { | 292 | for (CutPicBean.FigLoaction figLoaction : figLoactions) { |
293 | ImageBean.Cut cut = new ImageBean.Cut(); | 293 | ImageBean.Cut cut = new ImageBean.Cut(); |
294 | cut.setRect(figLoaction); | 294 | cut.setRect(figLoaction); |
295 | cut.setSelect(true); | 295 | cut.setSelect(true); |
296 | cuts.add(cut); | 296 | cuts.add(cut); |
297 | } | 297 | } |
298 | list.get(index).setCuts(cuts); | 298 | list.get(index).setCuts(cuts); |
299 | imageAdapter.notifyItemChanged(index); | 299 | imageAdapter.notifyItemChanged(index); |
300 | cancelLoadingDialog(); | 300 | cancelLoadingDialog(); |
301 | |||
302 | refreshNum(); | ||
301 | } | 303 | } |
302 | 304 | ||
303 | private void rotatingImage(CutPicBean cutPicBean) { | 305 | private void rotatingImage(CutPicBean cutPicBean) { |
304 | int index = binding.viewPager.getCurrentItem(); | 306 | int index = binding.viewPager.getCurrentItem(); |
305 | Bitmap bitmap = BitmapFactory.decodeFile(list.get(index).getPath()); | 307 | Bitmap bitmap = BitmapFactory.decodeFile(list.get(index).getPath()); |
306 | int angle = 0; | 308 | int angle = 0; |
307 | switch (cutPicBean.getDirection()) { | 309 | switch (cutPicBean.getDirection()) { |
308 | case 1: | 310 | case 1: |
309 | angle = 90; | 311 | angle = 90; |
310 | break; | 312 | break; |
311 | case 2: | 313 | case 2: |
312 | angle = 180; | 314 | angle = 180; |
313 | break; | 315 | break; |
314 | case 3: | 316 | case 3: |
315 | angle = 270; | 317 | angle = 270; |
316 | break; | 318 | break; |
317 | } | 319 | } |
318 | if (cutPicBean.getQus_figure() != null && cutPicBean.getQus_figure().size() > 0) { | 320 | if (cutPicBean.getQus_figure() != null && cutPicBean.getQus_figure().size() > 0) { |
319 | List<CutPicBean.FigLoaction> figLoactions = new ArrayList<>(); | 321 | List<CutPicBean.FigLoaction> figLoactions = new ArrayList<>(); |
320 | for (CutPicBean.CutLocation cutLocation : cutPicBean.getQus_figure()) { | 322 | for (CutPicBean.CutLocation cutLocation : cutPicBean.getQus_figure()) { |
321 | figLoactions.add(cutLocation.getFig_location()); | 323 | figLoactions.add(cutLocation.getFig_location()); |
322 | } | 324 | } |
323 | figLoactions = CommonUtil.rotaingLocation(angle, figLoactions, bitmap.getWidth(), bitmap.getHeight()); | 325 | figLoactions = CommonUtil.rotaingLocation(angle, figLoactions, bitmap.getWidth(), bitmap.getHeight()); |
324 | bitmap = CommonUtil.rotaingImageView(angle, bitmap); | 326 | bitmap = CommonUtil.rotaingImageView(angle, bitmap); |
325 | String filepath = context.getExternalFilesDir("images").getPath() + "/" + String.valueOf(System.currentTimeMillis()) + CommonUtil.getStr() + ".jpg"; | 327 | String filepath = context.getExternalFilesDir("images").getPath() + "/" + String.valueOf(System.currentTimeMillis()) + CommonUtil.getStr() + ".jpg"; |
326 | CommonUtil.saveBitmapToUri(bitmap, filepath); | 328 | CommonUtil.saveBitmapToUri(bitmap, filepath); |
327 | list.get(index).setPath(filepath); | 329 | list.get(index).setPath(filepath); |
328 | imageAdapter.notifyItemChanged(index); | 330 | imageAdapter.notifyItemChanged(index); |
329 | List<CutPicBean.FigLoaction> finalFigLoactions = figLoactions; | 331 | List<CutPicBean.FigLoaction> finalFigLoactions = figLoactions; |
330 | new Handler().postDelayed(new Runnable() { | 332 | new Handler().postDelayed(new Runnable() { |
331 | @Override | 333 | @Override |
332 | public void run() { | 334 | public void run() { |
333 | getRects(finalFigLoactions); | 335 | getRects(finalFigLoactions); |
334 | } | 336 | } |
335 | }, 500); | 337 | }, 500); |
336 | } else { | 338 | } else { |
337 | cancelLoadingDialog(); | 339 | cancelLoadingDialog(); |
338 | } | 340 | } |
339 | } | 341 | } |
340 | 342 | ||
341 | @Override | 343 | @Override |
342 | protected ActivityImageBinding getViewBinding() { | 344 | protected ActivityImageBinding getViewBinding() { |
343 | return ActivityImageBinding.inflate(getLayoutInflater()); | 345 | return ActivityImageBinding.inflate(getLayoutInflater()); |
344 | } | 346 | } |
345 | 347 | ||
346 | @SuppressLint("SetTextI18n") | 348 | @SuppressLint("SetTextI18n") |
347 | public void refreshNum() { | 349 | public void refreshNum() { |
348 | int num = 0; | 350 | int num = 0; |
349 | for (ImageBean imageBean : list) { | 351 | for (ImageBean imageBean : list) { |
350 | if (imageBean.getCuts() != null && imageBean.getCuts().size() > 0) { | 352 | if (imageBean.getCuts() != null && imageBean.getCuts().size() > 0) { |
351 | for (ImageBean.Cut cut : imageBean.getCuts()) { | 353 | for (ImageBean.Cut cut : imageBean.getCuts()) { |
352 | if (cut.isSelect()) { | 354 | if (cut.isSelect()) { |
353 | num++; | 355 | num++; |
354 | } | 356 | } |
355 | } | 357 | } |
356 | } | 358 | } |
357 | } | 359 | } |
358 | String btnText = type == 0 ? "保存错题" : "录入题目"; | 360 | String btnText = type == 0 ? "保存错题" : "录入题目"; |
359 | if (num > 0) { | 361 | if (num > 0) { |
360 | binding.tvSave.setEnabled(true); | 362 | binding.tvSave.setEnabled(true); |
361 | binding.tvSave.setBackgroundResource(R.drawable.bg_soild_blue_5); | 363 | binding.tvSave.setBackgroundResource(R.drawable.bg_soild_blue_5); |
362 | binding.tvSave.setText(btnText + "(" + num + ")"); | 364 | binding.tvSave.setText(btnText + "(" + num + ")"); |
363 | } else { | 365 | } else { |
364 | binding.tvSave.setEnabled(false); | 366 | binding.tvSave.setEnabled(false); |
365 | binding.tvSave.setBackgroundResource(R.drawable.bg_soild_blue_light_5); | 367 | binding.tvSave.setBackgroundResource(R.drawable.bg_soild_blue_light_5); |
366 | binding.tvSave.setText(btnText); | 368 | binding.tvSave.setText(btnText); |
367 | } | 369 | } |
368 | } | 370 | } |
369 | 371 | ||
370 | @Override | 372 | @Override |
371 | public void onClick(View v) { | 373 | public void onClick(View v) { |
372 | switch (v.getId()) { | 374 | switch (v.getId()) { |
373 | case R.id.iv_back: | 375 | case R.id.iv_back: |
374 | back(); | 376 | back(); |
375 | break; | 377 | break; |
376 | case R.id.rl_next: | 378 | case R.id.rl_next: |
377 | if (binding.viewPager.getCurrentItem() + 1 < list.size()) { | 379 | if (binding.viewPager.getCurrentItem() + 1 < list.size()) { |
378 | binding.viewPager.setCurrentItem(binding.viewPager.getCurrentItem() + 1); | 380 | binding.viewPager.setCurrentItem(binding.viewPager.getCurrentItem() + 1); |
379 | } | 381 | } |
380 | break; | 382 | break; |
381 | case R.id.rl_previous: | 383 | case R.id.rl_previous: |
382 | if (binding.viewPager.getCurrentItem() != 0) { | 384 | if (binding.viewPager.getCurrentItem() != 0) { |
383 | binding.viewPager.setCurrentItem(binding.viewPager.getCurrentItem() - 1); | 385 | binding.viewPager.setCurrentItem(binding.viewPager.getCurrentItem() - 1); |
384 | } | 386 | } |
385 | break; | 387 | break; |
386 | case R.id.ll_edit: | 388 | case R.id.ll_edit: |
387 | Intent intent = new Intent(context, ImageEditActivity.class); | 389 | Intent intent = new Intent(context, ImageEditActivity.class); |
388 | intent.putExtra("path", list.get(binding.viewPager.getCurrentItem()).getPath()); | 390 | intent.putExtra("path", list.get(binding.viewPager.getCurrentItem()).getPath()); |
389 | startActivityForResult(intent, 1001); | 391 | startActivityForResult(intent, 1001); |
390 | break; | 392 | break; |
391 | case R.id.tv_photo: | 393 | case R.id.tv_photo: |
392 | Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); | 394 | Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); |
393 | //确保有相机来处理Intent | 395 | //确保有相机来处理Intent |
394 | filePath = context.getExternalFilesDir("images").getPath() + "/" + String.valueOf(System.currentTimeMillis()) + CommonUtil.getStr() + ".jpg"; | 396 | filePath = context.getExternalFilesDir("images").getPath() + "/" + String.valueOf(System.currentTimeMillis()) + CommonUtil.getStr() + ".jpg"; |
395 | File photoFile = new File(filePath); | 397 | File photoFile = new File(filePath); |
396 | if (photoFile != null) { | 398 | if (photoFile != null) { |
397 | //适配Android 7.0文件权限,通过FileProvider创建一个content类型的Uri | 399 | //适配Android 7.0文件权限,通过FileProvider创建一个content类型的Uri |
398 | Uri photoUri = FileProvider.getUriForFile(activity, "com.hjx.parent.fileprovider", photoFile); | 400 | Uri photoUri = FileProvider.getUriForFile(activity, "com.hjx.parent.fileprovider", photoFile); |
399 | takePictureIntent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION); | 401 | takePictureIntent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION); |
400 | takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoUri); | 402 | takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoUri); |
401 | activity.startActivityForResult(takePictureIntent, 1002); | 403 | activity.startActivityForResult(takePictureIntent, 1002); |
402 | } | 404 | } |
403 | break; | 405 | break; |
404 | case R.id.tv_add: | 406 | case R.id.tv_add: |
405 | Intent intent1 = new Intent(context, ImageSelectActivity.class); | 407 | Intent intent1 = new Intent(context, ImageSelectActivity.class); |
406 | intent1.putExtra("path", list.get(binding.viewPager.getCurrentItem()).getPath()); | 408 | intent1.putExtra("path", list.get(binding.viewPager.getCurrentItem()).getPath()); |
407 | intent1.putExtra("source", list.get(binding.viewPager.getCurrentItem()).source); | 409 | intent1.putExtra("source", list.get(binding.viewPager.getCurrentItem()).source); |
408 | startActivityForResult(intent1, 1001); | 410 | startActivityForResult(intent1, 1001); |
409 | break; | 411 | break; |
410 | case R.id.tv_save: | 412 | case R.id.tv_save: |
411 | List<TopicBean> topicBeans = new ArrayList<>(); | 413 | List<TopicBean> topicBeans = new ArrayList<>(); |
412 | for (ImageBean imageBean : list) { | 414 | for (ImageBean imageBean : list) { |
413 | if (imageBean.getCuts() != null && imageBean.getCuts().size() > 0) { | 415 | if (imageBean.getCuts() != null && imageBean.getCuts().size() > 0) { |
414 | for (ImageBean.Cut cut : imageBean.getCuts()) { | 416 | for (ImageBean.Cut cut : imageBean.getCuts()) { |
415 | if (cut.isSelect()) { | 417 | if (cut.isSelect()) { |
416 | TopicBean bean = new TopicBean(); | 418 | TopicBean bean = new TopicBean(); |
417 | String path = context.getExternalFilesDir("images").getPath() + "/" + String.valueOf(System.currentTimeMillis()) + CommonUtil.getStr() + ".jpg"; | 419 | String path = context.getExternalFilesDir("images").getPath() + "/" + String.valueOf(System.currentTimeMillis()) + CommonUtil.getStr() + ".jpg"; |
418 | BitmapUtils.saveBitmap(cut.getBitmap(), path); | 420 | BitmapUtils.saveBitmap(cut.getBitmap(), path); |
419 | bean.setPath(path); | 421 | bean.setPath(path); |
420 | topicBeans.add(bean); | 422 | topicBeans.add(bean); |
421 | } | 423 | } |
422 | } | 424 | } |
423 | } | 425 | } |
424 | } | 426 | } |
425 | save(topicBeans); | 427 | save(topicBeans); |
426 | break; | 428 | break; |
427 | } | 429 | } |
428 | } | 430 | } |
429 | 431 | ||
430 | private void save(List<TopicBean> topicBeans) { | 432 | private void save(List<TopicBean> topicBeans) { |
431 | if (type == 0) { | 433 | if (type == 0) { |
432 | ErrorInputDialog dialog = new ErrorInputDialog(this, topicBeans); | 434 | ErrorInputDialog dialog = new ErrorInputDialog(this, topicBeans); |
433 | dialog.show(() -> { | 435 | dialog.show(() -> { |
434 | Intent intent = new Intent(this, AddSuccessActivity.class); | 436 | Intent intent = new Intent(this, AddSuccessActivity.class); |
435 | startActivity(intent); | 437 | startActivity(intent); |
436 | finish(); | 438 | finish(); |
437 | }); | 439 | }); |
438 | } else { | 440 | } else { |
439 | List<String> paths = new ArrayList<>(); | 441 | List<String> paths = new ArrayList<>(); |
440 | for (TopicBean it: topicBeans) { | 442 | for (TopicBean it: topicBeans) { |
441 | paths.add(it.getPath()); | 443 | paths.add(it.getPath()); |
442 | } | 444 | } |
443 | if (addHomeworkDialog == null) { | 445 | if (addHomeworkDialog == null) { |
444 | addHomeworkDialog = new AddHomeworkDialog(this); | 446 | addHomeworkDialog = new AddHomeworkDialog(this); |
445 | } | 447 | } |
446 | addHomeworkDialog.show(paths, student -> { | 448 | addHomeworkDialog.show(paths, student -> { |
447 | Intent intent = new Intent(context, AddSuccessActivity.class); | 449 | Intent intent = new Intent(context, AddSuccessActivity.class); |
448 | intent.putExtra("type", type); | 450 | intent.putExtra("type", type); |
449 | intent.putExtra("studentJson", new Gson().toJson(student)); | 451 | intent.putExtra("studentJson", new Gson().toJson(student)); |
450 | startActivity(intent); | 452 | startActivity(intent); |
451 | finish(); | 453 | finish(); |
452 | }); | 454 | }); |
453 | } | 455 | } |
454 | } | 456 | } |
455 | 457 | ||
456 | @Override | 458 | @Override |
457 | protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { | 459 | protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { |
458 | super.onActivityResult(requestCode, resultCode, data); | 460 | super.onActivityResult(requestCode, resultCode, data); |
459 | if (requestCode == 1001) { | 461 | if (requestCode == 1001) { |
460 | if (resultCode == 1002) { | 462 | if (resultCode == 1002) { |
461 | if (list.size() > 1) { | 463 | if (list.size() > 1) { |
462 | list.remove(binding.viewPager.getCurrentItem()); | 464 | list.remove(binding.viewPager.getCurrentItem()); |
463 | if (list.size() <= 1) { | 465 | if (list.size() <= 1) { |
464 | binding.rlPrevious.setVisibility(View.GONE); | 466 | binding.rlPrevious.setVisibility(View.GONE); |
465 | binding.rlNext.setVisibility(View.GONE); | 467 | binding.rlNext.setVisibility(View.GONE); |
466 | } | 468 | } |
467 | imageAdapter.notifyItemRemoved(binding.viewPager.getCurrentItem()); | 469 | imageAdapter.notifyItemRemoved(binding.viewPager.getCurrentItem()); |
468 | binding.tvTitle.setText((binding.viewPager.getCurrentItem() + 1) + "/" + list.size()); | 470 | binding.tvTitle.setText((binding.viewPager.getCurrentItem() + 1) + "/" + list.size()); |
469 | refreshNum(); | 471 | refreshNum(); |
470 | } else { | 472 | } else { |
471 | finish(); | 473 | finish(); |
472 | } | 474 | } |
473 | } else if (resultCode == 1003) { | 475 | } else if (resultCode == 1003) { |
474 | int position = binding.viewPager.getCurrentItem(); | 476 | int position = binding.viewPager.getCurrentItem(); |
475 | String src = list.get(position).source; | 477 | String src = list.get(position).source; |
476 | list.remove(position); | 478 | list.remove(position); |
477 | String path = data.getStringExtra("path"); | 479 | String path = data.getStringExtra("path"); |
478 | ImageBean imageBean = new ImageBean(); | 480 | ImageBean imageBean = new ImageBean(); |
479 | imageBean.setPath(path); | 481 | imageBean.setPath(path); |
480 | imageBean.source = src; | 482 | imageBean.source = src; |
481 | list.add(position, imageBean); | 483 | list.add(position, imageBean); |
482 | imageAdapter.notifyItemChanged(position); | 484 | imageAdapter.notifyItemChanged(position); |
483 | clearText(); | 485 | clearText(); |
484 | refreshNum(); | 486 | refreshNum(); |
485 | } else if (resultCode == 1004) { | 487 | } else if (resultCode == 1004) { |
486 | Rect rect = data.getParcelableExtra("cut"); | 488 | Rect rect = data.getParcelableExtra("cut"); |
487 | if (rect != null) { | 489 | if (rect != null) { |
488 | int position = binding.viewPager.getCurrentItem(); | 490 | int position = binding.viewPager.getCurrentItem(); |
489 | ImageBean.Cut cut = new ImageBean.Cut(); | 491 | ImageBean.Cut cut = new ImageBean.Cut(); |
490 | cut.setRect1(rect); | 492 | cut.setRect1(rect); |
491 | cut.setSelect(false); | 493 | cut.setSelect(false); |
492 | if (list.get(position).getCuts() != null) { | 494 | if (list.get(position).getCuts() != null) { |
493 | list.get(position).getCuts().add(cut); | 495 | list.get(position).getCuts().add(cut); |
494 | } else { | 496 | } else { |
495 | List<ImageBean.Cut> cuts =new ArrayList<>(); | 497 | List<ImageBean.Cut> cuts =new ArrayList<>(); |
496 | cuts.add(cut); | 498 | cuts.add(cut); |
497 | list.get(position).setCuts(cuts); | 499 | list.get(position).setCuts(cuts); |
498 | } | 500 | } |
499 | imageAdapter.notifyItemChanged(position); | 501 | imageAdapter.notifyItemChanged(position); |
500 | refreshNum(); | 502 | refreshNum(); |
501 | } | 503 | } |
502 | } else if (resultCode == 1005) { | 504 | } else if (resultCode == 1005) { |
503 | int i = data.getIntExtra("position", 0); | 505 | int i = data.getIntExtra("position", 0); |
504 | int position = binding.viewPager.getCurrentItem(); | 506 | int position = binding.viewPager.getCurrentItem(); |
505 | Rect rect = data.getParcelableExtra("cut"); | 507 | Rect rect = data.getParcelableExtra("cut"); |
506 | if (rect != null) { | 508 | if (rect != null) { |
507 | ImageBean.Cut cut = new ImageBean.Cut(); | 509 | ImageBean.Cut cut = new ImageBean.Cut(); |
508 | cut.setRect1(rect); | 510 | cut.setRect1(rect); |
509 | cut.setSelect(false); | 511 | cut.setSelect(false); |
510 | list.get(position).getCuts().remove(i); | 512 | list.get(position).getCuts().remove(i); |
511 | list.get(position).getCuts().add(i, cut); | 513 | list.get(position).getCuts().add(i, cut); |
512 | imageAdapter.notifyItemChanged(position); | 514 | imageAdapter.notifyItemChanged(position); |
513 | refreshNum(); | 515 | refreshNum(); |
514 | } else { | 516 | } else { |
515 | list.get(position).getCuts().remove(i); | 517 | list.get(position).getCuts().remove(i); |
516 | imageAdapter.notifyItemChanged(position); | 518 | imageAdapter.notifyItemChanged(position); |
517 | refreshNum(); | 519 | refreshNum(); |
518 | } | 520 | } |
519 | } | 521 | } |
520 | } else if (requestCode == 1002 && resultCode == RESULT_OK && !TextUtils.isEmpty(filePath)) { | 522 | } else if (requestCode == 1002 && resultCode == RESULT_OK && !TextUtils.isEmpty(filePath)) { |
521 | Bitmap b = BitmapUtils.compress(BitmapFactory.decodeFile(filePath)); | 523 | Bitmap b = BitmapUtils.compress(BitmapFactory.decodeFile(filePath)); |
522 | String path = context.getExternalFilesDir("images").getPath() + "/" + String.valueOf(System.currentTimeMillis()) + CommonUtil.getStr() + ".jpg"; | 524 | String path = context.getExternalFilesDir("images").getPath() + "/" + String.valueOf(System.currentTimeMillis()) + CommonUtil.getStr() + ".jpg"; |
523 | CommonUtil.saveBitmapToUri(b, path); | 525 | CommonUtil.saveBitmapToUri(b, path); |
524 | int position = binding.viewPager.getCurrentItem(); | 526 | int position = binding.viewPager.getCurrentItem(); |
525 | list.remove(position); | 527 | list.remove(position); |
526 | ImageBean imageBean = new ImageBean(); | 528 | ImageBean imageBean = new ImageBean(); |
527 | imageBean.setPath(path); | 529 | imageBean.setPath(path); |
528 | imageBean.source = path; | 530 | imageBean.source = path; |
529 | list.add(position, imageBean); | 531 | list.add(position, imageBean); |
530 | imageAdapter.notifyItemChanged(position); | 532 | imageAdapter.notifyItemChanged(position); |
531 | clearText(); | 533 | clearText(); |
532 | refreshNum(); | 534 | refreshNum(); |
533 | } | 535 | } |
534 | } | 536 | } |
535 | 537 | ||
536 | private void back() { | 538 | private void back() { |
537 | showTipDialog("温馨提示", "是否确认退出?", "取消", "确定", new TipDialog.TipDialogInterface() { | 539 | showTipDialog("温馨提示", "是否确认退出?", "取消", "确定", new TipDialog.TipDialogInterface() { |
538 | @Override | 540 | @Override |
539 | public void onConfirm(Dialog dialog) { | 541 | public void onConfirm(Dialog dialog) { |
540 | dialog.dismiss(); | 542 | dialog.dismiss(); |
541 | finish(); | 543 | finish(); |
542 | } | 544 | } |
543 | 545 | ||
544 | @Override | 546 | @Override |
545 | public void onCancel(Dialog dialog) { | 547 | public void onCancel(Dialog dialog) { |
546 | dialog.dismiss(); | 548 | dialog.dismiss(); |
547 | } | 549 | } |
548 | }); | 550 | }); |
549 | } | 551 | } |
550 | 552 | ||
551 | @Override | 553 | @Override |
552 | public boolean onKeyDown(int keyCode, KeyEvent event) { | 554 | public boolean onKeyDown(int keyCode, KeyEvent event) { |
553 | if (keyCode == KeyEvent.KEYCODE_BACK) { | 555 | if (keyCode == KeyEvent.KEYCODE_BACK) { |
554 | back(); | 556 | back(); |
555 | return true; | 557 | return true; |
556 | } | 558 | } |
557 | return super.onKeyDown(keyCode, event); | 559 | return super.onKeyDown(keyCode, event); |
558 | } | 560 | } |
559 | } | 561 | } |
560 | 562 |