public abstract class AbstractTutorialView extends android.widget.RelativeLayout implements TutorialViewInterface
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractTutorialView.AnimationType
Animation type that are supported by the tutorial view.
|
static interface |
AbstractTutorialView.TutorialClosedListener |
android.widget.RelativeLayout.LayoutParamsandroid.view.ViewGroup.MarginLayoutParams, android.view.ViewGroup.OnHierarchyChangeListenerandroid.view.View.AccessibilityDelegate, android.view.View.BaseSavedState, android.view.View.DragShadowBuilder, android.view.View.MeasureSpec, android.view.View.OnApplyWindowInsetsListener, android.view.View.OnAttachStateChangeListener, android.view.View.OnClickListener, android.view.View.OnCreateContextMenuListener, android.view.View.OnDragListener, android.view.View.OnFocusChangeListener, android.view.View.OnGenericMotionListener, android.view.View.OnHoverListener, android.view.View.OnKeyListener, android.view.View.OnLayoutChangeListener, android.view.View.OnLongClickListener, android.view.View.OnSystemUiVisibilityChangeListener, android.view.View.OnTouchListener| Modifier and Type | Field and Description |
|---|---|
protected int |
actionBarHeight |
protected boolean |
closing
true if the tutorial is animating closing of the tutorial.
|
static boolean |
DEBUG |
protected static boolean |
DEBUG_DRAW |
protected android.graphics.Paint |
debugPaint
Used for debug drawing to find problems with calculations.
|
protected static int |
DEFAULT_BACKGROUND_COLOR |
protected static int |
DEFAULT_CIRCLE_PADDING |
protected static int |
DEFAULT_PRECAUTION_ABOVE_DISTANCE |
protected static int |
DEFAULT_STROKE_WIDTH |
protected static int |
INNER_CIRCLE_DEFAULT_ALPHA |
protected android.app.ActionBar |
mActionBar |
protected java.lang.String |
mActionBarOldTitle
The title of the action bar before we changed it to the tutorial title,
Used for restoring the action bar state after tutorial is closed.
|
protected int |
mActionBarRestoreColor
The default color of the action bar,
This is used combine with mChangeActionBarColor
to set the background of the action bar to the tutorial color.
|
protected android.graphics.Paint |
mBackgroundPaint
The paint that will be used to draw the tutorial background color.
|
protected boolean |
mChangeActionBarColor
If true when the tutorial view will be visible the action bar color will be change to the tutorial background color
|
protected android.view.View |
mGotItButton |
protected android.graphics.Paint |
mInnerCirclePaint
The paint that will be used to draw the inner circles.
|
protected android.view.View |
mSkipButton |
protected android.view.View |
mTitleView |
protected Tutorial |
mTutorial |
protected android.view.View |
mTutorialInfoView |
protected android.graphics.Typeface |
mTutorialTextTypeFace
Holds the typeface that will be used for the default info view text view
|
protected android.graphics.RectF |
mViewBoundsInParent
Holds the view bounds on screen,
This is used for DEBUG_DRAW and for creating the arcs surrounding the view.
|
protected int |
mViewToSurroundCenterX |
protected int |
mViewToSurroundCenterY |
protected int |
mViewToSurroundRadius |
protected boolean |
showing
true if the tutorial is visible.
|
protected int |
statusBarHeight |
static java.lang.String |
TAG |
protected AbstractTutorialView.TutorialClosedListener |
tutorialClosedListener
Listener for the tutorial closing.
|
ABOVE, ALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_END, ALIGN_LEFT, ALIGN_PARENT_BOTTOM, ALIGN_PARENT_END, ALIGN_PARENT_LEFT, ALIGN_PARENT_RIGHT, ALIGN_PARENT_START, ALIGN_PARENT_TOP, ALIGN_RIGHT, ALIGN_START, ALIGN_TOP, BELOW, CENTER_HORIZONTAL, CENTER_IN_PARENT, CENTER_VERTICAL, END_OF, LEFT_OF, RIGHT_OF, START_OF, TRUECLIP_TO_PADDING_MASK, FOCUS_AFTER_DESCENDANTS, FOCUS_BEFORE_DESCENDANTS, FOCUS_BLOCK_DESCENDANTS, LAYOUT_MODE_CLIP_BOUNDS, LAYOUT_MODE_OPTICAL_BOUNDS, PERSISTENT_ALL_CACHES, PERSISTENT_ANIMATION_CACHE, PERSISTENT_NO_CACHE, PERSISTENT_SCROLLING_CACHEACCESSIBILITY_LIVE_REGION_ASSERTIVE, ACCESSIBILITY_LIVE_REGION_NONE, ACCESSIBILITY_LIVE_REGION_POLITE, ALPHA, DRAWING_CACHE_QUALITY_AUTO, DRAWING_CACHE_QUALITY_HIGH, DRAWING_CACHE_QUALITY_LOW, EMPTY_STATE_SET, ENABLED_FOCUSED_SELECTED_STATE_SET, ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_FOCUSED_STATE_SET, ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, ENABLED_SELECTED_STATE_SET, ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_STATE_SET, ENABLED_WINDOW_FOCUSED_STATE_SET, FIND_VIEWS_WITH_CONTENT_DESCRIPTION, FIND_VIEWS_WITH_TEXT, FOCUS_BACKWARD, FOCUS_DOWN, FOCUS_FORWARD, FOCUS_LEFT, FOCUS_RIGHT, FOCUS_UP, FOCUSABLES_ALL, FOCUSABLES_TOUCH_MODE, FOCUSED_SELECTED_STATE_SET, FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, FOCUSED_STATE_SET, FOCUSED_WINDOW_FOCUSED_STATE_SET, GONE, HAPTIC_FEEDBACK_ENABLED, IMPORTANT_FOR_ACCESSIBILITY_AUTO, IMPORTANT_FOR_ACCESSIBILITY_NO, IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS, IMPORTANT_FOR_ACCESSIBILITY_YES, INVISIBLE, KEEP_SCREEN_ON, LAYER_TYPE_HARDWARE, LAYER_TYPE_NONE, LAYER_TYPE_SOFTWARE, LAYOUT_DIRECTION_INHERIT, LAYOUT_DIRECTION_LOCALE, LAYOUT_DIRECTION_LTR, LAYOUT_DIRECTION_RTL, MEASURED_HEIGHT_STATE_SHIFT, MEASURED_SIZE_MASK, MEASURED_STATE_MASK, MEASURED_STATE_TOO_SMALL, NO_ID, OVER_SCROLL_ALWAYS, OVER_SCROLL_IF_CONTENT_SCROLLS, OVER_SCROLL_NEVER, PRESSED_ENABLED_FOCUSED_SELECTED_STATE_SET, PRESSED_ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_SELECTED_STATE_SET, PRESSED_ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_STATE_SET, PRESSED_ENABLED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_SELECTED_STATE_SET, PRESSED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_STATE_SET, PRESSED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_SELECTED_STATE_SET, PRESSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_STATE_SET, PRESSED_WINDOW_FOCUSED_STATE_SET, ROTATION, ROTATION_X, ROTATION_Y, SCALE_X, SCALE_Y, SCREEN_STATE_OFF, SCREEN_STATE_ON, SCROLL_AXIS_HORIZONTAL, SCROLL_AXIS_NONE, SCROLL_AXIS_VERTICAL, SCROLLBAR_POSITION_DEFAULT, SCROLLBAR_POSITION_LEFT, SCROLLBAR_POSITION_RIGHT, SCROLLBARS_INSIDE_INSET, SCROLLBARS_INSIDE_OVERLAY, SCROLLBARS_OUTSIDE_INSET, SCROLLBARS_OUTSIDE_OVERLAY, SELECTED_STATE_SET, SELECTED_WINDOW_FOCUSED_STATE_SET, SOUND_EFFECTS_ENABLED, STATUS_BAR_HIDDEN, STATUS_BAR_VISIBLE, SYSTEM_UI_FLAG_FULLSCREEN, SYSTEM_UI_FLAG_HIDE_NAVIGATION, SYSTEM_UI_FLAG_IMMERSIVE, SYSTEM_UI_FLAG_IMMERSIVE_STICKY, SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN, SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION, SYSTEM_UI_FLAG_LAYOUT_STABLE, SYSTEM_UI_FLAG_LOW_PROFILE, SYSTEM_UI_FLAG_VISIBLE, SYSTEM_UI_LAYOUT_FLAGS, TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_GRAVITY, TEXT_ALIGNMENT_INHERIT, TEXT_ALIGNMENT_TEXT_END, TEXT_ALIGNMENT_TEXT_START, TEXT_ALIGNMENT_VIEW_END, TEXT_ALIGNMENT_VIEW_START, TEXT_DIRECTION_ANY_RTL, TEXT_DIRECTION_FIRST_STRONG, TEXT_DIRECTION_INHERIT, TEXT_DIRECTION_LOCALE, TEXT_DIRECTION_LTR, TEXT_DIRECTION_RTL, TRANSLATION_X, TRANSLATION_Y, TRANSLATION_Z, VIEW_LOG_TAG, VISIBLE, WINDOW_FOCUSED_STATE_SET, X, Y, Z| Constructor and Description |
|---|
AbstractTutorialView(android.content.Context context) |
AbstractTutorialView(android.content.Context context,
android.util.AttributeSet attrs) |
AbstractTutorialView(android.content.Context context,
android.util.AttributeSet attrs,
int defStyleAttr) |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
beforeFirstDraw()
This function will be called before the view needs to be draw.
|
protected void |
calcViewBoundsRadiusAndCenter()
Calculating the view position variables and the circle radius.
|
void |
changeActionBarColor(boolean mChangeActionBarColor)
If true and an action bar is given to the view the action bar background color will be changed to the tutorial color.
|
abstract void |
closeTutorial() |
protected void |
dispatchTutorialClosed() |
protected void |
drawInnerCircles(android.graphics.Canvas canvas)
Drawing two semi transparent circles so the view would look better.
|
long |
getAnimationDuration() |
AbstractTutorialView.AnimationType |
getAnimationType() |
int |
getTutorialBackgroundColor() |
int |
getTutorialGotItPosition() |
int |
getTutorialInfoLayoutId() |
int |
getTutorialInfoTextPosition() |
java.lang.String |
getTutorialText() |
int |
getTutorialTextColor() |
int |
getTutorialTextSize() |
java.lang.String |
getTutorialTextTypeFace() |
abstract android.view.animation.Animation |
hide(java.lang.Runnable onHidden) |
protected void |
inflateTutorialInfo()
Inflating the layout by given id that will explain about the view that has been surrounded.
|
protected void |
initActionBar(java.lang.String title) |
protected void |
initTypeFace()
Initialize the type face object from the mTutorial object type face name.
|
boolean |
isShowing() |
boolean |
isWalkThrough() |
protected void |
onDraw(android.graphics.Canvas canvas) |
protected void |
removeTutorialInfo()
Animate the tutorial info view out and remove it from the view.
|
protected void |
restoreActionBar()
Restore the action bar if has a reference to it.
|
void |
setActionBar(android.app.ActionBar actionBar)
Setting the action bar, Used only if you pace the Tutorial view inside your root view.
|
void |
setActionBarRestoreColor(int mActionBarColor)
The of the color that will be set as the action bar color when the tutorial view will be closed.
|
void |
setAnimationDuration(long animationDuration) |
void |
setAnimationType(AbstractTutorialView.AnimationType mAnimationType) |
void |
setHasActionBar(boolean hasActionBar)
Set true if the application has the activity that hold this view has action bar..
|
void |
setHasStatusBar(boolean hasStatusBar)
Set true if the application has status bar.
|
void |
setPositionToSurround(float positionToSurroundX,
float positionToSurroundY,
int positionToSurroundWidth,
int positionToSurroundHeight)
Used mostly for the tutorial activity, Instead of passing a view to surround we pass the view coordination and dimensions.
|
void |
setPositionToSurround(float positionToSurroundX,
float positionToSurroundY,
int positionToSurroundWidth,
int positionToSurroundHeight,
java.lang.String title)
Used mostly for the tutorial activity, Instead of passing a view to surround we pass the view coordination and dimensions.
|
void |
setTutorial(Tutorial tutorial)
Set the tutorial data for this view and animate it into the screen.
|
void |
setTutorial(Tutorial tutorial,
boolean show)
Set the tutorial data for this view and animate it into the screen if wanted.
|
void |
setTutorialBackgroundColor(int mTutorialBackgroundColor)
The background color for the tutorial.
|
void |
setTutorialClosedListener(AbstractTutorialView.TutorialClosedListener tutorialClosedListener)
Setting a listener that will be called when the tutorial is closed.
|
void |
setTutorialGotItPosition(int gotItPosition) |
void |
setTutorialInfoLayoutId(int tutorialInfoLayoutId)
The Layout id of the view that will be used to show the tutorial text or information.
|
void |
setTutorialInfoTextPosition(int infoTextPosition) |
void |
setTutorialText(java.lang.String tutorialText)
The text that will be used for the
mTutorialInfoView. |
void |
setTutorialTextColor(int mTutorialTextColor)
Set the color that will be used for the default info view text view.
|
void |
setTutorialTextSize(int mTutorialTextSize)
Set the size that will be used for the default info view text view.
|
void |
setTutorialTextTypeFace(java.lang.String tutorialTextTypeFaceName)
Set the name of the wanted typeface for this tutorial.
|
void |
setViewToSurround(android.view.View mViewToSurround)
Surround a given view by a visual tutorial with text.
|
void |
setViewToSurround(android.view.View mViewToSurround,
java.lang.String title)
Surround a given view by a visual tutorial with text and title.
|
protected boolean |
shouldDraw()
No need to draw if the view to surround or his dimensions is null.
|
abstract android.view.animation.Animation |
show(java.lang.Runnable onShown) |
checkLayoutParams, dispatchPopulateAccessibilityEvent, generateDefaultLayoutParams, generateLayoutParams, generateLayoutParams, getBaseline, getGravity, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, onLayout, onMeasure, requestLayout, setGravity, setHorizontalGravity, setIgnoreGravity, setVerticalGravity, shouldDelayChildPressedStateaddChildrenForAccessibility, addFocusables, addStatesFromChildren, addTouchables, addView, addView, addView, addView, addView, addViewInLayout, addViewInLayout, attachLayoutAnimationParameters, attachViewToParent, bringChildToFront, canAnimate, childDrawableStateChanged, childHasTransientStateChanged, cleanupLayoutState, clearChildFocus, clearDisappearingChildren, clearFocus, debug, detachAllViewsFromParent, detachViewFromParent, detachViewFromParent, detachViewsFromParent, dispatchApplyWindowInsets, dispatchConfigurationChanged, dispatchDisplayHint, dispatchDragEvent, dispatchDraw, dispatchDrawableHotspotChanged, 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, 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, onAnimationEnd, onAnimationStart, onAttachedToWindow, onCreateDrawableState, onDetachedFromWindow, onInterceptHoverEvent, onInterceptTouchEvent, onNestedFling, onNestedPreFling, onNestedPrePerformAccessibilityAction, onNestedPreScroll, onNestedScroll, onNestedScrollAccepted, onRequestFocusInDescendants, onRequestSendAccessibilityEvent, onStartNestedScroll, onStopNestedScroll, recomputeViewAttributes, removeAllViews, removeAllViewsInLayout, removeDetachedView, removeView, removeViewAt, removeViewInLayout, removeViews, removeViewsInLayout, requestChildFocus, requestChildRectangleOnScreen, requestDisallowInterceptTouchEvent, requestFocus, requestSendAccessibilityEvent, requestTransparentRegion, scheduleLayoutAnimation, setAddStatesFromChildren, setAlwaysDrawnWithCacheEnabled, setAnimationCacheEnabled, setChildrenDrawingCacheEnabled, setChildrenDrawingOrderEnabled, setChildrenDrawnWithCacheEnabled, setClipChildren, setClipToPadding, setDescendantFocusability, setLayoutAnimation, setLayoutAnimationListener, setLayoutMode, setLayoutTransition, setMotionEventSplittingEnabled, setOnHierarchyChangeListener, setPersistentDrawingCache, setStaticTransformationsEnabled, setTouchscreenBlocksFocus, setTransitionGroup, showContextMenuForChild, startActionModeForChild, startLayoutAnimation, startViewTransition, updateViewLayoutaddFocusables, addOnAttachStateChangeListener, addOnLayoutChangeListener, animate, announceForAccessibility, awakenScrollBars, awakenScrollBars, awakenScrollBars, bringToFront, buildDrawingCache, buildDrawingCache, buildLayer, callOnClick, cancelLongPress, cancelPendingInputEvents, canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, canScrollHorizontally, canScrollVertically, checkInputConnectionProxy, clearAnimation, combineMeasuredStates, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeHorizontalScrollRange, computeScroll, computeSystemWindowInsets, computeVerticalScrollExtent, computeVerticalScrollOffset, computeVerticalScrollRange, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchGenericMotionEvent, dispatchNestedFling, dispatchNestedPreFling, dispatchNestedPrePerformAccessibilityAction, dispatchNestedPreScroll, dispatchNestedScroll, draw, drawableHotspotChanged, findViewById, findViewWithTag, fitSystemWindows, focusSearch, forceLayout, generateViewId, getAccessibilityLiveRegion, getAccessibilityNodeProvider, getAccessibilityTraversalAfter, getAccessibilityTraversalBefore, getAlpha, getAnimation, getApplicationWindowToken, getBackground, getBackgroundTintList, getBackgroundTintMode, getBottom, getBottomFadingEdgeStrength, getBottomPaddingOffset, getCameraDistance, getClipBounds, getClipToOutline, getContentDescription, getContext, getContextMenuInfo, getDefaultSize, getDisplay, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getElevation, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusables, getFocusedRect, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarHeight, getId, getImportantForAccessibility, getKeepScreenOn, getKeyDispatcherState, getLabelFor, getLayerType, getLayoutDirection, getLayoutParams, getLeft, getLeftFadingEdgeStrength, getLeftPaddingOffset, getLocalVisibleRect, getLocationInWindow, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOutlineProvider, getOverScrollMode, getPaddingBottom, getPaddingEnd, getPaddingLeft, getPaddingRight, getPaddingStart, getPaddingTop, getParent, getParentForAccessibility, getPivotX, getPivotY, getResources, getRight, getRightFadingEdgeStrength, getRightPaddingOffset, getRootView, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, getScrollX, getScrollY, getSolidColor, getStateListAnimator, getSuggestedMinimumHeight, getSuggestedMinimumWidth, getSystemUiVisibility, getTag, getTag, getTextAlignment, getTextDirection, getTop, getTopFadingEdgeStrength, getTopPaddingOffset, getTouchables, getTouchDelegate, getTransitionName, getTranslationX, getTranslationY, getTranslationZ, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarWidth, getViewTreeObserver, getVisibility, getWidth, getWindowAttachCount, getWindowId, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, getZ, hasNestedScrollingParent, hasOnClickListeners, hasOverlappingRendering, hasWindowFocus, inflate, invalidate, invalidate, invalidate, invalidateDrawable, invalidateOutline, isAccessibilityFocused, isActivated, isAttachedToWindow, isClickable, isDirty, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isHapticFeedbackEnabled, isHardwareAccelerated, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isImportantForAccessibility, isInEditMode, isInLayout, isInTouchMode, isLaidOut, isLayoutDirectionResolved, isLayoutRequested, isLongClickable, isNestedScrollingEnabled, isOpaque, isPaddingOffsetRequired, isPaddingRelative, isPressed, isSaveEnabled, isSaveFromParentEnabled, isScrollbarFadingEnabled, isScrollContainer, isSelected, isShown, isSoundEffectsEnabled, isTextAlignmentResolved, isTextDirectionResolved, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, measure, mergeDrawableStates, offsetLeftAndRight, offsetTopAndBottom, onApplyWindowInsets, onCancelPendingInputEvents, onCheckIsTextEditor, onConfigurationChanged, onCreateContextMenu, onCreateInputConnection, onDisplayHint, onDragEvent, onDrawScrollBars, onFilterTouchEventForSecurity, onFinishInflate, onFinishTemporaryDetach, onFocusChanged, onGenericMotionEvent, onHoverChanged, onHoverEvent, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onOverScrolled, onPopulateAccessibilityEvent, onRestoreInstanceState, onRtlPropertiesChanged, onSaveInstanceState, 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, postOnAnimation, postOnAnimationDelayed, refreshDrawableState, removeCallbacks, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, requestApplyInsets, requestFitSystemWindows, requestFocus, requestFocus, requestFocusFromTouch, 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, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setElevation, setEnabled, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setFocusable, setFocusableInTouchMode, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHovered, setId, setImportantForAccessibility, setKeepScreenOn, setLabelFor, setLayerPaint, setLayerType, setLayoutDirection, setLayoutParams, setLeft, setLongClickable, setMeasuredDimension, setMinimumHeight, setMinimumWidth, setNestedScrollingEnabled, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnApplyWindowInsetsListener, setOnClickListener, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnLongClickListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setOutlineProvider, setOverScrollMode, setPadding, setPaddingRelative, setPivotX, setPivotY, setPressed, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollbarFadingEnabled, setScrollBarSize, setScrollBarStyle, setScrollContainer, setScrollX, setScrollY, setSelected, setSoundEffectsEnabled, setStateListAnimator, setSystemUiVisibility, setTag, setTag, setTextAlignment, setTextDirection, setTop, setTouchDelegate, setTransitionName, setTranslationX, setTranslationY, setTranslationZ, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setVisibility, setWillNotCacheDrawing, setWillNotDraw, setX, setY, setZ, showContextMenu, startActionMode, startAnimation, startDrag, startNestedScroll, stopNestedScroll, toString, unscheduleDrawable, unscheduleDrawable, verifyDrawable, willNotCacheDrawing, willNotDrawclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waithide, showcanResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, createContextMenu, getLayoutDirection, getParent, getParentForAccessibility, getTextAlignment, getTextDirection, isLayoutDirectionResolved, isLayoutRequested, isTextAlignmentResolved, isTextDirectionResolved, requestFitSystemWindowsprotected static final boolean DEBUG_DRAW
public static final java.lang.String TAG
public static final boolean DEBUG
protected static final int DEFAULT_BACKGROUND_COLOR
protected static final int DEFAULT_PRECAUTION_ABOVE_DISTANCE
protected static final int DEFAULT_CIRCLE_PADDING
protected static final int INNER_CIRCLE_DEFAULT_ALPHA
protected static final int DEFAULT_STROKE_WIDTH
protected int mViewToSurroundCenterX
protected int mViewToSurroundCenterY
protected int mViewToSurroundRadius
protected int statusBarHeight
protected int actionBarHeight
protected android.view.View mTutorialInfoView
protected android.view.View mGotItButton
protected android.view.View mSkipButton
protected android.view.View mTitleView
protected Tutorial mTutorial
protected android.graphics.Paint mBackgroundPaint
protected android.graphics.Paint debugPaint
protected android.graphics.Paint mInnerCirclePaint
protected boolean showing
protected boolean closing
protected android.app.ActionBar mActionBar
protected boolean mChangeActionBarColor
protected int mActionBarRestoreColor
protected java.lang.String mActionBarOldTitle
protected AbstractTutorialView.TutorialClosedListener tutorialClosedListener
protected android.graphics.RectF mViewBoundsInParent
protected android.graphics.Typeface mTutorialTextTypeFace
public AbstractTutorialView(android.content.Context context)
public AbstractTutorialView(android.content.Context context,
android.util.AttributeSet attrs)
public AbstractTutorialView(android.content.Context context,
android.util.AttributeSet attrs,
int defStyleAttr)
public abstract void closeTutorial()
public abstract void beforeFirstDraw()
public abstract android.view.animation.Animation show(java.lang.Runnable onShown)
public abstract android.view.animation.Animation hide(java.lang.Runnable onHidden)
public void setViewToSurround(android.view.View mViewToSurround)
setViewToSurround in interface TutorialViewInterfacemViewToSurround - the view that need to be surrounded with the tutorial.public void setViewToSurround(android.view.View mViewToSurround,
java.lang.String title)
setViewToSurround in interface TutorialViewInterfacetitle - the text of the title that will be used for the tutorial, If an action bar is assign the title will be in the action bar title.mViewToSurround - the view that need to be surrounded with the tutorial.public void setPositionToSurround(float positionToSurroundX,
float positionToSurroundY,
int positionToSurroundWidth,
int positionToSurroundHeight)
setPositionToSurround in interface TutorialViewInterfacepositionToSurroundX - The x position of the area that should be surrounded, This could be obtained by using getX() on the view you want to surround.positionToSurroundY - The y position of the area that should be surrounded, This could be obtained by using getY() on the view you want to surround.positionToSurroundWidth - The width of the area that should be surrounded, This could be obtained by using getMeasuredWidth() on the view you want to surround.positionToSurroundHeight - The height of the area that should be surrounded, This could be obtained by using getMeasuredHeight() on the view you want to surround.public void setPositionToSurround(float positionToSurroundX,
float positionToSurroundY,
int positionToSurroundWidth,
int positionToSurroundHeight,
java.lang.String title)
setPositionToSurround in interface TutorialViewInterfacetitle - The title text that will be used for this tutorial.positionToSurroundX - The x position of the area that should be surrounded, This could be obtained by using getX() on the view you want to surround.positionToSurroundY - The y position of the area that should be surrounded, This could be obtained by using getY() on the view you want to surround.positionToSurroundWidth - The width of the area that should be surrounded, This could be obtained by using getMeasuredWidth() on the view you want to surround.positionToSurroundHeight - The height of the area that should be surrounded, This could be obtained by using getMeasuredHeight() on the view you want to surround.public void setTutorial(Tutorial tutorial)
TutorialViewInterfacesetTutorial in interface TutorialViewInterfacetutorial - The tutorial object that hold all the tutorial data.public void setTutorial(Tutorial tutorial, boolean show)
TutorialViewInterfacesetTutorial in interface TutorialViewInterfacetutorial - The tutorial object that hold all the tutorial data.show - pass true if you want the tutorial to be shown.protected void onDraw(android.graphics.Canvas canvas)
onDraw in class android.view.Viewprotected void calcViewBoundsRadiusAndCenter()
protected void inflateTutorialInfo()
setTutorialText(String)
for setting the text for the explanation.protected void removeTutorialInfo()
protected void dispatchTutorialClosed()
protected void initTypeFace()
protected void initActionBar(java.lang.String title)
protected void restoreActionBar()
protected void drawInnerCircles(android.graphics.Canvas canvas)
protected boolean shouldDraw()
public void setTutorialInfoLayoutId(int tutorialInfoLayoutId)
setTutorialInfoLayoutId in interface TutorialInterfacetutorialInfoLayoutId - the id of the layout that should be used for the info text.public void setActionBar(android.app.ActionBar actionBar)
TutorialViewInterfacesetActionBar in interface TutorialViewInterfaceTutorialViewInterface.setActionBarRestoreColor(int),
TutorialViewInterface.changeActionBarColor(boolean)public void setTutorialClosedListener(AbstractTutorialView.TutorialClosedListener tutorialClosedListener)
TutorialViewInterfacesetTutorialClosedListener in interface TutorialViewInterfacepublic void setTutorialBackgroundColor(int mTutorialBackgroundColor)
setTutorialBackgroundColor in interface TutorialInterfacemTutorialBackgroundColor - the backgrond color to use for the backgroundpublic void changeActionBarColor(boolean mChangeActionBarColor)
mActionBarRestoreColor so when the tutorial is closed the action bar color will ber restored.changeActionBarColor in interface TutorialViewInterfacesetActionBarRestoreColor(int)public void setActionBarRestoreColor(int mActionBarColor)
setActionBarRestoreColor in interface TutorialViewInterfacechangeActionBarColor(boolean)public void setHasStatusBar(boolean hasStatusBar)
setHasStatusBar in interface TutorialViewInterfacepublic void setHasActionBar(boolean hasActionBar)
setHasActionBar in interface TutorialViewInterfacepublic void setTutorialText(java.lang.String tutorialText)
mTutorialInfoView.
Only if the layout that is used is the default layout R.layout.tutorial_text.setTutorialText in interface TutorialInterfacetutorialText - The explenation text about the view.setTutorialTextTypeFace(String),
setTutorialTextColor(int),
setTutorialTextSize(int)public void setTutorialTextSize(int mTutorialTextSize)
setTutorialTextSize in interface TutorialInterfacemTutorialTextSize - the size that would be used for the info text.setTutorialText(String),
setTutorialTextColor(int),
setTutorialTextTypeFace(String)public void setTutorialTextColor(int mTutorialTextColor)
setTutorialTextColor in interface TutorialInterfacemTutorialTextColor - the color that will be used for the default info view text view.
This color will also be used for the "Got It" button.setTutorialTextSize(int),
setTutorialText(String),
setTutorialTextTypeFace(String)public void setTutorialTextTypeFace(java.lang.String tutorialTextTypeFaceName)
setTutorialTextTypeFace in interface TutorialInterfacetutorialTextTypeFaceName - the typeface name that will be used for the default info view text view.setTutorialTextSize(int),
setTutorialText(String),
setTutorialTextColor(int)public boolean isShowing()
isShowing in interface TutorialViewInterfacepublic void setAnimationType(AbstractTutorialView.AnimationType mAnimationType)
setAnimationType in interface TutorialInterfacemAnimationType - the animation type that will be used to show and hide the tutorial.public void setAnimationDuration(long animationDuration)
setAnimationDuration in interface TutorialInterfaceanimationDuration - the time that will be used for the animationpublic long getAnimationDuration()
getAnimationDuration in interface TutorialInterfacepublic AbstractTutorialView.AnimationType getAnimationType()
getAnimationType in interface TutorialInterfacepublic int getTutorialInfoLayoutId()
getTutorialInfoLayoutId in interface TutorialInterfacepublic int getTutorialBackgroundColor()
getTutorialBackgroundColor in interface TutorialInterfacepublic java.lang.String getTutorialText()
getTutorialText in interface TutorialInterfacepublic int getTutorialTextSize()
getTutorialTextSize in interface TutorialInterfacepublic int getTutorialTextColor()
getTutorialTextColor in interface TutorialInterfacepublic java.lang.String getTutorialTextTypeFace()
getTutorialTextTypeFace in interface TutorialInterfacepublic void setTutorialInfoTextPosition(int infoTextPosition)
setTutorialInfoTextPosition in interface TutorialInterfacepublic int getTutorialInfoTextPosition()
getTutorialInfoTextPosition in interface TutorialInterfacepublic int getTutorialGotItPosition()
getTutorialGotItPosition in interface TutorialInterfacepublic void setTutorialGotItPosition(int gotItPosition)
setTutorialGotItPosition in interface TutorialInterfacepublic boolean isWalkThrough()
isWalkThrough in interface TutorialViewInterface