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 stands with Ukraine
  • 25,310
  • 18
  • 114
  • 149
salad buah
  • 11
  • 2

3 Answers3

0

Try this :

recyclerview.setFocusable(false);

Faisal Russel
  • 212
  • 3
  • 5
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
  • 252
  • 1
  • 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
  • 690
  • 1
  • 7
  • 19