AndBase开发框架  1.6
 全部  命名空间 文件 函数 变量 枚举值 
| Public 成员函数 | 静态 Public 属性 | Protected 成员函数 | 包函数 | 包属性 | 静态包属性 | Private 成员函数 | Private 属性 | 所有成员列表
com.ab.view.carousel.CarouselAdapter< T extends Adapter >类 参考abstract
类 com.ab.view.carousel.CarouselAdapter< T extends Adapter > 继承关系图:
com.ab.view.carousel.CarouselAdapter< T extends Adapter >.AdapterContextMenuInfo com.ab.view.carousel.CarouselAdapter< T extends Adapter >.AdapterDataSetObserver com.ab.view.carousel.CarouselAdapter< T extends Adapter >.SelectionNotifier com.ab.view.carousel.CarouselAdapter< T extends Adapter >.SelectionNotifier com.ab.view.carousel.CarouselSpinner com.ab.view.carousel.CarouselImageView com.ab.view.carousel.CarouselView

class  AdapterContextMenuInfo
 
class  AdapterDataSetObserver
 
interface  OnItemClickListener
 
interface  OnItemLongClickListener
 
interface  OnItemSelectedListener
 
class  SelectionNotifier
 

Public 成员函数

 CarouselAdapter (Context context)
 
 CarouselAdapter (Context context, AttributeSet attrs)
 
 CarouselAdapter (Context context, AttributeSet attrs, int defStyle)
 
void setOnItemClickListener (OnItemClickListener listener)
 
final OnItemClickListener getOnItemClickListener ()
 
boolean performItemClick (View view, int position, long id)
 
void setOnItemLongClickListener (OnItemLongClickListener listener)
 
final OnItemLongClickListener getOnItemLongClickListener ()
 
void setOnItemSelectedListener (OnItemSelectedListener listener)
 
final OnItemSelectedListener getOnItemSelectedListener ()
 
abstract T getAdapter ()
 
abstract void setAdapter (T adapter)
 
void addView (View child)
 
void addView (View child, int index)
 
void addView (View child, LayoutParams params)
 
void addView (View child, int index, LayoutParams params)
 
void removeView (View child)
 
void removeViewAt (int index)
 
void removeAllViews ()
 
.CapturedViewProperty int getSelectedItemPosition ()
 
.CapturedViewProperty long getSelectedItemId ()
 
abstract View getSelectedView ()
 
Object getSelectedItem ()
 
.CapturedViewProperty int getCount ()
 
int getPositionForView (View view)
 
int getFirstVisiblePosition ()
 
int getLastVisiblePosition ()
 
abstract void setSelection (int position)
 
void setEmptyView (View emptyView)
 
View getEmptyView ()
 
void setFocusable (boolean focusable)
 
void setFocusableInTouchMode (boolean focusable)
 
Object getItemAtPosition (int position)
 
long getItemIdAtPosition (int position)
 
void setOnClickListener (OnClickListener l)
 
boolean dispatchPopulateAccessibilityEvent (AccessibilityEvent event)
 

静态 Public 属性

static final int ITEM_VIEW_TYPE_IGNORE = -1
 
static final int ITEM_VIEW_TYPE_HEADER_OR_FOOTER = -2
 
static final int INVALID_POSITION = -1
 
static final long INVALID_ROW_ID = Long.MIN_VALUE
 

Protected 成员函数

void onLayout (boolean changed, int left, int top, int right, int bottom)
 
void dispatchSaveInstanceState (SparseArray< Parcelable > container)
 
void dispatchRestoreInstanceState (SparseArray< Parcelable > container)
 
boolean canAnimate ()
 

包函数

boolean isInFilterMode ()
 
void checkFocus ()
 
void selectionChanged ()
 
void handleDataChanged ()
 
void checkSelectionChanged ()
 
int findSyncPosition ()
 
int lookForSelectablePosition (int position, boolean lookDown)
 
void setSelectedPositionInt (int position)
 
void setNextSelectedPositionInt (int position)
 
void rememberSyncState ()
 

包属性

.ExportedProperty int mFirstPosition = 0
 
int mSpecificTop
 
int mSyncPosition
 
long mSyncRowId = INVALID_ROW_ID
 
