Added in API level 1

AbsListView


abstract class AbsListView : AdapterView<ListAdapter!>, Filter.FilterListener, TextWatcher, ViewTreeObserver.OnGlobalLayoutListener, ViewTreeObserver.OnTouchModeChangeListener
kotlin.Any
   ↳ android.view.View
   ↳ android.view.ViewGroup
   ↳ android.widget.AdapterView<android.widget.ListAdapter>
   ↳ android.widget.AbsListView

Base class that can be used to implement virtualized lists of items. A list does not have a spatial definition here. For instance, subclasses of this class can display the content of the list in a grid, in a carousel, as stack, etc.

Summary

Nested classes
open

AbsListView extends LayoutParams to provide a place to hold the view type.

abstract

A MultiChoiceModeListener receives events for AbsListView.CHOICE_MODE_MULTIPLE_MODAL.

abstract

Interface definition for a callback to be invoked when the list or grid has been scrolled.

abstract

A RecyclerListener is used to receive a notification whenever a View is placed inside the RecycleBin's scrap heap.

abstract

The top-level view of a list item can implement this interface to allow itself to modify the bounds of the selection shown for that item.

XML attributes
android:cacheColorHint Indicates that this list will always be drawn on top of solid, single-color opaque background.
android:choiceMode Defines the choice behavior for the view.
android:drawSelectorOnTop When set to true, the selector will be drawn over the selected item.
android:fastScrollEnabled Enables the fast scroll thumb that can be dragged to quickly scroll through the list.
android:listSelector Drawable used to indicate the currently selected item in the list.
android:scrollingCache When set to true, the list uses a drawing cache during scrolling.
android:smoothScrollbar When set to true, the list will use a more refined calculation method based on the pixels height of the items visible on screen.
android:stackFromBottom Used by ListView and GridView to stack their content from the bottom.
android:textFilterEnabled When set to true, the list will filter results as the user types.
android:transcriptMode Sets the transcript mode for the list.
Inherited XML attributes
Constants
static Int

The list allows multiple choices

static Int

The list allows multiple choices in a modal selection mode

static Int

Normal list that does not indicate choices

static Int

The list allows up to one choice

static Int

The list will automatically scroll to the bottom, no matter what items are currently visible.

static Int

Disables the transcript mode.

static Int

The list will automatically scroll to the bottom when a data set change notification is received and only if the last item is already visible on screen.

Inherited constants
Public constructors
AbsListView(context: Context!)

AbsListView(context: Context!, attrs: AttributeSet!)

AbsListView(context: Context!, attrs: AttributeSet!, defStyleAttr: Int)

AbsListView(context: Context!, attrs: AttributeSet!, defStyleAttr: Int, defStyleRes: Int)

Public methods
open Unit

Add any touchable views that are descendants of this view (possibly including this view if it is touchable itself) to views.

open Unit

For our text watcher that is associated with the text filter.

open Unit
beforeTextChanged(s: CharSequence!, start: Int, count: Int, after: Int)

For our text watcher that is associated with the text filter.

open Boolean
canScrollList(direction: Int)

Check if the items in the list can be scrolled in a certain direction.

open Boolean

For filtering we proxy an input connection to an internal text editor, and this allows the proxying to happen.

open Unit

Clear any choices previously set

open Unit

Clear the text filter.

open Unit

This defers a notifyDataSetChanged on the pending RemoteViewsAdapter if it has not connected yet.

open Unit

open Unit
draw(canvas: Canvas)

open Unit
fling(velocityY: Int)

Initiate a fling with the given velocity.

open AbsListView.LayoutParams!

open CharSequence!

A TYPE_VIEW_SCROLLED event should be sent whenever a scroll happens, even if the mFirstPosition and the child count have not changed.

open Int

Returns the bottom edge effect color.

open Int

When set to a non-zero value, the cache color hint indicates that this list is always drawn on top of a solid, single-color, opaque background

