Android
android.widget
public abstract class

android.widget.AbsSeekBar

java.lang.Object
android.view.View Drawable.Callback KeyEvent.Callback
android.widget.ProgressBar
android.widget.AbsSeekBar
Known Direct Subclasses

Summary

XML Attributes inherited from class android.widget.ProgressBar
XML Attributes inherited from class android.view.View
Constants inherited from class android.view.View
Fields inherited from class android.view.View

Public Constructors

            AbsSeekBar(Context context)
            AbsSeekBar(Context context, AttributeSet attrs)
            AbsSeekBar(Context context, AttributeSet attrs, int defStyle)

Public Methods

          int  getThumbOffset()
          boolean  onTouchEvent(MotionEvent event)
Implement this method to handle touch screen motion events.
          void  setThumb(Drawable thumb)
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.

Protected Methods

          void  drawableStateChanged()
This function is called whenever the state of the view changes in such a way that it impacts the state of drawables being shown.
  synchronized        void  onDraw(Canvas canvas)
Implement this to do your drawing.
  synchronized        void  onMeasure(int widthMeasureSpec, int heightMeasureSpec)

Measure the view and its content to determine the measured width and the measured height.

          void  onSizeChanged(int w, int h, int oldw, int oldh)
This is called during layout when the size of this view has changed.
          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 android.widget.ProgressBar
Methods inherited from class android.view.View
Methods inherited from class java.lang.Object
Methods inherited from interface android.graphics.drawable.Drawable.Callback
Methods inherited from interface android.view.KeyEvent.Callback

Details

Public Constructors

public AbsSeekBar(Context context)

public AbsSeekBar(Context context, AttributeSet attrs)

public AbsSeekBar(Context context, AttributeSet attrs, int defStyle)

Public Methods

public int getThumbOffset()

public boolean onTouchEvent(MotionEvent event)

Implement this method to handle touch screen motion events.

Parameters

event The motion event.

Returns

  • True if the event was handled, false otherwise.

public void setThumb(Drawable thumb)

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

Parameters

thumb Drawable representing the thumb

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.

Protected Methods

protected void drawableStateChanged()

This function is called whenever the state of the view changes in such a way that it impacts the state of drawables being shown.

Be sure to call through to the superclass when overriding this function.

protected synchronized void onDraw(Canvas canvas)

Implement this to do your drawing.

Parameters

canvas the canvas on which the background will be drawn

protected synchronized void onMeasure(int widthMeasureSpec, int heightMeasureSpec)

Measure the view and its content to determine the measured width and the measured height. This method is invoked by measure(int, int) and should be overriden by subclasses to provide accurate and efficient measurement of their contents.

CONTRACT: When overriding this method, you must call setMeasuredDimension(int, int) to store the measured width and height of this view. Failure to do so will trigger an IllegalStateException, thrown by measure(int, int). Calling the superclass' onMeasure(int, int) 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 onMeasure(int, int) to provide better measurements of their content.

If this method is overridden, it is the subclass's responsibility to make sure the measured height and width are at least the view's minimum height and width (getSuggestedMinimumHeight() and getSuggestedMinimumWidth()).

Parameters

widthMeasureSpec horizontal space requirements as imposed by the parent. The requirements are encoded with View.MeasureSpec.
heightMeasureSpec vertical space requirements as imposed by the parent. The requirements are encoded with View.MeasureSpec.

protected void onSizeChanged(int w, int h, int oldw, int oldh)

This is called during layout when the size of this view has changed. If you were just added to the view hierarchy, you're called with the old values of 0.

Parameters

w Current width of this view.
h Current height of this view.
oldw Old width of this view.
oldh Old height of this view.

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. This allows animations for those drawables to be scheduled.

Be sure to call through to the super class when overriding this function.

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.
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:48