long mSyncHeight
 
boolean mNeedSync = false
 
int mSyncMode
 
boolean mInLayout = false
 
OnItemSelectedListener mOnItemSelectedListener
 
OnItemClickListener mOnItemClickListener
 
OnItemLongClickListener mOnItemLongClickListener
 
boolean mDataChanged
 
.ExportedProperty int mNextSelectedPosition = INVALID_POSITION
 
long mNextSelectedRowId = INVALID_ROW_ID
 
.ExportedProperty int mSelectedPosition = INVALID_POSITION
 
long mSelectedRowId = INVALID_ROW_ID
 
.ExportedProperty int mItemCount
 
int mOldItemCount
 
int mOldSelectedPosition = INVALID_POSITION
 
long mOldSelectedRowId = INVALID_ROW_ID
 
boolean mBlockLayoutRequests = false
 

静态包属性

static final int SYNC_SELECTED_POSITION = 0
 
static final int SYNC_FIRST_POSITION = 1
 
static final int SYNC_MAX_DURATION_MILLIS = 100
 

Private 成员函数

void updateEmptyStatus (boolean empty)
 
void fireOnSelected ()
 

Private 属性

int mLayoutHeight
 
View mEmptyView
 
boolean mDesiredFocusableState
 
boolean mDesiredFocusableInTouchModeState
 
SelectionNotifier mSelectionNotifier
 

详细描述

The Class CarouselAdapter.

参数
<T>the generic type

构造及析构函数说明

com.ab.view.carousel.CarouselAdapter< T extends Adapter >.CarouselAdapter ( Context  context)
inline

Instantiates a new carousel adapter.

参数
contextthe context
com.ab.view.carousel.CarouselAdapter< T extends Adapter >.CarouselAdapter ( Context  context,
AttributeSet  attrs 
)
inline

Instantiates a new carousel adapter.

参数
contextthe context
attrsthe attrs
com.ab.view.carousel.CarouselAdapter< T extends Adapter >.CarouselAdapter ( Context  context,
AttributeSet  attrs,
int  defStyle 
)
inline

Instantiates a new carousel adapter.

参数
contextthe context
attrsthe attrs
defStylethe def style

成员函数说明

void com.ab.view.carousel.CarouselAdapter< T extends Adapter >.addView ( View  child)
inline

This method is not supported and throws an UnsupportedOperationException when called.

参数
childIgnored.
void com.ab.view.carousel.CarouselAdapter< T extends Adapter >.addView ( View  child,
int  index 
)
inline

This method is not supported and throws an UnsupportedOperationException when called.

参数
childIgnored.
indexIgnored.
void com.ab.view.carousel.CarouselAdapter< T extends Adapter >.addView ( View  child,
LayoutParams  params 
)
inline

This method is not supported and throws an UnsupportedOperationException when called.

参数
childIgnored.
paramsIgnored.
void com.ab.view.carousel.CarouselAdapter< T extends Adapter >.addView ( View  child,
int  index,
LayoutParams  params 
)
inline

This method is not supported and throws an UnsupportedOperationException when called.

参数
childIgnored.
indexIgnored.
paramsIgnored.
boolean com.ab.view.carousel.CarouselAdapter< T extends Adapter >.canAnimate ( )
inlineprotected

描述:TODO.

版本
v1.0
返回
true, if successful
参见
android.view.ViewGroup::canAnimate()
作者
: amsoft.cn
日期
:2013-11-28 上午11:14:34
void com.ab.view.carousel.CarouselAdapter< T extends Adapter >.checkFocus ( )
inlinepackage

Check focus.

void com.ab.view.carousel.CarouselAdapter< T extends Adapter >.checkSelectionChanged ( )
inlinepackage

Check selection changed.

boolean com.ab.view.carousel.CarouselAdapter< T extends Adapter >.dispatchPopulateAccessibilityEvent ( AccessibilityEvent  event)
inline

描述:TODO.

版本
v1.0
参数
eventthe event
返回
true, if successful
参见
android.view.ViewGroup::dispatchPopulateAccessibilityEvent(android.view.accessibility.AccessibilityEvent)
作者
: amsoft.cn
日期
:2013-11-28 上午11:14:33
void com.ab.view.carousel.CarouselAdapter< T extends Adapter >.dispatchRestoreInstanceState ( SparseArray< Parcelable >  container)
inlineprotected

