Class ButtonState


  • public class ButtonState
    extends java.lang.Object
    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.
    • Constructor Summary

      Constructors 
      Constructor Description
      ButtonState​(android.content.Context context, int key, int desc, android.graphics.drawable.Drawable image, android.view.View.OnClickListener handler)
      Builds a button state object for a given key, description and state manager.
      ButtonState​(android.content.Context context, int key, int desc, android.graphics.drawable.Drawable image, java.lang.String eventType)
      Builds a button state object for a given key, description, state manager and event type.
      ButtonState​(android.content.Context context, int key, int desc, android.graphics.drawable.Drawable image, java.lang.String eventType, android.view.View.OnClickListener handler)
      Builds a button state object for a given key, description and state manager.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getContentDescription()
      Implements a getter for the accessibility content description.
      java.lang.String getEventType()
      Implements a getter for the button text.
      android.view.View.OnClickListener getHandler()
      Implements a getter for the button on-click handler.
      android.graphics.drawable.Drawable getImage()
      Implements a getter for the custom image.
      int getKey()  
      java.lang.CharSequence getText()
      Implements a getter for the button text.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ButtonState

        public ButtonState​(android.content.Context context,
                           int key,
                           int desc,
                           android.graphics.drawable.Drawable image,
                           java.lang.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

        public ButtonState​(android.content.Context context,
                           int key,
                           int desc,
                           android.graphics.drawable.Drawable image,
                           android.view.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

        public ButtonState​(android.content.Context context,
                           int key,
                           int desc,
                           android.graphics.drawable.Drawable image,
                           java.lang.String eventType,
                           android.view.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

      • getImage

        public android.graphics.drawable.Drawable getImage()
        Implements a getter for the custom image.
        Returns:
        null if there is no custom image, the custom image otherwise.
      • getText

        public java.lang.CharSequence getText()
        Implements a getter for the button text.
        Returns:
        The non-null button text.
      • getContentDescription

        public java.lang.String getContentDescription()
        Implements a getter for the accessibility content description.
        Returns:
        The non-null button content description.
      • getEventType

        public java.lang.String getEventType()
        Implements a getter for the button text.
        Returns:
        The, possibly null, event type.
      • getHandler

        public android.view.View.OnClickListener getHandler()
        Implements a getter for the button on-click handler.
        Returns:
        The non-null click handler.
      • getKey

        public int getKey()