danger.ui
Interface ISliderData

All Known Implementing Classes:
MediaVolumeSlider, PhoneVolumeSlider, ProfileSlider, Slider, SliderWindow


public interface ISliderData

Interface for data shared between Slider and SliderWindow.


Field Summary
static int COMPRESSED
          Slider is shown as a Button with a Title and an Icon.
static int DONT_SHOW_FIRST_OR_LAST_TICK
          Don't show the starting or ending tick marks.
static int JUSTIFY_BOTTOM
          Draw the indicator against the bottom of the indicator frame.
static int JUSTIFY_CENTER
          Draw the indicator centered in the frame.
static int JUSTIFY_TOP
          Draw the indicator against the top of the indicator frame.
static int LEFT_TO_RIGHT
          Slider indicator moves from left to right.
static int RIGHT_TO_LEFT
          Slider indicator moves from right to left.
static int SHOW_FIRST_AND_LAST_TICK
          Show both the starting and ending ticks.
static int SHOW_FIRST_TICK
          Show the starting tick but not the ending tick.
static int SHOW_LAST_TICK
          Show the ending tick, but not the starting tick.
static int TICK_MARKS_AUTO
          Show tick marks (scale) on indicator when the range of values exceeds a threshold.
static int TICK_MARKS_OFF
          Never show tick marks (scale) on indicator.
static int TICK_MARKS_ON
          Always show tick marks (scale) on indicator.
static int UNCOMPRESSED
          Slider is shown as a Button with a Title and an inactive slider control.
static int WINDOW_ONLY
          Slider is shown as a Window with a Title and an active Slider control.
 
Method Summary
 Bitmap[] getBitmaps()
          Get the array of bitmaps associated with the Slider value.
 String getDescription()
          Get the description text for the Slider.
 int getDirection()
          Get the direction for the indicator.
 boolean getHasFrame()
          Gets the display of the standard frame for the slider.
 boolean getHasInnerFrame()
          Gets the display of the inner frame for the slider.
 boolean getHasThumb()
          Gets the display of the thumb.
 int getHasTickMarks()
          Gets whether tick marks are displayed on the indicator.
 boolean getIndicateSingleValue()
          Gets how values should be indicated on the Slider.
 int getIndicatorJustification()
          Gets the justification of the indicator.
 int getIndicatorMargin()
          Gets the margin between the frame and the indicator.
 String getLeftLabel()
          Get the left label for the Slider.
 int getMaxValue()
          Get the maximum value for the Slider.
 int getMinValue()
          Get the minimum value for the Slider.
 String getRightLabel()
          Get the right label for the Slider.
 int getShowEndTicks()
          Gets whether start and end tick marks are shown on the indicator.
 int getSliderPortionWidth()
          Get the width in pixels of the indicator portion of the Slider.
 int getSliderType()
          Get the type of the Slider.
 String getTitle()
          Get the title associated with the Slider.
 int getValue()
          Get the value for the Slider.
 void setBitmaps(Bitmap[] inBitmaps)
          Specify an array of bitmaps associated with the Slider value.
 void setDescription(String text)
          Specify a description to be displayed beneath the Slider title and indicator.
 void setDirection(int direction)
          Sets the direction for the indicator.
 void setHasFrame(boolean hasFrame)
          Sets the display of the standard frame for the slider.
 void setHasInnerFrame(boolean hasInnerFrame)
          Sets the display of the inner frame for the slider.
 void setHasThumb(boolean hasThumb)
          Sets the display of the thumb at the end of the indicator.
 void setHasTickMarks(int tickMarks)
          Sets the display of tick marks on the slider.
 void setIndicateSingleValue(boolean indicateSingleValue)
          Sets how values should be indicated on the Slider.
 void setIndicatorJustification(int indicatorJustification)
          Sets the justification of the indicator.
 void setIndicatorMargin(int indicatorMargin)
          Sets the margin between the frame and the indicator.
 void setLabels(String leftLabel, String rightLabel)
          Specify text labels to appear to the right and left of the Slider indicator.
 void setMaxValue(int inMaxValue)
          Set the maximum value for the Slider.
 void setMinValue(int inMinValue)
          Set the minimum value for the Slider.
 void setShowEndTicks(int showEndTicks)
          Sets the display of start and ending tick marks on the slider.
 void setSliderPortionWidth(int inWidth)
          Set the width in pixels of the indicator portion of the Slider.
 void setSliderType(int type)
          Set the type of the Slider.
 void setTitle(String inTitle)
          Set the title associated with the Slider.
 void setValue(int inValue)
          Set the value for the Slider.
 