Override to prevent thawing of any views created by the adapter.

参数
containerthe container
void com.ab.view.carousel.CarouselAdapter< T extends Adapter >.dispatchSaveInstanceState ( SparseArray< Parcelable >  container)
inlineprotected

Override to prevent freezing of any views created by the adapter.

参数
containerthe container
int com.ab.view.carousel.CarouselAdapter< T extends Adapter >.findSyncPosition ( )
inlinepackage

Searches the adapter for a position matching mSyncRowId. The search starts at mSyncPosition and then alternates between moving up and moving down until 1) we find the right position, or 2) we run out of time, or 3) we have looked at every position

返回
Position of the row that matches mSyncRowId, or INVALID_POSITION if it can't be found
void com.ab.view.carousel.CarouselAdapter< T extends Adapter >.fireOnSelected ( )
inlineprivate

Fire on selected.

abstract T com.ab.view.carousel.CarouselAdapter< T extends Adapter >.getAdapter ( )
abstract

Returns the adapter currently associated with this widget.

返回
The adapter used to provide this view's content.
.CapturedViewProperty int com.ab.view.carousel.CarouselAdapter< T extends Adapter >.getCount ( )
inline

Gets the count.

返回
The number of items owned by the Adapter associated with this CarouselAdapter. (This is the number of data items, which may be larger than the number of visible view.)
View com.ab.view.carousel.CarouselAdapter< T extends Adapter >.getEmptyView ( )
inline

When the current adapter is empty, the CarouselAdapter can display a special view call the empty view. The empty view is used to provide feedback to the user that no data is available in this CarouselAdapter.

返回
The view to show if the adapter is empty.
int com.ab.view.carousel.CarouselAdapter< T extends Adapter >.getFirstVisiblePosition ( )
inline

Returns the position within the adapter's data set for the first item displayed on screen.

返回
The position within the adapter's data set
Object com.ab.view.carousel.CarouselAdapter< T extends Adapter >.getItemAtPosition ( int  position)
inline

Gets the data associated with the specified position in the list.

参数
positionWhich data to get
返回
The data associated with the specified position in the list
long com.ab.view.carousel.CarouselAdapter< T extends Adapter >.getItemIdAtPosition ( int  position)
inline

Gets the item id at position.

参数
positionthe position
返回
the item id at position
int com.ab.view.carousel.CarouselAdapter< T extends Adapter >.getLastVisiblePosition ( )
inline

Returns the position within the adapter's data set for the last item displayed on screen.

返回
The position within the adapter's data set
final OnItemClickListener com.ab.view.carousel.CarouselAdapter< T extends Adapter >.getOnItemClickListener ( )
inline

Gets the on item click listener.

返回
The callback to be invoked with an item in this CarouselAdapter has been clicked, or null id no callback has been set.
final OnItemLongClickListener com.ab.view.carousel.CarouselAdapter< T extends Adapter >.getOnItemLongClickListener ( )
inline

Gets the on item long click listener.

返回
The callback to be invoked with an item in this CarouselAdapter has been clicked and held, or null id no callback as been set.
final OnItemSelectedListener com.ab.view.carousel.CarouselAdapter< T extends Adapter >.getOnItemSelectedListener ( )
inline

Gets the on item selected listener.

返回
the on item selected listener
int com.ab.view.carousel.CarouselAdapter< T extends Adapter >.getPositionForView ( View  view)
inline

Get the position within the adapter's data set for the view, where view is a an adapter item or a descendant of an adapter item.

参数
viewan adapter item, or a descendant of an adapter item. This must be visible in this CarouselAdapter at the time of the call.
返回
the position within the adapter's data set of the view, or INVALID_POSITION if the view does not correspond to a list item (or it is not currently visible).
Object com.ab.view.carousel.CarouselAdapter< T extends Adapter >.getSelectedItem ( )
inline

Gets the selected item.

返回
The data corresponding to the currently selected item, or null if there is nothing selected.
.CapturedViewProperty long com.ab.view.carousel.CarouselAdapter< T extends Adapter >.getSelectedItemId ( )
inline

