开发者

using viewpager, gallery or viewanimator

I'm trying to fling a view object (e.g an image) from left to right. First I used Gallery with a custom adapter. Then I tried ViewPager. I couldn't decide which one has a better performance. I guess ViewPager is better. By the way, I read about viewanimator, but could not understand whether it can be used for same purpose. Does it also provide some animation during fling?

Which one do you suggest?

Also i'm looking for "something" that shows the index of the flinging object with dots below. Clickin开发者_如何学Cg the dot, shows the relevant object. Are there any ready widget for this purpose?

Thanks a lot,


Try using HorizontalPager for that, it uses a GroupView and implements all the things you need. It also has an example of the dot thing you want.

Here's the link: https://github.com/ysamlan/horizontalpager


Here's a tutorial for a gallery integration below a ViewPager i wrote: http://responsiveandroid.com/2012/01/26/android-viewpager-and-gallery-integration.html . clicking on gallery items will page the ViewPager to the corresponding image. You can use the ViewPager indicator https://github.com/JakeWharton/Android-ViewPagerIndicator that has small circles to indicate which view you are on.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