public class SwipeLayout
extends android.widget.FrameLayout
Modifier and Type | Class and Description |
---|---|
static interface |
SwipeLayout.DoubleClickListener |
static class |
SwipeLayout.DragEdge |
static interface |
SwipeLayout.OnLayout
View.OnLayoutChangeListener added in API 11. |
static interface |
SwipeLayout.OnRevealListener |
static class |
SwipeLayout.ShowMode |
static class |
SwipeLayout.Status |
static interface |
SwipeLayout.SwipeDenier |
(package private) class |
SwipeLayout.SwipeDetector |
static interface |
SwipeLayout.SwipeListener |
android.widget.FrameLayout.LayoutParams
android.view.ViewGroup.MarginLayoutParams, android.view.ViewGroup.OnHierarchyChangeListener
android.view.View.AccessibilityDelegate, android.view.View.BaseSavedState, android.view.View.DragShadowBuilder, android.view.View.MeasureSpec, android.view.View.OnApplyWindowInsetsListener, android.view.View.OnAttachStateChangeListener, android.view.View.OnClickListener, android.view.View.OnContextClickListener, android.view.View.OnCreateContextMenuListener, android.view.View.OnDragListener, android.view.View.OnFocusChangeListener, android.view.View.OnGenericMotionListener, android.view.View.OnHoverListener, android.view.View.OnKeyListener, android.view.View.OnLayoutChangeListener, android.view.View.OnLongClickListener, android.view.View.OnScrollChangeListener, android.view.View.OnSystemUiVisibilityChangeListener, android.view.View.OnTouchListener
Modifier and Type | Field and Description |
---|---|
private android.view.GestureDetector |
gestureDetector |
private SwipeLayout.DoubleClickListener |
mDoubleClickListener |
private int |
mDragDistance |
private SwipeLayout.DragEdge |
mDragEdge |
private android.support.v4.widget.ViewDragHelper |
mDragHelper |
private android.support.v4.widget.ViewDragHelper.Callback |
mDragHelperCallback |
private int |
mEventCounter |
private float |
mHorizontalSwipeOffset |
private java.util.List<SwipeLayout.OnLayout> |
mOnLayoutListeners |
private java.util.Map<android.view.View,java.util.ArrayList<SwipeLayout.OnRevealListener>> |
mRevealListeners |
private java.util.Map<android.view.View,java.lang.Boolean> |
mShowEntirely |
private SwipeLayout.ShowMode |
mShowMode |
private java.util.List<SwipeLayout.SwipeDenier> |
mSwipeDeniers |
private boolean |
mSwipeEnabled |
private java.util.List<SwipeLayout.SwipeListener> |
mSwipeListeners |
private boolean |
mTouchConsumedByChild |
private float |
mVerticalSwipeOffset |
private float |
sX |
private float |
sY |
CLIP_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_CACHE
ACCESSIBILITY_LIVE_REGION_ASSERTIVE, ACCESSIBILITY_LIVE_REGION_NONE, ACCESSIBILITY_LIVE_REGION_POLITE, ALPHA, DRAG_FLAG_GLOBAL, DRAG_FLAG_GLOBAL_PERSISTABLE_URI_PERMISSION, DRAG_FLAG_GLOBAL_PREFIX_URI_PERMISSION, DRAG_FLAG_GLOBAL_URI_READ, DRAG_FLAG_GLOBAL_URI_WRITE, DRAG_FLAG_OPAQUE, 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, SCROLL_AXIS_HORIZONTAL, SCROLL_AXIS_NONE, SCROLL_AXIS_VERTICAL, SCROLL_INDICATOR_BOTTOM, SCROLL_INDICATOR_END, SCROLL_INDICATOR_LEFT, SCROLL_INDICATOR_RIGHT, SCROLL_INDICATOR_START, SCROLL_INDICATOR_TOP, 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_LIGHT_STATUS_BAR, 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_FIRST_STRONG_LTR, TEXT_DIRECTION_FIRST_STRONG_RTL, TEXT_DIRECTION_INHERIT, TEXT_DIRECTION_LOCALE, TEXT_DIRECTION_LTR, TEXT_DIRECTION_RTL, TRANSLATION_X, TRANSLATION_Y, TRANSLATION_Z, VIEW_LOG_TAG, VISIBLE, WINDOW_FOCUSED_STATE_SET, X, Y, Z
Constructor and Description |
---|
SwipeLayout(android.content.Context context) |
SwipeLayout(android.content.Context context,
android.util.AttributeSet attrs) |
SwipeLayout(android.content.Context context,
android.util.AttributeSet attrs,
int defStyle) |
Modifier and Type | Method and Description |
---|---|
void |
addOnLayoutListener(SwipeLayout.OnLayout l) |
void |
addRevealListener(int[] childIds,
SwipeLayout.OnRevealListener l)
bind multiple views with an
SwipeLayout.OnRevealListener . |
void |
addRevealListener(int childId,
SwipeLayout.OnRevealListener l)
bind a view with a specific
SwipeLayout.OnRevealListener |
void |
addSwipeDenier(SwipeLayout.SwipeDenier denier) |
void |
addSwipeListener(SwipeLayout.SwipeListener l) |
private void |
caseMotionActionCancel(android.view.ViewGroup touching) |
private void |
caseMotionActionDown(android.view.MotionEvent event,
android.view.ViewParent parent,
android.view.ViewGroup touching) |
private void |
caseMotionActionMoveFirstBranch(android.view.MotionEvent event,
android.view.ViewParent parent) |
private boolean |
caseMotionActionMoveSecondBranch(android.view.MotionEvent event,
SwipeLayout.Status status,
android.view.ViewParent parent,
android.view.ViewGroup touching) |
private android.view.View |
childNeedHandleTouchEvent(android.view.ViewGroup v,
android.view.MotionEvent event)
if the ViewGroup children want to handle this event.
|
private boolean |
childNeedHandleTouchEvent(android.view.View v,
android.view.MotionEvent event)
if the view (v) wants to handle this event.
|
void |
close()
smoothly close surface.
|
void |
close(boolean smooth) |
void |
close(boolean smooth,
boolean notify)
close surface
|
private android.graphics.Rect |
computeBottomLayDown(SwipeLayout.DragEdge dragEdge) |
private android.graphics.Rect |
computeBottomLayoutAreaViaSurface(SwipeLayout.ShowMode mode,
android.graphics.Rect surfaceArea) |
void |
computeScroll() |
private android.graphics.Rect |
computeSurfaceLayoutArea(boolean open)
a helper function to compute the Rect area that surface will hold in.
|
protected void |
dispatchRevealEvent(int surfaceLeft,
int surfaceTop,
int surfaceRight,
int surfaceBottom) |
protected void |
dispatchSwipeEvent(int surfaceLeft,
int surfaceTop,
boolean open) |
protected void |
dispatchSwipeEvent(int surfaceLeft,
int surfaceTop,
int dx,
int dy) |
private int |
dp2px(float dp) |
private android.widget.AdapterView |
getAdapterView() |
android.view.ViewGroup |
getBottomView() |
int |
getDragDistance() |
SwipeLayout.DragEdge |
getDragEdge() |
SwipeLayout.Status |
getOpenStatus()
get the open status.
|
protected android.graphics.Rect |
getRelativePosition(android.view.View child) |
SwipeLayout.ShowMode |
getShowMode() |
android.view.ViewGroup |
getSurfaceView() |
private boolean |
insideAdapterView() |
private boolean |
isDisabledInAdapterView()
if working in
AdapterView , we should response Adapter
isEnable(int position). |
boolean |
isSwipeDisabled() |
protected boolean |
isViewShowing(android.view.View child,
android.graphics.Rect relativePosition,
SwipeLayout.DragEdge availableEdge,
int surfaceLeft,
int surfaceTop,
int surfaceRight,
int surfaceBottom) |
protected boolean |
isViewTotallyFirstShowed(android.view.View child,
android.graphics.Rect relativePosition,
SwipeLayout.DragEdge edge,
int surfaceLeft,
int surfaceTop,
int surfaceRight,
int surfaceBottom)
the dispatchRevealEvent method may not always get accurate position, it makes the view may not always get the event when the view is
totally show( fraction = 1), so , we need to calculate every time.
|
(package private) void |
layoutLayDown() |
(package private) void |
layoutPullOut() |
boolean |
onInterceptTouchEvent(android.view.MotionEvent ev) |
protected void |
onLayout(boolean changed,
int l,
int t,
int r,
int b) |
protected void |
onMeasure(int widthMeasureSpec,
int heightMeasureSpec) |
boolean |
onTouchEvent(android.view.MotionEvent event) |
void |
open()
smoothly open surface.
|
void |
open(boolean smooth) |
void |
open(boolean smooth,
boolean notify) |
private void |
performAdapterViewItemClick(android.view.MotionEvent e) |
private void |
processBottomLayDownMode(float xvel,
float yvel)
process bottom (LayDown mode) hand release event.
|
private void |
processBottomPullOutRelease(float xvel,
float yvel)
process bottom (PullOut mode) hand release event.
|
private void |
processSurfaceRelease(float xvel,
float yvel)
Process the surface release event.
|
void |
removeAllRevealListeners(int childId) |
void |
removeAllSwipeDeniers() |
void |
removeOnLayoutListener(SwipeLayout.OnLayout l) |
void |
removeRevealListener(int childId,
SwipeLayout.OnRevealListener l) |
void |
removeSwipeDenier(SwipeLayout.SwipeDenier denier) |
void |
removeSwipeListener(SwipeLayout.SwipeListener l) |
private void |
safeBottomView()
prevent bottom view get any touch event.
|
void |
setDragDistance(int max)
set the drag distance, it will force set the bottom view's width or height via this value.
|
void |
setDragEdge(SwipeLayout.DragEdge dragEdge) |
void |
setOnDoubleClickListener(SwipeLayout.DoubleClickListener doubleClickListener) |
void |
setShowMode(SwipeLayout.ShowMode mode)
There are 2 diffirent show mode.
|
void |
setSwipeEnabled(boolean enabled) |
void |
toggle() |
void |
toggle(boolean smooth) |
checkLayoutParams, generateDefaultLayoutParams, generateLayoutParams, generateLayoutParams, getAccessibilityClassName, getConsiderGoneChildrenWhenMeasuring, getMeasureAllChildren, setForegroundGravity, setMeasureAllChildren, shouldDelayChildPressedState
addChildrenForAccessibility, addFocusables, 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, dispatchConfigurationChanged, dispatchDisplayHint, dispatchDragEvent, dispatchDraw, dispatchDrawableHotspotChanged, dispatchFreezeSelfOnly, dispatchGenericFocusedEvent, dispatchGenericPointerEvent, dispatchHoverEvent, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchProvideStructure, dispatchRestoreInstanceState, dispatchSaveInstanceState, dispatchSetActivated, dispatchSetPressed, dispatchSetSelected, dispatchSystemUiVisibilityChanged, dispatchThawSelfOnly, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchVisibilityChanged, dispatchWindowFocusChanged, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, drawableStateChanged, drawChild, endViewTransition, findFocus, findViewsWithText, focusableViewAvailable, focusSearch, gatherTransparentRegion, getChildAt, getChildCount, getChildDrawingOrder, getChildMeasureSpec, getChildStaticTransformation, getChildVisibleRect, getClipChildren, getClipToPadding, getDescendantFocusability, getFocusedChild, getLayoutAnimation, getLayoutAnimationListener, getLayoutMode, getLayoutTransition, getNestedScrollAxes, getOverlay, getPersistentDrawingCache, getTouchscreenBlocksFocus, hasFocus, hasFocusable, hasTransientState, indexOfChild, invalidateChild, invalidateChildInParent, isAlwaysDrawnWithCacheEnabled, isAnimationCacheEnabled, isChildrenDrawingOrderEnabled, isChildrenDrawnWithCacheEnabled, isMotionEventSplittingEnabled, isTransitionGroup, jumpDrawablesToCurrentState, layout, measureChild, measureChildren, measureChildWithMargins, notifySubtreeAccessibilityStateChanged, offsetDescendantRectToMyCoords, offsetRectIntoDescendantCoords, onAttachedToWindow, onCreateDrawableState, onDetachedFromWindow, onInterceptHoverEvent, onNestedFling, onNestedPreFling, onNestedPrePerformAccessibilityAction, onNestedPreScroll, onNestedScroll, onNestedScrollAccepted, onRequestFocusInDescendants, onRequestSendAccessibilityEvent, onResolvePointerIcon, onStartNestedScroll, onStopNestedScroll, onViewAdded, onViewRemoved, recomputeViewAttributes, removeAllViews, removeAllViewsInLayout, removeDetachedView, removeView, removeViewAt, removeViewInLayout, removeViews, removeViewsInLayout, requestChildFocus, requestChildRectangleOnScreen, requestDisallowInterceptTouchEvent, requestFocus, requestSendAccessibilityEvent, requestTransparentRegion, scheduleLayoutAnimation, setAddStatesFromChildren, setAlwaysDrawnWithCacheEnabled, setAnimationCacheEnabled, setChildrenDrawingCacheEnabled, setChildrenDrawingOrderEnabled, setChildrenDrawnWithCacheEnabled, setClipChildren, setClipToPadding, setDescendantFocusability, setLayoutAnimation, setLayoutAnimationListener, setLayoutMode, setLayoutTransition, setMotionEventSplittingEnabled, setOnHierarchyChangeListener, setPersistentDrawingCache, setStaticTransformationsEnabled, setTouchscreenBlocksFocus, setTransitionGroup, showContextMenuForChild, showContextMenuForChild, startActionModeForChild, startActionModeForChild, startLayoutAnimation, startViewTransition, updateViewLayout
addFocusables, addOnAttachStateChangeListener, addOnLayoutChangeListener, animate, announceForAccessibility, awakenScrollBars, awakenScrollBars, awakenScrollBars, bringToFront, buildDrawingCache, buildDrawingCache, buildLayer, callOnClick, cancelDragAndDrop, cancelLongPress, cancelPendingInputEvents, canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, canScrollHorizontally, canScrollVertically, checkInputConnectionProxy, clearAnimation, combineMeasuredStates, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeHorizontalScrollRange, computeSystemWindowInsets, computeVerticalScrollExtent, computeVerticalScrollOffset, computeVerticalScrollRange, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchFinishTemporaryDetach, dispatchGenericMotionEvent, dispatchNestedFling, dispatchNestedPreFling, dispatchNestedPrePerformAccessibilityAction, dispatchNestedPreScroll, dispatchNestedScroll, dispatchPopulateAccessibilityEvent, dispatchStartTemporaryDetach, draw, drawableHotspotChanged, findViewById, findViewWithTag, fitSystemWindows, focusSearch, forceHasOverlappingRendering, forceLayout, generateViewId, getAccessibilityLiveRegion, getAccessibilityNodeProvider, getAccessibilityTraversalAfter, getAccessibilityTraversalBefore, getAlpha, getAnimation, getApplicationWindowToken, getBackground, getBackgroundTintList, getBackgroundTintMode, getBaseline, getBottom, getBottomFadingEdgeStrength, getBottomPaddingOffset, getCameraDistance, getClipBounds, getClipBounds, getClipToOutline, getContentDescription, getContext, getContextMenuInfo, getDefaultSize, getDisplay, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getElevation, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusables, getFocusedRect, getForeground, getForegroundGravity, getForegroundTintList, getForegroundTintMode, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHasOverlappingRendering, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarHeight, getId, getImportantForAccessibility, getKeepScreenOn, getKeyDispatcherState, getLabelFor, getLayerType, getLayoutDirection, getLayoutParams, getLeft, getLeftFadingEdgeStrength, getLeftPaddingOffset, getLocalVisibleRect, getLocationInWindow, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOutlineProvider, getOverScrollMode, getPaddingBottom, getPaddingEnd, getPaddingLeft, getPaddingRight, getPaddingStart, getPaddingTop, getParent, getParentForAccessibility, getPivotX, getPivotY, getPointerIcon, getResources, getRevealOnFocusHint, getRight, getRightFadingEdgeStrength, getRightPaddingOffset, getRootView, getRootWindowInsets, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, getScrollIndicators, getScrollX, getScrollY, getSolidColor, getStateListAnimator, getSuggestedMinimumHeight, getSuggestedMinimumWidth, getSystemUiVisibility, getTag, getTag, getTextAlignment, getTextDirection, getTop, getTopFadingEdgeStrength, getTopPaddingOffset, getTouchables, getTouchDelegate, getTransitionName, getTranslationX, getTranslationY, getTranslationZ, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarWidth, getViewTreeObserver, getVisibility, getWidth, getWindowAttachCount, getWindowId, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, getZ, hasNestedScrollingParent, hasOnClickListeners, hasOverlappingRendering, hasWindowFocus, inflate, invalidate, invalidate, invalidate, invalidateDrawable, invalidateOutline, isAccessibilityFocused, isActivated, isAttachedToWindow, isClickable, isContextClickable, isDirty, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isHapticFeedbackEnabled, isHardwareAccelerated, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isImportantForAccessibility, isInEditMode, isInLayout, isInTouchMode, isLaidOut, isLayoutDirectionResolved, isLayoutRequested, isLongClickable, isNestedScrollingEnabled, isOpaque, isPaddingOffsetRequired, isPaddingRelative, isPressed, isSaveEnabled, isSaveFromParentEnabled, isScrollbarFadingEnabled, isScrollContainer, isSelected, isShown, isSoundEffectsEnabled, isTemporarilyDetached, isTextAlignmentResolved, isTextDirectionResolved, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, measure, mergeDrawableStates, offsetLeftAndRight, offsetTopAndBottom, onAnimationEnd, onAnimationStart, onApplyWindowInsets, onCancelPendingInputEvents, onCheckIsTextEditor, onConfigurationChanged, onCreateContextMenu, onCreateInputConnection, onDisplayHint, onDragEvent, onDraw, onDrawForeground, onDrawScrollBars, onFilterTouchEventForSecurity, onFinishInflate, onFinishTemporaryDetach, onFocusChanged, onGenericMotionEvent, onHoverChanged, onHoverEvent, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onOverScrolled, onPopulateAccessibilityEvent, onProvideStructure, onProvideVirtualStructure, onRestoreInstanceState, onRtlPropertiesChanged, onSaveInstanceState, onScreenStateChanged, onScrollChanged, onSetAlpha, onSizeChanged, onStartTemporaryDetach, onTrackballEvent, onVisibilityAggregated, onVisibilityChanged, onWindowFocusChanged, onWindowSystemUiVisibilityChanged, onWindowVisibilityChanged, overScrollBy, performAccessibilityAction, performClick, performContextClick, performContextClick, performHapticFeedback, performHapticFeedback, performLongClick, performLongClick, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, postInvalidateOnAnimation, postInvalidateOnAnimation, postOnAnimation, postOnAnimationDelayed, refreshDrawableState, removeCallbacks, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, requestApplyInsets, requestFitSystemWindows, requestFocus, requestFocus, requestFocusFromTouch, requestLayout, requestRectangleOnScreen, requestRectangleOnScreen, requestUnbufferedDispatch, resolveSize, resolveSizeAndState, restoreHierarchyState, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEvent, sendAccessibilityEventUnchecked, setAccessibilityDelegate, setAccessibilityLiveRegion, setAccessibilityTraversalAfter, setAccessibilityTraversalBefore, setActivated, setAlpha, setAnimation, setBackground, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setBackgroundTintList, setBackgroundTintMode, setBottom, setCameraDistance, setClickable, setClipBounds, setClipToOutline, setContentDescription, setContextClickable, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setElevation, setEnabled, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setFocusable, setFocusableInTouchMode, setForeground, setForegroundTintList, setForegroundTintMode, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHovered, setId, setImportantForAccessibility, setKeepScreenOn, setLabelFor, setLayerPaint, setLayerType, setLayoutDirection, setLayoutParams, setLeft, setLongClickable, setMeasuredDimension, setMinimumHeight, setMinimumWidth, setNestedScrollingEnabled, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnApplyWindowInsetsListener, setOnClickListener, setOnContextClickListener, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnLongClickListener, setOnScrollChangeListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setOutlineProvider, setOverScrollMode, setPadding, setPaddingRelative, setPivotX, setPivotY, setPointerIcon, setPressed, setRevealOnFocusHint, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollbarFadingEnabled, setScrollBarSize, setScrollBarStyle, setScrollContainer, setScrollIndicators, setScrollIndicators, setScrollX, setScrollY, setSelected, setSoundEffectsEnabled, setStateListAnimator, setSystemUiVisibility, setTag, setTag, setTextAlignment, setTextDirection, setTop, setTouchDelegate, setTransitionName, setTranslationX, setTranslationY, setTranslationZ, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setVisibility, setWillNotCacheDrawing, setWillNotDraw, setX, setY, setZ, showContextMenu, showContextMenu, startActionMode, startActionMode, startAnimation, startDrag, startDragAndDrop, startNestedScroll, stopNestedScroll, toString, unscheduleDrawable, unscheduleDrawable, updateDragShadow, verifyDrawable, willNotCacheDrawing, willNotDraw
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, createContextMenu, getLayoutDirection, getParent, getParentForAccessibility, getTextAlignment, getTextDirection, isLayoutDirectionResolved, isLayoutRequested, isTextAlignmentResolved, isTextDirectionResolved, requestFitSystemWindows, requestLayout
private android.support.v4.widget.ViewDragHelper mDragHelper
private int mDragDistance
private SwipeLayout.DragEdge mDragEdge
private SwipeLayout.ShowMode mShowMode
private float mHorizontalSwipeOffset
private float mVerticalSwipeOffset
private java.util.List<SwipeLayout.SwipeListener> mSwipeListeners
private java.util.List<SwipeLayout.SwipeDenier> mSwipeDeniers
private java.util.Map<android.view.View,java.util.ArrayList<SwipeLayout.OnRevealListener>> mRevealListeners
private java.util.Map<android.view.View,java.lang.Boolean> mShowEntirely
private SwipeLayout.DoubleClickListener mDoubleClickListener
private boolean mSwipeEnabled
private android.support.v4.widget.ViewDragHelper.Callback mDragHelperCallback
private int mEventCounter
private java.util.List<SwipeLayout.OnLayout> mOnLayoutListeners
private boolean mTouchConsumedByChild
private float sX
private float sY
private android.view.GestureDetector gestureDetector
public SwipeLayout(android.content.Context context)
public SwipeLayout(android.content.Context context, android.util.AttributeSet attrs)
public SwipeLayout(android.content.Context context, android.util.AttributeSet attrs, int defStyle)
public void addSwipeListener(SwipeLayout.SwipeListener l)
public void removeSwipeListener(SwipeLayout.SwipeListener l)
public void addSwipeDenier(SwipeLayout.SwipeDenier denier)
public void removeSwipeDenier(SwipeLayout.SwipeDenier denier)
public void removeAllSwipeDeniers()
public void addRevealListener(int childId, SwipeLayout.OnRevealListener l)
SwipeLayout.OnRevealListener
childId
- the view id.l
- the target SwipeLayout.OnRevealListener
public void addRevealListener(int[] childIds, SwipeLayout.OnRevealListener l)
SwipeLayout.OnRevealListener
.childIds
- the view id.l
- the SwipeLayout.OnRevealListener
public void removeRevealListener(int childId, SwipeLayout.OnRevealListener l)
public void removeAllRevealListeners(int childId)
protected boolean isViewTotallyFirstShowed(android.view.View child, android.graphics.Rect relativePosition, SwipeLayout.DragEdge edge, int surfaceLeft, int surfaceTop, int surfaceRight, int surfaceBottom)
protected boolean isViewShowing(android.view.View child, android.graphics.Rect relativePosition, SwipeLayout.DragEdge availableEdge, int surfaceLeft, int surfaceTop, int surfaceRight, int surfaceBottom)
protected android.graphics.Rect getRelativePosition(android.view.View child)
protected void dispatchSwipeEvent(int surfaceLeft, int surfaceTop, int dx, int dy)
protected void dispatchSwipeEvent(int surfaceLeft, int surfaceTop, boolean open)
private void safeBottomView()
protected void dispatchRevealEvent(int surfaceLeft, int surfaceTop, int surfaceRight, int surfaceBottom)
public void computeScroll()
computeScroll
in class android.view.View
public void addOnLayoutListener(SwipeLayout.OnLayout l)
public void removeOnLayoutListener(SwipeLayout.OnLayout l)
protected void onLayout(boolean changed, int l, int t, int r, int b)
onLayout
in class android.widget.FrameLayout
void layoutPullOut()
void layoutLayDown()
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
onMeasure
in class android.widget.FrameLayout
public boolean onInterceptTouchEvent(android.view.MotionEvent ev)
onInterceptTouchEvent
in class android.view.ViewGroup
private android.view.View childNeedHandleTouchEvent(android.view.ViewGroup v, android.view.MotionEvent event)
private boolean childNeedHandleTouchEvent(android.view.View v, android.view.MotionEvent event)
public boolean onTouchEvent(android.view.MotionEvent event)
onTouchEvent
in class android.view.View
private void caseMotionActionCancel(android.view.ViewGroup touching)
private boolean caseMotionActionMoveSecondBranch(android.view.MotionEvent event, SwipeLayout.Status status, android.view.ViewParent parent, android.view.ViewGroup touching)
private void caseMotionActionMoveFirstBranch(android.view.MotionEvent event, android.view.ViewParent parent)
private void caseMotionActionDown(android.view.MotionEvent event, android.view.ViewParent parent, android.view.ViewGroup touching)
private boolean isDisabledInAdapterView()
AdapterView
, we should response Adapter
isEnable(int position).public void setSwipeEnabled(boolean enabled)
public boolean isSwipeDisabled()
private boolean insideAdapterView()
private android.widget.AdapterView getAdapterView()
private void performAdapterViewItemClick(android.view.MotionEvent e)
public void setDragEdge(SwipeLayout.DragEdge dragEdge)
public void setDragDistance(int max)
public void setShowMode(SwipeLayout.ShowMode mode)
SwipeLayout.ShowMode
.PullOut and SwipeLayout.ShowMode
.LayDown.public SwipeLayout.DragEdge getDragEdge()
public int getDragDistance()
public SwipeLayout.ShowMode getShowMode()
public android.view.ViewGroup getSurfaceView()
public android.view.ViewGroup getBottomView()
public SwipeLayout.Status getOpenStatus()
SwipeLayout.Status
Open , Close or Middle.private void processSurfaceRelease(float xvel, float yvel)
private void processBottomPullOutRelease(float xvel, float yvel)
private void processBottomLayDownMode(float xvel, float yvel)
public void open()
public void open(boolean smooth)
public void open(boolean smooth, boolean notify)
public void close()
public void close(boolean smooth)
public void close(boolean smooth, boolean notify)
smooth
- smoothly or not.notify
- if notify all the listeners.public void toggle()
public void toggle(boolean smooth)
private android.graphics.Rect computeSurfaceLayoutArea(boolean open)
open
- open status or close status.private android.graphics.Rect computeBottomLayoutAreaViaSurface(SwipeLayout.ShowMode mode, android.graphics.Rect surfaceArea)
private android.graphics.Rect computeBottomLayDown(SwipeLayout.DragEdge dragEdge)
public void setOnDoubleClickListener(SwipeLayout.DoubleClickListener doubleClickListener)
private int dp2px(float dp)