/**@class android.widget.ListView
@extends android.widget.AbsListView
<p>Displays a vertically-scrollable collection of views, where each view is positioned
immediatelybelow the previous view in the list. For a more modern, flexible, and performant
approach to displaying lists, use {@link android.support.v7.widget.RecyclerView}.</p>
<p>To display a list, you can include a list view in your layout XML file:</p>
<pre><ListView
android:id="@+id/list_view"
android:layout_width="match_parent"
android:layout_height="match_parent" /></pre>
<p>A list view is an <a href="{@docRoot}guide/topics/ui/declaring-layout.html#AdapterViews">
adapter view</a> that does not know the details, such as type and contents, of the views it
contains. Instead list view requests views on demand from a {@link android.widget.ListAdapter} as needed,
such as to display new views as the user scrolls up or down.</p>
<p>In order to display items in the list, call {@link #setAdapter}(ListAdapter adapter)
to associate an adapter with the list. For a simple example, see the discussion of filling an
adapter view with text in the
<a href="{@docRoot}guide/topics/ui/declaring-layout.html#FillingTheLayout">
Layouts</a> guide.</p>
<p>To display a more custom view for each item in your dataset, implement a ListAdapter.
For example, extend {@link android.widget.BaseAdapter} and create and configure the view for each data item in
{@code getView(...)}:</p>
<pre>private class MyAdapter extends BaseAdapter {
// override other abstract methods here
@Override
public View getView(int position, View convertView, ViewGroup container) {
if (convertView == null) {
convertView = getLayoutInflater().inflate(R.layout.list_item, container, false);
}
((TextView) convertView.findViewById(android.R.id.text1))
.setText(getItem(position));
return convertView;
}
}</pre>
<p class="note">ListView attempts to reuse view objects in order to improve performance and
avoid a lag in response to user scrolls. To take advantage of this feature, check if the
{@code convertView} provided to {@code getView(...)} is null before creating or inflating a new
view object. See
<a href="{@docRoot}training/improving-layouts/smooth-scrolling.html">
Making ListView Scrolling Smooth</a> for more ways to ensure a smooth user experience.</p>
<p>For a more complete example of creating a custom adapter, see the
<a href="{@docRoot}samples/CustomChoiceList/index.html">
Custom Choice List</a> sample app.</p>
<p>To specify an action when a user clicks or taps on a single list item, see
<a href="{@docRoot}guide/topics/ui/declaring-layout.html#HandlingUserSelections">
Handling click events</a>.</p>
<p>To learn how to populate a list view with a CursorAdapter, see the discussion of filling an
adapter view with text in the
<a href="{@docRoot}guide/topics/ui/declaring-layout.html#FillingTheLayout">
Layouts</a> guide.
See <a href="{@docRoot}guide/topics/ui/layout/listview.html">
Using a Loader</a>
to learn how to avoid blocking the main thread when using a cursor.</p>
<p class="note">Note, many examples use {@link android.app.ListActivity ListActivity}
or {@link android.app.ListFragment ListFragment}
to display a list view. Instead, favor the more flexible approach when writing your own app:
use a more generic Activity subclass or Fragment subclass and add a list view to the layout
or view hierarchy directly. This approach gives you more direct control of the
list view and adapter.</p>
@attr ref android.R.styleable#ListView_entries
@attr ref android.R.styleable#ListView_divider
@attr ref android.R.styleable#ListView_dividerHeight
@attr ref android.R.styleable#ListView_headerDividersEnabled
@attr ref android.R.styleable#ListView_footerDividersEnabled
*/
var ListView = {
/**
@return {Number} The maximum amount a list view will scroll in response to
an arrow event.
*/
getMaxScrollAmount : function( ) {},
/**Add a fixed view to appear at the top of the list. If this method is
called more than once, the views will appear in the order they were
added. Views added using this call can take focus if they want.
<p>
Note: When first introduced, this method could only be called before
setting the adapter with {@link #setAdapter}(ListAdapter). Starting with
{@link android.os.Build.VERSION_CODES#KITKAT}, this method may be
called at any time. If the ListView's adapter does not extend
{@link android.widget.HeaderViewListAdapter}, it will be wrapped with a supporting
instance of {@link android.widget.WrapperListAdapter}.
@param {Object {View}} v The view to add.
@param {Object {Object}} data Data to associate with this view
@param {Boolean} isSelectable whether the item is selectable
*/
addHeaderView : function( ) {},
/**Add a fixed view to appear at the top of the list. If addHeaderView is
called more than once, the views will appear in the order they were
added. Views added using this call can take focus if they want.
<p>
Note: When first introduced, this method could only be called before
setting the adapter with {@link #setAdapter}(ListAdapter). Starting with
{@link android.os.Build.VERSION_CODES#KITKAT}, this method may be
called at any time. If the ListView's adapter does not extend
{@link android.widget.HeaderViewListAdapter}, it will be wrapped with a supporting
instance of {@link android.widget.WrapperListAdapter}.
@param {Object {View}} v The view to add.
*/
addHeaderView : function( ) {},
/**
*/
getHeaderViewsCount : function( ) {},
/**Removes a previously-added header view.
@param {Object {View}} v The view to remove
@return {Boolean} true if the view was removed, false if the view was not a header
view
*/
removeHeaderView : function( ) {},
/**Add a fixed view to appear at the bottom of the list. If addFooterView is
called more than once, the views will appear in the order they were
added. Views added using this call can take focus if they want.
<p>
Note: When first introduced, this method could only be called before
setting the adapter with {@link #setAdapter}(ListAdapter). Starting with
{@link android.os.Build.VERSION_CODES#KITKAT}, this method may be
called at any time. If the ListView's adapter does not extend
{@link android.widget.HeaderViewListAdapter}, it will be wrapped with a supporting
instance of {@link android.widget.WrapperListAdapter}.
@param {Object {View}} v The view to add.
@param {Object {Object}} data Data to associate with this view
@param {Boolean} isSelectable true if the footer view can be selected
*/
addFooterView : function( ) {},
/**Add a fixed view to appear at the bottom of the list. If addFooterView is
called more than once, the views will appear in the order they were
added. Views added using this call can take focus if they want.
<p>
Note: When first introduced, this method could only be called before
setting the adapter with {@link #setAdapter}(ListAdapter). Starting with
{@link android.os.Build.VERSION_CODES#KITKAT}, this method may be
called at any time. If the ListView's adapter does not extend
{@link android.widget.HeaderViewListAdapter}, it will be wrapped with a supporting
instance of {@link android.widget.WrapperListAdapter}.
@param {Object {View}} v The view to add.
*/
addFooterView : function( ) {},
/**
*/
getFooterViewsCount : function( ) {},
/**Removes a previously-added footer view.
@param {Object {View}} v The view to remove
@return {Boolean} true if the view was removed, false if the view was not a footer view
*/
removeFooterView : function( ) {},
/**Returns the adapter currently in use in this ListView. The returned adapter
might not be the same adapter passed to {@link #setAdapter}(ListAdapter) but
might be a {@link android.widget.WrapperListAdapter}.
@return {Object {android.widget.ListAdapter}} The adapter currently used to display data in this ListView.
@see #setAdapter(ListAdapter)
*/
getAdapter : function( ) {},
/**Sets up this AbsListView to use a remote views adapter which connects to a RemoteViewsService
through the specified intent.
@param {Object {Intent}} intent the intent used to identify the RemoteViewsService for the adapter to connect to.
*/
setRemoteViewsAdapter : function( ) {},
/**Sets the data behind this ListView.
The adapter passed to this method may be wrapped by a {@link android.widget.WrapperListAdapter},
depending on the ListView features currently in use. For instance, adding
headers and/or footers will cause the adapter to be wrapped.
@param {Object {ListAdapter}} adapter The ListAdapter which is responsible for maintaining the
data backing this list and for producing a view to represent an
item in that data set.
@see #getAdapter()
*/
setAdapter : function( ) {},
/**
*/
requestChildRectangleOnScreen : function( ) {},
/**Smoothly scroll to the specified adapter position. The view will
scroll such that the indicated position is displayed.
@param {Number} position Scroll to this adapter position.
*/
smoothScrollToPosition : function( ) {},
/**Smoothly scroll to the specified adapter position offset. The view will
scroll such that the indicated position is displayed.
@param {Number} offset The amount to offset from the adapter position to scroll to.
*/
smoothScrollByOffset : function( ) {},
/**Sets the currently selected item. If in touch mode, the item will not be selected
but it will still be positioned appropriately. If the specified selection position
is less than 0, then the item at position 0 will be selected.
@param {Number} position Index (starting at 0) of the data item to be selected.
*/
setSelection : function( ) {},
/**setSelectionAfterHeaderView set the selection to be the first list item
after the header views.
*/
setSelectionAfterHeaderView : function( ) {},
/**
*/
dispatchKeyEvent : function( ) {},
/**
*/
onKeyDown : function( ) {},
/**
*/
onKeyMultiple : function( ) {},
/**
*/
onKeyUp : function( ) {},
/**Indicates that the views created by the ListAdapter can contain focusable
items.
@param {Boolean} itemsCanFocus true if items can get focus, false otherwise
*/
setItemsCanFocus : function( ) {},
/**
@return {Boolean} Whether the views created by the ListAdapter can contain focusable
items.
*/
getItemsCanFocus : function( ) {},
/**
*/
isOpaque : function( ) {},
/**
*/
setCacheColorHint : function( ) {},
/**Returns the drawable that will be drawn between each item in the list.
@return {Object {android.graphics.drawable.Drawable}} the current drawable drawn between list elements
@attr ref R.styleable#ListView_divider
*/
getDivider : function( ) {},
/**Sets the drawable that will be drawn between each item in the list.
<p>
<strong>Note:</strong> If the drawable does not have an intrinsic
height, you should also call {@link #setDividerHeight}(int).
@param {Object {Drawable}} divider the drawable to use
@attr ref R.styleable#ListView_divider
*/
setDivider : function( ) {},
/**
@return {Number} Returns the height of the divider that will be drawn between each item in the list.
*/
getDividerHeight : function( ) {},
/**Sets the height of the divider that will be drawn between each item in the list. Calling
this will override the intrinsic height as set by {@link #setDivider}(Drawable)
@param {Number} height The new height of the divider in pixels.
*/
setDividerHeight : function( ) {},
/**Enables or disables the drawing of the divider for header views.
@param {Boolean} headerDividersEnabled True to draw the headers, false otherwise.
@see #setFooterDividersEnabled(boolean)
@see #areHeaderDividersEnabled()
@see #addHeaderView(android.view.View)
*/
setHeaderDividersEnabled : function( ) {},
/**
@return {Boolean} Whether the drawing of the divider for header views is enabled
@see #setHeaderDividersEnabled(boolean)
*/
areHeaderDividersEnabled : function( ) {},
/**Enables or disables the drawing of the divider for footer views.
@param {Boolean} footerDividersEnabled True to draw the footers, false otherwise.
@see #setHeaderDividersEnabled(boolean)
@see #areFooterDividersEnabled()
@see #addFooterView(android.view.View)
*/
setFooterDividersEnabled : function( ) {},
/**
@return {Boolean} Whether the drawing of the divider for footer views is enabled
@see #setFooterDividersEnabled(boolean)
*/
areFooterDividersEnabled : function( ) {},
/**Sets the drawable that will be drawn above all other list content.
This area can become visible when the user overscrolls the list.
@param {Object {Drawable}} header The drawable to use
*/
setOverscrollHeader : function( ) {},
/**
@return {Object {android.graphics.drawable.Drawable}} The drawable that will be drawn above all other list content
*/
getOverscrollHeader : function( ) {},
/**Sets the drawable that will be drawn below all other list content.
This area can become visible when the user overscrolls the list,
or when the list's content does not fully fill the container area.
@param {Object {Drawable}} footer The drawable to use
*/
setOverscrollFooter : function( ) {},
/**
@return {Object {android.graphics.drawable.Drawable}} The drawable that will be drawn below all other list content
*/
getOverscrollFooter : function( ) {},
/**Returns the set of checked items ids. The result is only valid if the
choice mode has not been set to {@link #CHOICE_MODE_NONE}.
@return {Number} A new array which contains the id of each checked item in the
list.
@deprecated Use {@link #getCheckedItemIds()} instead.
*/
getCheckItemIds : function( ) {},
/**
*/
getAccessibilityClassName : function( ) {},
/**
@hide
*/
onInitializeAccessibilityNodeInfoInternal : function( ) {},
/**
@hide
*/
performAccessibilityActionInternal : function( ) {},
/**
*/
onInitializeAccessibilityNodeInfoForItem : function( ) {},
};