Class MarkedSeekBar

All Implemented Interfaces:
Drawable.Callback, AccessibilityEventSource, KeyEvent.Callback

public class MarkedSeekBar extends SeekBar
A SeekBar that can display marks at specified positions.
  • Constructor Details

    • MarkedSeekBar

      public MarkedSeekBar(Context context)
      Creates a new MarkedSeekBar.
      Parameters:
      context - The context.
    • MarkedSeekBar

      public MarkedSeekBar(Context context, AttributeSet attrs)
      Creates a new MarkedSeekBar.
      Parameters:
      context - The context.
      attrs - The attributes.
    • MarkedSeekBar

      public MarkedSeekBar(Context context, AttributeSet attrs, int defStyleAttr)
      Creates a new MarkedSeekBar.
      Parameters:
      context - The context.
      attrs - The attributes.
      defStyleAttr - The default style attribute.
    • MarkedSeekBar

      @RequiresApi(api=21) public MarkedSeekBar(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
      Creates a new MarkedSeekBar.
      Parameters:
      context - The context.
      attrs - The attributes.
      defStyleAttr - The default style attribute.
      defStyleRes - The default style resource.
  • Method Details

    • setMarkDrawable

      public void setMarkDrawable(@Nullable Drawable markDrawable)
      Sets the drawable to be used for the marks.
      Parameters:
      markDrawable - The drawable to be used for the marks.
    • setMarks

      public void setMarks(@Nullable Collection<Float> marks)
      Sets the marks to be displayed on the SeekBar.
      Parameters:
      marks - A collection of floats representing the positions of the marks, as a percentage of the SeekBar's width.