|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.view.View
android.view.ViewGroup
net.simonvt.menudrawer.MenuDrawer
net.simonvt.menudrawer.DraggableDrawer
public abstract class DraggableDrawer
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class net.simonvt.menudrawer.MenuDrawer |
|---|
MenuDrawer.OnDrawerStateChangeListener, MenuDrawer.OnInterceptMoveEventListener |
| Nested classes/interfaces inherited from class android.view.ViewGroup |
|---|
android.view.ViewGroup.LayoutParams, android.view.ViewGroup.MarginLayoutParams, android.view.ViewGroup.OnHierarchyChangeListener |
| Nested classes/interfaces inherited from class android.view.View |
|---|
android.view.View.AccessibilityDelegate, android.view.View.BaseSavedState, android.view.View.DragShadowBuilder, android.view.View.MeasureSpec, 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 |
| Field Summary | |
|---|---|
protected static android.view.animation.Interpolator |
INDICATOR_INTERPOLATOR
Interpolator used for stretching/retracting the active indicator. |
protected static int |
INVALID_POINTER
|
protected int |
mActivePointerId
The current pointer id. |
protected static int |
MAX_MENU_OVERLAY_ALPHA
The maximum alpha of the dark menu overlay used for dimming the menu. |
protected int |
mCloseEnough
Distance in px from closed position from where the drawer is considered closed with regards to touch events. |
protected float |
mInitialMotionX
The initial X position of a drag. |
protected float |
mInitialMotionY
The initial Y position of a drag. |
protected boolean |
mIsDragging
Indicates whether the drawer is currently being dragged. |
protected float |
mLastMotionX
The last X position of a drag. |
protected float |
mLastMotionY
The last Y position of a drag. |
protected int |
mMaxVelocity
Maximum velocity allowed when animating the drawer open/closed. |
protected boolean |
mOffsetMenu
Indicates whether the menu should be offset when dragging the drawer. |
protected float |
mOffsetPixels
Current left position of the content. |
protected long |
mPeekDelay
Default delay between each subsequent animation, after peekDrawer() has been called. |
protected Runnable |
mPeekRunnable
Runnable used when the peek animation is running. |
protected net.simonvt.menudrawer.Scroller |
mPeekScroller
Scroller used for the peek drawer animation. |
protected int |
mTouchSlop
Slop before starting a drag. |
protected android.view.VelocityTracker |
mVelocityTracker
Velocity tracker used when animating the drawer open/closed after a drag. |
protected static int |
PEEK_DURATION
The duration of the peek animation. |
| Fields inherited from class android.view.ViewGroup |
|---|
CLIP_TO_PADDING_MASK, FOCUS_AFTER_DESCENDANTS, FOCUS_BEFORE_DESCENDANTS, FOCUS_BLOCK_DESCENDANTS, PERSISTENT_ALL_CACHES, PERSISTENT_ANIMATION_CACHE, PERSISTENT_NO_CACHE, PERSISTENT_SCROLLING_CACHE |
| Fields inherited from class android.view.View |
|---|
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_YES, INVISIBLE, KEEP_SCREEN_ON, LAYER_TYPE_HARDWARE, LAYER_TYPE_NONE, LAYER_TYPE_SOFTWARE, 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_WINDOW_FOCUSED_STATE_SET, ROTATION, ROTATION_X, ROTATION_Y, SCALE_X, SCALE_Y, SCREEN_STATE_OFF, SCREEN_STATE_ON, SCROLLBAR_POSITION_DEFAULT, SCROLLBAR_POSITION_LEFT, SCROLLBAR_POSITION_RIGHT, SCROLLBARS_INSIDE_INSET, SCROLLBARS_INSIDE_OVERLAY, SCROLLBARS_OUTSIDE_INSET, SCROLLBARS_OUTSIDE_OVERLAY, SELECTED_STATE_SET, SELECTED_WINDOW_FOCUSED_STATE_SET, SOUND_EFFECTS_ENABLED, STATUS_BAR_HIDDEN, STATUS_BAR_VISIBLE, SYSTEM_UI_FLAG_FULLSCREEN, SYSTEM_UI_FLAG_HIDE_NAVIGATION, SYSTEM_UI_FLAG_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_INHERIT, TEXT_ALIGNMENT_RESOLVED_DEFAULT, TRANSLATION_X, TRANSLATION_Y, VIEW_LOG_TAG, VISIBLE, WINDOW_FOCUSED_STATE_SET, X, Y |
| Constructor Summary | |
|---|---|
DraggableDrawer(android.content.Context context)
|
|
DraggableDrawer(android.content.Context context,
android.util.AttributeSet attrs)
|
|
DraggableDrawer(android.content.Context context,
android.util.AttributeSet attrs,
int defStyle)
|
|
| Method Summary | |
|---|---|
protected void |
animateOffsetTo(int position,
int velocity,
boolean animate)
Moves the drawer to the position passed. |
protected boolean |
canChildScrollHorizontally(android.view.View v,
boolean checkV,
int dx,
int x,
int y)
Tests scrollability within child views of v given a delta of dx. |
protected boolean |
canChildScrollVertically(android.view.View v,
boolean checkV,
int dx,
int x,
int y)
Tests scrollability within child views of v given a delta of dx. |
protected void |
dispatchDraw(android.graphics.Canvas canvas)
|
protected abstract void |
drawDropShadow(android.graphics.Canvas canvas,
int offsetPixels)
Called when the content drop shadow should be drawn. |
protected abstract void |
drawIndicator(android.graphics.Canvas canvas,
int offsetPixels)
Called when the active indicator should be drawn. |
protected abstract void |
drawMenuOverlay(android.graphics.Canvas canvas,
int offsetPixels)
Called when the menu overlay should be drawn. |
protected void |
endDrag()
Called when a drag has been ended. |
protected void |
endPeek()
Stops ongoing peek drawer animation. |
boolean |
getOffsetMenuEnabled()
Indicates whether the menu is being offset when dragging the drawer. |
int |
getTouchBezelSize()
Returns the size of the touch bezel in px. |
int |
getTouchMode()
Returns the touch mode. |
protected void |
initDrawer(android.content.Context context,
android.util.AttributeSet attrs,
int defStyle)
|
protected abstract void |
initPeekScroller()
|
protected boolean |
isCloseEnough()
|
protected abstract boolean |
isContentTouch(android.view.MotionEvent ev)
Returns true if the touch event occurs over the content. |
boolean |
isMenuVisible()
Indicates whether the menu is currently visible. |
protected abstract boolean |
onDownAllowDrag(android.view.MotionEvent ev)
Returns true if dragging the content should be allowed. |
protected abstract boolean |
onMoveAllowDrag(android.view.MotionEvent ev,
float dx)
Returns true if dragging the content should be allowed. |
protected abstract void |
onMoveEvent(float dx)
Called when a move event has happened while dragging the content is in progress. |
protected abstract void |
onOffsetPixelsChanged(int offsetPixels)
Called when the number of pixels the content should be offset by has changed. |
protected abstract void |
onUpEvent(android.view.MotionEvent ev)
Called when MotionEvent.ACTION_UP of MotionEvent.ACTION_CANCEL is
delivered to View.onTouchEvent(android.view.MotionEvent). |
void |
peekDrawer()
Animates the drawer slightly open until the user opens the drawer. |
void |
peekDrawer(long delay)
Animates the drawer slightly open. |
void |
peekDrawer(long startDelay,
long delay)
Animates the drawer slightly open. |
void |
restoreState(android.os.Parcelable in)
Restores the state of the drawer. |
void |
setHardwareLayerEnabled(boolean enabled)
Enables or disables the user of View.LAYER_TYPE_HARDWARE when animations views. |
void |
setMenuSize(int size)
Set the size of the menu drawer when open. |
void |
setOffsetMenuEnabled(boolean offsetMenu)
Enables or disables offsetting the menu when dragging the drawer. |
protected void |
setOffsetPixels(float offsetPixels)
Sets the number of pixels the content should be offset. |
void |
setTouchBezelSize(int size)
Sets the size of the touch bezel. |
void |
setTouchMode(int mode)
Sets the drawer touch mode. |
protected void |
startLayerTranslation()
If possible, set the layer type to View.LAYER_TYPE_HARDWARE. |
protected void |
startPeek()
Starts peek drawer animation. |
protected void |
stopAnimation()
Stops ongoing animation of the drawer. |
void |
toggleMenu(boolean animate)
Toggles the menu open and close. |
protected void |
updateTouchAreaSize()
Compute the touch area based on the touch mode. |
| Methods inherited from class android.view.ViewGroup |
|---|
addChildrenForAccessibility, addFocusables, addStatesFromChildren, addTouchables, addView, addView, addView, addView, addViewInLayout, addViewInLayout, attachLayoutAnimationParameters, attachViewToParent, bringChildToFront, canAnimate, checkLayoutParams, childDrawableStateChanged, cleanupLayoutState, clearChildFocus, clearDisappearingChildren, clearFocus, debug, detachAllViewsFromParent, detachViewFromParent, detachViewFromParent, detachViewsFromParent, dispatchConfigurationChanged, dispatchDisplayHint, dispatchDragEvent, dispatchFreezeSelfOnly, dispatchGenericFocusedEvent, dispatchGenericPointerEvent, dispatchHoverEvent, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, 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, getChildAt, getChildCount, getChildDrawingOrder, getChildMeasureSpec, getChildStaticTransformation, getChildVisibleRect, getDescendantFocusability, getFocusedChild, getLayoutAnimation, getLayoutAnimationListener, getLayoutTransition, getPersistentDrawingCache, hasFocus, hasFocusable, indexOfChild, invalidateChild, invalidateChildInParent, isAlwaysDrawnWithCacheEnabled, isAnimationCacheEnabled, isChildrenDrawingOrderEnabled, isChildrenDrawnWithCacheEnabled, isMotionEventSplittingEnabled, jumpDrawablesToCurrentState, layout, measureChild, measureChildren, measureChildWithMargins, offsetDescendantRectToMyCoords, offsetRectIntoDescendantCoords, onAnimationEnd, onAnimationStart, onCreateDrawableState, onInterceptHoverEvent, onInterceptTouchEvent, onLayout, onRequestFocusInDescendants, onRequestSendAccessibilityEvent, 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, setLayoutTransition, setMotionEventSplittingEnabled, setOnHierarchyChangeListener, setPadding, setPersistentDrawingCache, setStaticTransformationsEnabled, shouldDelayChildPressedState, showContextMenuForChild, startActionModeForChild, startLayoutAnimation, startViewTransition, updateViewLayout |
| Methods inherited from class android.view.View |
|---|
addFocusables, addOnAttachStateChangeListener, addOnLayoutChangeListener, animate, announceForAccessibility, awakenScrollBars, awakenScrollBars, awakenScrollBars, bringToFront, buildDrawingCache, buildDrawingCache, buildLayer, callOnClick, cancelLongPress, canScrollHorizontally, canScrollVertically, checkInputConnectionProxy, clearAnimation, combineMeasuredStates, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeHorizontalScrollRange, computeScroll, computeVerticalScrollExtent, computeVerticalScrollOffset, computeVerticalScrollRange, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchGenericMotionEvent, dispatchPopulateAccessibilityEvent, draw, findViewById, findViewWithTag, focusSearch, forceLayout, getAccessibilityNodeProvider, getAlpha, getAnimation, getApplicationWindowToken, getBackground, getBaseline, getBottom, getBottomFadingEdgeStrength, getBottomPaddingOffset, getCameraDistance, getContentDescription, getContext, getContextMenuInfo, getDefaultSize, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusables, getFocusedRect, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarHeight, getId, getImportantForAccessibility, getKeepScreenOn, getKeyDispatcherState, getLayerType, getLayoutParams, getLeft, getLeftFadingEdgeStrength, getLeftPaddingOffset, getLocalVisibleRect, getLocationInWindow, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOverScrollMode, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getParent, getParentForAccessibility, getPivotX, getPivotY, getResources, getRight, getRightFadingEdgeStrength, getRightPaddingOffset, getRootView, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, getScrollX, getScrollY, getSolidColor, getSuggestedMinimumHeight, getSuggestedMinimumWidth, getSystemUiVisibility, getTag, getTag, getTop, getTopFadingEdgeStrength, getTopPaddingOffset, getTouchables, getTouchDelegate, getTranslationX, getTranslationY, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarWidth, getViewTreeObserver, getVisibility, getWidth, getWindowAttachCount, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, hasOnClickListeners, hasOverlappingRendering, hasTransientState, hasWindowFocus, inflate, initializeFadingEdge, initializeScrollbars, invalidate, invalidate, invalidate, invalidateDrawable, isActivated, isClickable, isDirty, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isHapticFeedbackEnabled, isHardwareAccelerated, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isInEditMode, isInTouchMode, isLayoutRequested, isLongClickable, isOpaque, isPaddingOffsetRequired, isPressed, isSaveEnabled, isSaveFromParentEnabled, isScrollbarFadingEnabled, isScrollContainer, isSelected, isShown, isSoundEffectsEnabled, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, measure, mergeDrawableStates, offsetLeftAndRight, offsetTopAndBottom, onCheckIsTextEditor, onConfigurationChanged, onCreateContextMenu, onCreateInputConnection, onDisplayHint, onDragEvent, onDraw, onDrawScrollBars, onFilterTouchEventForSecurity, onFinishInflate, onFinishTemporaryDetach, onFocusChanged, onGenericMotionEvent, onHoverChanged, onHoverEvent, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onMeasure, onOverScrolled, onPopulateAccessibilityEvent, onScreenStateChanged, onScrollChanged, onSetAlpha, onSizeChanged, onStartTemporaryDetach, onTouchEvent, onTrackballEvent, onVisibilityChanged, onWindowFocusChanged, onWindowSystemUiVisibilityChanged, onWindowVisibilityChanged, overScrollBy, performAccessibilityAction, performClick, performHapticFeedback, performHapticFeedback, performLongClick, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, postInvalidateOnAnimation, postInvalidateOnAnimation, postOnAnimationDelayed, refreshDrawableState, removeCallbacks, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, requestFitSystemWindows, requestFocus, requestFocus, requestFocusFromTouch, requestLayout, requestRectangleOnScreen, requestRectangleOnScreen, resolveSize, resolveSizeAndState, restoreHierarchyState, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEvent, sendAccessibilityEventUnchecked, setAccessibilityDelegate, setActivated, setAlpha, setAnimation, setBackground, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setBottom, setCameraDistance, setClickable, setContentDescription, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setEnabled, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setFocusable, setFocusableInTouchMode, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHovered, setId, setImportantForAccessibility, setKeepScreenOn, setLayerType, setLayoutParams, setLeft, setLongClickable, setMeasuredDimension, setMinimumHeight, setMinimumWidth, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnClickListener, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnLongClickListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setOverScrollMode, setPivotX, setPivotY, setPressed, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollbarFadingEnabled, setScrollBarSize, setScrollBarStyle, setScrollContainer, setScrollX, setScrollY, setSelected, setSoundEffectsEnabled, setSystemUiVisibility, setTag, setTag, setTop, setTouchDelegate, setTranslationX, setTranslationY, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setVisibility, setWillNotCacheDrawing, setWillNotDraw, setX, setY, showContextMenu, startActionMode, startAnimation, startDrag, unscheduleDrawable, unscheduleDrawable, verifyDrawable, willNotCacheDrawing, willNotDraw |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface android.view.ViewParent |
|---|
createContextMenu, getParent, getParentForAccessibility, isLayoutRequested, requestFitSystemWindows, requestLayout |
| Field Detail |
|---|
protected static final android.view.animation.Interpolator INDICATOR_INTERPOLATOR
protected static final int MAX_MENU_OVERLAY_ALPHA
protected static final int PEEK_DURATION
protected static final int INVALID_POINTER
protected int mTouchSlop
protected final Runnable mPeekRunnable
protected float mOffsetPixels
protected boolean mIsDragging
protected int mActivePointerId
protected float mInitialMotionX
protected float mInitialMotionY
protected float mLastMotionX
protected float mLastMotionY
protected long mPeekDelay
peekDrawer() has been called.
protected net.simonvt.menudrawer.Scroller mPeekScroller
protected android.view.VelocityTracker mVelocityTracker
protected int mMaxVelocity
protected boolean mOffsetMenu
protected int mCloseEnough
| Constructor Detail |
|---|
public DraggableDrawer(android.content.Context context)
public DraggableDrawer(android.content.Context context,
android.util.AttributeSet attrs)
public DraggableDrawer(android.content.Context context,
android.util.AttributeSet attrs,
int defStyle)
| Method Detail |
|---|
protected void initDrawer(android.content.Context context,
android.util.AttributeSet attrs,
int defStyle)
initDrawer in class MenuDrawerpublic void toggleMenu(boolean animate)
MenuDrawer
toggleMenu in class MenuDraweranimate - Whether open/close should be animated.public boolean isMenuVisible()
MenuDrawer
isMenuVisible in class MenuDrawerpublic void setMenuSize(int size)
MenuDrawer
setMenuSize in class MenuDrawersize - The size of the menu.public void setOffsetMenuEnabled(boolean offsetMenu)
MenuDrawer
setOffsetMenuEnabled in class MenuDraweroffsetMenu - True to offset the menu, false otherwise.public boolean getOffsetMenuEnabled()
MenuDrawer
getOffsetMenuEnabled in class MenuDrawerpublic void peekDrawer()
MenuDrawer
peekDrawer in class MenuDrawerpublic void peekDrawer(long delay)
MenuDrawer
peekDrawer in class MenuDrawerdelay - The delay (in milliseconds) between each run of the animation. If 0, this animation is only run
once.
public void peekDrawer(long startDelay,
long delay)
MenuDrawer
peekDrawer in class MenuDrawerstartDelay - 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 void setHardwareLayerEnabled(boolean enabled)
MenuDrawerView.LAYER_TYPE_HARDWARE when animations views.
setHardwareLayerEnabled in class MenuDrawerenabled - Whether hardware layers are enabled.public int getTouchMode()
MenuDrawer
getTouchMode in class MenuDrawerpublic void setTouchMode(int mode)
MenuDrawerMenuDrawer.TOUCH_MODE_NONE, MenuDrawer.TOUCH_MODE_BEZEL or
MenuDrawer.TOUCH_MODE_FULLSCREEN.
setTouchMode in class MenuDrawermode - The touch mode.public void setTouchBezelSize(int size)
MenuDrawer
setTouchBezelSize in class MenuDrawersize - The touch bezel size in px.public int getTouchBezelSize()
MenuDrawer
getTouchBezelSize in class MenuDrawerprotected 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.protected void startLayerTranslation()
View.LAYER_TYPE_HARDWARE.
protected void updateTouchAreaSize()
protected void endDrag()
protected void stopAnimation()
protected void animateOffsetTo(int position,
int velocity,
boolean animate)
position - The position the content is moved to.velocity - Optional velocity if called by releasing a drag event.animate - Whether the move is animated.protected void startPeek()
protected abstract void initPeekScroller()
protected void endPeek()
protected boolean isCloseEnough()
protected abstract boolean isContentTouch(android.view.MotionEvent ev)
ev - The motion event.
protected abstract boolean onDownAllowDrag(android.view.MotionEvent ev)
ev - The motion event.
protected boolean canChildScrollHorizontally(android.view.View v,
boolean checkV,
int dx,
int x,
int y)
v - View to test for horizontal scrollabilitycheckV - Whether the view should be checked for draggabilitydx - Delta scrolled in pixelsx - X coordinate of the active touch pointy - Y coordinate of the active touch point
protected boolean canChildScrollVertically(android.view.View v,
boolean checkV,
int dx,
int x,
int y)
v - View to test for horizontal scrollabilitycheckV - Whether the view should be checked for draggabilitydx - Delta scrolled in pixelsx - X coordinate of the active touch pointy - Y coordinate of the active touch point
protected abstract boolean onMoveAllowDrag(android.view.MotionEvent ev,
float dx)
ev - The motion event.
protected abstract void onMoveEvent(float dx)
dx - The X difference between the last motion event and the current motion event.protected abstract void onUpEvent(android.view.MotionEvent ev)
MotionEvent.ACTION_UP of MotionEvent.ACTION_CANCEL is
delivered to View.onTouchEvent(android.view.MotionEvent).
ev - The motion event.protected void dispatchDraw(android.graphics.Canvas canvas)
dispatchDraw in class android.view.ViewGroup
protected abstract void drawDropShadow(android.graphics.Canvas canvas,
int offsetPixels)
canvas - The canvas on which to draw.offsetPixels - Value in pixels indicating the offset.
protected abstract void drawMenuOverlay(android.graphics.Canvas canvas,
int offsetPixels)
canvas - The canvas on which to draw.offsetPixels - Value in pixels indicating the offset.
protected abstract void drawIndicator(android.graphics.Canvas canvas,
int offsetPixels)
canvas - The canvas on which to draw.offsetPixels - Value in pixels indicating the offset.public void restoreState(android.os.Parcelable in)
MenuDrawer
restoreState in class MenuDrawerin - A parcelable containing the drawer state.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||