-
- All Implemented Interfaces:
-
android.graphics.drawable.Drawable.Callback,android.view.KeyEvent.Callback,android.view.accessibility.AccessibilityEventSource
public class DiscreteSeekBar extends View
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceDiscreteSeekBar.OnProgressChangeListenerInterface to propagate seekbar change event
public abstract classDiscreteSeekBar.NumericTransformerInterface to transform the current internal value of this DiscreteSeekBar to anther one for thevisualization.This will be used on the floating bubble to display a different value if needed.Using this in conjunction with setIndicatorFormatter you will be able tomanipulate thevalue seen by the user
-
Constructor Summary
Constructors Constructor Description DiscreteSeekBar(Context context)DiscreteSeekBar(Context context, AttributeSet attrs)DiscreteSeekBar(Context context, AttributeSet attrs, int defStyleAttr)
-
Method Summary
Modifier and Type Method Description voidsetIndicatorFormatter(@Nullable() String formatter)Sets the current Indicator formatter string voidsetNumericTransformer(@Nullable() DiscreteSeekBar.NumericTransformer transformer)Sets the current NumericTransformer DiscreteSeekBar.NumericTransformergetNumericTransformer()Retrieves the current NumericTransformer voidsetMax(int max)Sets the maximum value for this DiscreteSeekBarif the supplied argument is smaller than the Current MIN value,the MIN value will be set to MAX-1Also if the current progress is out of the new range, it will be set to MIN intgetMax()voidsetMin(int min)Sets the minimum value for this DiscreteSeekBarif the supplied argument is bigger than the Current MAX value,the MAX value will be set to MIN+1Also if the current progress is out of the new range, it will be set to MIN intgetMin()voidsetProgress(int progress)Sets the current progress for this DiscreteSeekBarThe supplied argument will be capped to the current MIN-MAX range intgetProgress()Get the current progress voidsetOnProgressChangeListener(@Nullable() DiscreteSeekBar.OnProgressChangeListener listener)Sets a listener to receive notifications of changes to the DiscreteSeekBar's progress level.Alsoprovides notifications of when the DiscreteSeekBar shows/hides the bubble indicator. voidsetThumbColor(int thumbColor, int indicatorColor)Sets the color of the seek thumb, as well as the color of the popup indicator. voidsetThumbColor(@NonNull() ColorStateList thumbColorStateList, int indicatorColor)Sets the color of the seek thumb, as well as the color of the popup indicator. voidsetScrubberColor(int color)Sets the color of the seekbar scrubber voidsetScrubberColor(@NonNull() ColorStateList colorStateList)Sets the color of the seekbar scrubber voidsetRippleColor(int color)Sets the color of the seekbar ripple voidsetRippleColor(@NonNull() ColorStateList colorStateList)Sets the color of the seekbar ripple voidsetTrackColor(int color)Sets the color of the seekbar scrubber voidsetTrackColor(@NonNull() ColorStateList colorStateList)Sets the color of the seekbar scrubber voidsetIndicatorPopupEnabled(boolean enabled)If {@code enabled}is false the indicator won't appear.voidscheduleDrawable(Drawable who, Runnable what, long when)booleanonTouchEvent(MotionEvent event)booleanonKeyDown(int keyCode, KeyEvent event)booleanisRtl()-
Methods inherited from class android.view.View
addChildrenForAccessibility, addExtraDataToAccessibilityNodeInfo, addFocusables, addKeyboardNavigationClusters, addOnAttachStateChangeListener, addOnLayoutChangeListener, addOnUnhandledKeyEventListener, addTouchables, animate, announceForAccessibility, autofill, bringToFront, buildDrawingCache, buildLayer, callOnClick, canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, canScrollHorizontally, canScrollVertically, cancelDragAndDrop, cancelLongPress, cancelPendingInputEvents, checkInputConnectionProxy, clearAnimation, clearFocus, clearViewTranslationCallback, combineMeasuredStates, computeScroll, computeSystemWindowInsets, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchApplyWindowInsets, dispatchCapturedPointerEvent, dispatchConfigurationChanged, dispatchCreateViewTranslationRequest, dispatchDisplayHint, dispatchDragEvent, dispatchDrawableHotspotChanged, dispatchFinishTemporaryDetach, dispatchGenericMotionEvent, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchNestedFling, dispatchNestedPreFling, dispatchNestedPrePerformAccessibilityAction, dispatchNestedPreScroll, dispatchNestedScroll, dispatchPointerCaptureChanged, dispatchPopulateAccessibilityEvent, dispatchProvideAutofillStructure, dispatchProvideStructure, dispatchScrollCaptureSearch, dispatchStartTemporaryDetach, dispatchSystemUiVisibilityChanged, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchWindowFocusChanged, dispatchWindowInsetsAnimationEnd, dispatchWindowInsetsAnimationPrepare, dispatchWindowInsetsAnimationProgress, dispatchWindowInsetsAnimationStart, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, draw, drawableHotspotChanged, findFocus, findViewById, findViewWithTag, findViewsWithText, focusSearch, forceHasOverlappingRendering, forceLayout, gatherTransparentRegion, generateDisplayHash, generateViewId, getAccessibilityClassName, getAccessibilityDelegate, getAccessibilityLiveRegion, getAccessibilityNodeProvider, getAccessibilityPaneTitle, getAccessibilityTraversalAfter, getAccessibilityTraversalBefore, getAlpha, getAnimation, getAnimationMatrix, getApplicationWindowToken, getAttributeResolutionStack, getAttributeSourceResourceMap, getAutofillHints, getAutofillId, getAutofillType, getAutofillValue, getBackground, getBackgroundTintBlendMode, getBackgroundTintList, getBackgroundTintMode, getBaseline, getBottom, getCameraDistance, getClipBounds, getClipBounds, getClipToOutline, getContentCaptureSession, getContentDescription, getContext, getDefaultFocusHighlightEnabled, getDefaultSize, getDisplay, getDrawableState, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getElevation, getExplicitStyle, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusable, getFocusables, getFocusedRect, getForeground, getForegroundGravity, getForegroundTintBlendMode, getForegroundTintList, getForegroundTintMode, getGlobalVisibleRect, getHandler, getHasOverlappingRendering, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarThumbDrawable, getHorizontalScrollbarTrackDrawable, getId, getImportantForAccessibility, getImportantForAutofill, getImportantForContentCapture, getKeepScreenOn, getKeyDispatcherState, getLabelFor, getLayerType, getLayoutDirection, getLayoutParams, getLeft, getLocalVisibleRect, getLocationInSurface, getLocationInWindow, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextClusterForwardId, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOutlineAmbientShadowColor, getOutlineProvider, getOutlineSpotShadowColor, getOverScrollMode, getOverlay, getPaddingBottom, getPaddingEnd, getPaddingLeft, getPaddingRight, getPaddingStart, getPaddingTop, getParent, getParentForAccessibility, getPivotX, getPivotY, getPointerIcon, getReceiveContentMimeTypes, getResources, getRevealOnFocusHint, getRight, getRootSurfaceControl, getRootView, getRootWindowInsets, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, getScrollCaptureHint, getScrollIndicators, getScrollX, getScrollY, getSolidColor, getSourceLayoutResId, getStateDescription, getStateListAnimator, getSystemGestureExclusionRects, getSystemUiVisibility, getTag, getTextAlignment, getTextDirection, getTooltipText, getTop, getTouchDelegate, getTouchables, getTransitionAlpha, getTransitionName, getTranslationX, getTranslationY, getTranslationZ, getUniqueDrawingId, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarThumbDrawable, getVerticalScrollbarTrackDrawable, getVerticalScrollbarWidth, getViewTranslationResponse, getViewTreeObserver, getVisibility, getWidth, getWindowId, getWindowInsetsController, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, getZ, hasExplicitFocusable, hasFocus, hasFocusable, hasNestedScrollingParent, hasOnClickListeners, hasOnLongClickListeners, hasOverlappingRendering, hasPointerCapture, hasTransientState, hasWindowFocus, inflate, invalidate, invalidateDrawable, invalidateOutline, isAccessibilityFocused, isAccessibilityHeading, isActivated, isAttachedToWindow, isClickable, isContextClickable, isDirty, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isFocusedByDefault, isForceDarkAllowed, isHapticFeedbackEnabled, isHardwareAccelerated, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isImportantForAccessibility, isImportantForAutofill, isImportantForContentCapture, isInEditMode, isInLayout, isInTouchMode, isKeyboardNavigationCluster, isLaidOut, isLayoutDirectionResolved, isLayoutRequested, isLongClickable, isNestedScrollingEnabled, isOpaque, isPaddingRelative, isPivotSet, isPressed, isSaveEnabled, isSaveFromParentEnabled, isScreenReaderFocusable, isScrollContainer, isScrollbarFadingEnabled, isSelected, isShowingLayoutBounds, isShown, isSoundEffectsEnabled, isTemporarilyDetached, isTextAlignmentResolved, isTextDirectionResolved, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, isVisibleToUserForAutofill, jumpDrawablesToCurrentState, keyboardNavigationClusterSearch, layout, measure, offsetLeftAndRight, offsetTopAndBottom, onApplyWindowInsets, onCancelPendingInputEvents, onCapturedPointerEvent, onCheckIsTextEditor, onCreateInputConnection, onCreateViewTranslationRequest, onCreateVirtualViewTranslationRequests, onDragEvent, onDrawForeground, onFilterTouchEventForSecurity, onFinishTemporaryDetach, onGenericMotionEvent, onHoverChanged, onHoverEvent, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onPointerCaptureChange, onPopulateAccessibilityEvent, onProvideAutofillStructure, onProvideAutofillVirtualStructure, onProvideContentCaptureStructure, onProvideStructure, onProvideVirtualStructure, onReceiveContent, onResolvePointerIcon, onRtlPropertiesChanged, onScreenStateChanged, onScrollCaptureSearch, onStartTemporaryDetach, onTouchEvent, onTrackballEvent, onViewTranslationResponse, onVirtualViewTranslationResponses, onVisibilityAggregated, onWindowFocusChanged, onWindowSystemUiVisibilityChanged, performAccessibilityAction, performClick, performContextClick, performHapticFeedback, performLongClick, performReceiveContent, playSoundEffect, post, postDelayed, postInvalidate, postInvalidateDelayed, postInvalidateOnAnimation, postOnAnimation, postOnAnimationDelayed, refreshDrawableState, releasePointerCapture, removeCallbacks, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, removeOnUnhandledKeyEventListener, requestApplyInsets, requestFitSystemWindows, requestFocus, requestFocusFromTouch, requestLayout, requestPointerCapture, requestRectangleOnScreen, requestUnbufferedDispatch, requireViewById, resetPivot, resolveSize, resolveSizeAndState, restoreDefaultFocus, restoreHierarchyState, saveAttributeDataForStyleable, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEvent, sendAccessibilityEventUnchecked, setAccessibilityDelegate, setAccessibilityHeading, setAccessibilityLiveRegion, setAccessibilityPaneTitle, setAccessibilityTraversalAfter, setAccessibilityTraversalBefore, setActivated, setAllowClickWhenDisabled, setAlpha, setAnimation, setAnimationMatrix, setAutofillHints, setAutofillId, setBackground, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setBackgroundTintBlendMode, setBackgroundTintList, setBackgroundTintMode, setBottom, setCameraDistance, setClickable, setClipBounds, setClipToOutline, setContentCaptureSession, setContentDescription, setContextClickable, setDefaultFocusHighlightEnabled, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setElevation, setEnabled, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setFocusable, setFocusableInTouchMode, setFocusedByDefault, setForceDarkAllowed, setForeground, setForegroundGravity, setForegroundTintBlendMode, setForegroundTintList, setForegroundTintMode, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHorizontalScrollbarThumbDrawable, setHorizontalScrollbarTrackDrawable, setHovered, setId, setImportantForAccessibility, setImportantForAutofill, setImportantForContentCapture, setKeepScreenOn, setKeyboardNavigationCluster, setLabelFor, setLayerPaint, setLayerType, setLayoutDirection, setLayoutParams, setLeft, setLeftTopRightBottom, setLongClickable, setMinimumHeight, setMinimumWidth, setNestedScrollingEnabled, setNextClusterForwardId, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnApplyWindowInsetsListener, setOnCapturedPointerListener, setOnClickListener, setOnContextClickListener, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnLongClickListener, setOnReceiveContentListener, setOnScrollChangeListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setOutlineAmbientShadowColor, setOutlineProvider, setOutlineSpotShadowColor, setOverScrollMode, setPadding, setPaddingRelative, setPivotX, setPivotY, setPointerIcon, setPressed, setRenderEffect, setRevealOnFocusHint, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScreenReaderFocusable, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollBarSize, setScrollBarStyle, setScrollCaptureCallback, setScrollCaptureHint, setScrollContainer, setScrollIndicators, setScrollX, setScrollY, setScrollbarFadingEnabled, setSelected, setSoundEffectsEnabled, setStateDescription, setStateListAnimator, setSystemGestureExclusionRects, setSystemUiVisibility, setTag, setTextAlignment, setTextDirection, setTooltipText, setTop, setTouchDelegate, setTransitionAlpha, setTransitionName, setTransitionVisibility, setTranslationX, setTranslationY, setTranslationZ, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setVerticalScrollbarThumbDrawable, setVerticalScrollbarTrackDrawable, setViewTranslationCallback, setVisibility, setWillNotCacheDrawing, setWillNotDraw, setWindowInsetsAnimationCallback, setX, setY, setZ, showContextMenu, startActionMode, startAnimation, startDrag, startDragAndDrop, startNestedScroll, stopNestedScroll, toString, transformMatrixToGlobal, transformMatrixToLocal, unscheduleDrawable, updateDragShadow, willNotCacheDrawing, willNotDraw -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
DiscreteSeekBar
DiscreteSeekBar(Context context)
-
DiscreteSeekBar
DiscreteSeekBar(Context context, AttributeSet attrs)
-
DiscreteSeekBar
DiscreteSeekBar(Context context, AttributeSet attrs, int defStyleAttr)
-
-
Method Detail
-
setIndicatorFormatter
void setIndicatorFormatter(@Nullable() String formatter)
Sets the current Indicator formatter string
-
setNumericTransformer
void setNumericTransformer(@Nullable() DiscreteSeekBar.NumericTransformer transformer)
Sets the current NumericTransformer
-
getNumericTransformer
DiscreteSeekBar.NumericTransformer getNumericTransformer()
Retrieves the current NumericTransformer
-
setMax
void setMax(int max)
Sets the maximum value for this DiscreteSeekBarif the supplied argument is smaller than the Current MIN value,the MIN value will be set to MAX-1Also if the current progress is out of the new range, it will be set to MIN
-
getMax
int getMax()
-
setMin
void setMin(int min)
Sets the minimum value for this DiscreteSeekBarif the supplied argument is bigger than the Current MAX value,the MAX value will be set to MIN+1
Also if the current progress is out of the new range, it will be set to MIN
-
getMin
int getMin()
-
setProgress
void setProgress(int progress)
Sets the current progress for this DiscreteSeekBarThe supplied argument will be capped to the current MIN-MAX range
-
getProgress
int getProgress()
Get the current progress
-
setOnProgressChangeListener
void setOnProgressChangeListener(@Nullable() DiscreteSeekBar.OnProgressChangeListener listener)
Sets a listener to receive notifications of changes to the DiscreteSeekBar's progress level.Alsoprovides notifications of when the DiscreteSeekBar shows/hides the bubble indicator.
- Parameters:
listener- The seek bar notification listener
-
setThumbColor
void setThumbColor(int thumbColor, int indicatorColor)
Sets the color of the seek thumb, as well as the color of the popup indicator.
- Parameters:
thumbColor- The color the seek thumb will be changed toindicatorColor- The color the popup indicator will be changed toThe indicator will animate from thumbColor to indicatorColorwhen opening
-
setThumbColor
void setThumbColor(@NonNull() ColorStateList thumbColorStateList, int indicatorColor)
Sets the color of the seek thumb, as well as the color of the popup indicator.
- Parameters:
thumbColorStateList- The ColorStateList the seek thumb will be changed toindicatorColor- The color the popup indicator will be changed toThe indicator will animate from thumbColorStateList(pressed state) to indicatorColorwhen opening
-
setScrubberColor
void setScrubberColor(int color)
Sets the color of the seekbar scrubber
- Parameters:
color- The color the track scrubber will be changed to
-
setScrubberColor
void setScrubberColor(@NonNull() ColorStateList colorStateList)
Sets the color of the seekbar scrubber
- Parameters:
colorStateList- The ColorStateList the track scrubber will be changed to
-
setRippleColor
void setRippleColor(int color)
Sets the color of the seekbar ripple
- Parameters:
color- The color the track ripple will be changed to
-
setRippleColor
void setRippleColor(@NonNull() ColorStateList colorStateList)
Sets the color of the seekbar ripple
- Parameters:
colorStateList- The ColorStateList the track ripple will be changed to
-
setTrackColor
void setTrackColor(int color)
Sets the color of the seekbar scrubber
- Parameters:
color- The color the track will be changed to
-
setTrackColor
void setTrackColor(@NonNull() ColorStateList colorStateList)
Sets the color of the seekbar scrubber
- Parameters:
colorStateList- The ColorStateList the track will be changed to
-
setIndicatorPopupEnabled
void setIndicatorPopupEnabled(boolean enabled)
If
{@code enabled}is false the indicator won't appear. By default popup indicator isenabled.
-
scheduleDrawable
void scheduleDrawable(Drawable who, Runnable what, long when)
-
onTouchEvent
boolean onTouchEvent(MotionEvent event)
-
isRtl
boolean isRtl()
-
-
-
-