open class ActionToggleButton : Action
(source)
An action button with two states, selected and unselected. When the button is pressed, the state changes automatically.
imageDrawable
- The drawable to be shown if the button is in unselected state.
imageSelectedDrawable
- The drawable to be shown if the button is in selected state.
contentDescription
- The content description to use if the button is in unselected state.
contentDescriptionSelected
- The content description to use if the button is in selected state.
visible
- Lambda that returns true or false to indicate whether this button should be shown.
selected
- Sets whether this button should be selected initially.
padding
- A optional custom padding.
listener
- Callback that will be invoked whenever the checked state changes.
ActionToggleButton(imageDrawable: Drawable, imageSelectedDrawable: Drawable, contentDescription: String, contentDescriptionSelected: String, visible: () -> Boolean = { true }, selected: Boolean = false, background: Int = 0, padding: Padding? = null, listener: (Boolean) -> Unit)
An action button with two states, selected and unselected. When the button is pressed, the state changes automatically. |
open val visible: () -> Boolean
Lambda that returns true or false to indicate whether this button should be shown. |
open fun bind(view: View): Unit |
|
open fun createView(parent: ViewGroup): View |
|
fun isSelected(): Boolean
Returns the current selected state of the action. |
|
fun setSelected(selected: Boolean, notifyListener: Boolean = true): Unit
Changes the selected state of the action. |
|
fun toggle(notifyListener: Boolean = true): Unit
Changes the selected state of the action to the inverse of its current state. |
class ToggleButton : ActionToggleButton
An action button with two states, selected and unselected. When the button is pressed, the state changes automatically. |