Gets the selected item id.

返回
The id corresponding to the currently selected item, or INVALID_ROW_ID if nothing is selected.
.CapturedViewProperty int com.ab.view.carousel.CarouselAdapter< T extends Adapter >.getSelectedItemPosition ( )
inline

Return the position of the currently selected item within the adapter's data set.

返回
int Position (starting at 0), or INVALID_POSITION if there is nothing selected.
abstract View com.ab.view.carousel.CarouselAdapter< T extends Adapter >.getSelectedView ( )
abstract

Gets the selected view.

返回
The view corresponding to the currently selected item, or null if nothing is selected
void com.ab.view.carousel.CarouselAdapter< T extends Adapter >.handleDataChanged ( )
inlinepackage

Handle data changed.

boolean com.ab.view.carousel.CarouselAdapter< T extends Adapter >.isInFilterMode ( )
inlinepackage

Indicates whether this view is in filter mode. Filter mode can for instance be enabled by a user when typing on the keyboard.

返回
True if the view is in filter mode, false otherwise.
int com.ab.view.carousel.CarouselAdapter< T extends Adapter >.lookForSelectablePosition ( int  position,
boolean  lookDown 
)
inlinepackage

Find a position that can be selected (i.e., is not a separator).

参数
positionThe starting position to look at.
lookDownWhether to look down for other positions.
返回
The next selectable position starting at position and then searching either up or down. Returns INVALID_POSITION if nothing can be found.
void com.ab.view.carousel.CarouselAdapter< T extends Adapter >.onLayout ( boolean  changed,
int  left,
int  top,
int  right,
int  bottom 
)
inlineprotected

描述:TODO.

版本
v1.0
参数
changedthe changed
leftthe left
topthe top
rightthe right
bottomthe bottom
参见
android.view.ViewGroup::onLayout(boolean, int, int, int, int)
作者
: amsoft.cn
日期
:2013-11-28 上午11:14:33
boolean com.ab.view.carousel.CarouselAdapter< T extends Adapter >.performItemClick ( View  view,
int  position,
long  id 
)
inline

Call the OnItemClickListener, if it is defined.

参数
viewThe view within the CarouselAdapter that was clicked.
positionThe position of the view in the adapter.
idThe row id of the item that was clicked.
返回
True if there was an assigned OnItemClickListener that was called, false otherwise is returned.
void com.ab.view.carousel.CarouselAdapter< T extends Adapter >.rememberSyncState ( )
inlinepackage

Remember enough information to restore the screen state when the data has changed.

void com.ab.view.carousel.CarouselAdapter< T extends Adapter >.removeAllViews ( )
inline

This method is not supported and throws an UnsupportedOperationException when called.

void com.ab.view.carousel.CarouselAdapter< T extends Adapter >.removeView ( View  child)
inline

This method is not supported and throws an UnsupportedOperationException when called.

参数
childIgnored.
void com.ab.view.carousel.CarouselAdapter< T extends Adapter >.removeViewAt ( int  index)
inline

This method is not supported and throws an UnsupportedOperationException when called.

参数
indexIgnored.
void com.ab.view.carousel.CarouselAdapter< T extends Adapter >.selectionChanged ( )
inlinepackage

Selection changed.

abstract void com.ab.view.carousel.CarouselAdapter< T extends Adapter >.setAdapter ( adapter)
abstract

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

参数
adapterThe adapter to use to create this view's content.
void com.ab.view.carousel.CarouselAdapter< T extends Adapter >.setEmptyView ( View  emptyView)
inline

Sets the view to show if the adapter is empty.

参数
emptyViewthe new empty view
void com.ab.view.carousel.CarouselAdapter< T extends Adapter >.setFocusable ( boolean  focusable)
inline

描述:TODO.

版本
v1.0
参数
focusablethe new focusable
参见
android.view.View::setFocusable(boolean)
作者
: amsoft.cn
日期
:2013-11-28 上午11:14:33
void com.ab.view.carousel.CarouselAdapter< T extends Adapter >.setFocusableInTouchMode ( boolean  focusable)
inline

描述:TODO.

