Inefficient API is used
Dear developers,
I found an inefficient API, setImageURI(), is used in OpenNoteScanner.
For setImageURI(), Google says this: https://developer.android.com/reference/android/widget/ImageView.html#setImageURI(android.net.Uri) " This does Bitmap reading and decoding on the UI thread, which can cause a latency hiccup. If that's a concern, consider using setImageDrawable(android.graphics.drawable.Drawable) or setImageBitmap(android.graphics.Bitmap) and BitmapFactory instead. "
I noticed that in the following code, setImageURI() is used: com.todobom.opennotescanner.views.TouchImageView.java (line number: 181) https://github.com/ctodobom/OpenNoteScanner/blob/master/app/src/main/java/com/todobom/opennotescanner/views/TouchImageView.java
Do you think the use of setImageURI() will affect OpenNoteScanner's performance? If so, maybe we should move Bitmap reading and decoding to a background thread.
Thanks.
Thank you for your report @struggggle !
This class was got from https://github.com/MikeOrtiz/TouchImageView , you can open a ticket there if there isn't any already!
@ctodobom I have checked the class there, and these APIs are still used in it (the class was written 3 years ago). https://github.com/MikeOrtiz/TouchImageView/blob/master/src/com/ortiz/touch/TouchImageView.java#L175
Can you submit a Pull Request or a patch for it? If you do and it pass on my tests, I will merge it!