java.lang.Object
com.brightcove.player.mediacontroller.buttons.ButtonState

public class ButtonState extends 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, 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, String eventType, android.view.View.OnClickListener handler)
    Builds a button state object for a given key, description and state manager.
  • Method Summary

    Modifier and Type
    Method
    Description
    Implements a getter for the accessibility content description.
    Implements a getter for the button text.
    android.view.View.OnClickListener
    Implements a getter for the button on-click handler.
    android.graphics.drawable.Drawable
    Implements a getter for the custom image.
    int
     
    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 Details

    • ButtonState

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

      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, 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 Details

    • 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 CharSequence getText()
      Implements a getter for the button text.
      Returns:
      The non-null button text.
    • getContentDescription

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

      public 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()