I have to make an application in which the user moves around a screen, which is like our android home screen.
There is a list of images that come, and we can scroll through the images in a horizontal scroll er.
The user cannot change the location of images, it's just like a few thumbnails arranged over a horizontal screen
This is like the paging control in iPhone app development.
I have tried to find ways to do this, but I am fairly new to android and I wanted to know the best way to achieve the above?
I have heard of the gallery control, but I am not sure if it will suit my purposes.
Also if you can give links to the answers you suggest.. it would be great as if there is a new controller involved , I will be able to understand it better as I am still a fresher. Thank you in advance.
Edit: For those who are unfamiliar with the iPhone paging view,here is a video example.
Set the overflow-y: hidden; and overflow-x: auto; that will automatically hide the vertical scroll bar and present only the horizontal scrollbar. The white-space: nowrap; property is used to wrap text in a single line. Here the scroll div will be horizontally scrollable.
HorizontalScrollView is used to scroll the child elements or views in a horizontal direction. HorizontalScrollView only supports horizontal scrolling. For vertical scroll, android uses ScrollView. Let's implement simple example of HorizontalScrollView.
In my search to implement this, I found many implementation like below
Well, you could look at the source code for the android homescreen, since it's open source. Maybe you can get some ideas from there.
The GreenDroid library (a collection of useful Android components) recently added a PagedView class that does exactly what you're looking for. It also includes a PageIndicator that works like the iOS dots.
It uses a Adapter system, similar to ListView (with efficient View re-use, etc), which I haven't seen in any of the other implementations of this pattern.
Source code: https://github.com/cyrilmottier/GreenDroid
Demo application: https://market.android.com/details?id=com.cyrilmottier.android.gdcatalog
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With