public class Slider extends AndroidViewComponent implements android.widget.SeekBar.OnSeekBarChangeListener
The Slider is a progress bar that adds a draggable thumb. You can touch the thumb and drag left or right to set the slider thumb position. As Slider thumb is dragged, it will trigger PositionChanged event, reporting the position of the Slider thumb. The Slider uses the following default values. However these values can be changed through designer or block editor
container
ACCELEROMETER_SENSITIVITY_MODERATE, ACCELEROMETER_SENSITIVITY_STRONG, ACCELEROMETER_SENSITIVITY_WEAK, ALIGNMENT_CENTER, ALIGNMENT_NORMAL, ALIGNMENT_OPPOSITE, ASSET_DIRECTORY, BUTTON_SHAPE_DEFAULT, BUTTON_SHAPE_OVAL, BUTTON_SHAPE_RECT, BUTTON_SHAPE_ROUNDED, COLOR_BLACK, COLOR_BLUE, COLOR_CYAN, COLOR_DEFAULT, COLOR_DKGRAY, COLOR_GRAY, COLOR_GREEN, COLOR_LTGRAY, COLOR_MAGENTA, COLOR_NONE, COLOR_ORANGE, COLOR_PINK, COLOR_RED, COLOR_WHITE, COLOR_YELLOW, DEFAULT_VALUE_COLOR_BLACK, DEFAULT_VALUE_COLOR_BLUE, DEFAULT_VALUE_COLOR_CYAN, DEFAULT_VALUE_COLOR_DEFAULT, DEFAULT_VALUE_COLOR_DKGRAY, DEFAULT_VALUE_COLOR_GRAY, DEFAULT_VALUE_COLOR_GREEN, DEFAULT_VALUE_COLOR_LTGRAY, DEFAULT_VALUE_COLOR_MAGENTA, DEFAULT_VALUE_COLOR_NONE, DEFAULT_VALUE_COLOR_ORANGE, DEFAULT_VALUE_COLOR_PINK, DEFAULT_VALUE_COLOR_RED, DEFAULT_VALUE_COLOR_WHITE, DEFAULT_VALUE_COLOR_YELLOW, DIRECTION_EAST, DIRECTION_MAX, DIRECTION_MIN, DIRECTION_NONE, DIRECTION_NORTH, DIRECTION_NORTHEAST, DIRECTION_NORTHWEST, DIRECTION_SOUTH, DIRECTION_SOUTHEAST, DIRECTION_SOUTHWEST, DIRECTION_WEST, FONT_DEFAULT_SIZE, LAYOUT_ORIENTATION_HORIZONTAL, LAYOUT_ORIENTATION_VERTICAL, LENGTH_FILL_PARENT, LENGTH_PREFERRED, LENGTH_UNKNOWN, SLIDER_MAX_VALUE, SLIDER_MIN_VALUE, SLIDER_THUMB_VALUE, TOAST_LENGTH_LONG, TOAST_LENGTH_SHORT, TYPEFACE_DEFAULT, TYPEFACE_MONOSPACE, TYPEFACE_SANSSERIF, TYPEFACE_SERIF
Constructor and Description |
---|
Slider(ComponentContainer container)
Creates a new Slider component.
|
Modifier and Type | Method and Description |
---|---|
int |
ColorLeft()
Returns the color of the slider bar to the left of the thumb, as an alpha-red-green-blue
integer, i.e.,
0xAARRGGBB . |
void |
ColorLeft(int argb)
Specifies the color of the slider bar to the left of the thumb as an alpha-red-green-blue
integer, i.e.,
0xAARRGGBB . |
int |
ColorRight()
Returns the color of the slider bar to the right of the thumb, as an alpha-red-green-blue
integer, i.e.,
0xAARRGGBB . |
void |
ColorRight(int argb)
Specifies the color of the slider bar to the right of the thumb as an alpha-red-green-blue
integer, i.e.,
0xAARRGGBB . |
android.view.View |
getView()
Returns the
View that is displayed in the UI. |
int |
Height()
Returns the component's vertical height, measured in pixels.
|
void |
Height(int height)
Specifies the component's vertical height, measured in pixels.
|
float |
MaxValue()
Returns the slider max value
|
void |
MaxValue(float value) |
float |
MinValue()
Returns the value of slider min value.
|
void |
MinValue(float value) |
void |
onProgressChanged(android.widget.SeekBar seekBar,
int progress,
boolean fromUser) |
void |
onStartTrackingTouch(android.widget.SeekBar seekBar) |
void |
onStopTrackingTouch(android.widget.SeekBar seekBar) |
void |
PositionChanged(float thumbPosition)
Indicates that position of the slider thumb has changed.
|
boolean |
ThumbEnabled()
Whether or not the slider thumb is being be shown
|
void |
ThumbEnabled(boolean enabled)
Sets whether or not the slider thumb should be shown
|
float |
ThumbPosition()
Returns the position of slider thumb
|
void |
ThumbPosition(float position)
Sets the slider thumb position.
|
Column, Column, CopyHeight, CopyWidth, getDispatchDelegate, Row, Row, Visible, Visible, Width, Width
public Slider(ComponentContainer container)
container
- container that the component will be placed inpublic void ThumbEnabled(boolean enabled)
enabled
- Whether or not the slider thumb should be shownpublic boolean ThumbEnabled()
public void ThumbPosition(float position)
position
- the position of the slider thumb. This value should be between
sliderMinValue and sliderMaxValue. If this value is not within the min and
max, then it will be calculated.public float ThumbPosition()
public void MinValue(float value)
public float MinValue()
public void MaxValue(float value)
public float MaxValue()
public int ColorLeft()
0xAARRGGBB
. An alpha of 00
indicates fully transparent and FF
means opaque.public void ColorLeft(int argb)
0xAARRGGBB
. An alpha of 00
indicates fully transparent and FF
means opaque.argb
- background color in the format 0xAARRGGBB, which
includes alpha, red, green, and blue componentspublic int ColorRight()
0xAARRGGBB
. An alpha of 00
indicates fully transparent and FF
means opaque.public void ColorRight(int argb)
0xAARRGGBB
. An alpha of 00
indicates fully transparent and FF
means opaque.argb
- background color in the format 0xAARRGGBB, which
includes alpha, red, green, and blue componentspublic android.view.View getView()
AndroidViewComponent
View
that is displayed in the UI.getView
in class AndroidViewComponent
public void onProgressChanged(android.widget.SeekBar seekBar, int progress, boolean fromUser)
onProgressChanged
in interface android.widget.SeekBar.OnSeekBarChangeListener
public void PositionChanged(float thumbPosition)
public void onStartTrackingTouch(android.widget.SeekBar seekBar)
onStartTrackingTouch
in interface android.widget.SeekBar.OnSeekBarChangeListener
public void onStopTrackingTouch(android.widget.SeekBar seekBar)
onStopTrackingTouch
in interface android.widget.SeekBar.OnSeekBarChangeListener
public int Height()
Height
in class AndroidViewComponent
public void Height(int height)
Height
in class AndroidViewComponent
height
- in pixels