public class

Gallery

extends View
java.lang.Object
   ↳ com.neomades.ui.View
     ↳ com.neomades.ui.Gallery

Class Overview

A view that shows items in a center-locked, horizontally scrolling list.

See Also

Summary

[Expand]
Inherited XML Attributes
From class com.neomades.ui.View
[Expand]
Inherited Constants
From interface com.neomades.ui.Alignment
From interface com.neomades.ui.StretchMode
Public Constructors
Gallery()
Creates a new view gallery.
Public Methods
void notifyDataChanged()
Notifies the gallery that data has changed and the gallery should update the UI.
void setAdapter(ListAdapter adapter)
Set a ListAdapter that will supply views for this pager as needed.
void setCurrentPage(int number)
Changes the current selected page.
void setPageAnimationDuration(int animDuration)
Sets how long the transition animation should run when a child view changes position.
void setPageHeight(int pageHeight)
Sets the height of the views inside the gallery (in dp unit).
void setPageSpacing(int pageSpacing)
Sets the spacing between items in a Gallery.
void setPageWidth(int pageWidth)
Sets the width of the views inside the gallery (in dp unit).
[Expand]
Inherited Methods
From class com.neomades.ui.View
From class java.lang.Object

Public Constructors

public Gallery ()

Creates a new view gallery.

Public Methods

public void notifyDataChanged ()

Notifies the gallery that data has changed and the gallery should update the UI.

public void setAdapter (ListAdapter adapter)

Set a ListAdapter that will supply views for this pager as needed.

Parameters
adapter Adapter to use
See Also

public void setCurrentPage (int number)

Changes the current selected page. If the index of the page is outside the gallery bounds, nothing is done.

The first page is the page 0.

Parameters
number Page index
Throws
CrossThreadException if the method is called from outside the UI-Thread

public void setPageAnimationDuration (int animDuration)

Sets how long the transition animation should run when a child view changes position.

Parameters
animDuration Duration of the animation in millisecond

public void setPageHeight (int pageHeight)

Sets the height of the views inside the gallery (in dp unit).

Parameters
pageHeight Height of the view inside the gallery in dp

public void setPageSpacing (int pageSpacing)

Sets the spacing between items in a Gallery.

Parameters
pageSpacing The spacing in dp between items in the Gallery

public void setPageWidth (int pageWidth)

Sets the width of the views inside the gallery (in dp unit).

If the width of the page is smaller than the width of the gallery, views at the left and at the right of the current page will be visible too with a transparency effect.

Parameters
pageWidth Width of the view inside the gallery in dp