Skip to content
This repository has been archived by the owner on Aug 25, 2020. It is now read-only.

I can't scroll EcoGallery with Views which are clickable like Buttons ... #10

Open
Kcorab opened this issue Aug 10, 2014 · 5 comments
Open

Comments

@Kcorab
Copy link

Kcorab commented Aug 10, 2014

Hello,
I want to use the EcoGallery like a horizontal ListView with locking centre. My BaseAdapter holds a lot of Buttons which are match_parent in height and width. An OnClickListener is set for any Button.
Now the problem is that the EcoGallery is not scrollable.

For the old Gallery a similar problem existed but was solved very well. Please see:
http://stackoverflow.com/questions/8127828/scrolling-a-gallery-with-buttons

Can you extend the EcoGallery for one setter-methode which makes the EcoGallery scrollable in this case?

@Gryzor
Copy link

Gryzor commented Aug 10, 2014

Unless you have a very good reason to use a gallery, I suggest you use a ViewPager.

@Kcorab
Copy link
Author

Kcorab commented Aug 11, 2014

I have thought about it more than one time.
If you have got a very good reason for using some "special" class then use this class and no "bad" alternative. ;-)

In my opinion ViewPager is a peculiar construct. It doesn't use View recycling and I am only able to scroll slowly.
But this is only the estimation from a newcomer.

I love (Eco)Galley so much.

@Gryzor
Copy link

Gryzor commented Aug 11, 2014

I have hacked around the Gallery long enough to know how bad the code is (and I can imagine why Google engineers saw the code and said, well we gotta deprecate this hack). ;)

In any case, if you still want to use it, I suggest you use my (little bit enhanced) version: https://github.com/Gryzor/TimelineGallerySample

Please note that I do not use it anymore.

There are multiple ViewPager forks (the source is open) that scroll faster and provide other sorts of niceties. In my experience, it doesn't feel like the old gallery, ever, but it's generally more stable, faster and less problematic in the long run. (In the short term it's more annoying because you have to deal with the ViewPager "Peculiarities". ;)

You can achieve most (if not all) of the old gallery features (center, scroll, fling, etc.) with a ViewPager.

Unless you really really need the Gallery, I recommend you learn and try ViewPagers. They seem to be here to stay anyway.

Good luck!

@falnatsheh
Copy link
Owner

@Gryzor Agree, they deprecate it for a good reason.
@Kcorab Not familiar with @Gryzor version of Gallery but I recommend looking at it, hopefully it fixes your issue. If not, you could extend the EcoGallery and do the same thing that was mentioned in the SoF answer since EcoGallery extend Gallery view, feel free to send a pull request if you got it working :).

@Kcorab
Copy link
Author

Kcorab commented Aug 13, 2014

Thanks for your answers.
What I was searching for is an equivalent of Gallery. A horizontal ListView with centre locking maybe ...
A fork of ViewPager which supports multiple pages, fling and ViewRecycling I didn't find.

@falnatsheh
As I said I am a android- and java newcomer. I am not able to extend your class because of my deficient skills. :-(

I will keep searching. :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants