android.gesture
Class GestureOverlayView

java.lang.Object
  extended by android.view.View
      extended by android.view.ViewGroup
          extended by android.widget.FrameLayout
              extended by android.gesture.GestureOverlayView
All Implemented Interfaces:
Drawable.Callback, AccessibilityEventSource, KeyEvent.Callback, ViewManager, ViewParent

public class GestureOverlayView
extends FrameLayout


Nested Class Summary
static interface GestureOverlayView.OnGestureListener
           
static interface GestureOverlayView.OnGesturePerformedListener
           
static interface GestureOverlayView.OnGesturingListener
           
 
Nested classes/interfaces inherited from class android.widget.FrameLayout
FrameLayout.LayoutParams
 
Nested classes/interfaces inherited from class android.view.ViewGroup
ViewGroup.MarginLayoutParams, ViewGroup.OnHierarchyChangeListener
 
Nested classes/interfaces inherited from class android.view.View
View.AccessibilityDelegate, View.BaseSavedState, View.DragShadowBuilder, View.MeasureSpec, View.OnAttachStateChangeListener, View.OnClickListener, View.OnCreateContextMenuListener, View.OnDragListener, View.OnFocusChangeListener, View.OnGenericMotionListener, View.OnHoverListener, View.OnKeyListener, View.OnLayoutChangeListener, View.OnLongClickListener, View.OnSystemUiVisibilityChangeListener, View.OnTouchListener
 
Field Summary
static int GESTURE_STROKE_TYPE_MULTIPLE
           
static int GESTURE_STROKE_TYPE_SINGLE
           
static int ORIENTATION_HORIZONTAL
           
static int ORIENTATION_VERTICAL
           
 
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, 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, 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_HIDE_NAVIGATION, SYSTEM_UI_FLAG_LOW_PROFILE, SYSTEM_UI_FLAG_VISIBLE, TRANSLATION_X, TRANSLATION_Y, VIEW_LOG_TAG, VISIBLE, WINDOW_FOCUSED_STATE_SET, X, Y
 
Constructor Summary
GestureOverlayView(Context context)
           
GestureOverlayView(Context context, AttributeSet attrs)
           
GestureOverlayView(Context context, AttributeSet attrs, int defStyle)
           
 
Method Summary
 void addOnGestureListener(GestureOverlayView.OnGestureListener listener)
           
 void addOnGesturePerformedListener(GestureOverlayView.OnGesturePerformedListener listener)
           
 void addOnGesturingListener(GestureOverlayView.OnGesturingListener listener)
           
 void cancelClearAnimation()
           
 void cancelGesture()
           
 void clear(boolean animated)
           
 boolean dispatchTouchEvent(MotionEvent event)
           
 void draw(Canvas canvas)
           
 ArrayList<GesturePoint> getCurrentStroke()
           
 long getFadeOffset()
           
 Gesture getGesture()
           
 int getGestureColor()
           
 Path getGesturePath()
           
 Path getGesturePath(Path path)
           
 float getGestureStrokeAngleThreshold()
           
 float getGestureStrokeLengthThreshold()
           
 float getGestureStrokeSquarenessTreshold()
           
 int getGestureStrokeType()
           
 float getGestureStrokeWidth()
           
 int getOrientation()
           
 int getUncertainGestureColor()
           
 boolean isEventsInterceptionEnabled()
           
 boolean isFadeEnabled()
           
 boolean isGestureVisible()
           
 boolean isGesturing()
           
protected  void onDetachedFromWindow()
           
 void removeAllOnGestureListeners()
           
 void removeAllOnGesturePerformedListeners()
           
 void removeAllOnGesturingListeners()
           
 void removeOnGestureListener(GestureOverlayView.OnGestureListener listener)
           
 void removeOnGesturePerformedListener(GestureOverlayView.OnGesturePerformedListener listener)
           
 void removeOnGesturingListener(GestureOverlayView.OnGesturingListener listener)
           
 void setEventsInterceptionEnabled(boolean enabled)
           
 void setFadeEnabled(boolean fadeEnabled)
           
 void setFadeOffset(long fadeOffset)
           
 void setGesture(Gesture gesture)
           
 void setGestureColor(int color)
           
 void setGestureStrokeAngleThreshold(float gestureStrokeAngleThreshold)
           
 void setGestureStrokeLengthThreshold(float gestureStrokeLengthThreshold)
           
 void setGestureStrokeSquarenessTreshold(float gestureStrokeSquarenessTreshold)
           
 void setGestureStrokeType(int gestureStrokeType)
           
 void setGestureStrokeWidth(float gestureStrokeWidth)
           
 void setGestureVisible(boolean visible)
           
 void setOrientation(int orientation)
           
 void setUncertainGestureColor(int color)
           
 