Field Detail

COMPRESSED

static final int COMPRESSED
Slider is shown as a Button with a Title and an Icon. The current value is shown using an icon displayed to the right of the title.

See Also:
Constant Field Values

UNCOMPRESSED

static final int UNCOMPRESSED
Slider is shown as a Button with a Title and an inactive slider control. The current value is shown in the slider to the right of the title.

See Also:
Constant Field Values

WINDOW_ONLY

static final int WINDOW_ONLY
Slider is shown as a Window with a Title and an active Slider control.

See Also:
Constant Field Values

LEFT_TO_RIGHT

static final int LEFT_TO_RIGHT
Slider indicator moves from left to right. This is the default and is used for Sliders that are not controlled by the volume buttons.

See Also:
Constant Field Values

RIGHT_TO_LEFT

static final int RIGHT_TO_LEFT
Slider indicator moves from right to left. This is used for Sliders that are controlled by the volume buttons.

See Also:
Constant Field Values

TICK_MARKS_AUTO

static final int TICK_MARKS_AUTO
Show tick marks (scale) on indicator when the range of values exceeds a threshold.

See Also:
Constant Field Values

TICK_MARKS_ON

static final int TICK_MARKS_ON
Always show tick marks (scale) on indicator.

See Also:
Constant Field Values

TICK_MARKS_OFF

static final int TICK_MARKS_OFF
Never show tick marks (scale) on indicator.

See Also:
Constant Field Values

DONT_SHOW_FIRST_OR_LAST_TICK

static final int DONT_SHOW_FIRST_OR_LAST_TICK
Don't show the starting or ending tick marks.

See Also:
Constant Field Values

SHOW_FIRST_TICK

static final int SHOW_FIRST_TICK
Show the starting tick but not the ending tick.

See Also:
Constant Field Values

SHOW_LAST_TICK

static final int SHOW_LAST_TICK
Show the ending tick, but not the starting tick.

See Also:
Constant Field Values

SHOW_FIRST_AND_LAST_TICK

static final int SHOW_FIRST_AND_LAST_TICK
Show both the starting and ending ticks.

See Also:
Constant Field Values

JUSTIFY_TOP

static final int JUSTIFY_TOP
Draw the indicator against the top of the indicator frame.

See Also:
Constant Field Values

JUSTIFY_CENTER

static final int JUSTIFY_CENTER
Draw the indicator centered in the frame.

See Also:
Constant Field Values

JUSTIFY_BOTTOM

static final int JUSTIFY_BOTTOM
Draw the indicator against the bottom of the indicator frame.

See Also:
Constant Field Values
Method Detail

setTitle

void setTitle(String inTitle)
Set the title associated with the Slider.

Parameters:
inTitle - String representing the title.

setValue

void setValue(int inValue)
Set the value for the Slider. The value must be >= MinValue and <= MaxValue.

Parameters:
inValue - int specifying the new value.

setMinValue

void setMinValue(int inMinValue)
Set the minimum value for the Slider.

Parameters:
inMinValue - int specifying the minimum value.

setMaxValue

void setMaxValue(int inMaxValue)
Set the maximum value for the Slider.

Parameters:
inMaxValue - int specifying the max value.

setSliderPortionWidth

void setSliderPortionWidth(int inWidth)
Set the width in pixels of the indicator portion of the Slider. UNCOMPRESSED Sliders display a title on the left and a value indicator on the right side. This value specifies the width of the indicator portion. The default is 100.

Parameters:
inWidth - int specifiying width in pixels of the indicator portion.

setSliderType

void setSliderType(int type)
Set the type of the Slider.

Parameters:
type - int speficying the type. Valid values are UNCOMPRESSED, COMPRESSED, WINDOW_ONLY.

setBitmaps

