public class

HorizontalListView

extends AbsListView
java.lang.Object
   ↳ com.neomades.ui.View
     ↳ com.neomades.ui.AbsListView
       ↳ com.neomades.ui.HorizontalListView

Class Overview

A HorizontalListView is a horizontal list of views, where only one view can be clicked at the same time.

The behavior is the same as ListView. The only difference is the orientation. See ListView for further details.

Summary

[Expand]
Inherited XML Attributes
From class com.neomades.ui.AbsListView
From class com.neomades.ui.View
[Expand]
Inherited Constants
From interface com.neomades.ui.Alignment
From interface com.neomades.ui.StretchMode
Public Constructors
HorizontalListView()
Creates a new horizontal view.
Public Methods
void scrollToLeft()
Move the scrolled position to the first item of your HorizontalListView.
void scrollToPosition(int itemPosition)
Set the scrolled position of your HorizontalListView.
void setColumnWidth(int width)
Sets the column width in DP unit for every column.
void setColumnWidthAdapter(ColumnWidthAdapter columnWidthAdapter)
Sets an adapter for the column width.
void setPagerEnabled(boolean enabled)
Enables or disables the pager mode.
[Expand]
Inherited Methods
From class com.neomades.ui.AbsListView
From class com.neomades.ui.View
From class java.lang.Object

Public Constructors

public HorizontalListView ()

Creates a new horizontal view.

Public Methods

public void scrollToLeft ()

Move the scrolled position to the first item of your HorizontalListView.

public void scrollToPosition (int itemPosition)

Set the scrolled position of your HorizontalListView.

If the position is higher than the item count, the HorizontalListView is scrolled to the last item.
If the position is less than 0, the HorizontalListView is scrolled to the first item.

Parameters
itemPosition the item position to scroll to

public void setColumnWidth (int width)

Sets the column width in DP unit for every column.

Use this method to apply the same width to all columns.

Parameters
width the column width in DP

public void setColumnWidthAdapter (ColumnWidthAdapter columnWidthAdapter)

Sets an adapter for the column width.

The adapter gives a width for each column (could be different).

Parameters
columnWidthAdapter an adapter or null

public void setPagerEnabled (boolean enabled)

Enables or disables the pager mode. If set to true, when going left or right the content stops on multiples of the list width instead of scrolling evenly. Disabled by default.

The content width should be a multiple of HorizontalListView width to have better results.

Parameters
enabled true to enable