open Int

Returns the number of items currently selected.

open LongArray!

Returns the set of checked items ids.

open Int

Returns the currently checked item.

open SparseBooleanArray!

Returns the set of checked items in the list.

open Int

open Unit

open Int

List padding is the maximum of the normal view's padding and the padding of the selector.

open Int

List padding is the maximum of the normal view's padding and the padding of the selector.

open Int

List padding is the maximum of the normal view's padding and the padding of the selector.

open Int

List padding is the maximum of the normal view's padding and the padding of the selector.

open View!

open Drawable!

Returns the selector android.graphics.drawable.Drawable that is used to draw the selection in the list.

open Int

open CharSequence!

Returns the list's text filter, if available.

open Int

Returns the top edge effect color.

open Int

Returns the current transcript mode.

open Int

open Boolean

Returns if the ListView currently has a text filter.

open Unit

Causes all the views to be rebuilt and redrawn.

open Boolean

Returns whether the selection highlight drawable should be drawn on top of the item or behind it.

open Boolean

Returns true if the fast scroller is set to always show on this view.

open Boolean

Returns true if the fast scroller is enabled.

open Boolean
isItemChecked(position: Int)

Returns the checked state of the specified position.

open Boolean

Indicates whether the children's drawing cache is used during a scroll.

open Boolean