void setBitmaps(Bitmap[] inBitmaps)
Specify an array of bitmaps associated with the Slider value. This allows you to specify an array of bitmaps (one for each value) to be displayed in the UNCOMPRESSED Slider instead of the standard value indicator.

Parameters:
inBitmaps - bitmap[] specifying the bitmap to be used for each value (max - min) of the Slider.

setDescription

void setDescription(String text)
Specify a description to be displayed beneath the Slider title and indicator. This description can be longer than the title, allowing you to be more descriptive. The description is not displayed when the Slider is COMPRESSED.

Parameters:
text - String specifying the description.

setLabels

void setLabels(String leftLabel,
               String rightLabel)
Specify text labels to appear to the right and left of the Slider indicator. These text labels are in addition to the title, and you don't have to specify both of them.

Parameters:
leftLabel - null-ok; String specifying label to appear between Slider title and indicator.
rightLabel - null-ok; String specifying label to appears to the right of Slider indicator.

setDirection

void setDirection(int direction)
Sets the direction for the indicator. By default, Sliders have the minValue on the left and move left-to-right. When using this control with volume buttons, the minValue is on the right and the indicator moves right-to-left to match the volume buttons.

Parameters:
direction - int specifying the direction. Valid values are LEFT_TO_RIGHT and RIGHT_TO_LEFT.

setHasTickMarks

void setHasTickMarks(int tickMarks)
Sets the display of tick marks on the slider. By default, the tick marks are displayed automatically when the range of values exceeds a certain amount (currently 5). You can also explicitly turn them off or on.

Parameters:
tickMarks - int specifying how to display tick marks. Valid values are TICK_MARKS_AUTO, TICK_MARKS_ON and TICK_MARKS_OFF.

setShowEndTicks

void setShowEndTicks(int showEndTicks)
Sets the display of start and ending tick marks on the slider. By default, sliders show the last (maxValue) tick mark but not the first (minValue). For sliders with no frame and no thumb, you may want to show both the first and the last tick. For sliders that have a frame, you may not want to show either the first or last tick.

Parameters:
showEndTicks - int specifying whether to show start and end tick marks. Valid values are DONT_SHOW_FIRST_OR_LAST_TICK, SHOW_FIRST_TICK, SHOW_LAST_TICK and SHOW_FIRST_AND_LAST_TICK.

setHasFrame

void setHasFrame(boolean hasFrame)
Sets the display of the standard frame for the slider.

Parameters:
hasFrame - true if you want the frame.

setHasInnerFrame

void setHasInnerFrame(boolean hasInnerFrame)
Sets the display of the inner frame for the slider. By default, sliders have a lighter colored frame inside the standard frame.

Parameters:
hasInnerFrame - true if you want the inner frame.

setHasThumb

void setHasThumb(boolean hasThumb)
Sets the display of the thumb at the end of the indicator.

Parameters:
hasThumb - true if you want the thumb.

setIndicatorMargin

void setIndicatorMargin(int indicatorMargin)
Sets the margin between the frame and the indicator. This specifies the gap between the indicator frame and the indicator. Default is 3 pixels.

Parameters:
indicatorMargin - int specifying the margin in pixels.

setIndicatorJustification

void setIndicatorJustification(int indicatorJustification)
Sets the justification of the indicator. By default, the indicator is centered inside the slider. This method allows you to position the indicator at the top or the bottom of the slider. If not centered, the indicator margin is only applied to the top (JUSTIFY_BOTTOM) or bottom (JUSTIFY_TOP) of the slider.

Parameters:
indicatorJustification - int specifying desired justification. Valid values are JUSTIFY_TOP, JUSTIFY_BOTTOM and JUSTIFY_CENTER

setIndicateSingleValue

void setIndicateSingleValue(boolean indicateSingleValue)
Sets how values should be indicated on the Slider. Normally the indicator is drawn from the minValue position to the value position. If indicateSingleValue is true, the indicator is drawn from value - 1 to value, showing only one segment.

Parameters:
indicateSingleValue - true if Slider should only indicate a single value.

getTitle

String getTitle()
Get the title associated with the Slider.

Returns:
String representing the title.

getValue

int getValue()
Get the value for the Slider.

Returns:
int specifying the new value.

getMinValue

int getMinValue()
Get the minimum value for the Slider.

