EcoGallery icon indicating copy to clipboard operation
EcoGallery copied to clipboard

Items Sometimes Snap To Center while Scrolling

Open jschleppy opened this issue 12 years ago • 5 comments

I have the EcoGallery working with my adapter and 20 items of data with my custom view (which is a large view, mainly an ImageView). They show and scroll great for most of the list. However, near the center of the list, specifically 9 thru 11 (out of my 20), the items will continuously snap the selected item back to the center. You can literally touch, and drag continuously left or right, and it will continue to snap back every 0.25-0.5 second or so, without picking up your finger. The only way to make it past these items is to fling generously to quickly bypass the item.

Does anyone have ideas on why this could be happening and potentially any solutions to provide consistent scrolling across the entire list?

jschleppy avatar Sep 18 '13 22:09 jschleppy

I'm using EcoGallery in my app (Motion) and actually I recently saw an issue when I set text view from EcoGallery onItemSelected, the gallery will snap to the center (if I comment the code it works fine). Do you do any work onItemSelected? I want to know if you are seeing the same behavior so I could try to fix it.

falnatsheh avatar Sep 25 '13 17:09 falnatsheh

I can verify that the issue occurs (or occured as of several months ago) with onItemSelected

BenjaminOrenstein avatar Mar 06 '14 21:03 BenjaminOrenstein

Take a look at my fork: https://github.com/Gryzor/TimelineGallerySample

Some devices (notably API level 16 and 17) issue a requestLayout when any of the views are changed (so when the library does a SnapToCenter a relayout is issued, this causes the gallery to jump and snap immediately).

Make sure you're using (look at the sample) a special ImageView for your gallery items that don't do anything on requestLayout.

Gryzor avatar Mar 07 '14 22:03 Gryzor

@Gryzor Makes sense, are you still maintaining your fork? I'm evaluating if I should continue support the library since I'm changing my app design and will no longer need Gallery view and it would be helpful to point developers to maintainable fork.

falnatsheh avatar Aug 11 '14 18:08 falnatsheh

@falnatsheh Nah, I just want the gallery to disappear from the face of the planet ;) I have used it for a while until I managed to make the ViewPager work the way I wanted. (Took me a while tho').

I don't mind looking at Pull Requests and maintaining it, but I can't make any "implement me this feature" promises. I just made the gallery "work" but there's no way to fix that hacky thing without a complete rewrite (which nobody seems interested in doing given that the 'alternatives' seem to be 'good enough').

Gryzor avatar Aug 12 '14 18:08 Gryzor