Returns whether the selected child view (from the adapter's getView) is enabled.

open Boolean

Returns the current state of the fast scroll feature.

open Boolean

Indicates whether the content of this view is pinned to, or stacked from, the bottom edge.

open Boolean

Indicates whether type filtering is enabled for this view

open Unit

open Unit

open InputConnection!

Return an InputConnection for editing of the filter text.

open Unit

open Boolean

open Unit

open Unit

Initializes an AccessibilityNodeInfo with information about a particular item in the list.

open Boolean

open Boolean

open Boolean
onKeyDown(keyCode: Int, event: KeyEvent!)

open Boolean
onKeyUp(keyCode: Int, event: KeyEvent!)

open Boolean
onNestedFling(target: View, velocityX: Float, velocityY: Float, consumed: Boolean)

open Unit
onNestedScroll(target: View, dxConsumed: Int, dyConsumed: Int, dxUnconsumed: Int, dyUnconsumed: Int)

open Unit
onNestedScrollAccepted(child: View, target: View, axes: Int)

open Unit

Populates a for content capture.

open Boolean

Called back when the adapter connects to the RemoteViewsService.

open Unit

Called back when the adapter disconnects from the RemoteViewsService.

open PointerIcon!
onResolvePointerIcon(event: MotionEvent!, pointerIndex: Int)

open Unit

open Unit
onRtlPropertiesChanged(layoutDirection: Int)

open Parcelable?

open Boolean
onStartNestedScroll(child: View, target: View, nestedScrollAxes: Int)

open Unit
onTextChanged(s: CharSequence!, start: Int, before: Int, count: Int)

For our text watcher that is associated with the text filter.

open Boolean

open Unit
onTouchModeChanged(isInTouchMode: Boolean)

open Unit
onWindowFocusChanged(hasWindowFocus: Boolean)

open Boolean
performItemClick(view: View!, position: Int, id: Long)

open Int

Maps a point to a position in the list.

open Long
pointToRowId(x: Int, y: Int)

Maps a point to a the rowId of the item which intersects that point.

open Unit

Move all views (excluding headers and footers) held by this AbsListView into the supplied List.

open Unit

open Unit

open Unit

Scrolls the list items within the view by a specified number of pixels.

open Unit

Sets the adapter that provides the data and the views to represent the data in this widget.

open Unit

Sets the bottom edge effect color.

open Unit

When set to a non-zero value, the cache color hint indicates that this list is always drawn on top of a solid, single-color, opaque background.

open Unit
setChoiceMode(choiceMode: Int)

Defines the choice behavior for the List.

open Unit

Controls whether the selection highlight drawable should be drawn on top of the item or behind it.

open Unit

Sets the edge effect color for both top and bottom edge effects.

open Unit

Set whether or not the fast scroller should always be shown in place of the standard scroll bars.

open Unit

Specifies whether fast scrolling is enabled or disabled.

open Unit
setFastScrollStyle(styleResId: Int)

Specifies the style of the fast scroller decorations.

open Unit
setFilterText(filterText: String!)

Sets the initial value for the text filter.

open Unit
setFriction(friction: Float)

The amount of friction applied to flings.

open Unit
setItemChecked(position: Int, value: Boolean)

Sets the checked state of the specified position.

open Unit

Set a MultiChoiceModeListener that will manage the lifecycle of the selection ActionMode.

open Unit

Set the listener that will receive notifications every time the list scrolls.

open Unit

Sets the recycler listener to be notified whenever a View is set aside in the recycler for later reuse.

open Unit

Sets up this AbsListView to use a remote views adapter which connects to a RemoteViewsService through the specified intent.

open Unit

open Unit
setScrollIndicators(up: View!, down: View!)

open Unit

Enables or disables the children's drawing cache during a scroll.

open Unit
setSelectedChildViewEnabled(selectedChildViewEnabled: Boolean)

Set whether the selected child view (from the adapter's getView) is enabled.

open Unit
setSelectionFromTop(position: Int, y: Int)

Sets the selected item and positions the selection y pixels from the top edge of the ListView.

open Unit

open Unit
setSelector(resID: Int)

Set a Drawable that should be used to highlight the currently selected item.

open Unit

When smooth scrollbar is enabled, the position and size of the scrollbar thumb is computed based on the number of visible pixels in the visible items.

open Unit
setStackFromBottom(stackFromBottom: Boolean)

When stack from bottom is set to true, the list fills its content starting from the bottom of the view.

open Unit
setTextFilterEnabled(textFilterEnabled: Boolean)

Enables or disables the type filter window.

open Unit

Sets the top edge effect color.

open Unit

Puts the list or grid into transcript mode.

open Unit

Sets a scale factor for the fling velocity.

open Unit

open Boolean

open Boolean

open Boolean
showContextMenuForChild(originalView: View!)

open Boolean
showContextMenuForChild(originalView: View!, x: Float, y: Float)

open Unit
smoothScrollBy(distance: Int, duration: Int)

Smoothly scroll by distance pixels over duration milliseconds.

open Unit

Smoothly scroll to the specified adapter position.

open Unit
smoothScrollToPosition(position: Int, boundPosition: Int)

Smoothly scroll to the specified adapter position.

open Unit
smoothScrollToPositionFromTop(position: Int, offset: Int)

Smoothly scroll to the specified adapter position.

open Unit
smoothScrollToPositionFromTop(position: Int, offset: Int, duration: Int)

Smoothly scroll to the specified adapter position.

open Boolean

If your view subclass is displaying its own Drawable objects, it should override this function and return true for any Drawable it is displaying.

Protected methods
open Boolean

open Int

open Int

open Int

open Unit

open Unit

open Unit

open ViewGroup.LayoutParams!

open ViewGroup.LayoutParams!

open Float

open Int

open ContextMenu.ContextMenuInfo!

open Int

open Int

open Float

open Int

open Unit

open Boolean

open Boolean

open Unit

Subclasses must override this method to layout their children.

open Unit

open Unit

open Unit

open Unit
onFocusChanged(gainFocus: Boolean, direction: Int, previouslyFocusedRect: Rect?)

open Unit
onLayout(changed: Boolean, l: Int, t: Int, r: Int, b: Int)

Subclasses should NOT override this method but layoutChildren() instead.

open Unit
onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int)

open Unit
onOverScrolled(scrollX: Int, scrollY: Int, clampedX: Boolean, clampedY: Boolean)

open Unit
onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int)

Inherited functions