-
public class ButtonState
Provides a class to manage a given button state, for example, the "play" state. A given key will define the glyph on the button face. The action associated with this button state can be to emit an SDK event or invoke an operation directly via a secondary on-click listener.
-
-
Field Summary
Fields Modifier and Type Field Description private String
contentDescription
private Drawable
image
private String
eventType
private View.OnClickListener
handler
private CharSequence
text
private final int
key
-
Constructor Summary
Constructors Constructor Description ButtonState(Context context, int key, int desc, Drawable image, String eventType)
Builds a button state object for a given key, description, state manager and event type. ButtonState(Context context, int key, int desc, Drawable image, View.OnClickListener handler)
Builds a button state object for a given key, description and state manager. ButtonState(Context context, int key, int desc, Drawable image, String eventType, View.OnClickListener handler)
Builds a button state object for a given key, description and state manager.
-
Method Summary
Modifier and Type Method Description String
getContentDescription()
Implements a getter for the accessibility content description. Drawable
getImage()
Implements a getter for the custom image. String
getEventType()
Implements a getter for the button text. View.OnClickListener
getHandler()
Implements a getter for the button on-click handler. CharSequence
getText()
Implements a getter for the button text. int
getKey()
-
-
Constructor Detail
-
ButtonState
ButtonState(Context context, int key, int desc, Drawable image, String eventType)
Builds a button state object for a given key, description, state manager and event type.- Parameters:
context
- The Android application context.key
- The given key used to identify the button glyph.desc
- The given accessible descripiton.image
- The, likely null, custom image to use instead of the icon font face.eventType
- The event type to emit when the the button is clicked.
-
ButtonState
ButtonState(Context context, int key, int desc, Drawable image, View.OnClickListener handler)
Builds a button state object for a given key, description and state manager.- Parameters:
context
- The Android application context.key
- The given key used to identify the button glyph.desc
- The given accessible descripiton.image
- The, likely null, custom image to use instead of the icon font face.handler
- A handler to use instead of emitting an event.
-
ButtonState
ButtonState(Context context, int key, int desc, Drawable image, String eventType, View.OnClickListener handler)
Builds a button state object for a given key, description and state manager.- Parameters:
context
- The Android application context.key
- The given key used to identify the button glyph.desc
- The given accessible descripiton.image
- The, likely null, custom image to use instead of the icon font face.eventType
- The event type to emit for this button state.handler
- A handler to invoke when the event type is null.
-
-
Method Detail
-
getContentDescription
String getContentDescription()
Implements a getter for the accessibility content description.
-
getEventType
String getEventType()
Implements a getter for the button text.
-
getHandler
View.OnClickListener getHandler()
Implements a getter for the button on-click handler.
-
getText
CharSequence getText()
Implements a getter for the button text.
-
getKey
int getKey()
-
-
-
-