Added in API level 1

AbsSeekBar


abstract class AbsSeekBar : ProgressBar
kotlin.Any
   ↳ android.view.View
   ↳ android.widget.ProgressBar
   ↳ android.widget.AbsSeekBar

AbsSeekBar extends the capabilities of ProgressBar by adding a draggable thumb.

Summary

Inherited XML attributes
Inherited constants
Public constructors
AbsSeekBar(context: Context!)

AbsSeekBar(context: Context!, attrs: AttributeSet!)

AbsSeekBar(context: Context!, attrs: AttributeSet!, defStyleAttr: Int)

AbsSeekBar(context: Context!, attrs: AttributeSet!, defStyleAttr: Int, defStyleRes: Int)

Public methods
open Unit

open CharSequence!

open Int

Returns the amount of progress changed via the arrow keys.

open Boolean

Returns whether the track should be split by the thumb.

open Drawable!

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.

open Int

open BlendMode?

Returns the blending mode used to apply the tint to the thumb drawable, if specified.

open ColorStateList?

Returns the tint applied to the thumb drawable, if specified.

open PorterDuff.Mode?

Returns the blending mode used to apply the tint to the thumb drawable, if specified.

open Drawable!

open BlendMode?

Returns the blending mode used to apply the tint to the tick mark drawable, if specified.

open ColorStateList?

Returns the tint applied to the tick mark drawable, if specified.

open PorterDuff.Mode?

Returns the blending mode used to apply the tint to the tick mark drawable, if specified.

open Unit

open Boolean
onKeyDown(keyCode: Int, event: KeyEvent!)

open Unit
onRtlPropertiesChanged(layoutDirection: Int)

open Boolean

open Unit

Sets the amount of progress changed via the arrow keys.

open Unit
setMax(max: Int)

open Unit
setMin(min: Int)

open Unit
setSplitTrack(splitTrack: Boolean)

Specifies whether the track should be split by the thumb.

open Unit

Sets a list of areas within this view's post-layout coordinate space where the system should not intercept touch or other pointing device gestures.

open Unit
setThumb(thumb: Drawable!)

Sets the thumb that will be drawn at the end of the progress meter within the SeekBar.

open Unit
setThumbOffset(thumbOffset: Int)

Sets the thumb offset that allows the thumb to extend out of the range of the track.

open Unit

Specifies the blending mode used to apply the tint specified by setThumbTintList(android.content.res.ColorStateList)} to the thumb drawable.

open Unit

Applies a tint to the thumb drawable.

open Unit

Specifies the blending mode used to apply the tint specified by setThumbTintList(android.content.res.ColorStateList)} to the thumb drawable.

open Unit
setTickMark(tickMark: Drawable!)

Sets the drawable displayed at each progress position, e.

open Unit

Specifies the blending mode used to apply the tint specified by setTickMarkTintList(android.content.res.ColorStateList)} to the tick mark drawable.

open Unit

Applies a tint to the tick mark drawable.

open Unit

Specifies the blending mode used to apply the tint specified by setTickMarkTintList(android.content.res.ColorStateList)} to the tick mark drawable.

Protected methods
open Unit

open Unit
onDraw(canvas: Canvas)

open Unit
onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int)

open Unit
onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int)

open Boolean

If your view subclass is displaying its own Drawable objects, it should override this function and return true for any Drawable it is displaying.

Inherited functions
Inherited properties

Public constructors

AbsSeekBar

Added in API level 1
AbsSeekBar(context: Context!)

AbsSeekBar

Added in API level 1
AbsSeekBar(
    context: Context!,
    attrs: AttributeSet!)

AbsSeekBar

Added in API level 1
AbsSeekBar(
    context: Context!,
    attrs: AttributeSet!,
    defStyleAttr: Int)

AbsSeekBar

Added in API level 21
AbsSeekBar(
    context: Context!,
    attrs: AttributeSet!,
    defStyleAttr: Int,
    defStyleRes: Int)

Public methods

drawableHotspotChanged

Added in API level 21
open fun drawableHotspotChanged(
    x: Float,
    y: Float
): Unit
Parameters
x Float: hotspot x coordinate
y Float: hotspot y coordinate

getAccessibilityClassName

Added in API level 23
open fun getAccessibilityClassName(): CharSequence!

getKeyProgressIncrement

Added in API level 3
open fun getKeyProgressIncrement(): Int

Returns the amount of progress changed via the arrow keys.

By default, this will be a value that is derived from the progress range.

Return
Int The amount to increment or decrement when the user presses the arrow keys. This will be positive.

getSplitTrack

Added in API level 21
open fun getSplitTrack(): Boolean

Returns whether the track should be split by the thumb.

getThumb

Added in API level 16
open fun getThumb(): Drawable!

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.

