public class DynamicListView extends ListView
ListView implementation which provides the following functionality:
ListView.FixedViewInfoAbsListView.LayoutParams, AbsListView.MultiChoiceModeListener, AbsListView.OnScrollListener, AbsListView.RecyclerListener, AbsListView.SelectionBoundsAdjusterAdapterView.AdapterContextMenuInfo, AdapterView.OnItemClickListener, AdapterView.OnItemLongClickListener, AdapterView.OnItemSelectedListenerViewGroup.MarginLayoutParams, ViewGroup.OnHierarchyChangeListenerView.AccessibilityDelegate, View.BaseSavedState, View.DragShadowBuilder, View.MeasureSpec, View.OnApplyWindowInsetsListener, View.OnAttachStateChangeListener, View.OnClickListener, View.OnCreateContextMenuListener, View.OnDragListener, View.OnFocusChangeListener, View.OnGenericMotionListener, View.OnHoverListener, View.OnKeyListener, View.OnLayoutChangeListener, View.OnLongClickListener, View.OnSystemUiVisibilityChangeListener, View.OnTouchListenerNoCopySpan.ConcreteCHOICE_MODE_MULTIPLE, CHOICE_MODE_MULTIPLE_MODAL, CHOICE_MODE_NONE, CHOICE_MODE_SINGLE, TRANSCRIPT_MODE_ALWAYS_SCROLL, TRANSCRIPT_MODE_DISABLED, TRANSCRIPT_MODE_NORMALINVALID_POSITION, INVALID_ROW_ID, ITEM_VIEW_TYPE_HEADER_OR_FOOTER, ITEM_VIEW_TYPE_IGNORECLIP_TO_PADDING_MASK, FOCUS_AFTER_DESCENDANTS, FOCUS_BEFORE_DESCENDANTS, FOCUS_BLOCK_DESCENDANTS, LAYOUT_MODE_CLIP_BOUNDS, LAYOUT_MODE_OPTICAL_BOUNDS, PERSISTENT_ALL_CACHES, PERSISTENT_ANIMATION_CACHE, PERSISTENT_NO_CACHE, PERSISTENT_SCROLLING_CACHEACCESSIBILITY_LIVE_REGION_ASSERTIVE, ACCESSIBILITY_LIVE_REGION_NONE, ACCESSIBILITY_LIVE_REGION_POLITE, ALPHA, DRAWING_CACHE_QUALITY_AUTO, DRAWING_CACHE_QUALITY_HIGH, DRAWING_CACHE_QUALITY_LOW, EMPTY_STATE_SET, ENABLED_FOCUSED_SELECTED_STATE_SET, ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_FOCUSED_STATE_SET, ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, ENABLED_SELECTED_STATE_SET, ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_STATE_SET, ENABLED_WINDOW_FOCUSED_STATE_SET, FIND_VIEWS_WITH_CONTENT_DESCRIPTION, FIND_VIEWS_WITH_TEXT, FOCUS_BACKWARD, FOCUS_DOWN, FOCUS_FORWARD, FOCUS_LEFT, FOCUS_RIGHT, FOCUS_UP, FOCUSABLES_ALL, FOCUSABLES_TOUCH_MODE, FOCUSED_SELECTED_STATE_SET, FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, FOCUSED_STATE_SET, FOCUSED_WINDOW_FOCUSED_STATE_SET, GONE, HAPTIC_FEEDBACK_ENABLED, IMPORTANT_FOR_ACCESSIBILITY_AUTO, IMPORTANT_FOR_ACCESSIBILITY_NO, IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS, IMPORTANT_FOR_ACCESSIBILITY_YES, INVISIBLE, KEEP_SCREEN_ON, LAYER_TYPE_HARDWARE, LAYER_TYPE_NONE, LAYER_TYPE_SOFTWARE, LAYOUT_DIRECTION_INHERIT, LAYOUT_DIRECTION_LOCALE, LAYOUT_DIRECTION_LTR, LAYOUT_DIRECTION_RTL, MEASURED_HEIGHT_STATE_SHIFT, MEASURED_SIZE_MASK, MEASURED_STATE_MASK, MEASURED_STATE_TOO_SMALL, NO_ID, OVER_SCROLL_ALWAYS, OVER_SCROLL_IF_CONTENT_SCROLLS, OVER_SCROLL_NEVER, PRESSED_ENABLED_FOCUSED_SELECTED_STATE_SET, PRESSED_ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_SELECTED_STATE_SET, PRESSED_ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_STATE_SET, PRESSED_ENABLED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_SELECTED_STATE_SET, PRESSED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_STATE_SET, PRESSED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_SELECTED_STATE_SET, PRESSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_STATE_SET, PRESSED_WINDOW_FOCUSED_STATE_SET, ROTATION, ROTATION_X, ROTATION_Y, SCALE_X, SCALE_Y, SCREEN_STATE_OFF, SCREEN_STATE_ON, SCROLLBAR_POSITION_DEFAULT, SCROLLBAR_POSITION_LEFT, SCROLLBAR_POSITION_RIGHT, SCROLLBARS_INSIDE_INSET, SCROLLBARS_INSIDE_OVERLAY, SCROLLBARS_OUTSIDE_INSET, SCROLLBARS_OUTSIDE_OVERLAY, SELECTED_STATE_SET, SELECTED_WINDOW_FOCUSED_STATE_SET, SOUND_EFFECTS_ENABLED, STATUS_BAR_HIDDEN, STATUS_BAR_VISIBLE, SYSTEM_UI_FLAG_FULLSCREEN, SYSTEM_UI_FLAG_HIDE_NAVIGATION, SYSTEM_UI_FLAG_IMMERSIVE, SYSTEM_UI_FLAG_IMMERSIVE_STICKY, SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN, SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION, SYSTEM_UI_FLAG_LAYOUT_STABLE, SYSTEM_UI_FLAG_LOW_PROFILE, SYSTEM_UI_FLAG_VISIBLE, SYSTEM_UI_LAYOUT_FLAGS, TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_GRAVITY, TEXT_ALIGNMENT_INHERIT, TEXT_ALIGNMENT_TEXT_END, TEXT_ALIGNMENT_TEXT_START, TEXT_ALIGNMENT_VIEW_END, TEXT_ALIGNMENT_VIEW_START, TEXT_DIRECTION_ANY_RTL, TEXT_DIRECTION_FIRST_STRONG, TEXT_DIRECTION_INHERIT, TEXT_DIRECTION_LOCALE, TEXT_DIRECTION_LTR, TEXT_DIRECTION_RTL, TRANSLATION_X, TRANSLATION_Y, VIEW_LOG_TAG, VISIBLE, WINDOW_FOCUSED_STATE_SET, X, Y| Constructor and Description |
|---|
DynamicListView(Context context) |
DynamicListView(Context context,
AttributeSet attrs) |
DynamicListView(Context context,
AttributeSet attrs,
int defStyle) |
| Modifier and Type | Method and Description |
|---|---|
int |
computeVerticalScrollExtent() |
int |
computeVerticalScrollOffset() |
int |
computeVerticalScrollRange() |
void |
disableDragAndDrop()
Disables the drag and drop functionality.
|
void |
disableSwipeToDismiss()
Disables any swipe to dismiss functionality set by either
enableSwipeToDismiss(com.nhaarman.listviewanimations.itemmanipulation.swipedismiss.OnDismissCallback),
enableSwipeUndo(com.nhaarman.listviewanimations.itemmanipulation.swipedismiss.undo.UndoCallback) or enableSimpleSwipeUndo(). |
void |
dismiss(int position)
Dismisses the
View corresponding to given position. |
protected void |
dispatchDraw(Canvas canvas) |
boolean |
dispatchTouchEvent(MotionEvent ev) |
void |
enableDragAndDrop()
Enables the drag and drop functionality for this
DynamicListView. |
void |
enableSimpleSwipeUndo()
Enables swipe to dismiss with contextual undo for this
DynamicListView. |
void |
enableSwipeToDismiss(OnDismissCallback onDismissCallback)
Enables swipe to dismiss functionality for this
DynamicListView. |
void |
enableSwipeUndo(UndoCallback undoCallback)
Enables swipe to dismiss with contextual undo for this
DynamicListView. |
void |
fling(int position)
Flings the
View corresponding to given position out of sight. |
void |
insert(int index,
Object... items)
Inserts items, starting at given index.
|
void |
insert(int index,
Object item)
Inserts an item at given index.
|
<T> void |
insert(Iterable<Pair<Integer,T>> indexItemPairs)
Insert items at given indexes.
|
<T> void |
insert(Pair<Integer,T>... indexItemPairs)
Inserts items at given indexes.
|
boolean |
onTouchEvent(MotionEvent ev) |
void |
setAdapter(ListAdapter adapter)
Sets the
ListAdapter for this DynamicListView. |
void |
setDismissableManager(DismissableManager dismissableManager)
Sets the
DismissableManager to specify which views can or cannot be swiped. |
void |
setDraggableManager(DraggableManager draggableManager)
Sets the
DraggableManager to be used
for determining whether an item should be dragged when the user issues a down MotionEvent. |
void |
setMinimumAlpha(float minimumAlpha)
Sets the minimum value of the alpha property swiping Views should have.
|
void |
setOnItemMovedListener(OnItemMovedListener onItemMovedListener)
Sets the
OnItemMovedListener
that is notified when user has dropped a dragging item. |
void |
setOnScrollListener(AbsListView.OnScrollListener onScrollListener) |
void |
setOnTouchListener(View.OnTouchListener onTouchListener) |
void |
setScrollSpeed(float speed)
Sets the scroll speed when dragging an item.
|
void |
setSwipeTouchChild(int childResId)
Sets the resource id of a child view that should be touched to engage swipe.
|
void |
startDragging(int position)
Starts dragging the item at given position.
|
void |
undo(View view)
Performs the undo animation and restores the original state for given
View. |
addFooterView, addFooterView, addHeaderView, addHeaderView, areFooterDividersEnabled, areHeaderDividersEnabled, canAnimate, dispatchKeyEvent, drawChild, findViewTraversal, findViewWithTagTraversal, getAdapter, getCheckItemIds, getDivider, getDividerHeight, getFooterViewsCount, getHeaderViewsCount, getItemsCanFocus, getMaxScrollAmount, getOverscrollFooter, getOverscrollHeader, isOpaque, layoutChildren, onFinishInflate, onFocusChanged, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, onInitializeAccessibilityNodeInfoForItem, onKeyDown, onKeyMultiple, onKeyUp, onMeasure, onSizeChanged, removeFooterView, removeHeaderView, requestChildRectangleOnScreen, setCacheColorHint, setDivider, setDividerHeight, setFooterDividersEnabled, setHeaderDividersEnabled, setItemsCanFocus, setOverscrollFooter, setOverscrollHeader, setRemoteViewsAdapter, setSelection, setSelectionAfterHeaderView, setSelectionFromTop, smoothScrollByOffset, smoothScrollToPositionaddTouchables, afterTextChanged, beforeTextChanged, canScrollList, checkInputConnectionProxy, checkLayoutParams, clearChoices, clearTextFilter, deferNotifyDataSetChanged, dispatchSetPressed, draw, drawableStateChanged, generateDefaultLayoutParams, generateLayoutParams, generateLayoutParams, getBottomFadingEdgeStrength, getBottomPaddingOffset, getCacheColorHint, getCheckedItemCount, getCheckedItemIds, getCheckedItemPosition, getCheckedItemPositions, getChoiceMode, getContextMenuInfo, getFocusedRect, getLeftPaddingOffset, getListPaddingBottom, getListPaddingLeft, getListPaddingRight, getListPaddingTop, getRightPaddingOffset, getSelectedView, getSelector, getSolidColor, getTextFilter, getTopFadingEdgeStrength, getTopPaddingOffset, getTranscriptMode, getVerticalScrollbarWidth, handleDataChanged, hasTextFilter, invalidateViews, isFastScrollAlwaysVisible, isFastScrollEnabled, isInFilterMode, isItemChecked, isPaddingOffsetRequired, isScrollingCacheEnabled, isSmoothScrollbarEnabled, isStackFromBottom, isTextFilterEnabled, jumpDrawablesToCurrentState, onAttachedToWindow, onCancelPendingInputEvents, onCreateDrawableState, onCreateInputConnection, onDetachedFromWindow, onDisplayHint, onFilterComplete, onGenericMotionEvent, onGlobalLayout, onInterceptHoverEvent, onInterceptTouchEvent, onLayout, onOverScrolled, onRemoteAdapterConnected, onRemoteAdapterDisconnected, onRestoreInstanceState, onRtlPropertiesChanged, onSaveInstanceState, onTextChanged, onTouchModeChanged, onWindowFocusChanged, performAccessibilityAction, performItemClick, pointToPosition, pointToRowId, reclaimViews, requestDisallowInterceptTouchEvent, requestLayout, scrollListBy, sendAccessibilityEvent, setChoiceMode, setDrawSelectorOnTop, setFastScrollAlwaysVisible, setFastScrollEnabled, setFilterText, setFriction, setItemChecked, setMultiChoiceModeListener, setOverScrollMode, setRecyclerListener, setScrollBarStyle, setScrollIndicators, setScrollingCacheEnabled, setSelector, setSelector, setSmoothScrollbarEnabled, setStackFromBottom, setTextFilterEnabled, setTranscriptMode, setVelocityScale, setVerticalScrollbarPosition, showContextMenuForChild, smoothScrollBy, smoothScrollToPosition, smoothScrollToPositionFromTop, smoothScrollToPositionFromTop, verifyDrawableaddView, addView, addView, addView, dispatchPopulateAccessibilityEvent, dispatchRestoreInstanceState, dispatchSaveInstanceState, getCount, getEmptyView, getFirstVisiblePosition, getItemAtPosition, getItemIdAtPosition, getLastVisiblePosition, getOnItemClickListener, getOnItemLongClickListener, getOnItemSelectedListener, getPositionForView, getSelectedItem, getSelectedItemId, getSelectedItemPosition, onRequestSendAccessibilityEvent, removeAllViews, removeView, removeViewAt, setEmptyView, setFocusable, setFocusableInTouchMode, setOnClickListener, setOnItemClickListener, setOnItemLongClickListener, setOnItemSelectedListeneraddChildrenForAccessibility, addFocusables, addStatesFromChildren, addView, addViewInLayout, addViewInLayout, attachLayoutAnimationParameters, attachViewToParent, bringChildToFront, childDrawableStateChanged, childHasTransientStateChanged, cleanupLayoutState, clearChildFocus, clearDisappearingChildren, clearFocus, debug, detachAllViewsFromParent, detachViewFromParent, detachViewFromParent, detachViewsFromParent, dispatchApplyWindowInsets, dispatchConfigurationChanged, dispatchDisplayHint, dispatchDragEvent, dispatchFreezeSelfOnly, dispatchGenericFocusedEvent, dispatchGenericPointerEvent, dispatchHoverEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchSetActivated, dispatchSetSelected, dispatchSystemUiVisibilityChanged, dispatchThawSelfOnly, dispatchTrackballEvent, dispatchUnhandledMove, dispatchVisibilityChanged, dispatchWindowFocusChanged, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, endViewTransition, findFocus, findViewsWithText, focusableViewAvailable, focusSearch, gatherTransparentRegion, getChildAt, getChildCount, getChildDrawingOrder, getChildMeasureSpec, getChildStaticTransformation, getChildVisibleRect, getClipChildren, getDescendantFocusability, getFocusedChild, getLayoutAnimation, getLayoutAnimationListener, getLayoutMode, getLayoutTransition, getOverlay, getPersistentDrawingCache, hasFocus, hasFocusable, hasTransientState, indexOfChild, invalidateChild, invalidateChildInParent, isAlwaysDrawnWithCacheEnabled, isAnimationCacheEnabled, isChildrenDrawingOrderEnabled, isChildrenDrawnWithCacheEnabled, isMotionEventSplittingEnabled, layout, measureChild, measureChildren, measureChildWithMargins, notifySubtreeAccessibilityStateChanged, offsetDescendantRectToMyCoords, offsetRectIntoDescendantCoords, onAnimationEnd, onAnimationStart, onRequestFocusInDescendants, recomputeViewAttributes, removeAllViewsInLayout, removeDetachedView, removeViewInLayout, removeViews, removeViewsInLayout, requestChildFocus, requestFocus, requestSendAccessibilityEvent, requestTransparentRegion, scheduleLayoutAnimation, setAddStatesFromChildren, setAlwaysDrawnWithCacheEnabled, setAnimationCacheEnabled, setChildrenDrawingCacheEnabled, setChildrenDrawingOrderEnabled, setChildrenDrawnWithCacheEnabled, setClipChildren, setClipToPadding, setDescendantFocusability, setLayoutAnimation, setLayoutAnimationListener, setLayoutMode, setLayoutTransition, setMotionEventSplittingEnabled, setOnHierarchyChangeListener, setPersistentDrawingCache, setStaticTransformationsEnabled, shouldDelayChildPressedState, startActionModeForChild, startLayoutAnimation, startViewTransition, updateViewLayoutaddFocusables, addOnAttachStateChangeListener, addOnLayoutChangeListener, animate, announceForAccessibility, awakenScrollBars, awakenScrollBars, awakenScrollBars, bringToFront, buildDrawingCache, buildDrawingCache, buildLayer, callOnClick, cancelLongPress, cancelPendingInputEvents, canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, canScrollHorizontally, canScrollVertically, clearAnimation, combineMeasuredStates, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeHorizontalScrollRange, computeScroll, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchGenericMotionEvent, findViewById, findViewWithTag, fitSystemWindows, focusSearch, forceLayout, generateViewId, getAccessibilityLiveRegion, getAccessibilityNodeProvider, getAlpha, getAnimation, getApplicationWindowToken, getBackground, getBaseline, getBottom, getCameraDistance, getClipBounds, getContentDescription, getContext, getDefaultSize, getDisplay, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusables, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarHeight, getId, getImportantForAccessibility, getKeepScreenOn, getKeyDispatcherState, getLabelFor, getLayerType, getLayoutDirection, getLayoutParams, getLeft, getLeftFadingEdgeStrength, getLocalVisibleRect, getLocationInWindow, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOverScrollMode, getPaddingBottom, getPaddingEnd, getPaddingLeft, getPaddingRight, getPaddingStart, getPaddingTop, getParent, getParentForAccessibility, getPivotX, getPivotY, getResources, getRight, getRightFadingEdgeStrength, getRootView, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, getScrollX, getScrollY, getSuggestedMinimumHeight, getSuggestedMinimumWidth, getSystemUiVisibility, getTag, getTag, getTextAlignment, getTextDirection, getTop, getTouchables, getTouchDelegate, getTranslationX, getTranslationY, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getViewTreeObserver, getVisibility, getWidth, getWindowAttachCount, getWindowId, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, hasOnClickListeners, hasOverlappingRendering, hasWindowFocus, inflate, initializeFadingEdge, initializeScrollbars, invalidate, invalidate, invalidate, invalidateDrawable, isActivated, isAttachedToWindow, isClickable, isDirty, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isHapticFeedbackEnabled, isHardwareAccelerated, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isInEditMode, isInLayout, isInTouchMode, isLaidOut, isLayoutDirectionResolved, isLayoutRequested, isLongClickable, isPaddingRelative, isPressed, isSaveEnabled, isSaveFromParentEnabled, isScrollbarFadingEnabled, isScrollContainer, isSelected, isShown, isSoundEffectsEnabled, isTextAlignmentResolved, isTextDirectionResolved, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, measure, mergeDrawableStates, offsetLeftAndRight, offsetTopAndBottom, onApplyWindowInsets, onCheckIsTextEditor, onConfigurationChanged, onCreateContextMenu, onDragEvent, onDraw, onDrawScrollBars, onFilterTouchEventForSecurity, onFinishTemporaryDetach, onHoverChanged, onHoverEvent, onKeyLongPress, onKeyPreIme, onKeyShortcut, onPopulateAccessibilityEvent, onScreenStateChanged, onScrollChanged, onSetAlpha, onStartTemporaryDetach, onTrackballEvent, onVisibilityChanged, onWindowSystemUiVisibilityChanged, onWindowVisibilityChanged, overScrollBy, performClick, performHapticFeedback, performHapticFeedback, performLongClick, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, postInvalidateOnAnimation, postInvalidateOnAnimation, postOnAnimation, postOnAnimationDelayed, refreshDrawableState, removeCallbacks, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, requestApplyInsets, requestFitSystemWindows, requestFocus, requestFocus, requestFocusFromTouch, requestRectangleOnScreen, requestRectangleOnScreen, resolveSize, resolveSizeAndState, restoreHierarchyState, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEventUnchecked, setAccessibilityDelegate, setAccessibilityLiveRegion, setActivated, setAlpha, setAnimation, setBackground, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setBottom, setCameraDistance, setClickable, setClipBounds, setContentDescription, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setEnabled, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHovered, setId, setImportantForAccessibility, setKeepScreenOn, setLabelFor, setLayerPaint, setLayerType, setLayoutDirection, setLayoutParams, setLeft, setLongClickable, setMeasuredDimension, setMinimumHeight, setMinimumWidth, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnApplyWindowInsetsListener, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnLongClickListener, setOnSystemUiVisibilityChangeListener, setPadding, setPaddingRelative, setPivotX, setPivotY, setPressed, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollbarFadingEnabled, setScrollBarSize, setScrollContainer, setScrollX, setScrollY, setSelected, setSoundEffectsEnabled, setSystemUiVisibility, setTag, setTag, setTextAlignment, setTextDirection, setTop, setTouchDelegate, setTranslationX, setTranslationY, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVisibility, setWillNotCacheDrawing, setWillNotDraw, setX, setY, showContextMenu, startActionMode, startAnimation, startDrag, toString, unscheduleDrawable, unscheduleDrawable, willNotCacheDrawing, willNotDrawclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcanResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, createContextMenu, getLayoutDirection, getParent, getParentForAccessibility, getTextAlignment, getTextDirection, isLayoutDirectionResolved, isLayoutRequested, isTextAlignmentResolved, isTextDirectionResolved, requestFitSystemWindowspublic DynamicListView(Context context)
public DynamicListView(Context context, AttributeSet attrs)
public DynamicListView(Context context, AttributeSet attrs, int defStyle)
public void setOnTouchListener(View.OnTouchListener onTouchListener)
setOnTouchListener in class Viewpublic void setOnScrollListener(AbsListView.OnScrollListener onScrollListener)
setOnScrollListener in class AbsListViewpublic void enableDragAndDrop()
DynamicListView.
NOTE: This method can only be called on devices running ICS (14) and above, otherwise an exception will be thrown.UnsupportedOperationException - if the device uses an older API than 14.public void disableDragAndDrop()
public void enableSwipeToDismiss(OnDismissCallback onDismissCallback)
DynamicListView.onDismissCallback - the OnDismissCallback
that is notified of dismissals.public void enableSwipeUndo(UndoCallback undoCallback)
DynamicListView.undoCallback - the UndoCallback
that is used.public void enableSimpleSwipeUndo()
DynamicListView.
This method requires that a SwipeUndoAdapter has been set.
It is allowed to have the SwipeUndoAdapter wrapped in a BaseAdapterDecorator.IllegalStateException - if the adapter that was set does not extend SwipeUndoAdapter.public void disableSwipeToDismiss()
enableSwipeToDismiss(com.nhaarman.listviewanimations.itemmanipulation.swipedismiss.OnDismissCallback),
enableSwipeUndo(com.nhaarman.listviewanimations.itemmanipulation.swipedismiss.undo.UndoCallback) or enableSimpleSwipeUndo().public void setAdapter(ListAdapter adapter)
ListAdapter for this DynamicListView.
If the drag and drop functionality is or will be enabled, the adapter should have stable ids,
and should implement Swappable.setAdapter in class ListViewadapter - the adapter.IllegalStateException - if the drag and drop functionality is enabled
and the adapter does not have stable ids.IllegalArgumentException - if the drag and drop functionality is enabled
and the adapter does not implement Swappable.public boolean dispatchTouchEvent(MotionEvent ev)
dispatchTouchEvent in class ViewGrouppublic boolean onTouchEvent(MotionEvent ev)
onTouchEvent in class AbsListViewprotected void dispatchDraw(Canvas canvas)
dispatchDraw in class ListViewpublic int computeVerticalScrollOffset()
computeVerticalScrollOffset in class AbsListViewpublic int computeVerticalScrollExtent()
computeVerticalScrollExtent in class AbsListViewpublic int computeVerticalScrollRange()
computeVerticalScrollRange in class AbsListViewpublic void insert(int index,
Object item)
Insertable.add(int, Object) of the root BaseAdapter.index - the index the new item should be inserted at.item - the item to insert.IllegalStateException - if the adapter that was set does not implement Insertable.public void insert(int index,
Object... items)
Insertable.add(int, Object) of the root BaseAdapter.index - the starting index the new items should be inserted at.items - the items to insert.IllegalStateException - if the adapter that was set does not implement Insertable.public <T> void insert(Pair<Integer,T>... indexItemPairs)
Insertable.add(int, Object) of the root BaseAdapter.indexItemPairs - the index-item pairs to insert. The first argument of the Pair is the index, the second argument is the item.IllegalStateException - if the adapter that was set does not implement Insertable.public <T> void insert(Iterable<Pair<Integer,T>> indexItemPairs)
Insertable.add(int, Object) of the root BaseAdapter.indexItemPairs - the index-item pairs to insert. The first argument of the Pair is the index, the second argument is the item.IllegalStateException - if the adapter that was set does not implement Insertable.public void setDraggableManager(DraggableManager draggableManager)
DraggableManager to be used
for determining whether an item should be dragged when the user issues a down MotionEvent.
This method does nothing if the drag and drop functionality is not enabled.public void setOnItemMovedListener(OnItemMovedListener onItemMovedListener)
OnItemMovedListener
that is notified when user has dropped a dragging item.
This method does nothing if the drag and drop functionality is not enabled.public void startDragging(int position)
DynamicListView.
This method does nothing if the drag and drop functionality is not enabled.position - the position of the item in the adapter to start dragging. Be sure to subtract any header views.IllegalStateException - if the user is not touching this DynamicListView,
or if there is no adapter set.public void setScrollSpeed(float speed)
1.0f.
This method does nothing if the drag and drop functionality is not enabled.speed - <1.0f to slow down scrolling, >1.0f to speed up scrolling.public void setDismissableManager(DismissableManager dismissableManager)
DismissableManager to specify which views can or cannot be swiped.
This method does nothing if no swipe functionality is enabled.dismissableManager - null for no restrictions.public void fling(int position)
View corresponding to given position out of sight.
Calling this method has the same effect as manually swiping an item off the screen.
This method does nothing if no swipe functionality is enabled.position - the position of the item in the ListAdapter. Must be visible.public void setSwipeTouchChild(int childResId)
childResId - The resource id of the list items' child that the user should touch to be able to swipe the list items.public void setMinimumAlpha(float minimumAlpha)
minimumAlpha - the alpha value between 0.0f and 1.0f.public void dismiss(int position)
View corresponding to given position.
Calling this method has the same effect as manually swiping an item off the screen.
This method does nothing if no swipe functionality is enabled.
It will however throw an exception if an incompatible swipe functionality is enabled.position - the position of the item in the ListAdapter. Must be visible.IllegalStateException - if the SwipeTouchListener
that is enabled does not extend SwipeDismissTouchListener.public void undo(View view)
View.
This method does nothing if no swipe functionality is enabled.
It will however throw an exception if an incompatible swipe functionality is enabled.view - the parent View which contains both primary and undo Views.IllegalStateException - if the SwipeTouchListener
that is enabled doe snot extend SwipeUndoTouchListener.