Android
android.widget
public class

android.widget.ScrollBarDrawable

java.lang.Object
android.graphics.drawable.Drawable
android.widget.ScrollBarDrawable

Summary

Public Constructors

            ScrollBarDrawable()

Public Methods

          void  draw(Canvas canvas)
Draw in its bounds (set via setBounds) respecting optional effects such as alpha (set via setAlpha) and color filter (set via setColorFilter).
          boolean  getAlwaysDrawHorizontalTrack()
Indicates whether the horizontal scrollbar track should always be drawn regardless of the extent.
          boolean  getAlwaysDrawVerticalTrack()
Indicates whether the vertical scrollbar track should always be drawn regardless of the extent.
          int  getOpacity()
Return the opacity/transparency of this Drawable.
          int  getSize(boolean vertical)
          void  setAlpha(int alpha)
Specify an alpha value for the drawable.
          void  setAlwaysDrawHorizontalTrack(boolean alwaysDrawTrack)
Indicate whether the horizontal scrollbar track should always be drawn regardless of the extent.
          void  setAlwaysDrawVerticalTrack(boolean alwaysDrawTrack)
Indicate whether the vertical scrollbar track should always be drawn regardless of the extent.
          void  setColorFilter(ColorFilter cf)
Specify an optional colorFilter for the drawable.
          void  setHorizontalThumbDrawable(Drawable thumb)
          void  setHorizontalTrackDrawable(Drawable track)
          void  setParameters(int range, int offset, int extent, boolean vertical)
          void  setVerticalThumbDrawable(Drawable thumb)
          void  setVerticalTrackDrawable(Drawable track)
          String  toString()
Returns a string containing a concise, human-readable description of the receiver.

Protected Methods

          void  drawThumb(Canvas canvas, Rect bounds, int offset, int length, boolean vertical)
          void  drawTrack(Canvas canvas, Rect bounds, boolean vertical)
          void  onBoundsChange(Rect bounds)
Override this in your subclass to change appearance if you recognize the specified state.
Methods inherited from class android.graphics.drawable.Drawable
Methods inherited from class java.lang.Object

Details

Public Constructors

public ScrollBarDrawable()

Public Methods

public void draw(Canvas canvas)

Draw in its bounds (set via setBounds) respecting optional effects such as alpha (set via setAlpha) and color filter (set via setColorFilter).

Parameters

canvas The canvas to draw into

public boolean getAlwaysDrawHorizontalTrack()

Indicates whether the horizontal scrollbar track should always be drawn regardless of the extent.

public boolean getAlwaysDrawVerticalTrack()

Indicates whether the vertical scrollbar track should always be drawn regardless of the extent.

public int getOpacity()

Return the opacity/transparency of this Drawable. The returned value is one of the abstract format constants in PixelFormat: UNKNOWN, TRANSLUCENT, TRANSPARENT, or OPAQUE.

Generally a Drawable should be as conservative as possible with the value it returns. For example, if it contains multiple child drawables and only shows one of them at a time, if only one of the children is TRANSLUCENT and the others are OPAQUE then TRANSLUCENT should be returned. You can use the method resolveOpacity(int, int) to perform a standard reduction of two opacities to the appropriate single output.

Note that the returned value does not take into account a custom alpha or color filter that has been applied by the client through the setAlpha(int) or setColorFilter(ColorFilter) methods.

Returns

  • int The opacity class of the Drawable.

public int getSize(boolean vertical)

public void setAlpha(int alpha)

Specify an alpha value for the drawable. 0 means fully transparent, and 255 means fully opaque.

public void setAlwaysDrawHorizontalTrack(boolean alwaysDrawTrack)

Indicate whether the horizontal scrollbar track should always be drawn regardless of the extent. Defaults to false.

Parameters

alwaysDrawTrack Set to true if the track should always be drawn

public void setAlwaysDrawVerticalTrack(boolean alwaysDrawTrack)

Indicate whether the vertical scrollbar track should always be drawn regardless of the extent. Defaults to false.

Parameters

alwaysDrawTrack Set to true if the track should always be drawn

public void setColorFilter(ColorFilter cf)

Specify an optional colorFilter for the drawable. Pass null to remove any filters.

public void setHorizontalThumbDrawable(Drawable thumb)

public void setHorizontalTrackDrawable(Drawable track)

public void setParameters(int range, int offset, int extent, boolean vertical)

public void setVerticalThumbDrawable(Drawable thumb)

public void setVerticalTrackDrawable(Drawable track)

public String toString()

Returns a string containing a concise, human-readable description of the receiver.

Returns

  • String a printable representation for the receiver.

Protected Methods

protected void drawThumb(Canvas canvas, Rect bounds, int offset, int length, boolean vertical)

protected void drawTrack(Canvas canvas, Rect bounds, boolean vertical)

protected void onBoundsChange(Rect bounds)

Override this in your subclass to change appearance if you recognize the specified state.
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:48