Methods inherited from class android.widget.FrameLayout
checkLayoutParams, drawableStateChanged, gatherTransparentRegion, generateDefaultLayoutParams, generateLayoutParams, generateLayoutParams, getConsiderGoneChildrenWhenMeasuring, getForeground, getMeasureAllChildren, jumpDrawablesToCurrentState, onLayout, onMeasure, onSizeChanged, setForeground, setForegroundGravity, setMeasureAllChildren, shouldDelayChildPressedState, verifyDrawable
 
Methods inherited from class android.view.ViewGroup
addFocusables, addFocusables, addStatesFromChildren, addTouchables, addView, addView, addView, addView, addView, addViewInLayout, addViewInLayout, attachLayoutAnimationParameters, attachViewToParent, bringChildToFront, canAnimate, childDrawableStateChanged, cleanupLayoutState, clearChildFocus, clearDisappearingChildren, clearFocus, debug, detachAllViewsFromParent, detachViewFromParent, detachViewFromParent, detachViewsFromParent, dispatchConfigurationChanged, dispatchDisplayHint, dispatchDragEvent, dispatchDraw, dispatchFreezeSelfOnly, dispatchGenericFocusedEvent, dispatchGenericPointerEvent, dispatchHoverEvent, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchRestoreInstanceState, dispatchSaveInstanceState, dispatchSetActivated, dispatchSetPressed, dispatchSetSelected, dispatchSystemUiVisibilityChanged, dispatchThawSelfOnly, dispatchTrackballEvent, dispatchUnhandledMove, dispatchVisibilityChanged, dispatchWindowFocusChanged, dispatchWindowVisibilityChanged, drawChild, endViewTransition, findFocus, findViewsWithText, fitSystemWindows, focusableViewAvailable, focusSearch, getChildAt, getChildCount, getChildDrawingOrder, getChildMeasureSpec, getChildStaticTransformation, getChildVisibleRect, getDescendantFocusability, getFocusedChild, getLayoutAnimation, getLayoutAnimationListener, getLayoutTransition, getPersistentDrawingCache, hasFocus, hasFocusable, indexOfChild, invalidateChild, invalidateChildInParent, isAlwaysDrawnWithCacheEnabled, isAnimationCacheEnabled, isChildrenDrawingOrderEnabled, isChildrenDrawnWithCacheEnabled, isMotionEventSplittingEnabled, layout, measureChild, measureChildren, measureChildWithMargins, offsetDescendantRectToMyCoords, offsetRectIntoDescendantCoords, onAnimationEnd, onAnimationStart, onCreateDrawableState, onInterceptHoverEvent, onInterceptTouchEvent, onRequestFocusInDescendants, onRequestSendAccessibilityEvent, recomputeViewAttributes, removeAllViews, removeAllViewsInLayout, removeDetachedView, removeView, removeViewAt, removeViewInLayout, removeViews, removeViewsInLayout, requestChildFocus, requestChildRectangleOnScreen, requestDisallowInterceptTouchEvent, requestFocus, requestSendAccessibilityEvent, requestTransparentRegion, resetResolvedLayoutDirection, resetResolvedTextDirection, scheduleLayoutAnimation, setAddStatesFromChildren, setAlwaysDrawnWithCacheEnabled, setAnimationCacheEnabled, setChildrenDrawingCacheEnabled, setChildrenDrawingOrderEnabled, setChildrenDrawnWithCacheEnabled, setClipChildren, setClipToPadding, setDescendantFocusability, setLayoutAnimation, setLayoutAnimationListener, setLayoutTransition, setMotionEventSplittingEnabled, setOnHierarchyChangeListener, setPadding, setPersistentDrawingCache, setStaticTransformationsEnabled, showContextMenuForChild, startActionModeForChild, startLayoutAnimation, startViewTransition, updateViewLayout
 
