public class

EnhancedSeekBar

extends SeekBar
java.lang.Object
   ↳ android.view.View
     ↳ android.widget.ProgressBar
       ↳ android.widget.AbsSeekBar
         ↳ android.widget.SeekBar
           ↳ com.droidux.pack.commons.widget.progress.EnhancedSeekBar

Class Overview

A custom SeekBar that allows easy customization, such as changing the progress colors, pattern overlay, etc.

Note: If you plan to change the color of progress bar at runtime, it's more effective to use a gray-scale drawables for the progress, secondary progress, and indeterminate drawables.

See Also

Summary

XML Attributes
Attribute Name Related Method Description
dux_indeterminateProgressColor setIndeterminateProgressColor(int) Specifies the tint color of the indeterminate progress drawable. 
dux_progressColor setProgressColor(int) Specifies the tint color of the progress drawable. 
dux_secondaryProgressColor setSecondaryProgressColor(ColorStateList) Specifies the tint color of the secondary progress drawable. 
dux_thumbColor setThumbColor(int) Specifies the tint color of the thumb drawable. 
[Expand]
Inherited Constants
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
EnhancedSeekBar(Context context)
EnhancedSeekBar(Context context, AttributeSet attrs)
EnhancedSeekBar(Context context, AttributeSet attrs, int defStyle)
Public Methods
void setIndeterminateProgressColor(int color)
Sets the tint color of the indeterminate progress drawable
void setProgressColor(ColorStateList colors)
Sets the tint color of the default progress drawable
void setProgressColor(int color)
Sets the tint color of the default progress drawable
void setProgressPatternOffset(int offset)
If the progress has a pattern overlay, calling this method will shift the pattern by the specified offset.
void setProgressPatternOverlay(Bitmap pattern, boolean animate, int offset)
Sets the pattern bitmap to overlay the progress drawable.
void setProgressPatternOverlay(Bitmap pattern, boolean animate)
Sets the pattern bitmap to overlay the progress drawable.
void setSecondaryProgressColor(int color)
Sets the tint color of the secondary progress drawable
void setSecondaryProgressColor(ColorStateList colors)
Sets the tint color of the secondary progress drawable
void setSecondaryProgressPatternOffset(int offset)
If the secondary progress has a pattern overlay, calling this method will shift the pattern by the specified offset.
void setSecondaryProgressPatternOverlay(Bitmap pattern, boolean animate)
Sets the pattern bitmap to overlay the secondary progress drawable.
void setSecondaryProgressPatternOverlay(Bitmap pattern, boolean animate, int offset)
Sets the pattern bitmap to overlay the secondary progress drawable.
void setThumbColor(ColorStateList colors)
Sets the tint color of the thumb drawable
void setThumbColor(int color)
Sets the tint color of the thumb drawable
void setVisibility(int v)
Set the enabled state of this view.
[Expand]
Inherited Methods
From class android.widget.SeekBar
From class android.widget.AbsSeekBar
From class android.widget.ProgressBar
From class android.view.View
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.accessibility.AccessibilityEventSource

XML Attributes

dux_indeterminateProgressColor

Since: API Level

Specifies the tint color of the indeterminate progress drawable.

May be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

May be a color value, in the form of "#rgb", "#argb", "#rrggbb", or "#aarrggbb".

dux_progressColor

Since: API Level

Specifies the tint color of the progress drawable.

May be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

May be a color value, in the form of "#rgb", "#argb", "#rrggbb", or "#aarrggbb".

Related Methods

dux_secondaryProgressColor

Since: API Level

Specifies the tint color of the secondary progress drawable.

May be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

May be a color value, in the form of "#rgb", "#argb", "#rrggbb", or "#aarrggbb".

dux_thumbColor

Since: API Level

Specifies the tint color of the thumb drawable.

May be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

May be a color value, in the form of "#rgb", "#argb", "#rrggbb", or "#aarrggbb".

Related Methods

Public Constructors

public EnhancedSeekBar (Context context)

Since: API Level 2.5

public EnhancedSeekBar (Context context, AttributeSet attrs)

Since: API Level 2.5

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

Since: API Level 2.5

Public Methods

public void setIndeterminateProgressColor (int color)

Since: API Level 2.5

Sets the tint color of the indeterminate progress drawable

Related XML Attributes
Parameters
color The tint color.

public void setProgressColor (ColorStateList colors)

Since: API Level 2.5

Sets the tint color of the default progress drawable

Related XML Attributes
Parameters
colors The tint color.

public void setProgressColor (int color)

Since: API Level 2.5

Sets the tint color of the default progress drawable

Related XML Attributes
Parameters
color The tint color.

public void setProgressPatternOffset (int offset)

Since: API Level 2.5

If the progress has a pattern overlay, calling this method will shift the pattern by the specified offset. Otherwise calling this method has no effect.

Parameters
offset The amount of offset to shift the pattern overlay.

public void setProgressPatternOverlay (Bitmap pattern, boolean animate, int offset)

Since: API Level 2.5

Sets the pattern bitmap to overlay the progress drawable. Specify an offset if you want to shift the pattern horizontally. If pattern is null, the progress drawable will not be overlaid.

Parameters
pattern The bitmap used to overlay the progress drawable.
animate If true, the pattern will be animated.
offset The amount by which the pattern will be shifted horizontally.

public void setProgressPatternOverlay (Bitmap pattern, boolean animate)

Since: API Level 2.5

Sets the pattern bitmap to overlay the progress drawable. If pattern is null, the progress drawable will not be overlaid.

Parameters
pattern The bitmap used to overlay the progress drawable.
animate If true, the pattern will be animated.

public void setSecondaryProgressColor (int color)

Since: API Level 2.5

Sets the tint color of the secondary progress drawable

Related XML Attributes
Parameters
color The tint color.

public void setSecondaryProgressColor (ColorStateList colors)

Since: API Level 2.5

Sets the tint color of the secondary progress drawable

Related XML Attributes
Parameters
colors The tint color.

public void setSecondaryProgressPatternOffset (int offset)

Since: API Level 2.5

If the secondary progress has a pattern overlay, calling this method will shift the pattern by the specified offset. Otherwise calling this method has no effect.

Parameters
offset The amount of offset to shift the pattern overlay.

public void setSecondaryProgressPatternOverlay (Bitmap pattern, boolean animate)

Since: API Level 2.5

Sets the pattern bitmap to overlay the secondary progress drawable. If pattern is null, the progress drawable will not be overlaid.

Parameters
pattern The bitmap used to overlay the progress drawable.
animate If true, the pattern will be animated.

public void setSecondaryProgressPatternOverlay (Bitmap pattern, boolean animate, int offset)

Since: API Level 2.5

Sets the pattern bitmap to overlay the secondary progress drawable. Specify an offset if you want to shift the pattern horizontally. If pattern is null, the progress drawable will not be overlaid.

Parameters
pattern The bitmap used to overlay the progress drawable.
animate If true, the pattern will be animated.
offset The amount by which the pattern will be shifted horizontally.

public void setThumbColor (ColorStateList colors)

Since: API Level 2.5

Sets the tint color of the thumb drawable

Related XML Attributes
Parameters
colors The tint color.

public void setThumbColor (int color)

Since: API Level 2.5

Sets the tint color of the thumb drawable

Related XML Attributes
Parameters
color The tint color.

public void setVisibility (int v)

Since: API Level

Set the enabled state of this view.

Parameters
v One of VISIBLE, INVISIBLE, or GONE.