Returns:
int specifying the min value.

getMaxValue

int getMaxValue()
Get the maximum value for the Slider.

Returns:
int specifying the max value.

getSliderPortionWidth

int getSliderPortionWidth()
Get the width in pixels of the indicator portion of the Slider. UNCOMPRESSED Sliders display a title on the left and a value indicator on the right side. This value specifies the width of the indicator portion. The default is 100.

Returns:
int specifiying width in pixels of the indicator portion.

getSliderType

int getSliderType()
Get the type of the Slider.

Returns:
int speficying the type. Valid values are UNCOMPRESSED, COMPRESSED, WINDOW_ONLY.

getBitmaps

Bitmap[] getBitmaps()
Get the array of bitmaps associated with the Slider value. This allows you to specify an array of bitmaps (one for each value) to be displayed in the UNCOMPRESSED Slider instead of the standard value indicator.

Returns:
bitmap[] specifying the bitmap to be used for each value of the Slider.

getDescription

String getDescription()
Get the description text for the Slider. This description can be longer than the title, allowing you to be more descriptive. The description is not displayed when the Slider is COMPRESSED.

Returns:
String specifying the description.

getLeftLabel

String getLeftLabel()
Get the left label for the Slider.

Returns:
null-ok; String specifying label to appear between Slider title and indicator.

getRightLabel

String getRightLabel()
Get the right label for the Slider.

Returns:
null-ok; String specifying label to appears to the right of Slider indicator.

getDirection

int getDirection()
Get the direction for the indicator. By default, sliders have the minValue on the left and move left-to-right. When using this control with volume buttons, the minValue is on the right and the indicator move right-to-left to match the volume buttons.

Returns:
int specifying the direction. Valid values are LEFT_TO_RIGHT and RIGHT_TO_LEFT.

getHasTickMarks

int getHasTickMarks()
Gets whether tick marks are displayed on the indicator. By default, the tick marks are displayed automatically when the range of values exceeds a certain amount (currently 5). You can also explicitly turn them off or on.

Returns:
int specifying how to display tick marks. Valid values are TICK_MARKS_AUTO, TICK_MARKS_ON and TICK_MARKS_OFF.

getShowEndTicks

int getShowEndTicks()
Gets whether start and end tick marks are shown on the indicator. By default, sliders show the last (maxValue) tick mark but not the first (minValue). For sliders with no frame and no thumb, you may want to show both the first and the last tick. For sliders that have a frame, you may not want to show either the first or last tick.

Returns:
int specifying whether to show start and end tick marks. Valid values are DONT_SHOW_FIRST_OR_LAST_TICK, SHOW_FIRST_TICK, SHOW_LAST_TICK and SHOW_FIRST_AND_LAST_TICK.

getHasFrame

boolean getHasFrame()
Gets the display of the standard frame for the slider.

Returns:
true if the Slider has a frame.

getHasInnerFrame

boolean getHasInnerFrame()
Gets the display of the inner frame for the slider. By default, sliders have a lighter colored frame inside the standard frame.

Returns:
true if the Slider has an inner frame.

getHasThumb

boolean getHasThumb()
Gets the display of the thumb.

Returns:
true if Slider has a thumb.

getIndicatorMargin

int getIndicatorMargin()
Gets the margin between the frame and the indicator. This specifies the gap between the indicator frame and the indicator. Default is 3 pixels.

Returns:
int specifying the margin in pixels.

getIndicatorJustification

int getIndicatorJustification()
Gets the justification of the indicator. By default, the indicator is centered inside the slider. This method allows you to position the indicator at the top or the bottom of the slider. If not centered, the indicator margin is only applied to the top (JUSTIFY_BOTTOM) or bottom (JUSTIFY_TOP) of the slider.

Returns:
int specifying desired justification. Valid values are JUSTIFY_TOP, JUSTIFY_BOTTOM and JUSTIFY_CENTER

getIndicateSingleValue

boolean getIndicateSingleValue()
Gets how values should be indicated on the Slider. Normally the indicator is drawn from the minValue position to the value position. If indicateSingleValue is true, the indicator is drawn from value - 1 to value, showing only one segment.

Returns:
true if Slider should only indicate a single value.