Methods inherited from class android.view.View
addOnAttachStateChangeListener, addOnLayoutChangeListener, animate, awakenScrollBars, awakenScrollBars, awakenScrollBars, bringToFront, buildDrawingCache, buildDrawingCache, buildLayer, cancelLongPress, canScrollHorizontally, canScrollVertically, checkInputConnectionProxy, clearAnimation, combineMeasuredStates, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeHorizontalScrollRange, computeScroll, computeVerticalScrollExtent, computeVerticalScrollOffset, computeVerticalScrollRange, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchGenericMotionEvent, dispatchPopulateAccessibilityEvent, findViewById, findViewWithTag, fitsSystemWindows, focusSearch, forceLayout, getAlpha, getAnimation, getApplicationWindowToken, getBackground, getBaseline, getBottom, getBottomFadingEdgeStrength, getBottomPaddingOffset, getContentDescription, getContext, getContextMenuInfo, getDefaultSize, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getFilterTouchesWhenObscured, getFocusables, getFocusedRect, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarHeight, getId, getKeepScreenOn, getKeyDispatcherState, getLayerType, getLayoutParams, getLeft, getLeftFadingEdgeStrength, getLeftPaddingOffset, getLocalVisibleRect, getLocationInWindow, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOverScrollMode, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getParent, getPivotX, getPivotY, getResources, getRight, getRightFadingEdgeStrength, getRightPaddingOffset, getRootView, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarStyle, getScrollX, getScrollY, getSolidColor, getSuggestedMinimumHeight, getSuggestedMinimumWidth, getSystemUiVisibility, getTag, getTag, getTop, getTopFadingEdgeStrength, getTopPaddingOffset, getTouchables, getTouchDelegate, getTranslationX, getTranslationY, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarWidth, getViewTreeObserver, getVisibility, getWidth, getWindowAttachCount, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, 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, isSelected, isShown, isSoundEffectsEnabled, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, measure, mergeDrawableStates, offsetLeftAndRight, offsetTopAndBottom, onAttachedToWindow, onCheckIsTextEditor, onConfigurationChanged, onCreateContextMenu, onCreateInputConnection, onDisplayHint, onDragEvent, onDraw, onDrawScrollBars, onFilterTouchEventForSecurity, onFinishInflate, onFinishTemporaryDetach, onFocusChanged, onGenericMotionEvent, onHoverChanged, onHoverEvent, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onOverScrolled, onPopulateAccessibilityEvent, onRestoreInstanceState, onSaveInstanceState, onScrollChanged, onSetAlpha, onStartTemporaryDetach, onTouchEvent, onTrackballEvent, onVisibilityChanged, onWindowFocusChanged, onWindowVisibilityChanged, overScrollBy, performClick, performHapticFeedback, performHapticFeedback, performLongClick, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, refreshDrawableState, removeCallbacks, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, requestFocus, requestFocus, requestFocusFromTouch, requestLayout, requestRectangleOnScreen, requestRectangleOnScreen, resolveSize, resolveSizeAndState, restoreHierarchyState, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEvent, sendAccessibilityEventUnchecked, setAccessibilityDelegate, setActivated, setAlpha, setAnimation, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setBottom, setCameraDistance, setClickable, setContentDescription, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setEnabled, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setFocusable, setFocusableInTouchMode, setHapticFeedbackEnabled, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHovered, setId, 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, setScrollbarFadingEnabled, 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, 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, isLayoutRequested, requestLayout
 

Field Detail

GESTURE_STROKE_TYPE_SINGLE

public static final int GESTURE_STROKE_TYPE_SINGLE
See Also:
Constant Field Values

GESTURE_STROKE_TYPE_MULTIPLE

public static final int GESTURE_STROKE_TYPE_MULTIPLE
See Also:
Constant Field Values

ORIENTATION_HORIZONTAL