版本
v1.0
参数
focusablethe new focusable in touch mode
参见
android.view.View::setFocusableInTouchMode(boolean)
作者
: amsoft.cn
日期
:2013-11-28 上午11:14:33
void com.ab.view.carousel.CarouselAdapter< T extends Adapter >.setNextSelectedPositionInt ( int  position)
inlinepackage

Utility to keep mNextSelectedPosition and mNextSelectedRowId in sync.

参数
positionIntended value for mSelectedPosition the next time we go through layout
void com.ab.view.carousel.CarouselAdapter< T extends Adapter >.setOnClickListener ( OnClickListener  l)
inline

描述:TODO.

版本
v1.0
参数
lthe new on click listener
参见
android.view.View::setOnClickListener(android.view.View.OnClickListener)
作者
: amsoft.cn
日期
:2013-11-28 上午11:14:33
void com.ab.view.carousel.CarouselAdapter< T extends Adapter >.setOnItemClickListener ( OnItemClickListener  listener)
inline

Register a callback to be invoked when an item in this CarouselAdapter has been clicked.

参数
listenerThe callback that will be invoked.
void com.ab.view.carousel.CarouselAdapter< T extends Adapter >.setOnItemLongClickListener ( OnItemLongClickListener  listener)
inline

Register a callback to be invoked when an item in this CarouselAdapter has been clicked and held.

参数
listenerThe callback that will run
void com.ab.view.carousel.CarouselAdapter< T extends Adapter >.setOnItemSelectedListener ( OnItemSelectedListener  listener)
inline

Register a callback to be invoked when an item in this CarouselAdapter has been selected.

参数
listenerThe callback that will run
void com.ab.view.carousel.CarouselAdapter< T extends Adapter >.setSelectedPositionInt ( int  position)
inlinepackage

Utility to keep mSelectedPosition and mSelectedRowId in sync.

参数
positionOur current position
abstract void com.ab.view.carousel.CarouselAdapter< T extends Adapter >.setSelection ( int  position)
abstract

Sets the currently selected item. To support accessibility subclasses that override this method must invoke the overriden super method first.

参数
positionIndex (starting at 0) of the data item to be selected.
void com.ab.view.carousel.CarouselAdapter< T extends Adapter >.updateEmptyStatus ( boolean  empty)
inlineprivate

