| java.lang.Object | ||
| ↳ | com.neomades.ui.View | |
| ↳ | com.neomades.ui.SegmentedView | |
A SegmentedView object is a horizontal view with multiple segments.
Each segment is represented by a discrete button.
With ItemSelectedListener listener, the segmented may inform that the
selection has been changed.
By default, the first item is selected.
|
[Expand]
Inherited XML Attributes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.neomades.ui.View
| |||||||||||
| Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| int | STYLE_BAR | The iOS small toolbar style for segmented controls. | |||||||||
| int | STYLE_BEZELED | The iOS large bezeled style for segmented controls. | |||||||||
| int | STYLE_BORDERED | The iOS large bordered style for segmented controls. | |||||||||
| int | STYLE_PLAIN | The iOS large plain style for segmented controls. | |||||||||
|
[Expand]
Inherited Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From interface
com.neomades.ui.Alignment
| |||||||||||
From interface
com.neomades.ui.StretchMode
| |||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
SegmentedView()
Creates a new
SegmentedView. | |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| void |
addItem(String text)
Appends a new segment with text.
| ||||||||||
| int |
getSelectedIndex()
Returns the index number of the selected segment.
| ||||||||||
| String |
getSelectedItem()
Returns the text of the selected segment.
| ||||||||||
| void |
setItemSelectedListener(ItemSelectedListener listener)
Sets a listener.
| ||||||||||
| void |
setSelectedIndex(int index)
Sets the selected segment to the given index.
| ||||||||||
| void |
setSelectedItem(String item)
Sets the selected index to the index given in parameter.
| ||||||||||
| void |
setStyle(int style)
Sets the style of the segmented view.
| ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.neomades.ui.View
| |||||||||||
From class
java.lang.Object
| |||||||||||
The iOS small toolbar style for segmented controls. Segmented controls in this style can have a tint color.
The iOS large bezeled style for segmented controls. Segmented controls in this style can have a tint color
The iOS large bordered style for segmented controls.
The iOS large plain style for segmented controls. This style is the default.
Appends a new segment with text.
| text | the text of the new segment to add |
|---|
Returns the index number of the selected segment.
Returns the text of the selected segment.
Sets the selected segment to the given index.
By default, the first item is selected.
| index | the index of the segment to select |
|---|
Sets the selected index to the index given in parameter. The item selected will be the first in the segmented view that is equal to the String given in parameter.
| item | the item to select |
|---|
| CrossThreadException | if the method is called from outside the UI-Thread |
|---|
Sets the style of the segmented view.
| style | one of STYLE_BAR, STYLE_BEZELED, STYLE_BORDERED or STYLE_PLAIN |
|---|