public static final int ORIENTATION_HORIZONTAL
See Also:
Constant Field Values

ORIENTATION_VERTICAL

public static final int ORIENTATION_VERTICAL
See Also:
Constant Field Values
Constructor Detail

GestureOverlayView

public GestureOverlayView(Context context)

GestureOverlayView

public GestureOverlayView(Context context,
                          AttributeSet attrs)

GestureOverlayView

public GestureOverlayView(Context context,
                          AttributeSet attrs,
                          int defStyle)
Method Detail

getCurrentStroke

public ArrayList<GesturePoint> getCurrentStroke()

getOrientation

public int getOrientation()

setOrientation

public void setOrientation(int orientation)

setGestureColor

public void setGestureColor(int color)

setUncertainGestureColor

public void setUncertainGestureColor(int color)

getUncertainGestureColor

public int getUncertainGestureColor()

getGestureColor

public int getGestureColor()

getGestureStrokeWidth

public float getGestureStrokeWidth()

setGestureStrokeWidth

public void setGestureStrokeWidth(float gestureStrokeWidth)

getGestureStrokeType

public int getGestureStrokeType()

setGestureStrokeType

public void setGestureStrokeType(int gestureStrokeType)

getGestureStrokeLengthThreshold

public float getGestureStrokeLengthThreshold()

setGestureStrokeLengthThreshold

public void setGestureStrokeLengthThreshold(float gestureStrokeLengthThreshold)

getGestureStrokeSquarenessTreshold

public float getGestureStrokeSquarenessTreshold()

setGestureStrokeSquarenessTreshold

public void setGestureStrokeSquarenessTreshold(float gestureStrokeSquarenessTreshold)

getGestureStrokeAngleThreshold

public float getGestureStrokeAngleThreshold()

setGestureStrokeAngleThreshold

public void setGestureStrokeAngleThreshold(float gestureStrokeAngleThreshold)

isEventsInterceptionEnabled

public boolean isEventsInterceptionEnabled()

setEventsInterceptionEnabled

public void setEventsInterceptionEnabled(boolean enabled)

isFadeEnabled

public boolean isFadeEnabled()

setFadeEnabled

public void setFadeEnabled(boolean fadeEnabled)

getGesture

public Gesture getGesture()

setGesture

public void setGesture(Gesture gesture)

getGesturePath

public Path getGesturePath()

getGesturePath

public Path getGesturePath(Path path)

isGestureVisible

public boolean isGestureVisible()

setGestureVisible

public void setGestureVisible(boolean visible)

getFadeOffset

public long getFadeOffset()

setFadeOffset

public void setFadeOffset(long fadeOffset)

addOnGestureListener

public void addOnGestureListener(GestureOverlayView.OnGestureListener listener)

removeOnGestureListener

public void removeOnGestureListener(GestureOverlayView.OnGestureListener listener)

removeAllOnGestureListeners

public void removeAllOnGestureListeners()

addOnGesturePerformedListener

public void addOnGesturePerformedListener(GestureOverlayView.OnGesturePerformedListener listener)

removeOnGesturePerformedListener

public void removeOnGesturePerformedListener(GestureOverlayView.OnGesturePerformedListener listener)

removeAllOnGesturePerformedListeners

public void removeAllOnGesturePerformedListeners()

addOnGesturingListener

public void addOnGesturingListener(GestureOverlayView.OnGesturingListener listener)

removeOnGesturingListener

public void removeOnGesturingListener(GestureOverlayView.OnGesturingListener listener)

removeAllOnGesturingListeners

public void removeAllOnGesturingListeners()

isGesturing

public boolean isGesturing()

draw

public void draw(Canvas canvas)
Overrides:
draw in class FrameLayout

clear

public void clear(boolean animated)

cancelClearAnimation

public void cancelClearAnimation()

cancelGesture

public void cancelGesture()

onDetachedFromWindow

protected void onDetachedFromWindow()
Overrides:
onDetachedFromWindow in class View

dispatchTouchEvent

public boolean dispatchTouchEvent(MotionEvent event)
Overrides:
dispatchTouchEvent in class ViewGroup


Copyright © 2008-2012. All Rights Reserved.