public class SwipeLayout
extends android.widget.FrameLayout
| 限定符和类型 | 类和说明 |
|---|---|
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 |
static interface |
SwipeLayout.SwipeListener |
android.view.ViewGroup.MarginLayoutParams, android.view.ViewGroup.OnHierarchyChangeListenerandroid.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.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.OnSystemUiVisibilityChangeListener, android.view.View.OnTouchListener| 限定符和类型 | 字段和说明 |
|---|---|
static int |
EMPTY_LAYOUT
已过时。
|
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_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, SCROLL_AXIS_HORIZONTAL, SCROLL_AXIS_NONE, SCROLL_AXIS_VERTICAL, 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, TRANSLATION_Z, VIEW_LOG_TAG, VISIBLE, WINDOW_FOCUSED_STATE_SET, X, Y, Z| 构造器和说明 |
|---|
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) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addDrag(SwipeLayout.DragEdge dragEdge,
android.view.View child) |
void |
addDrag(SwipeLayout.DragEdge dragEdge,
android.view.View child,
android.view.ViewGroup.LayoutParams params) |
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) |
void |
addView(android.view.View child,
int index,
android.view.ViewGroup.LayoutParams params) |
void |
close()
smoothly close surface.
|
void |
close(boolean smooth) |
void |
close(boolean smooth,
boolean notify)
close surface
|
void |
computeScroll() |
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) |
java.util.List<android.view.View> |
getBottomViews() |
android.view.View |
getCurrentBottomView()
return null if there is no bottom view
|
int |
getDragDistance() |
SwipeLayout.DragEdge |
getDragEdge() |
java.util.Map<SwipeLayout.DragEdge,android.view.View> |
getDragEdgeMap() |
java.util.List<SwipeLayout.DragEdge> |
getDragEdges()
已过时。
|
SwipeLayout.Status |
getOpenStatus()
get the open status.
|
protected android.graphics.Rect |
getRelativePosition(android.view.View child) |
SwipeLayout.ShowMode |
getShowMode() |
android.view.View |
getSurfaceView()
return null if there is no surface view(no children)
|
boolean |
isBottomSwipeEnabled() |
boolean |
isClickToClose() |
boolean |
isLeftSwipeEnabled() |
boolean |
isRightSwipeEnabled() |
boolean |
isSwipeEnabled() |
boolean |
isTopSwipeEnabled() |
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.
|
protected void |
onAttachedToWindow() |
boolean |
onInterceptTouchEvent(android.view.MotionEvent ev) |
protected void |
onLayout(boolean changed,
int l,
int t,
int r,
int b) |
boolean |
onTouchEvent(android.view.MotionEvent event) |
protected void |
onViewRemoved(android.view.View child) |
void |
open()
smoothly open surface.
|
void |
open(boolean smooth) |
void |
open(boolean smooth,
boolean notify) |
void |
open(boolean smooth,
boolean notify,
SwipeLayout.DragEdge edge) |
void |
open(boolean smooth,
SwipeLayout.DragEdge edge) |
void |
open(SwipeLayout.DragEdge edge) |
protected void |
processHandRelease(float xvel,
float yvel,
boolean isCloseBeforeDragged)
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) |
void |
setBottomSwipeEnabled(boolean bottomSwipeEnabled) |
void |
setBottomViewIds(int leftId,
int rightId,
int topId,
int bottomId)
已过时。
|
void |
setClickToClose(boolean mClickToClose) |
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 |
setDragEdges(java.util.List<SwipeLayout.DragEdge> dragEdges)
已过时。
|
void |
setDragEdges(SwipeLayout.DragEdge... mDragEdges)
已过时。
|
void |
setLeftSwipeEnabled(boolean leftSwipeEnabled) |
void |
setOnClickListener(android.view.View.OnClickListener l) |
void |
setOnDoubleClickListener(SwipeLayout.DoubleClickListener doubleClickListener) |
void |
setOnLongClickListener(android.view.View.OnLongClickListener l) |
void |
setRightSwipeEnabled(boolean rightSwipeEnabled) |
void |
setShowMode(SwipeLayout.ShowMode mode)
There are 2 diffirent show mode.
|
void |
setSwipeEnabled(boolean enabled) |
void |
setTopSwipeEnabled(boolean topSwipeEnabled) |
void |
toggle() |
void |
toggle(boolean smooth) |
checkLayoutParams, draw, drawableHotspotChanged, drawableStateChanged, gatherTransparentRegion, generateDefaultLayoutParams, generateLayoutParams, generateLayoutParams, getConsiderGoneChildrenWhenMeasuring, getForeground, getForegroundGravity, getForegroundTintList, getForegroundTintMode, getMeasureAllChildren, jumpDrawablesToCurrentState, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, onMeasure, onSizeChanged, setForeground, setForegroundGravity, setForegroundTintList, setForegroundTintMode, setMeasureAllChildren, setVisibility, shouldDelayChildPressedState, verifyDrawableaddChildrenForAccessibility, addFocusables, addStatesFromChildren, addTouchables, 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, dispatchFreezeSelfOnly, dispatchGenericFocusedEvent, dispatchGenericPointerEvent, dispatchHoverEvent, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchRestoreInstanceState, dispatchSaveInstanceState, dispatchSetActivated, dispatchSetPressed, dispatchSetSelected, dispatchSystemUiVisibilityChanged, dispatchThawSelfOnly, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchVisibilityChanged, dispatchWindowFocusChanged, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, drawChild, endViewTransition, findFocus, findViewsWithText, focusableViewAvailable, focusSearch, 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, layout, measureChild, measureChildren, measureChildWithMargins, notifySubtreeAccessibilityStateChanged, offsetDescendantRectToMyCoords, offsetRectIntoDescendantCoords, onAnimationEnd, onAnimationStart, onCreateDrawableState, onDetachedFromWindow, onInterceptHoverEvent, onNestedFling, onNestedPreFling, onNestedPreScroll, onNestedScroll, onNestedScrollAccepted, onRequestFocusInDescendants, onRequestSendAccessibilityEvent, onStartNestedScroll, onStopNestedScroll, 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, startActionModeForChild, startLayoutAnimation, startViewTransition, updateViewLayoutaddFocusables, addOnAttachStateChangeListener, addOnLayoutChangeListener, animate, announceForAccessibility, awakenScrollBars, awakenScrollBars, awakenScrollBars, bringToFront, buildDrawingCache, buildDrawingCache, buildLayer, callOnClick, cancelLongPress, cancelPendingInputEvents, canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, canScrollHorizontally, canScrollVertically, checkInputConnectionProxy, clearAnimation, combineMeasuredStates, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeHorizontalScrollRange, computeSystemWindowInsets, computeVerticalScrollExtent, computeVerticalScrollOffset, computeVerticalScrollRange, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchGenericMotionEvent, dispatchNestedFling, dispatchNestedPreFling, dispatchNestedPreScroll, dispatchNestedScroll, dispatchPopulateAccessibilityEvent, findViewById, findViewWithTag, fitSystemWindows, focusSearch, forceLayout, generateViewId, getAccessibilityLiveRegion, getAccessibilityNodeProvider, getAlpha, getAnimation, getApplicationWindowToken, getBackground, getBackgroundTintList, getBackgroundTintMode, getBaseline, getBottom, getBottomFadingEdgeStrength, getBottomPaddingOffset, getCameraDistance, getClipBounds, getClipToOutline, getContentDescription, getContext, getContextMenuInfo, getDefaultSize, getDisplay, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getElevation, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusables, getFocusedRect, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, 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, getResources, getRight, getRightFadingEdgeStrength, getRightPaddingOffset, getRootView, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, 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, 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, isTextAlignmentResolved, isTextDirectionResolved, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, measure, mergeDrawableStates, offsetLeftAndRight, offsetTopAndBottom, onApplyWindowInsets, onCancelPendingInputEvents, onCheckIsTextEditor, onConfigurationChanged, onCreateContextMenu, onCreateInputConnection, onDisplayHint, onDragEvent, onDraw, onDrawScrollBars, onFilterTouchEventForSecurity, onFinishInflate, onFinishTemporaryDetach, onFocusChanged, onGenericMotionEvent, onHoverChanged, onHoverEvent, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onOverScrolled, onPopulateAccessibilityEvent, onRestoreInstanceState, onRtlPropertiesChanged, onSaveInstanceState, onScreenStateChanged, onScrollChanged, onSetAlpha, onStartTemporaryDetach, onTrackballEvent, onVisibilityChanged, onWindowFocusChanged, onWindowSystemUiVisibilityChanged, onWindowVisibilityChanged, overScrollBy, performAccessibilityAction, performClick, performHapticFeedback, performHapticFeedback, 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, setActivated, setAlpha, setAnimation, setBackground, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setBackgroundTintList, setBackgroundTintMode, setBottom, setCameraDistance, setClickable, setClipBounds, setClipToOutline, setContentDescription, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setElevation, setEnabled, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setFocusable, setFocusableInTouchMode, 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, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setOutlineProvider, setOverScrollMode, setPadding, setPaddingRelative, setPivotX, setPivotY, setPressed, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollbarFadingEnabled, setScrollBarSize, setScrollBarStyle, setScrollContainer, setScrollX, setScrollY, setSelected, setSoundEffectsEnabled, setStateListAnimator, setSystemUiVisibility, setTag, setTag, setTextAlignment, setTextDirection, setTop, setTouchDelegate, setTransitionName, setTranslationX, setTranslationY, setTranslationZ, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setWillNotCacheDrawing, setWillNotDraw, setX, setY, setZ, showContextMenu, startActionMode, startAnimation, startDrag, startNestedScroll, stopNestedScroll, 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, requestFitSystemWindows, requestLayout@Deprecated public static final int EMPTY_LAYOUT
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.OnRevealListenerchildId - the view id.l - the target
SwipeLayout.OnRevealListenerpublic void addRevealListener(int[] childIds,
SwipeLayout.OnRevealListener l)
SwipeLayout.OnRevealListener.childIds - the view id.l - the SwipeLayout.OnRevealListenerpublic 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)
protected void dispatchRevealEvent(int surfaceLeft,
int surfaceTop,
int surfaceRight,
int surfaceBottom)
public void computeScroll()
computeScroll 在类中 android.view.Viewpublic void addOnLayoutListener(SwipeLayout.OnLayout l)
public void removeOnLayoutListener(SwipeLayout.OnLayout l)
public void addDrag(SwipeLayout.DragEdge dragEdge, android.view.View child)
public void addDrag(SwipeLayout.DragEdge dragEdge, android.view.View child, android.view.ViewGroup.LayoutParams params)
public void addView(android.view.View child,
int index,
android.view.ViewGroup.LayoutParams params)
addView 在类中 android.view.ViewGroupprotected void onLayout(boolean changed,
int l,
int t,
int r,
int b)
onLayout 在类中 android.widget.FrameLayoutpublic boolean onInterceptTouchEvent(android.view.MotionEvent ev)
onInterceptTouchEvent 在类中 android.view.ViewGrouppublic boolean onTouchEvent(android.view.MotionEvent event)
onTouchEvent 在类中 android.view.Viewpublic boolean isClickToClose()
public void setClickToClose(boolean mClickToClose)
public void setSwipeEnabled(boolean enabled)
public boolean isSwipeEnabled()
public boolean isLeftSwipeEnabled()
public void setLeftSwipeEnabled(boolean leftSwipeEnabled)
public boolean isRightSwipeEnabled()
public void setRightSwipeEnabled(boolean rightSwipeEnabled)
public boolean isTopSwipeEnabled()
public void setTopSwipeEnabled(boolean topSwipeEnabled)
public boolean isBottomSwipeEnabled()
public void setBottomSwipeEnabled(boolean bottomSwipeEnabled)
protected void onAttachedToWindow()
onAttachedToWindow 在类中 android.view.ViewGrouppublic void setOnClickListener(android.view.View.OnClickListener l)
setOnClickListener 在类中 android.view.Viewpublic void setOnLongClickListener(android.view.View.OnLongClickListener l)
setOnLongClickListener 在类中 android.view.Viewpublic void setDragDistance(int max)
max - max distance in dp unitpublic void setShowMode(SwipeLayout.ShowMode mode)
SwipeLayout.ShowMode.PullOut and
SwipeLayout.ShowMode.LayDown.mode - public SwipeLayout.DragEdge getDragEdge()
public int getDragDistance()
public SwipeLayout.ShowMode getShowMode()
public android.view.View getSurfaceView()
public android.view.View getCurrentBottomView()
public java.util.List<android.view.View> getBottomViews()
public SwipeLayout.Status getOpenStatus()
SwipeLayout.Status Open , Close or
Middle.protected void processHandRelease(float xvel,
float yvel,
boolean isCloseBeforeDragged)
xvel - xVelocityyvel - yVelocityisCloseBeforeDragged - the open state before dragpublic void open()
public void open(boolean smooth)
public void open(boolean smooth,
boolean notify)
public void open(SwipeLayout.DragEdge edge)
public void open(boolean smooth,
SwipeLayout.DragEdge edge)
public void open(boolean smooth,
boolean notify,
SwipeLayout.DragEdge edge)
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)
public void setOnDoubleClickListener(SwipeLayout.DoubleClickListener doubleClickListener)
@Deprecated public void setDragEdge(SwipeLayout.DragEdge dragEdge)
addDrag(DragEdge, View)protected void onViewRemoved(android.view.View child)
public java.util.Map<SwipeLayout.DragEdge,android.view.View> getDragEdgeMap()
@Deprecated public java.util.List<SwipeLayout.DragEdge> getDragEdges()
getDragEdgeMap()@Deprecated public void setDragEdges(java.util.List<SwipeLayout.DragEdge> dragEdges)
addDrag(DragEdge, View)@Deprecated public void setDragEdges(SwipeLayout.DragEdge... mDragEdges)
addDrag(DragEdge, View)@Deprecated
public void setBottomViewIds(int leftId,
int rightId,
int topId,
int bottomId)
addDrag(DragEdge, View)
When using multiple drag edges it's a good idea to pass the ids of the views that
you're using for the left, right, top bottom views (-1 if you're not using a particular view)