FileDocCategorySizeDatePackage
SeekBar.javaAPI DocAndroid 5.1 API5041Thu Mar 12 22:22:10 GMT 2015android.widget

SeekBar

public class SeekBar extends AbsSeekBar
A SeekBar is an extension of ProgressBar that adds a draggable thumb. The user can touch the thumb and drag left or right to set the current progress level or use the arrow keys. Placing focusable widgets to the left or right of a SeekBar is discouraged.

Clients of the SeekBar can attach a {@link SeekBar.OnSeekBarChangeListener} to be notified of the user's actions.

attr
ref android.R.styleable#SeekBar_thumb

Fields Summary
private OnSeekBarChangeListener
mOnSeekBarChangeListener
Constructors Summary
public SeekBar(android.content.Context context)

        this(context, null);
    
public SeekBar(android.content.Context context, android.util.AttributeSet attrs)

        this(context, attrs, com.android.internal.R.attr.seekBarStyle);
    
public SeekBar(android.content.Context context, android.util.AttributeSet attrs, int defStyleAttr)

        this(context, attrs, defStyleAttr, 0);
    
public SeekBar(android.content.Context context, android.util.AttributeSet attrs, int defStyleAttr, int defStyleRes)

        super(context, attrs, defStyleAttr, defStyleRes);
    
Methods Summary
public voidonInitializeAccessibilityEvent(android.view.accessibility.AccessibilityEvent event)

        super.onInitializeAccessibilityEvent(event);
        event.setClassName(SeekBar.class.getName());
    
public voidonInitializeAccessibilityNodeInfo(android.view.accessibility.AccessibilityNodeInfo info)

        super.onInitializeAccessibilityNodeInfo(info);
        info.setClassName(SeekBar.class.getName());
    
voidonProgressRefresh(float scale, boolean fromUser)

        super.onProgressRefresh(scale, fromUser);

        if (mOnSeekBarChangeListener != null) {
            mOnSeekBarChangeListener.onProgressChanged(this, getProgress(), fromUser);
        }
    
voidonStartTrackingTouch()

        super.onStartTrackingTouch();
        if (mOnSeekBarChangeListener != null) {
            mOnSeekBarChangeListener.onStartTrackingTouch(this);
        }
    
voidonStopTrackingTouch()

        super.onStopTrackingTouch();
        if (mOnSeekBarChangeListener != null) {
            mOnSeekBarChangeListener.onStopTrackingTouch(this);
        }
    
public voidsetOnSeekBarChangeListener(android.widget.SeekBar$OnSeekBarChangeListener l)
Sets a listener to receive notifications of changes to the SeekBar's progress level. Also provides notifications of when the user starts and stops a touch gesture within the SeekBar.

param
l The seek bar notification listener
see
SeekBar.OnSeekBarChangeListener

        mOnSeekBarChangeListener = l;