java.lang.Object | ||
↳ | com.neomades.ui.View | |
↳ | com.neomades.ui.AbsListView |
![]() |
Base class that can be used to implement virtualized lists of items.
XML Attributes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Attribute Name | Related Method | Description | |||||||||
selectionColorEnabled | setSelectionColorEnabled(boolean) | ||||||||||
separatorColor | setSeparatorColor(Color) | #AARRGGBB or a color | |||||||||
separatorVisible | setSeparatorVisible(boolean) |
[Expand]
Inherited XML Attributes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
addView(View view, int atIndex)
Inserts a view at a specified position.
| ||||||||||
void |
addView(View view)
Add a new item view to the list.
| ||||||||||
int |
getViewsCount()
Returns the number of views inside this container.
| ||||||||||
void |
notifyDataChanged()
Notifies the list that data has changed and the list should update the UI.
| ||||||||||
void |
removeAllViews()
Remove all views from this container.
| ||||||||||
void |
removeIndex(int index)
Remove a view at the specified
index . | ||||||||||
void |
removeView(View view)
Remove a view from this list.
| ||||||||||
void |
setFadingEdgeColor(Color color)
Sets the fading edge color.
| ||||||||||
void |
setFadingEdgeEnabled(boolean enabled)
Sets if the vertical/horizontal edges should be faded when this view is
scrolled vertically/horizontally.
| ||||||||||
void |
setFadingEdgeLength(int length)
Sets the fading edge length
| ||||||||||
void |
setFastScrollEnabled(boolean enabled)
Specifies whether fast scrolling is enabled or disabled.
| ||||||||||
void |
setHorizontalScrollBarEnabled(boolean scrollBarEnabled)
Displays or hides the horizontal scroll bar.
| ||||||||||
void |
setIndexerEnabled(boolean indexerEnabled)
Enables or not the alphabetic indexer.
| ||||||||||
void |
setIndexes(String[] indexes)
Sets a specific list of indexes to show on the right of the list.
| ||||||||||
void |
setItemClickedListener(ItemClickedListener listener)
Set the item clicked listener.
| ||||||||||
void |
setItemTypeAdapter(ItemTypeAdapter itemTypeAdapter)
Sets the adapter that provides the data type to differentiate the data item
views in this widget.
| ||||||||||
void |
setListAdapter(ListAdapter adapter)
Sets the adapter that provides the views to represent the data in this list.
| ||||||||||
void |
setListIndexer(ListIndexer indexer)
Sets the alphabetical indexer at the right of the list.
| ||||||||||
void |
setListScrollListener(ListScrollListener listener)
Associates a
ListSrollListener with this ListView. | ||||||||||
void |
setRowHeight(int height)
Sets the row height in DP unit for every row.
| ||||||||||
void |
setSectionsVisible(boolean visible)
Enables or not section items in the list.
| ||||||||||
void |
setSelectionColor(Color selectionColor)
Changes the default color that is applied when a user select an item.
| ||||||||||
void |
setSelectionColorEnabled(boolean selectionEnabled)
Enables or disables the fact that the colors of an item changes when an user
selects it.
| ||||||||||
void |
setSeparatorColor(Color separatorColor)
Changes the color of the separators between each items of the list.
| ||||||||||
void |
setSeparatorHeight(int height)
Sets the size of the separator between two items of the list.
| ||||||||||
void |
setSeparatorVisible(boolean visible)
Displays or hide the separator (usually a line) between between each items in
the list.
| ||||||||||
void |
setVerticalScrollBarEnabled(boolean scrollBarEnabled)
Displays or hides the vertical scroll bar.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Inserts a view at a specified position.
view | the view to insert |
---|---|
atIndex | the position index |
CrossThreadException | if the method is called from outside the UI-Thread |
---|
Add a new item view to the list.
Do not use this method and setListAdapter(ListAdapter)
at the same
time.
view | child to add |
---|
CrossThreadException | if the method is called from outside the UI-Thread |
---|---|
IllegalStateException | if the view child has already a parent |
Returns the number of views inside this container.
Notifies the list that data has changed and the list should update the UI.
The scroll position will not change but visible items will be refreshed.
Remove all views from this container.
CrossThreadException | if the method is called from outside the UI-Thread |
---|
Remove a view at the specified index
.
index | the index of the view to remove |
---|
CrossThreadException | if the method is called from outside the UI-Thread |
---|
Remove a view from this list.
if the view is not a child of this ListView
, an
IllegalStateException
is thrown.
view | the view to remove |
---|
CrossThreadException | if the method is called from outside the UI-Thread |
---|---|
IllegalStateException | if the view is not a child of this list |
NullPointerException | if the view is null |
Sets the fading edge color.
color | color to use |
---|
NullPointerException | if color is null |
---|
Sets if the vertical/horizontal edges should be faded when this view is scrolled vertically/horizontally.
enabled | true if the vertical/horizontal edges should be faded when the view is scrolled vertically/horizontally |
---|
Sets the fading edge length
length | length in DP units, if 0 or negative, the default length will be set |
---|
Specifies whether fast scrolling is enabled or disabled.
When fast scrolling is enabled, the user can quickly scroll through lists by dragging the fast scroll thumb.
This method has effects only on Android.
enabled | true to enable fast scrolling, false otherwise |
---|
Displays or hides the horizontal scroll bar. Visible by default.
scrollBarEnabled | false to hide the scroll bar |
---|
Enables or not the alphabetic indexer.
indexerEnabled | true to diplay the indexer |
---|
Sets a specific list of indexes to show on the right of the list.
By default, indexes are letters from the alphabet (#ABC....XYZ where # means 0-9).
indexes | the indexes to show |
---|
Set the item clicked listener.
listener | the callback that listen what item has been clicked |
---|
Sets the adapter that provides the data type to differentiate the data item views in this widget.
Note: Using ListAdapters
is
mandatory to use this adapter.
itemTypeAdapter | The adapter to use to differentiate item view types. |
---|
Sets the adapter that provides the views to represent the data in this list.
The scroll position will be reset at the start of the list.
Do not use this method and addView(View)
at the same time.
adapter | The adapter to use to create this view's content. |
---|
Sets the alphabetical indexer at the right of the list.
indexer | an alphabetic indexer or null |
---|
Associates a ListSrollListener
with this ListView. The
ListSrollListener
will allow to follow the first item visible
and the number of visible items of the ListView while the user is scrolling.
listener | a ListSrollListener |
---|
Sets the row height in DP unit for every row.
Use this method to apply the same height to all rows.
This method could not be used if a RowHeightAdapter
is set. See
setRowHeightAdapter(RowHeightAdapter)
height | the row height in DP |
---|
Enables or not section items in the list.
This method does nothing on Android
.
visible | true to show sections |
---|
Changes the default color that is applied when a user select an item.
selectionColor | the new color to apply |
---|
Enables or disables the fact that the colors of an item changes when an user selects it.
selectionEnabled | true to enable the color change, false otherwise |
---|
Changes the color of the separators between each items of the list. If the
separators were hidden (see setSeparatorVisible(boolean)
,
they will become visible.
separatorColor | the color of the separator |
---|
NullPointerException | if the separatorColor argument is null |
---|
Sets the size of the separator between two items of the list.
This method does nothing in iOS
.
For the moment you can change its color with
setSeparatorColor(Color)
or hide it with
setSeparatorVisible(boolean)
height | the size of the separators |
---|
Displays or hide the separator (usually a line) between between each items in the list.
To follow the native platform behaviors:
visible | true to display the separators, false otherwise |
---|
Displays or hides the vertical scroll bar. Visible by default.
scrollBarEnabled | false to hide the scroll bar |
---|