Return
Drawable! The current thumb drawable

getThumbOffset

Added in API level 1
open fun getThumbOffset(): Int

getThumbTintBlendMode

Added in API level 29
open fun getThumbTintBlendMode(): BlendMode?

Returns the blending mode used to apply the tint to the thumb drawable, if specified.

Return
BlendMode? the blending mode used to apply the tint to the thumb drawable This value may be null.

getThumbTintList

Added in API level 21
open fun getThumbTintList(): ColorStateList?

Returns the tint applied to the thumb drawable, if specified.

Return
ColorStateList? the tint applied to the thumb drawable This value may be null.

getThumbTintMode

Added in API level 21
open fun getThumbTintMode(): PorterDuff.Mode?

Returns the blending mode used to apply the tint to the thumb drawable, if specified.

Return
PorterDuff.Mode? the blending mode used to apply the tint to the thumb drawable This value may be null.

getTickMark

Added in API level 24
open fun getTickMark(): Drawable!
Return
Drawable! the drawable displayed at each progress position

getTickMarkTintBlendMode

Added in API level 29
open fun getTickMarkTintBlendMode(): BlendMode?

Returns the blending mode used to apply the tint to the tick mark drawable, if specified.

Return
BlendMode? the blending mode used to apply the tint to the tick mark drawable This value may be null.

getTickMarkTintList

Added in API level 24
open fun getTickMarkTintList(): ColorStateList?

Returns the tint applied to the tick mark drawable, if specified.

Return
ColorStateList? the tint applied to the tick mark drawable This value may be null.

getTickMarkTintMode

Added in API level 24
open fun getTickMarkTintMode(): PorterDuff.Mode?

Returns the blending mode used to apply the tint to the tick mark drawable, if specified.

Return
PorterDuff.Mode? the blending mode used to apply the tint to the tick mark drawable This value may be null.

jumpDrawablesToCurrentState

Added in API level 11
open fun jumpDrawablesToCurrentState(): Unit

onKeyDown

Added in API level 1
open fun onKeyDown(
    keyCode: Int,
    event: KeyEvent!
): Boolean
Parameters
keyCode Int: a key code that represents the button pressed, from android.view.KeyEvent
event KeyEvent!: the KeyEvent object that defines the button action
Return
Boolean If you handled the event, return true. If you want to allow the event to be handled by the next receiver, return false.

onRtlPropertiesChanged

Added in API level 17
open fun onRtlPropertiesChanged(layoutDirection: Int): Unit
Parameters
layoutDirection Int: the direction of the layout Value is android.view.View#LAYOUT_DIRECTION_LTR, or android.view.View#LAYOUT_DIRECTION_RTL

onTouchEvent

Added in API level 1
open fun onTouchEvent(event: MotionEvent!): Boolean
Parameters
event MotionEvent!: The motion event.
Return
Boolean True if the event was handled, false otherwise.

setKeyProgressIncrement

Added in API level 3
open fun setKeyProgressIncrement(increment: Int): Unit

Sets the amount of progress changed via the arrow keys.

Parameters
increment Int: The amount to increment or decrement when the user presses the arrow keys.

setMax

Added in API level 1
open fun setMax(max: Int): Unit
Parameters
max Int: the upper range of this progress bar

setMin

Added in API level 26
open fun setMin(min: Int): Unit
Parameters
min Int: the lower range of this progress bar

setSplitTrack

Added in API level 21
open fun setSplitTrack(splitTrack: Boolean): Unit

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 Boolean: Whether the track should be split by the thumb

setSystemGestureExclusionRects

Added in API level 29
open fun setSystemGestureExclusionRects(rects: MutableList<Rect!>): Unit

Sets a list of areas within this view's post-layout coordinate space where the system should not intercept touch or other pointing device gestures. This method should be called by onLayout(boolean,int,int,int,int) or onDraw(android.graphics.Canvas).

Use this to tell the system which specific sub-areas of a view need to receive gesture input in order to function correctly in the presence of global system gestures that may conflict. For example, if the system wishes to capture swipe-in-from-screen-edge gestures to provide system-level navigation functionality, a view such as a navigation drawer container can mark the left (or starting) edge of itself as requiring gesture capture priority using this API. The system may then choose to relax its own gesture recognition to allow the app to consume the user's gesture. It is not necessary for an app to register exclusion rects for broadly spanning regions such as the entirety of a ScrollView or for simple press and release click targets such as Button. Mark an exclusion rect when interacting with a view requires a precision touch gesture in a small area in either the X or Y dimension, such as an edge swipe or dragging a SeekBar thumb.

Note: the system will put a limit of 200dp on the vertical extent of the exclusions it takes into account. The limit does not apply while the navigation bar is stickily hidden, nor to the input method and home activity.

