9

Is there something for the Android OS with which you can implement scroll pagination?

*Edit
With scroll pagination I mean pagination like on the homescreen, you can swipe right and left and go to the next or previous page.

Thizzer
  • 16,153
  • 28
  • 98
  • 139
  • Please clarify what do you mean "scroll pagination"? What should it look like? I would be happy to help if you make the question more specific. – Fedor Jan 05 '10 at 07:46

2 Answers2

9

You can take example on the source code of Launcher at android.git.kernel.org. Look for the classes called Workspace and CellLayout.

Romain Guy
  • 97,993
  • 18
  • 219
  • 200
  • I agree this functionality can be found in Launcher application. And it can be extracted from there. – Fedor Jan 05 '10 at 11:24
  • Can you give me the direct link to the Launcher source? – Thizzer Jan 05 '10 at 11:36
  • @MrThyhs: http://android.git.kernel.org/?p=platform/packages/apps/Launcher.git;a=blob_plain;f=src/com/android/launcher/Workspace.java;hb=HEAD, http://android.git.kernel.org/?p=platform/packages/apps/Launcher.git;a=blob_plain;f=src/com/android/launcher/CellLayout.java;hb=HEAD – Jay Wick Apr 21 '10 at 12:35
  • @jay: the links are not working, can you provide some other link – Android Sep 30 '11 at 04:14
  • @Android: looks like the server's been down. Clicking Browse Source does nothing via http://source.android.com/source/overview.html – Jay Wick Oct 04 '11 at 23:39
  • I came here and found all links dead, since google mirrors all their repo on github i decided to post the github links cause they are more readable - https://github.com/android/platform_packages_apps_launcher/tree/master/src/com/android/launcher – Shereef Marzouk Oct 19 '11 at 10:33
4

According to Apple, UIPageControl does not implement "scroll pagination", at least how I would interpret that phrase. UIPageControl tracks a number of pages, shows dots based on the page count/current page, and fires events when the user taps it. It does not actually implement "pagination" (you have to handle that yourself) and has nothing to do with scrolling.

All that being said, there is no "show a bunch of dots" widget built into Android with the same or similar API to UIPageControl. Creating one for your application would be fairly simple, using a set of ImageViews, watching for taps, replacing image resources to change dot colors, and firing events to registered listeners.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491