HorizontalScrollView with snapping effect - android

Is it possible to make HorizontalScrollView with snapping effects for each view inside it?
(Not gallery)

Nowdays you should use ViewPager or RecyclerView.
Old answer:
I used this one - http://www.dev-smart.com/archives/34
Very fast and compatible with lazy loading.

You try to use ViewPager instead

Have a look at below posts for sample codes. Still, most use ViewPager for the effect.
http://androidprogrammingmadeeasy.blogspot.jp/2011/08/creating-custom-horizontal-scroll-view.html
http://www.velir.com/blog/index.php/2010/11/17/android-snapping-horizontal-scroll/

Related

How to create a carousel in an android screen to show different elements?

In an android activity, I would like to have a view that can display different elements, sliding the screen like a carousel.
My question is what is the appropriate view for this work.
Horizontal ScrollView(http://developer.android.com/intl/es/reference/android/widget/HorizontalScrollView.html) is probably the simplest to implement, but I would suggest you to use a ViewPager (http://developer.android.com/intl/es/reference/android/support/v4/view/ViewPager.html)
Try ViewPager. This is the documentation http://developer.android.com/training/animation/screen-slide.html

Android: how to slide between activites?

I want to scroll between views. Actually, I don't know what to use: HorizontalScrollView or Activities?
I want to slide between my layouts:
Am I need to implement GestureListener?
The problem with HorizontalScrollView is that I can't have more than 1 child.
Sounds like you're looking for a ViewPager, here's a description of them and a video of how it works - http://developer.android.com/training/animation/screen-slide.html
You'll have to use Fragments rather than Activities and if you want to do them on older versions of Android you'll need to use the support library.
you are looking for ViewPager, also have a look at this library

Horizontal Carousel or ScrollView with text over image

I'm trying to figure out the best approach to design a horizontal scrollview from android >= 2.1 with some text over the image that when scroll if end is reached it starts showing the first items again hence carousel behavior.
You can continue scrolling horizontally, forever, and the first item shows up again when the end is reached, for example when scrolling swiping to the left. It can be a view pager with an adapter, a carousel but not horizontal scrollview as it does not support some android device.
Any suggestions would be greatly appreciated.
Why not use a ViewPager? As it is available in the Support Library. I would insist to use ViewPager instead of HorizontalScrollView or Gallery. You can check an example for ViewPager from my github.
UPDATE
To show multiple views inside a Fragment you can use getPageWidth(). Check here for reference.
For future people looking for this, here's an excellent library that fit my needs for a similar problem!
https://github.com/sparrow007/CarouselRecyclerview

Vertical swipe in ViewPager

I use ViewPager with PagerAdapter. Is it possible to implement vertical swipe in Android, where you can scroll between views from top to down and from down to top? I need identical behavior that ViewPager does by default, but in vertical way. I found method canScrollVertically() but it's not what I am looking for I suppose. Thanks in advance
Natively, no.
However, Jake Wharton has a directional ViewPager that does this.
https://github.com/JakeWharton/Android-DirectionalViewPager/
The only problem is he doesn't support it anymore, but it will get you started. It might even be enough for what you want.

Cannot perform proper view paging in Android GalleryView

I'm trying to use Android GalleryView to implement a view that can scroll horizontally as well as vertically, similar to the Google Music application. However, if I place a ListView inside a GalleryView, the ListView seems to steal all touch events and I'm unable to scroll horizontally on a GalleryView. What am I doing wrong? Is this the best approach? Does anyone have any other suggestions? Thanks!
Do not use a GalleryView for paging views. Furthermore, having a ListView inside a GalleryView is never recommended.
Instead use the ViewPager that's available as part of the Android Compatibility Package. I think that's more relevant to what you're trying to achieve. Here's a detailed article on ViewPager:
http://android-developers.blogspot.com/2011/08/horizontal-view-swiping-with-viewpager.html

Categories

Resources