1

I found an error (more likely bug) when load image with glide on Recyclerview. The problem is that when I load image from URL into an imageview on recyclerview item, imageview seem to have focus on it. Here is how it looks like : imageview gained focus after load image with glide

This causes recyclerview scrolls by itself (I cant post a video). Is there any idea how to solve this? Thank you and sorry for my English.

Zoe
  • 27,060
  • 21
  • 118
  • 148
salad buah
  • 21
  • 3

3 Answers3

0

Try this :

recyclerview.setFocusable(false);

Faisal Russel
  • 220
  • 3
  • 6
0

try setting the isFocusable to false forcefully while loading the image using Glide. it's just a try maybe it works for you.

Kuldeep Rathee
  • 282
  • 2
  • 7
-1

That is because RecyclerView ALWAYS set:

setFocusableInTouchMode(true);

so if you apply those attribute in your XML for a RecyclerView

android:focusable="false"
android:focudeableInTouchMode="false"

yo can also use descendantFocusability here is link for better understanding of Can someone explain descendantFocusability = afterDescendants?

and also add android:focusable="true" android:focusableInTouchMode="true" to your recyclerView and try again

Jaspalsinh Gohil
  • 941
  • 1
  • 9
  • 20