-
- All Implemented Interfaces:
-
android.graphics.drawable.Drawable.Callback,android.view.KeyEvent.Callback,android.view.ViewManager,android.view.ViewParent,android.view.accessibility.AccessibilityEventSource,androidx.core.view.NestedScrollingChild,androidx.core.view.NestedScrollingChild2,androidx.core.view.NestedScrollingChild3,androidx.core.view.ScrollingView
public class DragDropSwipeRecyclerView extends ScrollAwareRecyclerView
Extension of RecyclerView that detects swipe, drag & drop and scrolling.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumDragDropSwipeRecyclerView.ListOrientationIndicates the orientation of a recycler view of type DragDropSwipeRecyclerView.
public classDragDropSwipeRecyclerView.Companion
-
Field Summary
-
Constructor Summary
Constructors Constructor Description DragDropSwipeRecyclerView(Context context, AttributeSet attrs, Integer defStyleAttr)DragDropSwipeRecyclerView(Context context, AttributeSet attrs)DragDropSwipeRecyclerView(Context context)
-
Method Summary
Modifier and Type Method Description final IntegergetItemLayoutId()The ID of the item layout that will be used to populate each list item. final UnitsetItemLayoutId(Integer itemLayoutId)The ID of the item layout that will be used to populate each list item. final IntegergetDividerDrawableId()The ID of the drawable that will be displayed as a divider between list items. final UnitsetDividerDrawableId(Integer dividerDrawableId)final IntegergetBehindSwipedItemIconDrawableId()The ID of the drawable of the icon to display behind an item that is being swiped. final UnitsetBehindSwipedItemIconDrawableId(Integer behindSwipedItemIconDrawableId)final IntegergetBehindSwipedItemIconSecondaryDrawableId()The ID of the drawable of the secondary icon to display behind an item that is being swiped. final UnitsetBehindSwipedItemIconSecondaryDrawableId(Integer behindSwipedItemIconSecondaryDrawableId)final FloatgetBehindSwipedItemIconMargin()The distance between the icon displayed behind an item that is being swiped and the side of the item from which the swiping started. final UnitsetBehindSwipedItemIconMargin(Float behindSwipedItemIconMargin)The distance between the icon displayed behind an item that is being swiped and the side of the item from which the swiping started. final BooleangetBehindSwipedItemCenterIcon()Determines whether the icon displayed behind an item that is being swiped should be centered. final UnitsetBehindSwipedItemCenterIcon(Boolean behindSwipedItemCenterIcon)Determines whether the icon displayed behind an item that is being swiped should be centered. final IntegergetBehindSwipedItemBackgroundColor()The background color to be displayed behind an item that is being swiped. final UnitsetBehindSwipedItemBackgroundColor(Integer behindSwipedItemBackgroundColor)The background color to be displayed behind an item that is being swiped. final IntegergetBehindSwipedItemBackgroundSecondaryColor()The secondary background color to be displayed behind an item that is being swiped. final UnitsetBehindSwipedItemBackgroundSecondaryColor(Integer behindSwipedItemBackgroundSecondaryColor)The secondary background color to be displayed behind an item that is being swiped. final IntegergetBehindSwipedItemLayoutId()The ID of the custom layout to be displayed behind an item that is being swiped. final UnitsetBehindSwipedItemLayoutId(Integer behindSwipedItemLayoutId)final IntegergetBehindSwipedItemSecondaryLayoutId()The ID of the secondary custom layout to be displayed behind an item that is being swiped. final UnitsetBehindSwipedItemSecondaryLayoutId(Integer behindSwipedItemSecondaryLayoutId)final BooleangetReduceItemAlphaOnSwiping()Determines whether the item that is being swiped should be make more transparent the further it gets from its original position. final UnitsetReduceItemAlphaOnSwiping(Boolean reduceItemAlphaOnSwiping)Determines whether the item that is being swiped should be make more transparent the further it gets from its original position. final BooleangetLongPressToStartDragging()Determines whether the start of the dragging action will be triggered by a long press or by a standard one. final UnitsetLongPressToStartDragging(Boolean longPressToStartDragging)Determines whether the start of the dragging action will be triggered by a long press or by a standard one. final IntegergetNumOfColumnsPerRowInGridList()The number of columns of each row of the grid-arranged, vertically-scrollable list. final UnitsetNumOfColumnsPerRowInGridList(Integer numOfColumnsPerRowInGridList)The number of columns of each row of the grid-arranged, vertically-scrollable list. final IntegergetNumOfRowsPerColumnInGridList()The number of rows of each column of the grid-arranged, horizontally-scrollable list. final UnitsetNumOfRowsPerColumnInGridList(Integer numOfRowsPerColumnInGridList)The number of rows of each column of the grid-arranged, horizontally-scrollable list. final OnItemDragListener<?>getDragListener()Listener for dragging events. final UnitsetDragListener(OnItemDragListener<?> dragListener)final OnItemSwipeListener<?>getSwipeListener()Listener for swiping events. final UnitsetSwipeListener(OnItemSwipeListener<?> swipeListener)final DragDropSwipeAdapter<?, ?>getAdapter()Adapter of the recycler view. final UnitsetAdapter(DragDropSwipeAdapter<?, ?> adapter)final DragDropSwipeRecyclerView.ListOrientationgetOrientation()The orientation of the recycler view. final UnitsetOrientation(DragDropSwipeRecyclerView.ListOrientation orientation)final OnListScrollListenergetScrollListener()Listener for the scrolling events. final UnitsetScrollListener(OnListScrollListener scrollListener)Listener for the scrolling events. UnitsetAdapter(RecyclerView.Adapter<?> adapter)Sets the adapter of the recycler view. UnitsetLayoutManager(RecyclerView.LayoutManager layoutManager)Sets the layout manager of the recycler view, which is mandatory to make it work. final UnitdisableDragDirection(DragDropSwipeRecyclerView.ListOrientation.DirectionFlag dragDirectionToDisable)Disables the specified direction for all dragging actions on this list. final UnitdisableSwipeDirection(DragDropSwipeRecyclerView.ListOrientation.DirectionFlag swipeDirectionToDisable)Disables the specified direction for all swiping actions on this list. final UnitenableDragDirection(DragDropSwipeRecyclerView.ListOrientation.DirectionFlag dragDirectionToAllow)Allows the specified direction to be used for dragging actions (note that the specified direction will only trigger a dragging action if the current list orientation allows it). final UnitenableSwipeDirection(DragDropSwipeRecyclerView.ListOrientation.DirectionFlag swipeDirectionToAllow)Allows the specified direction to be used for swiping actions (note that the specified direction will only trigger a swiping action if the current list orientation allows it). -
Methods inherited from class com.ernestoyaquello.dragdropswiperecyclerview.DragDropSwipeRecyclerView
addOnScrollListener -
Methods inherited from class android.view.ViewGroup
addFocusables, addOnAttachStateChangeListener, addOnLayoutChangeListener, addOnUnhandledKeyEventListener, animate, announceForAccessibility, autofill, autofill, awakenScrollBars, awakenScrollBars, awakenScrollBars, bringToFront, buildDrawingCache, buildDrawingCache, buildLayer, callOnClick, canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, canScrollHorizontally, canScrollVertically, cancelDragAndDrop, cancelLongPress, cancelPendingInputEvents, checkInputConnectionProxy, clearAnimation, clearViewTranslationCallback, computeScroll, computeSystemWindowInsets, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchGenericMotionEvent, dispatchNestedPrePerformAccessibilityAction, drawableHotspotChanged, findOnBackInvokedDispatcher, findViewById, findViewWithTag, fitSystemWindows, focusSearch, forceHasOverlappingRendering, forceLayout, generateDisplayHash, getAccessibilityDelegate, getAccessibilityLiveRegion, getAccessibilityNodeProvider, getAccessibilityPaneTitle, getAccessibilityTraversalAfter, getAccessibilityTraversalBefore, getAllowedHandwritingDelegatePackageName, getAllowedHandwritingDelegatorPackageName, getAlpha, getAnimation, getAnimationMatrix, getApplicationWindowToken, getAttributeResolutionStack, getAttributeSourceResourceMap, getAutofillHints, getAutofillId, getAutofillType, getAutofillValue, getBackground, getBackgroundTintBlendMode, getBackgroundTintList, getBackgroundTintMode, getBottom, getBottomFadingEdgeStrength, getBottomPaddingOffset, getCameraDistance, getClipBounds, getClipBounds, getClipToOutline, getContentCaptureSession, getContentDescription, getContext, getContextMenuInfo, getDefaultFocusHighlightEnabled, getDisplay, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getElevation, getExplicitStyle, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusable, getFocusables, getFocusedRect, getForeground, getForegroundGravity, getForegroundTintBlendMode, getForegroundTintList, getForegroundTintMode, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHandwritingBoundsOffsetBottom, getHandwritingBoundsOffsetLeft, getHandwritingBoundsOffsetRight, getHandwritingBoundsOffsetTop, getHandwritingDelegatorCallback, getHasOverlappingRendering, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarHeight, getHorizontalScrollbarThumbDrawable, getHorizontalScrollbarTrackDrawable, getId, getImportantForAccessibility, getImportantForAutofill, getImportantForContentCapture, getKeepScreenOn, getKeyDispatcherState, getLabelFor, getLayerType, getLayoutDirection, getLayoutParams, getLeft, getLeftFadingEdgeStrength, getLeftPaddingOffset, getLocalVisibleRect, getLocationInSurface, getLocationInWindow, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextClusterForwardId, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOutlineAmbientShadowColor, getOutlineProvider, getOutlineSpotShadowColor, getOverScrollMode, getPaddingBottom, getPaddingEnd, getPaddingLeft, getPaddingRight, getPaddingStart, getPaddingTop, getParent, getParentForAccessibility, getPivotX, getPivotY, getPointerIcon, getPreferKeepClearRects, getReceiveContentMimeTypes, getResources, getRevealOnFocusHint, getRight, getRightFadingEdgeStrength, getRightPaddingOffset, getRootSurfaceControl, getRootView, getRootWindowInsets, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, getScrollCaptureHint, getScrollIndicators, getScrollX, getScrollY, getSolidColor, getSourceLayoutResId, getStateDescription, getStateListAnimator, getSuggestedMinimumHeight, getSuggestedMinimumWidth, getSystemGestureExclusionRects, getSystemUiVisibility, getTag, getTag, getTextAlignment, getTextDirection, getTooltipText, getTop, getTopFadingEdgeStrength, getTopPaddingOffset, getTouchDelegate, getTouchables, getTransitionAlpha, getTransitionName, getTranslationX, getTranslationY, getTranslationZ, getUniqueDrawingId, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarThumbDrawable, getVerticalScrollbarTrackDrawable, getVerticalScrollbarWidth, getViewTranslationResponse, getViewTreeObserver, getVisibility, getWidth, getWindowAttachCount, getWindowId, getWindowInsetsController, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, getZ, hasExplicitFocusable, hasFocusable, hasOnClickListeners, hasOnLongClickListeners, hasOverlappingRendering, hasPointerCapture, hasWindowFocus, invalidate, invalidate, invalidate, invalidateDrawable, invalidateOutline, isAccessibilityDataSensitive, isAccessibilityFocused, isAccessibilityHeading, isActivated, isAutoHandwritingEnabled, isClickable, isContextClickable, isCredential, isDirty, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isFocusedByDefault, isForceDarkAllowed, isHandwritingDelegate, isHapticFeedbackEnabled, isHardwareAccelerated, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isImportantForAccessibility, isImportantForAutofill, isImportantForContentCapture, isInEditMode, isInLayout, isInTouchMode, isKeyboardNavigationCluster, isLaidOut, isLayoutDirectionResolved, isLayoutRequested, isLongClickable, isOpaque, isPaddingOffsetRequired, isPaddingRelative, isPivotSet, isPreferKeepClear, isPressed, isSaveEnabled, isSaveFromParentEnabled, isScreenReaderFocusable, isScrollContainer, isScrollbarFadingEnabled, isSelected, isShowingLayoutBounds, isShown, isSoundEffectsEnabled, isTemporarilyDetached, isTextAlignmentResolved, isTextDirectionResolved, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, isVisibleToUserForAutofill, keyboardNavigationClusterSearch, measure, offsetLeftAndRight, offsetTopAndBottom, onAnimationEnd, onAnimationStart, onApplyWindowInsets, onCancelPendingInputEvents, onCapturedPointerEvent, onCheckIsTextEditor, onConfigurationChanged, onCreateContextMenu, onCreateInputConnection, onCreateViewTranslationRequest, onCreateVirtualViewTranslationRequests, onDisplayHint, onDragEvent, onDrawForeground, onDrawScrollBars, onFilterTouchEventForSecurity, onFinishInflate, onFinishTemporaryDetach, onFocusChanged, onHoverChanged, onHoverEvent, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onOverScrolled, onPointerCaptureChange, onPopulateAccessibilityEvent, onProvideAutofillStructure, onProvideAutofillVirtualStructure, onProvideContentCaptureStructure, onProvideStructure, onProvideVirtualStructure, onReceiveContent, onRtlPropertiesChanged, onScreenStateChanged, onScrollCaptureSearch, onScrollChanged, onSetAlpha, onStartTemporaryDetach, onTrackballEvent, onViewTranslationResponse, onVirtualViewTranslationResponses, onVisibilityAggregated, onVisibilityChanged, onWindowFocusChanged, onWindowSystemUiVisibilityChanged, onWindowVisibilityChanged, overScrollBy, performAccessibilityAction, performClick, performContextClick, performContextClick, performHapticFeedback, performHapticFeedback, performLongClick, performLongClick, performReceiveContent, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, postInvalidateOnAnimation, postInvalidateOnAnimation, postOnAnimation, postOnAnimationDelayed, refreshDrawableState, releasePointerCapture, removeCallbacks, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, removeOnUnhandledKeyEventListener, requestApplyInsets, requestFitSystemWindows, requestFocus, requestFocus, requestFocusFromTouch, requestPointerCapture, requestRectangleOnScreen, requestRectangleOnScreen, requestUnbufferedDispatch, requestUnbufferedDispatch, requireViewById, resetPivot, restoreHierarchyState, saveAttributeDataForStyleable, saveHierarchyState, scheduleDrawable, sendAccessibilityEvent, setAccessibilityDataSensitive, setAccessibilityDelegate, setAccessibilityHeading, setAccessibilityLiveRegion, setAccessibilityPaneTitle, setAccessibilityTraversalAfter, setAccessibilityTraversalBefore, setActivated, setAllowClickWhenDisabled, setAllowedHandwritingDelegatePackage, setAllowedHandwritingDelegatorPackage, setAlpha, setAnimation, setAnimationMatrix, setAutoHandwritingEnabled, setAutofillHints, setAutofillId, setBackground, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setBackgroundTintBlendMode, setBackgroundTintList, setBackgroundTintMode, setBottom, setCameraDistance, setClickable, setClipBounds, setClipToOutline, setContentCaptureSession, setContentDescription, setContextClickable, setDefaultFocusHighlightEnabled, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setElevation, setEnabled, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setFocusable, setFocusable, setFocusableInTouchMode, setFocusedByDefault, setForceDarkAllowed, setForeground, setForegroundGravity, setForegroundTintBlendMode, setForegroundTintList, setForegroundTintMode, setHandwritingBoundsOffsets, setHandwritingDelegatorCallback, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHorizontalScrollbarThumbDrawable, setHorizontalScrollbarTrackDrawable, setHovered, setId, setImportantForAccessibility, setImportantForAutofill, setImportantForContentCapture, setIsCredential, setIsHandwritingDelegate, setKeepScreenOn, setKeyboardNavigationCluster, setLabelFor, setLayerPaint, setLayerType, setLayoutDirection, setLayoutParams, setLeft, setLeftTopRightBottom, setLongClickable, setMeasuredDimension, setMinimumHeight, setMinimumWidth, setNextClusterForwardId, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnApplyWindowInsetsListener, setOnCapturedPointerListener, setOnClickListener, setOnContextClickListener, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnLongClickListener, setOnReceiveContentListener, setOnScrollChangeListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setOutlineAmbientShadowColor, setOutlineProvider, setOutlineSpotShadowColor, setOverScrollMode, setPadding, setPaddingRelative, setPivotX, setPivotY, setPointerIcon, setPreferKeepClear, setPreferKeepClearRects, setPressed, setRenderEffect, setRevealOnFocusHint, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScreenReaderFocusable, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollBarSize, setScrollBarStyle, setScrollCaptureCallback, setScrollCaptureHint, setScrollContainer, setScrollIndicators, setScrollIndicators, setScrollX, setScrollY, setScrollbarFadingEnabled, setSelected, setSoundEffectsEnabled, setStateDescription, setStateListAnimator, setSystemGestureExclusionRects, setSystemUiVisibility, setTag, setTag, setTextAlignment, setTextDirection, setTooltipText, setTop, setTouchDelegate, setTransitionAlpha, setTransitionName, setTransitionVisibility, setTranslationX, setTranslationY, setTranslationZ, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setVerticalScrollbarThumbDrawable, setVerticalScrollbarTrackDrawable, setViewTranslationCallback, setVisibility, setWillNotCacheDrawing, setWillNotDraw, setX, setY, setZ, showContextMenu, showContextMenu, startActionMode, startActionMode, startAnimation, startDrag, startDragAndDrop, toString, transformMatrixToGlobal, transformMatrixToLocal, unscheduleDrawable, unscheduleDrawable, updateDragShadow, verifyDrawable, willNotCacheDrawing, willNotDraw -
Methods inherited from class com.ernestoyaquello.dragdropswiperecyclerview.ScrollAwareRecyclerView
absorbGlows, addFocusables, addItemDecoration, addItemDecoration, addOnChildAttachStateChangeListener, addOnItemTouchListener, addRecyclerListener, animateAppearance, animateDisappearance, assertInLayoutOrScroll, assertNotInLayoutOrScroll, canReuseUpdatedViewHolder, checkLayoutParams, clearOldPositions, clearOnChildAttachStateChangeListeners, clearOnScrollListeners, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeHorizontalScrollRange, computeVerticalScrollExtent, computeVerticalScrollOffset, computeVerticalScrollRange, considerReleasingGlowsOnScroll, consumeFlingInHorizontalStretch, consumeFlingInVerticalStretch, consumePendingUpdateOperations, defaultOnMeasure, dispatchChildAttached, dispatchChildDetached, dispatchLayout, dispatchNestedFling, dispatchNestedPreFling, dispatchNestedPreScroll, dispatchNestedPreScroll, dispatchNestedScroll, dispatchNestedScroll, dispatchNestedScroll, dispatchOnScrollStateChanged, dispatchOnScrolled, dispatchPendingImportantForAccessibilityChanges, dispatchPopulateAccessibilityEvent, dispatchRestoreInstanceState, dispatchSaveInstanceState, draw, drawChild, ensureBottomGlow, ensureLeftGlow, ensureRightGlow, ensureTopGlow, exceptionLabel, fillRemainingScrollValues, findChildViewUnder, findContainingItemView, findContainingViewHolder, findViewHolderForAdapterPosition, findViewHolderForItemId, findViewHolderForLayoutPosition, findViewHolderForPosition, findViewHolderForPosition, fling, focusSearch, generateDefaultLayoutParams, generateLayoutParams, generateLayoutParams, getAccessibilityClassName, getAdapter, getAdapterPositionInRecyclerView, getBaseline, getChangedHolderKey, getChildAdapterPosition, getChildDrawingOrder, getChildItemId, getChildLayoutPosition, getChildPosition, getChildViewHolder, getClipToPadding, getCompatAccessibilityDelegate, getDecoratedBoundsWithMargins, getEdgeEffectFactory, getItemAnimator, getItemDecorInsetsForChild, getItemDecorationAt, getItemDecorationCount, getLayoutManager, getMaxFlingVelocity, getMinFlingVelocity, getNanoTime, getOnFlingListener, getPreserveFocusAfterLayout, getRecycledViewPool, getScrollState, hasFixedSize, hasNestedScrollingParent, hasNestedScrollingParent, hasPendingAdapterUpdates, initAdapterManager, initFastScroller, invalidateGlows, invalidateItemDecorations, isAccessibilityEnabled, isAnimating, isAttachedToWindow, isComputingLayout, isLayoutFrozen, isLayoutSuppressed, isNestedScrollingEnabled, jumpToPositionForSmoothScroller, markItemDecorInsetsDirty, markKnownViewsInvalid, nestedScrollBy, offsetChildrenHorizontal, offsetChildrenVertical, offsetPositionRecordsForInsert, offsetPositionRecordsForMove, offsetPositionRecordsForRemove, onAttachedToWindow, onChildAttachedToWindow, onChildDetachedFromWindow, onDetachedFromWindow, onDraw, onEnterLayoutOrScroll, onExitLayoutOrScroll, onExitLayoutOrScroll, onGenericMotionEvent, onInterceptTouchEvent, onLayout, onMeasure, onRequestFocusInDescendants, onScrollStateChanged, onScrolled, onSizeChanged, onTouchEvent, postAnimationRunner, processDataSetCompletelyChanged, recordAnimationInfoIfBouncedHiddenView, removeAndRecycleViews, removeAnimatingView, removeDetachedView, removeItemDecoration, removeItemDecorationAt, removeOnChildAttachStateChangeListener, removeOnItemTouchListener, removeOnScrollListener, removeRecyclerListener, repositionShadowingViews, requestChildFocus, requestChildRectangleOnScreen, requestDisallowInterceptTouchEvent, requestLayout, saveOldPositions, scrollBy, scrollByInternal, scrollStep, scrollTo, scrollToPosition, sendAccessibilityEventUnchecked, setAccessibilityDelegateCompat, setChildDrawingOrderCallback, setChildImportantForAccessibilityInternal, setClipToPadding, setEdgeEffectFactory, setHasFixedSize, setItemAnimator, setItemViewCacheSize, setLayoutFrozen, setLayoutTransition, setNestedScrollingEnabled, setOnFlingListener, setOnScrollListener, setPreserveFocusAfterLayout, setRecycledViewPool, setRecyclerListener, setScrollState, setScrollingTouchSlop, setViewCacheExtension, shouldDeferAccessibilityEvent, smoothScrollBy, smoothScrollBy, smoothScrollBy, smoothScrollBy, smoothScrollToPosition, startInterceptRequestLayout, startNestedScroll, startNestedScroll, stopInterceptRequestLayout, stopNestedScroll, stopNestedScroll, stopScroll, suppressLayout, swapAdapter, viewRangeUpdate -
Methods inherited from class androidx.recyclerview.widget.RecyclerView
addChildrenForAccessibility, addExtraDataToAccessibilityNodeInfo, addKeyboardNavigationClusters, addStatesFromChildren, addTouchables, addView, addView, addView, addView, addView, addViewInLayout, addViewInLayout, attachLayoutAnimationParameters, attachViewToParent, bringChildToFront, canAnimate, childDrawableStateChanged, childHasTransientStateChanged, cleanupLayoutState, clearChildFocus, clearDisappearingChildren, clearFocus, debug, detachAllViewsFromParent, detachViewFromParent, detachViewFromParent, detachViewsFromParent, dispatchApplyWindowInsets, dispatchCapturedPointerEvent, dispatchConfigurationChanged, dispatchCreateViewTranslationRequest, dispatchDisplayHint, dispatchDragEvent, dispatchDraw, dispatchDrawableHotspotChanged, dispatchFinishTemporaryDetach, dispatchFreezeSelfOnly, dispatchGenericFocusedEvent, dispatchGenericPointerEvent, dispatchHoverEvent, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchPointerCaptureChanged, dispatchProvideAutofillStructure, dispatchProvideStructure, dispatchScrollCaptureSearch, dispatchSetActivated, dispatchSetPressed, dispatchSetSelected, dispatchStartTemporaryDetach, dispatchSystemUiVisibilityChanged, dispatchThawSelfOnly, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchVisibilityChanged, dispatchWindowFocusChanged, dispatchWindowInsetsAnimationEnd, dispatchWindowInsetsAnimationPrepare, dispatchWindowInsetsAnimationProgress, dispatchWindowInsetsAnimationStart, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, drawableStateChanged, endViewTransition, findFocus, findOnBackInvokedDispatcherForChild, findViewsWithText, focusableViewAvailable, gatherTransparentRegion, getChildAt, getChildCount, getChildDrawingOrder, getChildStaticTransformation, getChildVisibleRect, getClipChildren, getDescendantFocusability, getFocusedChild, getLayoutAnimation, getLayoutAnimationListener, getLayoutMode, getLayoutTransition, getNestedScrollAxes, getOverlay, getPersistentDrawingCache, getTouchscreenBlocksFocus, hasFocus, hasTransientState, indexOfChild, invalidateChild, invalidateChildInParent, isAlwaysDrawnWithCacheEnabled, isAnimationCacheEnabled, isChildrenDrawingOrderEnabled, isChildrenDrawnWithCacheEnabled, isMotionEventSplittingEnabled, isTransitionGroup, jumpDrawablesToCurrentState, layout, measureChild, measureChildWithMargins, measureChildren, notifySubtreeAccessibilityStateChanged, offsetDescendantRectToMyCoords, offsetRectIntoDescendantCoords, onCreateDrawableState, onDescendantInvalidated, onInterceptHoverEvent, onNestedFling, onNestedPreFling, onNestedPrePerformAccessibilityAction, onNestedPreScroll, onNestedScroll, onNestedScrollAccepted, onRequestSendAccessibilityEvent, onResolvePointerIcon, onStartNestedScroll, onStopNestedScroll, onViewAdded, onViewRemoved, recomputeViewAttributes, removeAllViews, removeAllViewsInLayout, removeView, removeViewAt, removeViewInLayout, removeViews, removeViewsInLayout, requestFocus, requestSendAccessibilityEvent, requestTransparentRegion, restoreDefaultFocus, scheduleLayoutAnimation, setAddStatesFromChildren, setAlwaysDrawnWithCacheEnabled, setAnimationCacheEnabled, setChildrenDrawingCacheEnabled, setChildrenDrawingOrderEnabled, setChildrenDrawnWithCacheEnabled, setClipChildren, setDescendantFocusability, setLayoutAnimation, setLayoutAnimationListener, setLayoutMode, setMotionEventSplittingEnabled, setOnHierarchyChangeListener, setPersistentDrawingCache, setStaticTransformationsEnabled, setTouchscreenBlocksFocus, setTransitionGroup, setWindowInsetsAnimationCallback, shouldDelayChildPressedState, showContextMenuForChild, showContextMenuForChild, startActionModeForChild, startActionModeForChild, startLayoutAnimation, startViewTransition, updateViewLayout -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
DragDropSwipeRecyclerView
DragDropSwipeRecyclerView(Context context, AttributeSet attrs, Integer defStyleAttr)
-
DragDropSwipeRecyclerView
DragDropSwipeRecyclerView(Context context, AttributeSet attrs)
-
DragDropSwipeRecyclerView
DragDropSwipeRecyclerView(Context context)
-
-
Method Detail
-
getItemLayoutId
final Integer getItemLayoutId()
The ID of the item layout that will be used to populate each list item.
Can be set up in XML using the attribute "item_layout".
-
setItemLayoutId
final Unit setItemLayoutId(Integer itemLayoutId)
The ID of the item layout that will be used to populate each list item.
Can be set up in XML using the attribute "item_layout".
-
getDividerDrawableId
final Integer getDividerDrawableId()
The ID of the drawable that will be displayed as a divider between list items. If set to null, no divider will be drawn. Null by default.
Please note that, for vertical lists, the divider drawable's height must be defined. In the same way, horizontal lists need a divider drawable with a defined width, and grid lists need a divider drawable with both width and height defined. Also note that the divider should have no transparency to be drawn correctly at all times.
Can be set up in XML using the attribute "divider".
-
setDividerDrawableId
final Unit setDividerDrawableId(Integer dividerDrawableId)
-
getBehindSwipedItemIconDrawableId
final Integer getBehindSwipedItemIconDrawableId()
The ID of the drawable of the icon to display behind an item that is being swiped. If there is a secondary icon defined, this one will only be displayed when swiping left (or down). If there isn't a secondary icon defined, it will be displayed when swiping in any direction. If it is not specified (i.e., if null), no icon will be displayed behind swiped items. Null by default.
Can be set up in XML using the attribute "behind_swiped_item_icon".
-
setBehindSwipedItemIconDrawableId
final Unit setBehindSwipedItemIconDrawableId(Integer behindSwipedItemIconDrawableId)
-
getBehindSwipedItemIconSecondaryDrawableId
final Integer getBehindSwipedItemIconSecondaryDrawableId()
The ID of the drawable of the secondary icon to display behind an item that is being swiped. Because it is the secondary one, it will be displayed only when swiping right (or up). If not specified (i.e., if null), the main icon will be the one displayed when swiping right (or up). Null by default.
Can be set up in XML using the attribute "behind_swiped_item_icon_secondary".
-
setBehindSwipedItemIconSecondaryDrawableId
final Unit setBehindSwipedItemIconSecondaryDrawableId(Integer behindSwipedItemIconSecondaryDrawableId)
-
getBehindSwipedItemIconMargin
final Float getBehindSwipedItemIconMargin()
The distance between the icon displayed behind an item that is being swiped and the side of the item from which the swiping started. 0 if not specified; ignored if behindSwipedItemCenterIcon is true.
Can be set up in XML using the attribute "behind_swiped_item_icon_margin".
-
setBehindSwipedItemIconMargin
final Unit setBehindSwipedItemIconMargin(Float behindSwipedItemIconMargin)
The distance between the icon displayed behind an item that is being swiped and the side of the item from which the swiping started. 0 if not specified; ignored if behindSwipedItemCenterIcon is true.
Can be set up in XML using the attribute "behind_swiped_item_icon_margin".
-
getBehindSwipedItemCenterIcon
final Boolean getBehindSwipedItemCenterIcon()
Determines whether the icon displayed behind an item that is being swiped should be centered. If false, the icon will be displayed near the side from which the swiping started. False by default.
Can be set up in XML using the attribute "behind_swiped_item_icon_centered".
-
setBehindSwipedItemCenterIcon
final Unit setBehindSwipedItemCenterIcon(Boolean behindSwipedItemCenterIcon)
Determines whether the icon displayed behind an item that is being swiped should be centered. If false, the icon will be displayed near the side from which the swiping started. False by default.
Can be set up in XML using the attribute "behind_swiped_item_icon_centered".
-
getBehindSwipedItemBackgroundColor
final Integer getBehindSwipedItemBackgroundColor()
The background color to be displayed behind an item that is being swiped. If there is a secondary color defined, this one will only be displayed when swiping left (or down). If there isn't a secondary color defined, it will be displayed when swiping in any direction. If not specified (i.e., if null), no color will be displayed behind items that are being swiped. Null by default.
Note that this must be the actual value of the color and not a reference to a color resource.
Can be set up in XML using the attribute "behind_swiped_item_bg_color".
-
setBehindSwipedItemBackgroundColor
final Unit setBehindSwipedItemBackgroundColor(Integer behindSwipedItemBackgroundColor)
The background color to be displayed behind an item that is being swiped. If there is a secondary color defined, this one will only be displayed when swiping left (or down). If there isn't a secondary color defined, it will be displayed when swiping in any direction. If not specified (i.e., if null), no color will be displayed behind items that are being swiped. Null by default.
Note that this must be the actual value of the color and not a reference to a color resource.
Can be set up in XML using the attribute "behind_swiped_item_bg_color".
-
getBehindSwipedItemBackgroundSecondaryColor
final Integer getBehindSwipedItemBackgroundSecondaryColor()
The secondary background color to be displayed behind an item that is being swiped. Because it is the secondary one, it will be displayed only when swiping right (or up). If not specified (i.e., if null), the main color will be the one displayed when swiping right (or up). Null by default.
Note that this must be the actual value of the color and not a reference to a color resource.
Can be set up in XML using the attribute "behind_swiped_item_bg_color_secondary".
-
setBehindSwipedItemBackgroundSecondaryColor
final Unit setBehindSwipedItemBackgroundSecondaryColor(Integer behindSwipedItemBackgroundSecondaryColor)
The secondary background color to be displayed behind an item that is being swiped. Because it is the secondary one, it will be displayed only when swiping right (or up). If not specified (i.e., if null), the main color will be the one displayed when swiping right (or up). Null by default.
Note that this must be the actual value of the color and not a reference to a color resource.
Can be set up in XML using the attribute "behind_swiped_item_bg_color_secondary".
-
getBehindSwipedItemLayoutId
final Integer getBehindSwipedItemLayoutId()
The ID of the custom layout to be displayed behind an item that is being swiped. If there is a secondary layout defined, this one will only be displayed when swiping left (or down). If there isn't a secondary layout defined, it will be displayed when swiping in any direction. If it is not specified (i.e., if null), no custom layout will be displayed behind swiped items (but background colors and icons will still be displayed behind swiped items if specified). Null by default.
Can be set up in XML using the attribute "behind_swiped_item_custom_layout".
-
setBehindSwipedItemLayoutId
final Unit setBehindSwipedItemLayoutId(Integer behindSwipedItemLayoutId)
-
getBehindSwipedItemSecondaryLayoutId
final Integer getBehindSwipedItemSecondaryLayoutId()
The ID of the secondary custom layout to be displayed behind an item that is being swiped. Because it is the secondary one, it will be displayed only when swiping right (or up). If it is not specified, the main custom layout will be the one displayed when swiping right (or up). Null by default.
Can be set up in XML using the attribute "behind_swiped_item_custom_layout_secondary".
-
setBehindSwipedItemSecondaryLayoutId
final Unit setBehindSwipedItemSecondaryLayoutId(Integer behindSwipedItemSecondaryLayoutId)
-
getReduceItemAlphaOnSwiping
final Boolean getReduceItemAlphaOnSwiping()
Determines whether the item that is being swiped should be make more transparent the further it gets from its original position. False by default.
Can be set up in XML using the attribute "swiped_item_opacity_fades_on_swiping".
-
setReduceItemAlphaOnSwiping
final Unit setReduceItemAlphaOnSwiping(Boolean reduceItemAlphaOnSwiping)
Determines whether the item that is being swiped should be make more transparent the further it gets from its original position. False by default.
Can be set up in XML using the attribute "swiped_item_opacity_fades_on_swiping".
-
getLongPressToStartDragging
final Boolean getLongPressToStartDragging()
Determines whether the start of the dragging action will be triggered by a long press or by a standard one. True for long press; false for standard press. False by default.
Can be set up in XML using the attribute "long_press_to_start_dragging".
-
setLongPressToStartDragging
final Unit setLongPressToStartDragging(Boolean longPressToStartDragging)
Determines whether the start of the dragging action will be triggered by a long press or by a standard one. True for long press; false for standard press. False by default.
Can be set up in XML using the attribute "long_press_to_start_dragging".
-
getNumOfColumnsPerRowInGridList
final Integer getNumOfColumnsPerRowInGridList()
The number of columns of each row of the grid-arranged, vertically-scrollable list. This value will be used to avoid drawing dividers in wrong positions. 1 by default. To be ignored in non-grid-arranged lists.
-
setNumOfColumnsPerRowInGridList
final Unit setNumOfColumnsPerRowInGridList(Integer numOfColumnsPerRowInGridList)
The number of columns of each row of the grid-arranged, vertically-scrollable list. This value will be used to avoid drawing dividers in wrong positions. 1 by default. To be ignored in non-grid-arranged lists.
-
getNumOfRowsPerColumnInGridList
final Integer getNumOfRowsPerColumnInGridList()
The number of rows of each column of the grid-arranged, horizontally-scrollable list. This value will be used to avoid drawing dividers in wrong positions. 1 by default. To be ignored in non-grid-arranged lists.
-
setNumOfRowsPerColumnInGridList
final Unit setNumOfRowsPerColumnInGridList(Integer numOfRowsPerColumnInGridList)
The number of rows of each column of the grid-arranged, horizontally-scrollable list. This value will be used to avoid drawing dividers in wrong positions. 1 by default. To be ignored in non-grid-arranged lists.
-
getDragListener
final OnItemDragListener<?> getDragListener()
Listener for dragging events.
-
setDragListener
final Unit setDragListener(OnItemDragListener<?> dragListener)
-
getSwipeListener
final OnItemSwipeListener<?> getSwipeListener()
Listener for swiping events.
-
setSwipeListener
final Unit setSwipeListener(OnItemSwipeListener<?> swipeListener)
-
getAdapter
final DragDropSwipeAdapter<?, ?> getAdapter()
Adapter of the recycler view.
-
setAdapter
final Unit setAdapter(DragDropSwipeAdapter<?, ?> adapter)
-
getOrientation
final DragDropSwipeRecyclerView.ListOrientation getOrientation()
The orientation of the recycler view. It is mandatory to set it; the list won't work otherwise. Null by default.
If the orientation of the list hasn't been set but the list is set up with a linear layout manager, the orientation will be inferred automatically from the linear layout manager:
VERTICAL_LIST_WITH_VERTICAL_DRAGGING for linear layout managers with vertical orientation.
HORIZONTAL_LIST_WITH_UNCONSTRAINED_DRAGGING for linear layout managers with horizontal orientation.
In the same way, if the list is configured with a grid layout manager, the orientation will be set to GRID_LIST_WITH_HORIZONTAL_SWIPING automatically. If the layout manager is not one of the above and/or a different orientation is required, this property must be set manually.
Please note that this property is only used as a reference to handle actions of swiping and drag & drop; a layout manager still needs to be set in this recycler view. Note also that a grid orientation will disable the support for item dividers.
-
setOrientation
final Unit setOrientation(DragDropSwipeRecyclerView.ListOrientation orientation)
-
getScrollListener
final OnListScrollListener getScrollListener()
Listener for the scrolling events.
-
setScrollListener
final Unit setScrollListener(OnListScrollListener scrollListener)
Listener for the scrolling events.
-
setAdapter
Unit setAdapter(RecyclerView.Adapter<?> adapter)
Sets the adapter of the recycler view.
- Parameters:
adapter- The adapter to set.
-
setLayoutManager
Unit setLayoutManager(RecyclerView.LayoutManager layoutManager)
Sets the layout manager of the recycler view, which is mandatory to make it work.
- Parameters:
layoutManager- The layout manager to be used by the list to arrange the item layouts.
-
disableDragDirection
final Unit disableDragDirection(DragDropSwipeRecyclerView.ListOrientation.DirectionFlag dragDirectionToDisable)
Disables the specified direction for all dragging actions on this list. The disabled direction will be reset back to being allowed if the list orientation changes.
- Parameters:
dragDirectionToDisable- The drag direction to disable.
-
disableSwipeDirection
final Unit disableSwipeDirection(DragDropSwipeRecyclerView.ListOrientation.DirectionFlag swipeDirectionToDisable)
Disables the specified direction for all swiping actions on this list. The disabled direction will be reset back to being allowed if the list orientation changes.
- Parameters:
swipeDirectionToDisable- The swipe direction to disable.
-
enableDragDirection
final Unit enableDragDirection(DragDropSwipeRecyclerView.ListOrientation.DirectionFlag dragDirectionToAllow)
Allows the specified direction to be used for dragging actions (note that the specified direction will only trigger a dragging action if the current list orientation allows it). To be used in order to re-enable a dragging direction that had been previously disabled.
- Parameters:
dragDirectionToAllow- The drag direction to allow.
-
enableSwipeDirection
final Unit enableSwipeDirection(DragDropSwipeRecyclerView.ListOrientation.DirectionFlag swipeDirectionToAllow)
Allows the specified direction to be used for swiping actions (note that the specified direction will only trigger a swiping action if the current list orientation allows it). To be used in order to re-enable a swiping direction that had been previously disabled.
- Parameters:
swipeDirectionToAllow- The swipe direction to allow.
-
-
-
-