kontalk / androidclient

Kontalk official Android client
https://www.kontalk.org
GNU General Public License v3.0
572 stars 195 forks source link

Inefficient API is used #1297

Closed cataloque closed 4 years ago

cataloque commented 4 years ago

Dear developers, I found an inefficient API, setImageURI(), is used in kontalk. For setImageURI(), Google says this: " 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: de.hdodenhof.circleimageview.CircleImageView: void setImageURI(),

Do you think the use of setImageURI() will affect performance? If yes, maybe we should move Bitmap reading and decoding to a background thread. Thanks.

daniele-athome commented 4 years ago

Hello and thanks for reporting. The method you mentioned belongs to a third-party library we use, and Kontalk doesn't use it anyway, we set the image by means of an already allocated drawable or bitmap.