Update the status of the list based on the empty parameter. If empty is true and we have an empty view, display it. In all the other cases, make sure that the listview is VISIBLE and that the empty view is GONE (if it's not null).

参数
emptythe empty

类成员变量说明

final int com.ab.view.carousel.CarouselAdapter< T extends Adapter >.INVALID_POSITION = -1
static

Represents an invalid position. All valid positions are in the range 0 to 1 less than the number of items in the current adapter.

final long com.ab.view.carousel.CarouselAdapter< T extends Adapter >.INVALID_ROW_ID = Long.MIN_VALUE
static

Represents an empty or invalid row id.

final int com.ab.view.carousel.CarouselAdapter< T extends Adapter >.ITEM_VIEW_TYPE_HEADER_OR_FOOTER = -2
static

The item view type returned by Adapter#getItemViewType(int) when the item is a header or footer.

final int com.ab.view.carousel.CarouselAdapter< T extends Adapter >.ITEM_VIEW_TYPE_IGNORE = -1
static

The item view type returned by Adapter#getItemViewType(int) when the adapter does not want the item's view recycled.

boolean com.ab.view.carousel.CarouselAdapter< T extends Adapter >.mBlockLayoutRequests = false
package

When set to true, calls to requestLayout() will not propagate up the parent hierarchy. This is used to layout the children during a layout pass.

boolean com.ab.view.carousel.CarouselAdapter< T extends Adapter >.mDataChanged
package

True if the data has changed since the last layout.

boolean com.ab.view.carousel.CarouselAdapter< T extends Adapter >.mDesiredFocusableInTouchModeState
private

The m desired focusable in touch mode state.

boolean com.ab.view.carousel.CarouselAdapter< T extends Adapter >.mDesiredFocusableState
private

Indicates what focusable state is requested when calling setFocusable(). In addition to this, this view has other criteria for actually determining the focusable state (such as whether its empty or the text filter is shown).

参见
setFocusable(boolean)
checkFocus()
View com.ab.view.carousel.CarouselAdapter< T extends Adapter >.mEmptyView
private

View to show if there are no items to show.

.ExportedProperty int com.ab.view.carousel.CarouselAdapter< T extends Adapter >.mFirstPosition = 0
package

The position of the first child displayed.

boolean com.ab.view.carousel.CarouselAdapter< T extends Adapter >.mInLayout = false
package

Indicates that this view is currently being laid out.

.ExportedProperty int com.ab.view.carousel.CarouselAdapter< T extends Adapter >.mItemCount
package

The number of items in the current adapter.

int com.ab.view.carousel.CarouselAdapter< T extends Adapter >.mLayoutHeight
private

Our height after the last layout.

boolean com.ab.view.carousel.CarouselAdapter< T extends Adapter >.mNeedSync = false
package

True if we need to sync to mSyncRowId.

.ExportedProperty int com.ab.view.carousel.CarouselAdapter< T extends Adapter >.mNextSelectedPosition = INVALID_POSITION
package

The position within the adapter's data set of the item to select during the next layout.

long com.ab.view.carousel.CarouselAdapter< T extends Adapter >.mNextSelectedRowId = INVALID_ROW_ID
package

The item id of the item to select during the next layout.

int com.ab.view.carousel.CarouselAdapter< T extends Adapter >.mOldItemCount
package

The number of items in the adapter before a data changed event occured.

int com.ab.view.carousel.CarouselAdapter< T extends Adapter >.mOldSelectedPosition = INVALID_POSITION
package

The last selected position we used when notifying.

long com.ab.view.carousel.CarouselAdapter< T extends Adapter >.mOldSelectedRowId = INVALID_ROW_ID
package

The id of the last selected position we used when notifying.

OnItemClickListener com.ab.view.carousel.CarouselAdapter< T extends Adapter >.mOnItemClickListener
package

The listener that receives notifications when an item is clicked.

OnItemLongClickListener com.ab.view.carousel.CarouselAdapter< T extends Adapter >.mOnItemLongClickListener
package

The listener that receives notifications when an item is long clicked.

OnItemSelectedListener com.ab.view.carousel.CarouselAdapter< T extends Adapter >.mOnItemSelectedListener
package

The listener that receives notifications when an item is selected.

.ExportedProperty int com.ab.view.carousel.CarouselAdapter< T extends Adapter >.mSelectedPosition = INVALID_POSITION
package

The position within the adapter's data set of the currently selected item.

long com.ab.view.carousel.CarouselAdapter< T extends Adapter >.mSelectedRowId = INVALID_ROW_ID
package

The item id of the currently selected item.

SelectionNotifier com.ab.view.carousel.CarouselAdapter< T extends Adapter >.mSelectionNotifier
private

The m selection notifier.

int com.ab.view.carousel.CarouselAdapter< T extends Adapter >.mSpecificTop
package

The offset in pixels from the top of the CarouselAdapter to the top of the view to select during the next layout.

long com.ab.view.carousel.CarouselAdapter< T extends Adapter >.mSyncHeight
package

Height of the view when mSyncPosition and mSyncRowId where set.

int com.ab.view.carousel.CarouselAdapter< T extends Adapter >.mSyncMode
package

Indicates whether to sync based on the selection or position. Possible values are SYNC_SELECTED_POSITION or SYNC_FIRST_POSITION.

int com.ab.view.carousel.CarouselAdapter< T extends Adapter >.mSyncPosition
package

Position from which to start looking for mSyncRowId.

long com.ab.view.carousel.CarouselAdapter< T extends Adapter >.mSyncRowId = INVALID_ROW_ID
package

Row id to look for when data has changed.

final int com.ab.view.carousel.CarouselAdapter< T extends Adapter >.SYNC_FIRST_POSITION = 1
staticpackage

Sync based on the first child displayed.

final int com.ab.view.carousel.CarouselAdapter< T extends Adapter >.SYNC_MAX_DURATION_MILLIS = 100
staticpackage

Maximum amount of time to spend in findSyncPosition().

final int com.ab.view.carousel.CarouselAdapter< T extends Adapter >.SYNC_SELECTED_POSITION = 0
staticpackage

Sync based on the selected child.


该类的文档由以下文件生成: