|
||||||||||
| 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
public abstract class MenuDrawer
| Nested Class Summary | |
|---|---|
static interface |
MenuDrawer.OnDrawerStateChangeListener
Callback interface for changing state of the drawer. |
static interface |
MenuDrawer.OnInterceptMoveEventListener
Callback that is invoked when the drawer is in the process of deciding whether it should intercept the touch event. |
static class |
MenuDrawer.Type
|
| 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 int |
ANIMATION_DELAY
The time between each frame when animating the drawer. |
protected static android.view.animation.Interpolator |
INDICATOR_INTERPOLATOR
Interpolator used for stretching/retracting the active indicator. |
protected android.graphics.Bitmap |
mActiveIndicator
Bitmap used to indicate the active view. |
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 net.simonvt.menudrawer.BuildLayerFrameLayout |
mContentContainer
The parent of the content view. |
protected boolean |
mDrawerIndicatorEnabled
|
protected int |
mDrawerState
The current drawer state. |
protected boolean |
mDrawOverlay
Whether an overlay should be drawn as the drawer is opened and closed. |
protected int |
mDropShadowColor
The color of the drop shadow. |
protected android.graphics.drawable.Drawable |
mDropShadowDrawable
Drawable used as content drop shadow onto the menu. |
protected boolean |
mDropShadowEnabled
Defines whether the drop shadow is enabled. |
protected android.graphics.Rect |
mDropShadowRect
|
protected int |
mDropShadowSize
The size of the content drop shadow. |
static int |
MENU_DRAG_CONTENT
Drag mode for sliding only the content view. |
static int |
MENU_DRAG_WINDOW
Drag mode for sliding the entire window. |
protected boolean |
mHardwareLayersEnabled
Indicates whether to use View.LAYER_TYPE_HARDWARE when animating the drawer. |
protected boolean |
mIndicatorAnimating
Whether the indicator is currently animating. |
protected float |
mIndicatorOffset
[0..1] value indicating the current progress of the animation. |
protected int |
mIndicatorStartPos
The start position of the indicator when animating it to a new position. |
protected boolean |
mIsStatic
|
protected int |
mMaxAnimationDuration
The maximum duration of open/close animations. |
protected net.simonvt.menudrawer.BuildLayerFrameLayout |
mMenuContainer
The parent of the menu view. |
protected android.graphics.drawable.Drawable |
mMenuOverlay
Drawable used as menu overlay. |
protected int |
mMenuSize
The size of the menu (width or height depending on the gravity). |
protected boolean |
mMenuVisible
Indicates whether the menu is currently visible. |
protected float |
mOffsetPixels
Current offset. |
protected MenuDrawer.OnInterceptMoveEventListener |
mOnInterceptMoveEventListener
Callback that lets the listener override intercepting of touch events. |
protected Position |
mPosition
The position of the drawer. |
protected SlideDrawable |
mSlideDrawable
|
protected android.os.Bundle |
mState
Bundle used to hold the drawers state. |
protected android.graphics.drawable.Drawable |
mThemeUpIndicator
|
protected int |
mTouchBezelSize
The touch bezel size of the drawer in px. |
protected int |
mTouchMode
Touch mode for the Drawer. |
protected int |
mTouchSize
The touch area size of the drawer 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. |
| 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 | |
|---|---|
MenuDrawer(android.content.Context context)
|
|
MenuDrawer(android.content.Context context,
android.util.AttributeSet attrs)
|
|
MenuDrawer(android.content.Context context,
android.util.AttributeSet attrs,
int defStyle)
|
|
| Method Summary | |
|---|---|
static MenuDrawer |
attach(android.app.Activity activity)
Attaches the MenuDrawer to the Activity. |
static MenuDrawer |
attach(android.app.Activity activity,
MenuDrawer.Type type)
Attaches the MenuDrawer to the Activity. |
static MenuDrawer |
attach(android.app.Activity activity,
MenuDrawer.Type type,
Position position)
Attaches the MenuDrawer to the Activity. |
static MenuDrawer |
attach(android.app.Activity activity,
MenuDrawer.Type type,
Position position,
int dragMode)
Attaches the MenuDrawer to the Activity. |
static MenuDrawer |
attach(android.app.Activity activity,
Position position)
Attaches the MenuDrawer to the Activity. |
void |
closeMenu()
Animates the menu closed. |
abstract void |
closeMenu(boolean animate)
Closes the menu. |
protected void |
dispatchDraw(android.graphics.Canvas canvas)
|
protected void |
dispatchOnDrawerSlide(float openRatio,
int offsetPixels)
|
protected int |
dpToPx(int dp)
|
protected abstract void |
drawOverlay(android.graphics.Canvas canvas)
|
protected boolean |
fitSystemWindows(android.graphics.Rect insets)
|
boolean |
getAllowIndicatorAnimation()
Indicates whether the indicator should be animated between active views. |
android.view.ViewGroup |
getContentContainer()
Returns the ViewGroup used as a parent for the content view. |
int |
getDrawerState()
Get the current state of the drawer. |
boolean |
getDrawOverlay()
Gets whether an overlay is drawn when sliding the drawer. |
android.graphics.drawable.Drawable |
getDropShadow()
Returns the drawable of the drop shadow. |
protected android.graphics.drawable.GradientDrawable.Orientation |
getDropShadowOrientation()
|
android.view.ViewGroup |
getMenuContainer()
Returns the ViewGroup used as a parent for the menu view. |
int |
getMenuSize()
Returns the size of the menu. |
android.view.View |
getMenuView()
Returns the menu view. |
abstract boolean |
getOffsetMenuEnabled()
Indicates whether the menu is being offset when dragging the drawer. |
abstract int |
getTouchBezelSize()
Returns the size of the touch bezel in px. |
abstract int |
getTouchMode()
Returns the touch mode. |
protected void |
initDrawer(android.content.Context context,
android.util.AttributeSet attrs,
int defStyle)
|
boolean |
isDrawerIndicatorEnabled()
Indicates whether the drawer indicator is currently enabled. |
abstract boolean |
isMenuVisible()
Indicates whether the menu is currently visible. |
protected boolean |
isViewDescendant(android.view.View v)
|
protected void |
logDrawerState(int state)
|
protected void |
onAttachedToWindow()
|
protected void |
onDetachedFromWindow()
|
protected void |
onFinishInflate()
|
protected void |
onRestoreInstanceState(android.os.Parcelable state)
|
protected android.os.Parcelable |
onSaveInstanceState()
|
void |
openMenu()
Animates the menu open. |
abstract void |
openMenu(boolean animate)
Opens the menu. |
abstract void |
peekDrawer()
Animates the drawer slightly open until the user opens the drawer. |
abstract void |
peekDrawer(long delay)
Animates the drawer slightly open. |
abstract void |
peekDrawer(long startDelay,
long delay)
Animates the drawer slightly open. |
void |
postOnAnimation(Runnable action)
|
void |
restoreState(android.os.Parcelable in)
Restores the state of the drawer. |
android.os.Parcelable |
saveState()
Saves the state of the drawer. |
void |
setActiveView(android.view.View v)
Set the active view. |
void |
setActiveView(android.view.View v,
int position)
Set the active view. |
void |
setAllowIndicatorAnimation(boolean animate)
Sets whether the indicator should be animated between active views. |
void |
setContentView(int layoutResId)
Set the content from a layout resource. |
void |
setContentView(android.view.View view)
Set the content to an explicit view. |
void |
setContentView(android.view.View view,
android.view.ViewGroup.LayoutParams params)
Set the content to an explicit view. |
void |
setDrawerIndicatorEnabled(boolean enabled)
Sets whether the drawer indicator should be enabled. |
protected void |
setDrawerState(int state)
|
void |
setDrawOverlay(boolean drawOverlay)
Sets whether an overlay should be drawn when sliding the drawer. |
void |
setDropShadow(android.graphics.drawable.Drawable drawable)
Sets the drawable of the drop shadow. |
void |
setDropShadow(int resId)
Sets the drawable of the drop shadow. |
void |
setDropShadowColor(int color)
Sets the color of the drop shadow. |
void |
setDropShadowEnabled(boolean enabled)
Defines whether the drop shadow is enabled. |
void |
setDropShadowSize(int size)
Sets the size of the drop shadow. |
abstract void |
setHardwareLayerEnabled(boolean enabled)
Enables or disables the user of View.LAYER_TYPE_HARDWARE when animations views. |
void |
setMaxAnimationDuration(int duration)
Sets the maximum duration of open/close animations. |
abstract void |
setMenuSize(int size)
Set the size of the menu drawer when open. |
void |
setMenuView(int layoutResId)
Set the menu view from a layout resource. |
void |
setMenuView(android.view.View view)
Set the menu view to an explicit view. |
void |
setMenuView(android.view.View view,
android.view.ViewGroup.LayoutParams params)
Set the menu view to an explicit view. |
abstract void |
setOffsetMenuEnabled(boolean offsetMenu)
Enables or disables offsetting the menu when dragging the drawer. |
void |
setOnDrawerStateChangeListener(MenuDrawer.OnDrawerStateChangeListener listener)
Register a callback to be invoked when the drawer state changes. |
void |
setOnInterceptMoveEventListener(MenuDrawer.OnInterceptMoveEventListener listener)
Register a callback that will be invoked when the drawer is about to intercept touch events. |
void |
setSlideDrawable(android.graphics.drawable.Drawable drawable)
Sets the drawable used as the drawer indicator. |
void |
setSlideDrawable(int drawableRes)
Sets the drawable used as the drawer indicator. |
abstract void |
setTouchBezelSize(int size)
Sets the size of the touch bezel. |
abstract void |
setTouchMode(int mode)
Sets the drawer touch mode. |
void |
setupUpIndicator(android.app.Activity activity)
Sets up the drawer indicator. |
void |
toggleMenu()
Toggles the menu open and close with animation. |
abstract void |
toggleMenu(boolean animate)
Toggles the menu open and close. |
protected void |
updateDropShadowRect()
|
protected void |
updateIndicatorClipRect()
Update the Rect where the indicator is drawn. |
protected void |
updateTouchAreaSize()
Compute the touch area based on the touch mode. |
protected void |
updateUpContentDescription()
|
| Methods inherited from class android.view.ViewGroup |
|---|
addChildrenForAccessibility, addFocusables, addStatesFromChildren, addTouchables, addView, 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, 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 int ANIMATION_DELAY
public static final int MENU_DRAG_CONTENT
public static final int MENU_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 static final android.view.animation.Interpolator INDICATOR_INTERPOLATOR
protected android.graphics.drawable.Drawable mMenuOverlay
protected boolean mDropShadowEnabled
protected int mDropShadowColor
protected android.graphics.drawable.Drawable mDropShadowDrawable
protected int mDropShadowSize
protected android.graphics.Bitmap mActiveIndicator
protected android.view.View mActiveView
protected int mActivePosition
protected final android.graphics.Rect mActiveRect
protected net.simonvt.menudrawer.BuildLayerFrameLayout mMenuContainer
protected net.simonvt.menudrawer.BuildLayerFrameLayout mContentContainer
protected int mMenuSize
protected boolean mMenuVisible
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_BEZEL
protected boolean mHardwareLayersEnabled
View.LAYER_TYPE_HARDWARE when animating the drawer.
protected int mIndicatorStartPos
protected float mIndicatorOffset
protected boolean mIndicatorAnimating
protected android.os.Bundle mState
protected int mMaxAnimationDuration
protected MenuDrawer.OnInterceptMoveEventListener mOnInterceptMoveEventListener
protected SlideDrawable mSlideDrawable
protected android.graphics.drawable.Drawable mThemeUpIndicator
protected boolean mDrawerIndicatorEnabled
protected Position mPosition
protected boolean mIsStatic
protected final android.graphics.Rect mDropShadowRect
protected float mOffsetPixels
protected boolean mDrawOverlay
| Constructor Detail |
|---|
public MenuDrawer(android.content.Context context)
public MenuDrawer(android.content.Context context,
android.util.AttributeSet attrs)
public MenuDrawer(android.content.Context context,
android.util.AttributeSet attrs,
int defStyle)
| Method Detail |
|---|
public static MenuDrawer attach(android.app.Activity activity)
activity - The activity that the MenuDrawer will be attached to.
public static MenuDrawer attach(android.app.Activity activity,
MenuDrawer.Type type)
activity - The activity the menu drawer will be attached to.type - The MenuDrawer.Type of the drawer.
public static MenuDrawer attach(android.app.Activity activity,
Position position)
activity - The activity the menu drawer will be attached to.position - Where to position the menu.
public static MenuDrawer attach(android.app.Activity activity,
MenuDrawer.Type type,
Position position)
activity - The activity the menu drawer will be attached to.type - The MenuDrawer.Type of the drawer.position - Where to position the menu.
public static MenuDrawer attach(android.app.Activity activity,
MenuDrawer.Type type,
Position position,
int dragMode)
activity - The activity the menu drawer will be attached to.type - The MenuDrawer.Type of the drawer.position - Where to position the menu.dragMode - The drag mode of the drawer. Can be either MENU_DRAG_CONTENT
or MENU_DRAG_WINDOW.
protected void initDrawer(android.content.Context context,
android.util.AttributeSet attrs,
int defStyle)
protected void onFinishInflate()
onFinishInflate in class android.view.Viewprotected int dpToPx(int dp)
protected boolean isViewDescendant(android.view.View v)
protected void onAttachedToWindow()
onAttachedToWindow in class android.view.Viewprotected void onDetachedFromWindow()
onDetachedFromWindow in class android.view.Viewprotected void dispatchDraw(android.graphics.Canvas canvas)
dispatchDraw in class android.view.ViewGroupprotected abstract void drawOverlay(android.graphics.Canvas canvas)
protected void updateDropShadowRect()
protected void updateIndicatorClipRect()
Rect where the indicator is drawn.
public void toggleMenu()
public abstract void toggleMenu(boolean animate)
animate - Whether open/close should be animated.public void openMenu()
public abstract void openMenu(boolean animate)
animate - Whether open/close should be animated.public void closeMenu()
public abstract void closeMenu(boolean animate)
animate - Whether open/close should be animated.public abstract boolean isMenuVisible()
public abstract void setMenuSize(int size)
size - The size of the menu.public int getMenuSize()
public void setActiveView(android.view.View v)
v - The active view.
public void setActiveView(android.view.View v,
int position)
v - The active view.position - Optional position, usually used with ListView. v.setTag(R.id.mdActiveViewPosition, position)
must be called first.public void setAllowIndicatorAnimation(boolean animate)
animate - Whether the indicator should be animated between active views.public boolean getAllowIndicatorAnimation()
protected void updateTouchAreaSize()
public abstract void setOffsetMenuEnabled(boolean offsetMenu)
offsetMenu - True to offset the menu, false otherwise.public abstract boolean getOffsetMenuEnabled()
public int getDrawerState()
public void setOnDrawerStateChangeListener(MenuDrawer.OnDrawerStateChangeListener listener)
listener - The callback that will run.public void setOnInterceptMoveEventListener(MenuDrawer.OnInterceptMoveEventListener listener)
listener - The callback that will be invoked.public void setDropShadowEnabled(boolean enabled)
enabled - Whether the drop shadow is enabled.protected android.graphics.drawable.GradientDrawable.Orientation getDropShadowOrientation()
public void setDropShadowColor(int color)
color - The color of the drop shadow.public void setDropShadow(android.graphics.drawable.Drawable drawable)
drawable - The drawable of the drop shadow.public void setDropShadow(int resId)
resId - The resource identifier of the the drawable.public android.graphics.drawable.Drawable getDropShadow()
public void setDropShadowSize(int size)
size - The size of the drop shadow in px.public abstract void peekDrawer()
public abstract void peekDrawer(long delay)
delay - The delay (in milliseconds) between each run of the animation. If 0, this animation is only run
once.
public abstract void peekDrawer(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 void setHardwareLayerEnabled(boolean enabled)
View.LAYER_TYPE_HARDWARE when animations views.
enabled - Whether hardware layers are enabled.public void setMaxAnimationDuration(int duration)
duration - The maximum duration in milliseconds.public void setDrawOverlay(boolean drawOverlay)
drawOverlay - Whether an overlay should be drawn when sliding the drawer.public boolean getDrawOverlay()
protected void updateUpContentDescription()
public void setSlideDrawable(int drawableRes)
drawable - The drawable used as the drawer indicator.public void setSlideDrawable(android.graphics.drawable.Drawable drawable)
drawable - The drawable used as the drawer indicator.public void setupUpIndicator(android.app.Activity activity)
setDrawerIndicatorEnabled(boolean).
activity - The activity the drawer is attached to.public void setDrawerIndicatorEnabled(boolean enabled)
setupUpIndicator(android.app.Activity) must be
called first.
enabled - Whether the drawer indicator should enabled.public boolean isDrawerIndicatorEnabled()
public android.view.ViewGroup getMenuContainer()
public android.view.ViewGroup getContentContainer()
public void setMenuView(int layoutResId)
layoutResId - Resource ID to be inflated.public void setMenuView(android.view.View view)
view - The menu view.
public void setMenuView(android.view.View view,
android.view.ViewGroup.LayoutParams params)
view - The menu view.params - Layout parameters for the view.public android.view.View getMenuView()
public void setContentView(int layoutResId)
layoutResId - Resource ID to be inflated.public void setContentView(android.view.View view)
view - The desired content to display.
public void setContentView(android.view.View view,
android.view.ViewGroup.LayoutParams params)
view - The desired content to display.params - Layout parameters for the view.protected void setDrawerState(int state)
protected void logDrawerState(int state)
public abstract int getTouchMode()
public abstract void setTouchMode(int mode)
TOUCH_MODE_NONE, TOUCH_MODE_BEZEL or
TOUCH_MODE_FULLSCREEN.
mode - The touch mode.public abstract void setTouchBezelSize(int size)
size - The touch bezel size in px.public abstract int getTouchBezelSize()
public void postOnAnimation(Runnable action)
postOnAnimation in class android.view.Viewprotected boolean fitSystemWindows(android.graphics.Rect insets)
fitSystemWindows in class android.view.ViewGroup
protected void dispatchOnDrawerSlide(float openRatio,
int offsetPixels)
public final android.os.Parcelable saveState()
public void restoreState(android.os.Parcelable in)
in - A parcelable containing the drawer state.protected android.os.Parcelable onSaveInstanceState()
onSaveInstanceState in class android.view.Viewprotected void onRestoreInstanceState(android.os.Parcelable state)
onRestoreInstanceState in class android.view.View
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||