Parameters
rects MutableList<Rect!>: This value cannot be null.

setThumb

Added in API level 1
open fun setThumb(thumb: Drawable!): Unit

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!: Drawable representing the thumb

setThumbOffset

Added in API level 1
open fun setThumbOffset(thumbOffset: Int): Unit

Sets the thumb offset that allows the thumb to extend out of the range of the track.

Parameters
thumbOffset Int: The offset amount in pixels.

setThumbTintBlendMode

Added in API level 29
open fun setThumbTintBlendMode(blendMode: BlendMode?): Unit

Specifies the blending mode used to apply the tint specified by setThumbTintList(android.content.res.ColorStateList)} to the thumb drawable. The default mode is BlendMode#SRC_IN.

Parameters
blendMode BlendMode?: the blending mode used to apply the tint, may be null to clear tint

setThumbTintList

Added in API level 21
open fun setThumbTintList(tint: ColorStateList?): Unit

Applies a tint to the thumb drawable. Does not modify the current tint mode, which is PorterDuff.Mode#SRC_IN by default.

Subsequent calls to setThumb(android.graphics.drawable.Drawable) will automatically mutate the drawable and apply the specified tint and tint mode using Drawable#setTintList(ColorStateList).

Parameters
tint ColorStateList?: the tint to apply, may be null to clear tint

setThumbTintMode

Added in API level 21
open fun setThumbTintMode(tintMode: PorterDuff.Mode?): Unit

Specifies the blending mode used to apply the tint specified by setThumbTintList(android.content.res.ColorStateList)} to the thumb drawable. The default mode is PorterDuff.Mode#SRC_IN.

Parameters
tintMode PorterDuff.Mode?: the blending mode used to apply the tint, may be null to clear tint

setTickMark

Added in API level 24
open fun setTickMark(tickMark: Drawable!): Unit

Sets the drawable displayed at each progress position, e.g. at each possible thumb position.

Parameters
tickMark Drawable!: the drawable to display at each progress position

setTickMarkTintBlendMode

Added in API level 29
open fun setTickMarkTintBlendMode(blendMode: BlendMode?): Unit

Specifies the blending mode used to apply the tint specified by setTickMarkTintList(android.content.res.ColorStateList)} to the tick mark drawable. The default mode is BlendMode#SRC_IN.

Parameters
blendMode BlendMode?: the blending mode used to apply the tint, may be null to clear tint

setTickMarkTintList

Added in API level 24
open fun setTickMarkTintList(tint: ColorStateList?): Unit

Applies a tint to the tick mark drawable. Does not modify the current tint mode, which is PorterDuff.Mode#SRC_IN by default.

Subsequent calls to setTickMark(android.graphics.drawable.Drawable) will automatically mutate the drawable and apply the specified tint and tint mode using Drawable#setTintList(ColorStateList).

Parameters
tint ColorStateList?: the tint to apply, may be null to clear tint

setTickMarkTintMode

Added in API level 24
open fun setTickMarkTintMode(tintMode: PorterDuff.Mode?): Unit

Specifies the blending mode used to apply the tint specified by setTickMarkTintList(android.content.res.ColorStateList)} to the tick mark drawable. The default mode is PorterDuff.Mode#SRC_IN.

Parameters
tintMode PorterDuff.Mode?: the blending mode used to apply the tint, may be null to clear tint

Protected methods

drawableStateChanged

Added in API level 1
protected open fun drawableStateChanged(): Unit

onDraw

Added in API level 1
protected open fun onDraw(canvas: Canvas): Unit
Parameters
canvas Canvas: the canvas on which the background will be drawn This value cannot be null.

onMeasure

Added in API level 1
protected open fun onMeasure(
    widthMeasureSpec: Int,
    heightMeasureSpec: Int
): Unit
Parameters
widthMeasureSpec Int: horizontal space requirements as imposed by the parent. The requirements are encoded with android.view.View.MeasureSpec.
heightMeasureSpec Int: vertical space requirements as imposed by the parent. The requirements are encoded with android.view.View.MeasureSpec.

onSizeChanged

Added in API level 1
protected open fun onSizeChanged(
    w: Int,
    h: Int,
    oldw: Int,
    oldh: Int
): Unit
Parameters
w Int: Current width of this view.
h Int: Current height of this view.
oldw Int: Old width of this view.
oldh Int: Old height of this view.

verifyDrawable

Added in API level 1
protected open fun verifyDrawable(who: Drawable): Boolean

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.
If you override this method you must call through to the superclass implementation.

Parameters
who Drawable: This value cannot be null.
Return
Boolean boolean If true then the Drawable is being displayed in the view; else false and it is not allowed to animate.