ChatKit icon indicating copy to clipboard operation
ChatKit copied to clipboard

Avatars sometimes have a black background

Open Rudloff opened this issue 7 years ago • 7 comments

Hello,

I am not sure if this a bug with ChatKit or with Picasso. I am using ChatKit 0.3.1 and Picasso 2.71828.

Sometimes avatar have a black background instead of a transparent background: screenshot_20180926-235318

The images I am using are distant JPEG images.

(Here is the image used in the screenshot: https://lh4.googleusercontent.com/-JzeJQJnmGAI/AAAAAAAAAAI/AAAAAAAAElU/6f7jUL7Ga8Y/photo.jpg)

My code for loading the images is very simple: https://github.com/Rudloff/hangupsdroid/blob/0a82adf591252be71f5c00c8a0cefb7fca310da3/app/src/main/java/pro/rudloff/hangupsdroid/AvatarLoader.java#L9

Rudloff avatar Sep 26 '18 22:09 Rudloff

Same error.

I tried with ChatKit 0.3.0 and works fine with picasso 2.71828

oriolikart avatar Oct 01 '18 11:10 oriolikart

I confirm that it works correctly with chatkit 0.3.0.

Rudloff avatar Oct 01 '18 11:10 Rudloff

Hi! On some devices we have this problem. It's because of we are using canvas clipping in ShapeImageView. You can make quick fix by setting android:layerType="software". But if you using CardView you will have some artifacts with shadows.

bevzaanton avatar Oct 02 '18 08:10 bevzaanton

I tried using android:layerType="software" and it seems to work correctly, thanks! (But I suppose if will affect performances.)

Rudloff avatar Oct 02 '18 08:10 Rudloff

Same here on Samsung Galaxy S8. Unfortunately using android:layerType="software" is horrible for performance.

liamcottle avatar Nov 01 '18 10:11 liamcottle

Having here a similar problem using Chatkit 0.3.3 and Picasso 2.71828, but instead of the black background, my images show as squares instead of rounded (so no ugly black background) Also distant images, sometimes i can see both types in the same conversation Tested on Android 7 / Xperia Z5 Compact Screenshot_20191113-184703 Software layering fixes it, and it seems to work well on a more recent device (Xperia XZ1 Compact / Android 9) Is there any plan to fix that ?

herbeupat avatar Nov 13 '19 17:11 herbeupat

I have the same problem on Android 5.0, Android 6.0, Android 8.0 on these platforms I get a square icon where the corners under the rounding are black, I use androidx with legacy-support-v4: 1.0.0. Is this a bug? How can I solve? I have already tried with android:layerType="software" but it doesn't work. Thanks in advance!

AntonioVitiello avatar Sep 14 '20 14:09 AntonioVitiello