Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

which would be the best to do make a horizontal scrolling app in android?

Tags:

android

scroll

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.

like image 931
user590849 Avatar asked May 25 '11 20:05

user590849


People also ask

How do I make my horizontal scroll?

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.

What is horizontal scroll view in Android?

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.


3 Answers

In my search to implement this, I found many implementation like below

  1. http://www.codeshogun.com/blog/2009/04/16/how-to-implement-swipe-action-in-android/
  2. https://github.com/ysamlan/horizontalpager
  3. http://code.google.com/p/deezapps-widgets/
like image 113
ingsaurabh Avatar answered Oct 21 '22 04:10

ingsaurabh


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.

like image 25
dmon Avatar answered Oct 21 '22 05:10

dmon


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

like image 28
Christopher Souvey Avatar answered Oct 21 '22 04:10

Christopher Souvey