public abstract class SwipeBack
extends android.view.ViewGroup
| Modifier and Type | Class and Description |
|---|---|
static interface |
SwipeBack.OnInterceptMoveEventListener
Callback that is invoked when the drawer is in the process of deciding whether it should intercept the touch
event.
|
static interface |
SwipeBack.OnStateChangeListener
Callback interface for changing state of the swipe back.
|
static class |
SwipeBack.Type |
android.view.ViewGroup.LayoutParams, 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.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 |
|---|---|
protected static int |
ANIMATION_DELAY
The time between each frame when animating the drawer.
|
static int |
DRAG_CONTENT
Drag mode for sliding only the content view.
|
static int |
DRAG_WINDOW
Drag mode for sliding the entire window.
|
protected int |
mActivePosition
Position of the active view.
|
protected android.graphics.Rect |
mActiveRect
Used when reading the position of the active view.
|
protected android.view.View |
mActiveView
The currently active view.
|
protected com.hannesdorfmann.swipeback.BuildLayerFrameLayout |
mContentContainer
The parent of the content view.
|
protected int |
mDividerAsShadowColor
The color of the shadow that will be used as divider .
|
protected android.graphics.drawable.Drawable |
mDividerDrawable
Drawable used as content to swipe back view divider.
|
protected boolean |
mDividerEnabled
Defines if the divider is enabled (will be drawn)
|
protected android.graphics.Rect |
mDividerRect |
protected int |
mDividerSize
The size (width) of the content to swipe back view divider.
|
protected int |
mDrawerState
The current drawer state.
|
protected boolean |
mDrawOverlay
Whether an overlay should be drawn as the drawer is opened and closed.
|
protected boolean |
mHardwareLayersEnabled
Indicates whether to use
View.LAYER_TYPE_HARDWARE when animating the drawer. |
protected boolean |
mIsStatic |
protected int |
mMaxAnimationDuration
The maximum duration of open/close animations.
|
protected float |
mOffsetPixels
Current offset.
|
protected SwipeBack.OnInterceptMoveEventListener |
mOnInterceptMoveEventListener
Callback that lets the listener override intercepting of touch events.
|
protected int |
mPreviousTouchMode
Used for storing the previous touch mode, while disabling Swipe Back
temporarly
|
protected com.hannesdorfmann.swipeback.BuildLayerFrameLayout |
mSwipeBackContainer
The parent of the swipe back view.
|
protected android.graphics.drawable.Drawable |
mSwipeBackOverlay
Drawable used as swipe back view overlay.
|
protected SwipeBackTransformer |
mSwipeBackTransformer
The SwipeBackTransformer
|
protected int |
mSwipeBackViewSize
The size of the swipe back view (width or height depending on the
gravity).
|
protected boolean |
mSwipeBackViewVisible
Indicates whether the swipe back view is currently visible.
|
protected int |
mTouchBezelSize
The touch bezel size of the swipe back in px.
|
protected int |
mTouchMode
Touch mode for the Drawer.
|
protected int |
mTouchSize
The touch area size of the swipe back in px.
|
protected static android.view.animation.Interpolator |
SMOOTH_INTERPOLATOR
Interpolator used when animating the drawer open/closed.
|
static int |
STATE_CLOSED
Indicates that the drawer is currently closed.
|
static int |
STATE_CLOSING
Indicates that the drawer is currently closing.
|
static int |
STATE_DRAGGING
Indicates that the drawer is currently being dragged by the user.
|
static int |
STATE_OPEN
Indicates that the drawer is currently open.
|
static int |
STATE_OPENING
Indicates that the drawer is currently opening.
|
static int |
TOUCH_MODE_BEZEL
Allow opening drawer only by dragging on the edge of the screen.
|
static int |
TOUCH_MODE_FULLSCREEN
Allow opening drawer by dragging anywhere on the screen.
|
static int |
TOUCH_MODE_NONE
Disallow opening the drawer by dragging the screen.
|
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, 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 |
|---|
SwipeBack(android.content.Context context) |
SwipeBack(android.content.Context context,
android.util.AttributeSet attrs) |
SwipeBack(android.content.Context context,
android.util.AttributeSet attrs,
int defStyle) |
| Modifier and Type | Method and Description |
|---|---|
static SwipeBack |
attach(android.app.Activity activity)
Attaches the SwipeBack to the Activity.
|
static SwipeBack |
attach(android.app.Activity activity,
Position position)
Attaches the SwipeBack to the Activity.
|
static SwipeBack |
attach(android.app.Activity activity,
Position position,
SwipeBackTransformer transformer)
Attaches the SwipeBack to the Activity.
|
static SwipeBack |
attach(android.app.Activity activity,
SwipeBack.Type type)
Attaches the SwipeBack to the Activity.
|
static SwipeBack |
attach(android.app.Activity activity,
SwipeBack.Type type,
Position position)
Attaches the SwipeBack to the Activity
|
static SwipeBack |
attach(android.app.Activity activity,
SwipeBack.Type type,
Position position,
int dragMode)
Attaches the SwipeBack to the Activity
|
static SwipeBack |
attach(android.app.Activity activity,
SwipeBack.Type type,
Position position,
int dragMode,
SwipeBackTransformer transformer)
Attaches the SwipeBack to the Activity.
|
static SwipeBack |
attach(android.app.Activity activity,
SwipeBack.Type type,
Position position,
SwipeBackTransformer transformer)
Attaches the SwipeBack to the Activity.
|
static SwipeBack |
attach(android.app.Activity activity,
SwipeBack.Type type,
SwipeBackTransformer transformer)
Attaches the SwipeBack to the Activity.
|
static SwipeBack |
attach(android.app.Activity activity,
SwipeBackTransformer transformer)
Attaches the SwipeBack to the Activity.
|
SwipeBack |
close()
Animates the swipe back closed.
|
abstract SwipeBack |
close(boolean animate)
Closes the swipe back.
|
void |
disable() |
protected void |
dispatchDraw(android.graphics.Canvas canvas) |
protected void |
dispatchOnDrawerSlide(float openRatio,
int offsetPixels) |
int |
dpToPx(int dp) |
protected abstract void |
drawOverlay(android.graphics.Canvas canvas) |
protected boolean |
fitSystemWindows(android.graphics.Rect insets) |
android.view.ViewGroup |
getContentContainer()
Returns the ViewGroup used as a parent for the content view.
|
android.graphics.drawable.Drawable |
getDivider()
Returns the drawable of the divider.
|
protected android.graphics.drawable.GradientDrawable.Orientation |
getDividerOrientation() |
boolean |
getDrawOverlay()
Gets whether an overlay is drawn when sliding the swipe back view.
|
abstract boolean |
getOffsetSwipeBackEnabled()
Indicates whether the swipe back is being offset when dragging the
drawer.
|
protected Position |
getPosition() |
int |
getSize()
Returns the size of the swipe back.
|
int |
getState()
Get the current state of the drawer.
|
android.view.ViewGroup |
getSwipeBackContainer()
Returns the ViewGroup used as a parent for the swipe back view.
|
SwipeBackTransformer |
getSwipeBackTransformer()
Get the
SwipeBackTransformer |
android.view.View |
getSwipeBackView()
Returns the swipe back view.
|
abstract int |
getTouchBezelSize()
Returns the size of the touch bezel in px.
|
abstract int |
getTouchMode()
Returns the touch mode.
|
protected void |
init(android.content.Context context,
android.util.AttributeSet attrs,
int defStyle) |
protected boolean |
isActivitiyDestroyed()
Determines if the activity has been destroyed or finished.
|
protected boolean |
isViewDescendant(android.view.View v) |
abstract boolean |
isVisible()
Indicates whether the swipe back is currently visible.
|
protected SwipeBack |
logDrawerState(int state) |
protected void |
onAttachedToWindow() |
protected void |
onDetachedFromWindow() |
protected void |
onFinishInflate() |
protected abstract void |
onOffsetPixelsChanged(int offsetPixels)
Called when the number of pixels the content should be offset by has changed.
|
void |
onRtlPropertiesChanged(int layoutDirection) |
SwipeBack |
open()
Animates the swipe back open.
|
abstract SwipeBack |
open(boolean animate)
Opens the swipe back.
|
abstract SwipeBack |
peekSwipeBack()
Animates the swipe back view slightly open until the user opens it completely.
|
abstract SwipeBack |
peekSwipeBack(long delay)
Animates the swipe back view slightly open.
|
abstract SwipeBack |
peekSwipeBack(long startDelay,
long delay)
Animates the swipe back view slightly open.
|
void |
postOnAnimation(java.lang.Runnable action) |
SwipeBack |
setContentView(int layoutResId)
Set the content from a layout resource.
|
SwipeBack |
setContentView(android.view.View view)
Set the content to an explicit view.
|
SwipeBack |
setContentView(android.view.View view,
android.view.ViewGroup.LayoutParams params)
Set the content to an explicit view.
|
SwipeBack |
setDivider(android.graphics.drawable.Drawable drawable)
Sets the drawable of the divider.
|
SwipeBack |
setDivider(int resId)
Sets the drawable resource id of the divider .
|
SwipeBack |
setDividerAsShadowColor(int color)
Sets the color of the divider, if you have set the option to use a shadow
gradient as divider
You must enable the divider by calling
setDividerEnabled(boolean) |
SwipeBack |
setDividerAsSolidColor(int color)
Draw the divider as solid color (using
ColorDrawable). |
SwipeBack |
setDividerEnabled(boolean enabled)
Defines whether the drop shadow is enabled.
|
SwipeBack |
setDividerSize(int dp)
Sets the size (width) of the divider.
|
SwipeBack |
setDividerSizeInPixel(int pixel)
Sets the size (width) of the divider.
|
protected SwipeBack |
setDrawerState(int state) |
SwipeBack |
setDrawOverlay(boolean drawOverlay)
Sets whether an overlay should be drawn when sliding the swipe back view.
|
abstract SwipeBack |
setHardwareLayerEnabled(boolean enabled)
Enables or disables the user of
View.LAYER_TYPE_HARDWARE when animations views. |
SwipeBack |
setMaxAnimationDuration(int duration)
Sets the maximum duration of open/close animations.
|
protected void |
setOffsetPixels(float offsetPixels)
Sets the number of pixels the content should be offset.
|
abstract void |
setOffsetSwipeBackViewEnabled(boolean offsetEnabled)
Enables or disables offsetting the swipe back when dragging the drawer.
|
void |
setOnInterceptMoveEventListener(SwipeBack.OnInterceptMoveEventListener listener)
Register a callback that will be invoked when the drawer is about to intercept touch events.
|
SwipeBack |
setOnStateChangeListener(SwipeBack.OnStateChangeListener listener)
An additional
SwipeBack.OnStateChangeListener which will be plugged in to
the internal delegate to allow to observe the internal state from outside |
abstract SwipeBack |
setSize(int size)
Set the size of the swipe back when open.
|
SwipeBack |
setSwipeBackContainerBackgroundColor(int color)
Set the background color of the swipe back view container (The container
where the swipe back view is inflated into)
|
SwipeBack |
setSwipeBackContainerBackgroundDrawable(android.graphics.drawable.Drawable d)
Set the background of the wipe swipe back view container (The container
where the swipe back view is inflated into)
|
SwipeBack |
setSwipeBackContainerBackgroundDrawable(int resId)
Set the background of the wipe swipe back view container (The container
where the swipe back view is inflated into)
|
SwipeBack |
setSwipeBackTransformer(SwipeBackTransformer transformer)
Set the
SwipeBackTransformer |
SwipeBack |
setSwipeBackView(int layoutResId)
Set the swipe back view from a layout resource.
|
SwipeBack |
setSwipeBackView(android.view.View view)
Set the swipe back view to an explicit view.
|
SwipeBack |
setSwipeBackView(android.view.View view,
android.view.ViewGroup.LayoutParams params)
Set the swipe back view to an explicit view.
|
abstract SwipeBack |
setTouchBezelSize(int size)
Sets the size of the touch bezel.
|
void |
setTouchEnabled(boolean enabled)
Disable or enable Touch.
|
abstract SwipeBack |
setTouchMode(int mode)
Sets the drawer touch mode.
|
SwipeBack |
toggle()
Toggles the swipe back open and close with animation.
|
abstract SwipeBack |
toggle(boolean animate)
Toggles the swipe back open and close.
|
protected void |
updateDividerRect() |
protected void |
updateTouchAreaSize()
Compute the touch area based on the touch mode.
|
addChildrenForAccessibility, addFocusables, addStatesFromChildren, addTouchables, addView, addView, addView, addView, addView, addViewInLayout, addViewInLayout, attachLayoutAnimationParameters, attachViewToParent, bringChildToFront, canAnimate, checkLayoutParams, childDrawableStateChanged, childHasTransientStateChanged, cleanupLayoutState, clearChildFocus, clearDisappearingChildren, clearFocus, debug, detachAllViewsFromParent, detachViewFromParent, detachViewFromParent, detachViewsFromParent, dispatchApplyWindowInsets, dispatchConfigurationChanged, dispatchDisplayHint, dispatchDragEvent, 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, generateDefaultLayoutParams, generateLayoutParams, generateLayoutParams, getAccessibilityClassName, 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, onCreateDrawableState, onInterceptHoverEvent, onInterceptTouchEvent, onLayout, onNestedFling, onNestedPreFling, onNestedPrePerformAccessibilityAction, onNestedPreScroll, onNestedScroll, onNestedScrollAccepted, onRequestFocusInDescendants, onRequestSendAccessibilityEvent, 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, shouldDelayChildPressedState, showContextMenuForChild, startActionModeForChild, 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, computeScroll, computeSystemWindowInsets, computeVerticalScrollExtent, computeVerticalScrollOffset, computeVerticalScrollRange, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchGenericMotionEvent, dispatchNestedFling, dispatchNestedPreFling, dispatchNestedPrePerformAccessibilityAction, dispatchNestedPreScroll, dispatchNestedScroll, dispatchPopulateAccessibilityEvent, draw, drawableHotspotChanged, findViewById, findViewWithTag, focusSearch, 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, 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, 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, isTextAlignmentResolved, isTextDirectionResolved, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, measure, mergeDrawableStates, offsetLeftAndRight, offsetTopAndBottom, onAnimationEnd, onAnimationStart, onApplyWindowInsets, onCancelPendingInputEvents, onCheckIsTextEditor, onConfigurationChanged, onCreateContextMenu, onCreateInputConnection, onDisplayHint, onDragEvent, onDraw, onDrawForeground, onDrawScrollBars, onFilterTouchEventForSecurity, onFinishTemporaryDetach, onFocusChanged, onGenericMotionEvent, onHoverChanged, onHoverEvent, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onMeasure, onOverScrolled, onPopulateAccessibilityEvent, onProvideStructure, onProvideVirtualStructure, onRestoreInstanceState, onSaveInstanceState, onScreenStateChanged, onScrollChanged, onSetAlpha, onSizeChanged, onStartTemporaryDetach, onTouchEvent, onTrackballEvent, onVisibilityChanged, onWindowFocusChanged, onWindowSystemUiVisibilityChanged, onWindowVisibilityChanged, overScrollBy, performAccessibilityAction, performClick, performContextClick, performHapticFeedback, performHapticFeedback, performLongClick, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, postInvalidateOnAnimation, postInvalidateOnAnimation, 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, setForegroundGravity, 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, setPressed, 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, startActionMode, startActionMode, startAnimation, startDrag, startNestedScroll, stopNestedScroll, toString, unscheduleDrawable, unscheduleDrawable, verifyDrawable, willNotCacheDrawing, willNotDrawclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcanResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, createContextMenu, getLayoutDirection, getParent, getParentForAccessibility, getTextAlignment, getTextDirection, isLayoutDirectionResolved, isLayoutRequested, isTextAlignmentResolved, isTextDirectionResolved, requestFitSystemWindows, requestLayoutprotected static final int ANIMATION_DELAY
public static final int DRAG_CONTENT
public static final int DRAG_WINDOW
public static final int TOUCH_MODE_NONE
public static final int TOUCH_MODE_BEZEL
public static final int TOUCH_MODE_FULLSCREEN
public static final int STATE_CLOSED
public static final int STATE_CLOSING
public static final int STATE_DRAGGING
public static final int STATE_OPENING
public static final int STATE_OPEN
protected static final android.view.animation.Interpolator SMOOTH_INTERPOLATOR
protected android.graphics.drawable.Drawable mSwipeBackOverlay
protected boolean mDividerEnabled
protected int mDividerAsShadowColor
protected android.graphics.drawable.Drawable mDividerDrawable
protected int mDividerSize
protected android.view.View mActiveView
protected int mActivePosition
protected int mPreviousTouchMode
protected final android.graphics.Rect mActiveRect
protected com.hannesdorfmann.swipeback.BuildLayerFrameLayout mSwipeBackContainer
protected com.hannesdorfmann.swipeback.BuildLayerFrameLayout mContentContainer
protected int mSwipeBackViewSize
protected boolean mSwipeBackViewVisible
protected int mDrawerState
STATE_CLOSED,
STATE_CLOSING,
STATE_DRAGGING,
STATE_OPENING,
STATE_OPENprotected int mTouchBezelSize
protected int mTouchSize
protected int mTouchMode
TOUCH_MODE_NONE, TOUCH_MODE_BEZEL or TOUCH_MODE_FULLSCREEN
Default: TOUCH_MODE_BEZELprotected boolean mHardwareLayersEnabled
View.LAYER_TYPE_HARDWARE when animating the drawer.protected int mMaxAnimationDuration
protected SwipeBack.OnInterceptMoveEventListener mOnInterceptMoveEventListener
protected boolean mIsStatic
protected final android.graphics.Rect mDividerRect
protected float mOffsetPixels
protected boolean mDrawOverlay
protected SwipeBackTransformer mSwipeBackTransformer
public SwipeBack(android.content.Context context)
public SwipeBack(android.content.Context context,
android.util.AttributeSet attrs)
public SwipeBack(android.content.Context context,
android.util.AttributeSet attrs,
int defStyle)
public static SwipeBack attach(android.app.Activity activity)
activity - The activity that the SwipeBack will be attached to.public static SwipeBack attach(android.app.Activity activity, SwipeBackTransformer transformer)
activity - The activity that the SwipeBack will be attached to.transformer - the transformerpublic static SwipeBack attach(android.app.Activity activity, SwipeBack.Type type)
activity - The activity the Swipe Back will be attached to.type - The SwipeBack.Type of the drawer.public static SwipeBack attach(android.app.Activity activity, SwipeBack.Type type, SwipeBackTransformer transformer)
activity - The activity the swipe back will be attached to.type - The SwipeBack.Type of the drawer.public static SwipeBack attach(android.app.Activity activity, Position position, SwipeBackTransformer transformer)
activity - The activity the swipe back will be attached to.position - Where to position the swipe back.public static SwipeBack attach(android.app.Activity activity, Position position)
activity - The activity the swipe back will be attached to.position - Where to position the swipe back.public static SwipeBack attach(android.app.Activity activity, SwipeBack.Type type, Position position, SwipeBackTransformer transformer)
activity - The activity the swipe back will be attached to.type - The SwipeBack.Type of the drawer.position - Where to position the swipe back.transformer - public static SwipeBack attach(android.app.Activity activity, SwipeBack.Type type, Position position, int dragMode)
activity - type - position - dragMode - The dragMode which is DRAG_CONTENT or
DRAG_WINDOWpublic static SwipeBack attach(android.app.Activity activity, SwipeBack.Type type, Position position)
activity - type - position - public static SwipeBack attach(android.app.Activity activity, SwipeBack.Type type, Position position, int dragMode, SwipeBackTransformer transformer)
activity - The activity the swipe back will be attached to.type - The SwipeBack.Type of the drawer.position - Where to position the swipe back.dragMode - The drag mode of the drawer. Can be either
DRAG_CONTENT or
DRAG_WINDOW.protected boolean isActivitiyDestroyed()
protected void init(android.content.Context context,
android.util.AttributeSet attrs,
int defStyle)
protected void onFinishInflate()
onFinishInflate in class android.view.Viewpublic int dpToPx(int dp)
protected boolean isViewDescendant(android.view.View v)
protected void onAttachedToWindow()
onAttachedToWindow in class android.view.ViewGroupprotected void onDetachedFromWindow()
onDetachedFromWindow in class android.view.ViewGroupprotected void dispatchDraw(android.graphics.Canvas canvas)
dispatchDraw in class android.view.ViewGroupprotected abstract void drawOverlay(android.graphics.Canvas canvas)
protected void updateDividerRect()
public void setTouchEnabled(boolean enabled)
enabled - protected Position getPosition()
public void onRtlPropertiesChanged(int layoutDirection)
onRtlPropertiesChanged in class android.view.Viewprotected void setOffsetPixels(float offsetPixels)
offsetPixels - The number of pixels to offset the content by.protected abstract void onOffsetPixelsChanged(int offsetPixels)
offsetPixels - The number of pixels to offset the content by.public SwipeBack toggle()
public abstract SwipeBack toggle(boolean animate)
animate - Whether open/close should be animated.public SwipeBack open()
public abstract SwipeBack open(boolean animate)
animate - Whether open/close should be animated.public SwipeBack setSwipeBackContainerBackgroundColor(int color)
color - The color (not resource id)public SwipeBack setSwipeBackContainerBackgroundDrawable(android.graphics.drawable.Drawable d)
d - public SwipeBack setSwipeBackContainerBackgroundDrawable(int resId)
resId - The resource id of the drawable. Will interanlly call
getResources().getDrawable(resId)public SwipeBack close()
public abstract SwipeBack close(boolean animate)
animate - Whether open/close should be animated.public abstract boolean isVisible()
public abstract SwipeBack setSize(int size)
size - The size of the swipe back.public int getSize()
protected void updateTouchAreaSize()
public abstract void setOffsetSwipeBackViewEnabled(boolean offsetEnabled)
offsetEnabled - True to offset the swipe back, false otherwise.public abstract boolean getOffsetSwipeBackEnabled()
public int getState()
public void setOnInterceptMoveEventListener(SwipeBack.OnInterceptMoveEventListener listener)
listener - The callback that will be invoked.public SwipeBack setDividerEnabled(boolean enabled)
enabled - Whether the drop shadow is enabled.protected android.graphics.drawable.GradientDrawable.Orientation getDividerOrientation()
public SwipeBack setDividerAsShadowColor(int color)
setDividerEnabled(boolean)color - The color of the divider shadow.public SwipeBack setDivider(android.graphics.drawable.Drawable drawable)
setDividerEnabled(boolean)drawable - The drawable of the divider.public SwipeBack setDivider(int resId)
setDividerEnabled(boolean)resId - The resource identifier of the the drawable.public android.graphics.drawable.Drawable getDivider()
public SwipeBack setDividerSize(int dp)
size - The size (width) of the divider in dp (device independent
pixel = dp = dip).setDividerSizeInPixel(int)public SwipeBack setDividerSizeInPixel(int pixel)
pixel - The size (widht) of the divider in pixelssetDividerSize(int)public SwipeBack setDividerAsSolidColor(int color)
ColorDrawable).
You must enable the divider by calling
setDividerEnabled(boolean)color - public abstract SwipeBack peekSwipeBack()
public abstract SwipeBack peekSwipeBack(long delay)
delay - The delay (in milliseconds) between each run of the animation. If 0, this animation is only run
once.public abstract SwipeBack peekSwipeBack(long startDelay, long delay)
startDelay - The delay (in milliseconds) until the animation is first run.delay - The delay (in milliseconds) between each run of the animation. If 0, this animation is only run
once.public abstract SwipeBack setHardwareLayerEnabled(boolean enabled)
View.LAYER_TYPE_HARDWARE when animations views.enabled - Whether hardware layers are enabled.public SwipeBack setMaxAnimationDuration(int duration)
duration - The maximum duration in milliseconds.public SwipeBack setDrawOverlay(boolean drawOverlay)
drawOverlay - Whether an overlay should be drawn when sliding the drawer.public boolean getDrawOverlay()
public android.view.ViewGroup getSwipeBackContainer()
public android.view.ViewGroup getContentContainer()
public SwipeBack setSwipeBackView(int layoutResId)
layoutResId - Resource ID to be inflated.public SwipeBack setSwipeBackView(android.view.View view)
view - The swipe back view.public SwipeBack setSwipeBackView(android.view.View view, android.view.ViewGroup.LayoutParams params)
view - The swipe back view.params - Layout parameters for the view.public android.view.View getSwipeBackView()
public SwipeBack setContentView(int layoutResId)
layoutResId - Resource ID to be inflated.public SwipeBack setContentView(android.view.View view)
view - The desired content to display.public SwipeBack setContentView(android.view.View view, android.view.ViewGroup.LayoutParams params)
view - The desired content to display.params - Layout parameters for the view.protected SwipeBack setDrawerState(int state)
protected SwipeBack logDrawerState(int state)
public abstract int getTouchMode()
public abstract SwipeBack setTouchMode(int mode)
TOUCH_MODE_NONE, TOUCH_MODE_BEZEL or
TOUCH_MODE_FULLSCREEN.mode - The touch mode.public abstract SwipeBack setTouchBezelSize(int size)
size - The touch bezel size in px.public abstract int getTouchBezelSize()
public void disable()
public SwipeBack setSwipeBackTransformer(SwipeBackTransformer transformer)
SwipeBackTransformertransformer - public SwipeBackTransformer getSwipeBackTransformer()
SwipeBackTransformerpublic SwipeBack setOnStateChangeListener(SwipeBack.OnStateChangeListener listener)
SwipeBack.OnStateChangeListener which will be plugged in to
the internal delegate to allow to observe the internal state from outsidelistener - The SwipeBack.OnStateChangeListener listenerpublic void postOnAnimation(java.lang.Runnable action)
postOnAnimation in class android.view.Viewprotected boolean fitSystemWindows(android.graphics.Rect insets)
fitSystemWindows in class android.view.Viewprotected void dispatchOnDrawerSlide(float openRatio,
int offsetPixels)