Class AbsSeekBar
- All Implemented Interfaces:
Drawable.Callback
- Direct Known Subclasses:
SeekBar
-
Nested Class Summary
Nested classes/interfaces inherited from class icyllis.modernui.view.View
View.DragShadow, View.Focusable, View.FocusableMode, View.FocusDirection, View.FocusRealDirection, View.LayoutDir, View.NestedScrollType, View.OnAttachStateChangeListener, View.OnClickListener, View.OnContextClickListener, View.OnCreateContextMenuListener, View.OnDragListener, View.OnFocusChangeListener, View.OnGenericMotionListener, View.OnHoverListener, View.OnKeyListener, View.OnLayoutChangeListener, View.OnLongClickListener, View.OnScrollChangeListener, View.OnTouchListener, View.ResolvedLayoutDir, View.ScrollAxis, View.ScrollBarStyle, View.ScrollIndicators, View.TextAlignment, View.Visibility
-
Field Summary
Fields inherited from class icyllis.modernui.widget.ProgressBar
VISUAL_PROGRESS
Fields inherited from class icyllis.modernui.view.View
ALPHA, BOTTOM, 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, FOCUS_BACKWARD, FOCUS_DOWN, FOCUS_FORWARD, FOCUS_LEFT, FOCUS_RIGHT, FOCUS_UP, FOCUSABLE, FOCUSABLE_AUTO, 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, LAYOUT_DIRECTION_INHERIT, LAYOUT_DIRECTION_LOCALE, LAYOUT_DIRECTION_LTR, LAYOUT_DIRECTION_RTL, LAYOUT_DIRECTION_UNDEFINED, LEFT, MEASURED_HEIGHT_STATE_SHIFT, MEASURED_SIZE_MASK, MEASURED_STATE_MASK, MEASURED_STATE_TOO_SMALL, mPaddingBottom, mPaddingLeft, mPaddingRight, mPaddingTop, mScrollX, mScrollY, NO_ID, NOT_FOCUSABLE, 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, RIGHT, ROTATION, ROTATION_X, ROTATION_Y, SCALE_X, SCALE_Y, SCROLL_AXIS_HORIZONTAL, SCROLL_AXIS_NONE, SCROLL_AXIS_VERTICAL, SCROLL_INDICATOR_BOTTOM, SCROLL_INDICATOR_END, SCROLL_INDICATOR_LEFT, SCROLL_INDICATOR_RIGHT, SCROLL_INDICATOR_START, SCROLL_INDICATOR_TOP, SCROLL_X, SCROLL_Y, SCROLLBARS_INSIDE_INSET, SCROLLBARS_INSIDE_OVERLAY, SCROLLBARS_OUTSIDE_INSET, SCROLLBARS_OUTSIDE_OVERLAY, SELECTED_STATE_SET, SELECTED_WINDOW_FOCUSED_STATE_SET, SOUND_EFFECTS_ENABLED, TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_GRAVITY, TEXT_ALIGNMENT_INHERIT, TEXT_ALIGNMENT_TEXT_END, TEXT_ALIGNMENT_TEXT_START, TEXT_ALIGNMENT_VIEW_END, TEXT_ALIGNMENT_VIEW_START, TEXT_DIRECTION_ANY_RTL, TEXT_DIRECTION_FIRST_STRONG, TEXT_DIRECTION_FIRST_STRONG_LTR, TEXT_DIRECTION_FIRST_STRONG_RTL, TEXT_DIRECTION_INHERIT, TEXT_DIRECTION_LOCALE, TEXT_DIRECTION_LTR, TEXT_DIRECTION_RTL, TOP, TRANSLATION_X, TRANSLATION_Y, TRANSLATION_Z, TYPE_NON_TOUCH, TYPE_TOUCH, VIEW_MARKER, VISIBLE, WINDOW_FOCUSED_STATE_SET, X, Y, Z
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
drawableHotspotChanged
(float x, float y) This function is called whenever the view hotspot changes and needs to be propagated to drawables or child views managed by the view.protected void
This function is called whenever the state of the view changes in such a way that it impacts the state of drawables being shown.protected void
drawTickMarks
(Canvas canvas) int
Returns the amount of progress changed via the arrow keys.boolean
Returns whether the track should be split by the thumb.getThumb()
Return the drawable used to represent the scroll thumb - the component that the user can drag back and forth indicating the current value by its position.int
Returns the blending mode used to apply the tint to the thumb drawable, if specified.Returns the tint applied to the thumb drawable, if specified.Returns the blending mode used to apply the tint to the tick mark drawable, if specified.Returns the tint applied to the tick mark drawable, if specified.void
CallDrawable.jumpToCurrentState()
on all Drawable objects associated with this view.protected void
Draw the content of this view, implement this to do your drawing.boolean
Default implementation: perform press of the view whenKeyEvent.KEY_ENTER
,KeyEvent.KEY_KP_ENTER
orKeyEvent.KEY_SPACE
is released, if the view is enabled and clickable.protected void
onMeasure
(int widthMeasureSpec, int heightMeasureSpec) Measure the view and its content to determine the measured width and the measured height.void
onRtlPropertiesChanged
(int layoutDirection) Called when any RTL property (layout direction or text direction or text alignment) has been changed.protected void
onSizeChanged
(int w, int h, int oldw, int oldh) Called when width or height changedboolean
onTouchEvent
(MotionEvent event) Implement this method to handle touch screen motion events.void
setKeyProgressIncrement
(int increment) Sets the amount of progress changed via the arrow keys.void
setSplitTrack
(boolean splitTrack) Specifies whether the track should be split by the thumb.void
Sets the thumb that will be drawn at the end of the progress meter within the SeekBar.void
setThumbOffset
(int thumbOffset) Sets the thumb offset that allows the thumb to extend out of the range of the track.void
setThumbTintBlendMode
(BlendMode blendMode) Specifies the blending mode used to apply the tint specified bysetThumbTintList(ColorStateList)
} to the thumb drawable.void
Applies a tint to the thumb drawable.void
setTickMark
(Drawable tickMark) Sets the drawable displayed at each progress position, e.g.void
setTickMarkTintBlendMode
(BlendMode blendMode) Specifies the blending mode used to apply the tint specified bysetTickMarkTintList(ColorStateList)
} to the tick mark drawable.void
Applies a tint to the tick mark drawable.protected boolean
verifyDrawable
(Drawable who) If your view subclass is displaying its own Drawable objects, it should override this function and return true for any Drawable it is displaying.Methods inherited from class icyllis.modernui.widget.ProgressBar
getCurrentDrawable, getIndeterminateDrawable, getIndeterminateTintBlendMode, getIndeterminateTintList, getMax, getMaximumHeight, getMaximumWidth, getMin, getProgress, getProgressBackgroundTintBlendMode, getProgressBackgroundTintList, getProgressDrawable, getProgressTintBlendMode, getProgressTintList, getSecondaryProgress, getSecondaryProgressTintBlendMode, getSecondaryProgressTintList, incrementProgressBy, incrementSecondaryProgressBy, isIndeterminate, onResolveDrawables, setIndeterminate, setIndeterminateDrawable, setIndeterminateTintBlendMode, setIndeterminateTintList, setMax, setMaximumHeight, setMaximumWidth, setMin, setProgress, setProgress, setProgressBackgroundTintBlendMode, setProgressBackgroundTintList, setProgressDrawable, setProgressTintBlendMode, setProgressTintList, setSecondaryProgress, setSecondaryProgressTintBlendMode, setSecondaryProgressTintList
Methods inherited from class icyllis.modernui.view.View
addFocusables, addFocusables, addKeyboardNavigationClusters, addOnAttachStateChangeListener, addOnLayoutChangeListener, addTouchables, awakenScrollBars, awakenScrollBars, callOnClick, cancelLongPress, cancelPendingInputEvents, canReceivePointerEvents, canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, canScrollHorizontally, canScrollVertically, clearFocus, combineMeasuredStates, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeHorizontalScrollRange, computeScroll, computeVerticalScrollExtent, computeVerticalScrollOffset, computeVerticalScrollRange, createContextMenu, dispatchDraw, dispatchDrawableHotspotChanged, dispatchFinishTemporaryDetach, dispatchGenericMotionEvent, dispatchGenericPointerEvent, dispatchHoverEvent, dispatchKeyEvent, dispatchKeyShortcutEvent, dispatchNestedFling, dispatchNestedPreFling, dispatchNestedPreScroll, dispatchNestedScroll, dispatchPointerEvent, dispatchSetActivated, dispatchSetPressed, dispatchSetSelected, dispatchStartTemporaryDetach, dispatchTouchEvent, dispatchVisibilityChanged, dispatchWindowFocusChanged, dispatchWindowVisibilityChanged, dp, draw, findFocus, findViewById, findViewByPredicate, findViewByPredicateInsideOut, findViewByPredicateTraversal, findViewTraversal, focusSearch, forceHasOverlappingRendering, forceLayout, generateViewId, getAlpha, getAnimationMatrix, getBackground, getBaseline, getBottom, getBoundsOnScreen, getBoundsOnScreen, getContext, getContextMenuInfo, getDefaultSize, getDrawableState, getDrawingRect, getElevation, getFadingEdge, getFadingEdgeLength, getFocusable, getFocusables, getFocusedRect, getForeground, getForegroundGravity, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHasOverlappingRendering, getHeight, getHitRect, getHorizontalScrollbarHeight, getHorizontalScrollbarThumbDrawable, getHorizontalScrollbarTrackDrawable, getId, getInverseMatrix, getKeyDispatcherState, getLayoutDirection, getLayoutParams, getLeft, getLocalVisibleRect, getLocationInWindow, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextClusterForwardId, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOnLongClickListener, getOverScrollMode, getPaddingBottom, getPaddingEnd, getPaddingLeft, getPaddingRight, getPaddingStart, getPaddingTop, getParent, getPivotX, getPivotY, getRawLayoutDirection, getRawTextAlignment, getRawTextDirection, getRevealOnFocusHint, getRight, getRootView, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, getScrollIndicators, getScrollX, getScrollY, getStateListAnimator, getSuggestedMinimumHeight, getSuggestedMinimumWidth, getTag, getTextAlignment, getTextDirection, getTooltipText, getTooltipView, getTop, getTouchables, getTransitionAlpha, getTransitionName, getTranslationX, getTranslationY, getTranslationZ, getVerticalFadingEdgeLength, getVerticalScrollbarThumbDrawable, getVerticalScrollbarTrackDrawable, getVerticalScrollbarWidth, getViewRoot, getViewTreeObserver, getVisibility, getWidth, getWindowAttachCount, getWindowVisibility, getX, getY, getZ, handleScrollBarDragging, hasExplicitFocusable, hasFocus, hasFocusable, hasIdentityMatrix, hasNestedScrollingParent, hasOnClickListeners, hasOnLongClickListeners, hasOverlappingRendering, hasTransientState, hasTranslationTransientState, hasWindowFocus, internalSetPadding, invalidate, invalidateDrawable, isActivated, isAttachedToWindow, isClickable, isContextClickable, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isFocusedByDefault, isForegroundInsidePadding, isHapticFeedbackEnabled, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isInLayout, isInScrollingContainer, isInTouchMode, isKeyboardNavigationCluster, isLaidOut, isLayoutDirectionInherited, isLayoutDirectionResolved, isLayoutRequested, isLayoutRtl, isLongClickable, isNestedScrollingEnabled, isPaddingRelative, isPivotSet, isPressed, isRootNamespace, isScrollbarFadingEnabled, isSelected, isShowingLayoutBounds, isShown, isSoundEffectsEnabled, isTemporarilyDetached, isTextAlignmentInherited, isTextAlignmentResolved, isTextDirectionInherited, isTextDirectionResolved, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, isVerticalScrollBarHidden, keyboardNavigationClusterSearch, layout, mapRectFromViewToScreenCoords, measure, mergeDrawableStates, offsetLeftAndRight, offsetTopAndBottom, onAttachedToWindow, onCancelPendingInputEvents, onCreateContextMenu, onCreateDrawableState, onDetachedFromWindow, onDragEvent, onDrawForeground, onDrawScrollBars, onFinishTemporaryDetach, onFocusChanged, onGenericMotionEvent, onHoverChanged, onHoverEvent, onKeyShortcut, onKeyUp, onLayout, onOverScrolled, onResolvePointerIcon, onScrollChanged, onStartTemporaryDetach, onVisibilityAggregated, onVisibilityChanged, onWindowFocusChanged, onWindowVisibilityChanged, overScrollBy, performButtonActionOnTouchDown, performClick, performContextClick, performContextClick, performHapticFeedback, performHapticFeedback, performLongClick, performLongClick, playSoundEffect, pointInView, post, postDelayed, postInvalidate, postInvalidateDelayed, postInvalidateOnAnimation, postOnAnimation, postOnAnimationDelayed, refreshDrawableState, removeCallbacks, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, requestFocus, requestFocus, requestFocus, requestLayout, requestRectangleOnScreen, requestRectangleOnScreen, requireViewById, resetPivot, resetResolvedDrawables, resolveDrawables, resolveLayoutDirection, resolveLayoutParams, resolvePadding, resolveRtlPropertiesIfNeeded, resolveSize, resolveSizeAndState, resolveTextAlignment, resolveTextDirection, restoreDefaultFocus, scheduleDrawable, scrollBy, scrollTo, setActivated, setAlpha, setAnimationMatrix, setBackground, setBottom, setClickable, setContextClickable, setDuplicateParentStateEnabled, setElevation, setEnabled, setFocusable, setFocusable, setFocusableInTouchMode, setFocusedByDefault, setFocusedInCluster, setForeground, setForegroundGravity, setFrame, setHapticFeedbackEnabled, setHasTransientState, setHasTranslationTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHorizontalScrollbarThumbDrawable, setHorizontalScrollbarTrackDrawable, setHovered, setId, setIsRootNamespace, setKeyboardNavigationCluster, setLayoutDirection, setLayoutParams, setLeft, setLongClickable, setMeasuredDimension, setMinimumHeight, setMinimumWidth, setNestedScrollingEnabled, setNextClusterForwardId, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnClickListener, setOnContextClickListener, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnLongClickListener, setOnScrollChangeListener, setOnTouchListener, setOverScrollMode, setPadding, setPaddingRelative, setPivotX, setPivotY, setPressed, setRevealOnFocusHint, setRight, setRotation, setRotationX, setRotationY, setScaleX, setScaleY, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollbarFadingEnabled, setScrollBarSize, setScrollBarStyle, setScrollIndicators, setScrollIndicators, setScrollX, setScrollY, setSelected, setSoundEffectsEnabled, setStateListAnimator, setTag, setTextAlignment, setTextDirection, setTooltipText, setTop, setTransitionAlpha, setTransitionName, setTransitionVisibility, setTranslationX, setTranslationY, setTranslationZ, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarThumbDrawable, setVerticalScrollbarTrackDrawable, setVisibility, setWillNotDraw, setX, setY, setZ, showContextMenu, showContextMenu, sp, startActionMode, startActionMode, startDragAndDrop, startNestedScroll, stopNestedScroll, toGlobalMotionEvent, toLocalMotionEvent, toString, transformFromViewToWindowSpace, transformMatrixToGlobal, transformMatrixToLocal, unscheduleDrawable, unscheduleDrawable, willNotDraw
-
Constructor Details
-
AbsSeekBar
-
-
Method Details
-
setThumb
Sets the thumb that will be drawn at the end of the progress meter within the SeekBar.If the thumb is a valid drawable (i.e. not null), half its width will be used as the new thumb offset (@see #setThumbOffset(int)).
- Parameters:
thumb
- Drawable representing the thumb
-
getThumb
Return the drawable used to represent the scroll thumb - the component that the user can drag back and forth indicating the current value by its position.- Returns:
- The current thumb drawable
-
setThumbTintList
Applies a tint to the thumb drawable.Subsequent calls to
setThumb(Drawable)
will automatically mutate the drawable and apply the specified tint and tint mode usingDrawable.setTintList(ColorStateList)
.- Parameters:
tint
- the tint to apply, may benull
to clear tint- See Also:
-
getThumbTintList
Returns the tint applied to the thumb drawable, if specified.- Returns:
- the tint applied to the thumb drawable
- See Also:
-
setThumbTintBlendMode
Specifies the blending mode used to apply the tint specified bysetThumbTintList(ColorStateList)
} to the thumb drawable. The default mode isBlendMode.SRC_IN
.- Parameters:
blendMode
- the blending mode used to apply the tint, may benull
to clear tint- See Also:
-
getThumbTintBlendMode
Returns the blending mode used to apply the tint to the thumb drawable, if specified.- Returns:
- the blending mode used to apply the tint to the thumb drawable
- See Also:
-
getThumbOffset
public int getThumbOffset()- See Also:
-
setThumbOffset
public void setThumbOffset(int thumbOffset) Sets the thumb offset that allows the thumb to extend out of the range of the track.- Parameters:
thumbOffset
- The offset amount in pixels.
-
setSplitTrack
public void setSplitTrack(boolean splitTrack) Specifies whether the track should be split by the thumb. When true, the thumb's optical bounds will be clipped out of the track drawable, then the thumb will be drawn into the resulting gap.- Parameters:
splitTrack
- Whether the track should be split by the thumb
-
getSplitTrack
public boolean getSplitTrack()Returns whether the track should be split by the thumb. -
setTickMark
Sets the drawable displayed at each progress position, e.g. at each possible thumb position.- Parameters:
tickMark
- the drawable to display at each progress position
-
getTickMark
- Returns:
- the drawable displayed at each progress position
-
setTickMarkTintList
Applies a tint to the tick mark drawable.Subsequent calls to
setTickMark(Drawable)
will automatically mutate the drawable and apply the specified tint and tint mode usingDrawable.setTintList(ColorStateList)
.- Parameters:
tint
- the tint to apply, may benull
to clear tint- See Also:
-
getTickMarkTintList
Returns the tint applied to the tick mark drawable, if specified.- Returns:
- the tint applied to the tick mark drawable
- See Also:
-
setTickMarkTintBlendMode
Specifies the blending mode used to apply the tint specified bysetTickMarkTintList(ColorStateList)
} to the tick mark drawable. The default mode isBlendMode.SRC_IN
.- Parameters:
blendMode
- the blending mode used to apply the tint, may benull
to clear tint- See Also:
-
getTickMarkTintBlendMode
Returns the blending mode used to apply the tint to the tick mark drawable, if specified.- Returns:
- the blending mode used to apply the tint to the tick mark drawable
-
setKeyProgressIncrement
public void setKeyProgressIncrement(int increment) Sets the amount of progress changed via the arrow keys.- Parameters:
increment
- The amount to increment or decrement when the user presses the arrow keys.
-
getKeyProgressIncrement
public int getKeyProgressIncrement()Returns the amount of progress changed via the arrow keys.By default, this will be a value that is derived from the progress range.
- Returns:
- The amount to increment or decrement when the user presses the arrow keys. This will be positive.
-
verifyDrawable
Description copied from class:View
If your view subclass is displaying its own Drawable objects, it should override this function and return true for any Drawable it is displaying. This allows animations for those drawables to be scheduled.Be sure to call through to the super class when overriding this function.
- Overrides:
verifyDrawable
in classProgressBar
- Parameters:
who
- The Drawable to verify. Return true if it is one you are displaying, else return the result of calling through to the super class.- Returns:
- boolean If true then the Drawable is being displayed in the view; else false and it is not allowed to animate.
- See Also:
-
jumpDrawablesToCurrentState
public void jumpDrawablesToCurrentState()Description copied from class:View
CallDrawable.jumpToCurrentState()
on all Drawable objects associated with this view.Also calls
StateListAnimator.jumpToCurrentState()
if there is a StateListAnimator attached to this view.- Overrides:
jumpDrawablesToCurrentState
in classProgressBar
-
drawableStateChanged
protected void drawableStateChanged()Description copied from class:View
This function is called whenever the state of the view changes in such a way that it impacts the state of drawables being shown.If the View has a StateListAnimator, it will also be called to run necessary state change animations.
Be sure to call through to the superclass when overriding this function.
- Overrides:
drawableStateChanged
in classProgressBar
- See Also:
-
drawableHotspotChanged
public void drawableHotspotChanged(float x, float y) Description copied from class:View
This function is called whenever the view hotspot changes and needs to be propagated to drawables or child views managed by the view.Dispatching to child views is handled by
View.dispatchDrawableHotspotChanged(float, float)
.Be sure to call through to the superclass when overriding this function.
- Overrides:
drawableHotspotChanged
in classProgressBar
- Parameters:
x
- hotspot x coordinatey
- hotspot y coordinate
-
onSizeChanged
protected void onSizeChanged(int w, int h, int oldw, int oldh) Description copied from class:View
Called when width or height changed- Overrides:
onSizeChanged
in classProgressBar
- Parameters:
w
- new widthh
- new heightoldw
- previous widtholdh
- previous height
-
onMeasure
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) Description copied from class:View
Measure the view and its content to determine the measured width and the measured height. This method is invoked byView.measure(int, int)
and should be overridden by subclasses to provide accurate and efficient measurement of their contents.CONTRACT: When overriding this method, you must call
View.setMeasuredDimension(int, int)
to store the measured width and height of this view. Failure to do so will trigger anIllegalStateException
, thrown byView.measure(int, int)
. Calling super.onMeasure() is a valid use.The base class implementation of measure defaults to the background size, unless a larger size is allowed by the MeasureSpec. Subclasses should override the base one to provide better measurements of their content.
- Overrides:
onMeasure
in classProgressBar
- Parameters:
widthMeasureSpec
- width measure specification imposed by the parentMeasureSpec
heightMeasureSpec
- height measure specification imposed by the parentMeasureSpec
-
onDraw
Description copied from class:View
Draw the content of this view, implement this to do your drawing.Note that (0, 0) will be the top left of the bounds, and (width, height) will be the bottom right of the bounds.
- Overrides:
onDraw
in classProgressBar
- Parameters:
canvas
- the canvas to draw content
-
drawTickMarks
-
onTouchEvent
Description copied from class:View
Implement this method to handle touch screen motion events.If this method is used to detect click actions, it is recommended that the actions be performed by implementing and calling
View.performClick()
. This will ensure consistent system behavior.- Overrides:
onTouchEvent
in classView
- Parameters:
event
- the touch event- Returns:
true
if the event was handled by the view,false
otherwise
-
onKeyDown
Description copied from class:View
Default implementation: perform press of the view whenKeyEvent.KEY_ENTER
,KeyEvent.KEY_KP_ENTER
orKeyEvent.KEY_SPACE
is released, if the view is enabled and clickable. -
onRtlPropertiesChanged
public void onRtlPropertiesChanged(int layoutDirection) Description copied from class:View
Called when any RTL property (layout direction or text direction or text alignment) has been changed.Subclasses need to override this method to take care of cached information that depends on the resolved layout direction, or to inform child views that inherit their layout direction.
The default implementation does nothing.
- Overrides:
onRtlPropertiesChanged
in classView
- Parameters:
layoutDirection
- the direction of the layout- See Also:
-