public abstract class AbstractButtonController extends AbstractComponent implements ButtonController, RemoteControlKeyState
Modifier and Type | Class and Description |
---|---|
static interface |
AbstractButtonController.Visibility |
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_AUDIO_TRACKS_BUTTON_ID |
static int |
DEFAULT_CAPTIONS_BUTTON_ID |
static int |
DEFAULT_FAST_FORWARD_BUTTON_ID |
static int |
DEFAULT_FULL_SCREEN_BUTTON_ID |
static int |
DEFAULT_LIVE_BUTTON_ID |
static int |
DEFAULT_PLAY_BUTTON_ID |
static int |
DEFAULT_REWIND_BUTTON_ID |
static int |
DEFAULT_SEEK_BUTTON_ID |
protected java.util.Map<java.lang.String,java.lang.Object> |
properties
A set of properties supplied when emitting events as part of button click handling.
|
protected java.util.List<ButtonState> |
stateList
A list of states the button will sequence through as it is clicked.
|
protected BaseVideoView |
videoView
The Brightcove video view, provided as a convenience to subclasses.
|
eventEmitter, listenerTokens
Constructor and Description |
---|
AbstractButtonController(android.content.Context context,
BaseVideoView videoView,
android.view.View controlBar,
int id,
android.graphics.Typeface font)
Builds a complete controller.
|
Modifier and Type | Method and Description |
---|---|
android.widget.Button |
getButton()
Implements a getter for the button.
|
EventEmitter |
getEventEmitter()
Implements a getter for the SDK event emitter.
|
android.graphics.Typeface |
getFont()
Gets the button font.
|
int |
getId()
Obtains the Android resource id for the button being controlled.
|
java.util.Map<java.lang.String,java.lang.Object> |
getProperties()
Implements a default behavior to get the current properties without any additional processing.
|
java.util.List<ButtonState> |
getStateList()
Gets the button state list providing information about the states associated with a button face.
|
int |
getVisibilityState()
Gets the maintained visibility state for a button.
|
void |
onAccessibilityStateChanged(boolean enabled)
Called back on change in the accessibility state.
|
boolean |
onBack(android.view.KeyEvent event)
On back key actioned
|
boolean |
onDpadCenter(android.view.KeyEvent event)
On dpad center key actioned
|
boolean |
onDpadDown(android.view.KeyEvent event)
On dpad down key actioned
|
boolean |
onDpadLeft(android.view.KeyEvent event)
On dpad left key actioned
|
boolean |
onDpadRight(android.view.KeyEvent event)
On dpad right key actioned
|
boolean |
onDpadUp(android.view.KeyEvent event)
On dpad up key actioned
|
boolean |
onFastForward(android.view.KeyEvent event)
On fast forward key actioned
|
boolean |
onHome(android.view.KeyEvent event)
On home key actioned
|
boolean |
onMenu(android.view.KeyEvent event)
On menu key actioned
|
boolean |
onPause(android.view.KeyEvent event)
On pause key actioned
|
boolean |
onPlay(android.view.KeyEvent event)
On play key actioned
|
boolean |
onPlayPause(android.view.KeyEvent event)
On play pause key actioned
|
boolean |
onRewind(android.view.KeyEvent event)
On rewind key actioned
|
boolean |
onSkipBackward(android.view.KeyEvent event)
On skip backward key actioned
|
boolean |
onSkipForward(android.view.KeyEvent event)
On skip forward key actioned
|
void |
setVisibility(int visibility)
Sets the button visibility.
|
void |
syncStates()
Implements to update a state (toggle) button to display the correct glyph and
content description for the current managed state value.
|
addListener, addOnceListener, removeListener, removeListeners
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getManagedState, removeListeners
public static final int DEFAULT_AUDIO_TRACKS_BUTTON_ID
public static final int DEFAULT_CAPTIONS_BUTTON_ID
public static final int DEFAULT_FAST_FORWARD_BUTTON_ID
public static final int DEFAULT_FULL_SCREEN_BUTTON_ID
public static final int DEFAULT_LIVE_BUTTON_ID
public static final int DEFAULT_PLAY_BUTTON_ID
public static final int DEFAULT_REWIND_BUTTON_ID
public static final int DEFAULT_SEEK_BUTTON_ID
protected final java.util.Map<java.lang.String,java.lang.Object> properties
protected final java.util.List<ButtonState> stateList
protected final BaseVideoView videoView
public AbstractButtonController(android.content.Context context, BaseVideoView videoView, android.view.View controlBar, int id, android.graphics.Typeface font)
context
- The given Android application context.videoView
- The SDK video view used, possibly, to determine managed state asssociated with the button.controlBar
- The layout widget to which the button will be added.id
- The Android resource identifier for the button being controlled.@Nullable public android.graphics.Typeface getFont()
@Nullable public android.widget.Button getButton()
getButton
in interface ButtonController
ButtonController.getButton()
public void setVisibility(int visibility)
visibility
- One of View.VISIBLE
, View.INVISIBLE
, or View.GONE
.public EventEmitter getEventEmitter()
getEventEmitter
in interface ButtonController
getEventEmitter
in class AbstractComponent
ButtonController.getEventEmitter()
public int getId()
ButtonController
getId
in interface ButtonController
public java.util.Map<java.lang.String,java.lang.Object> getProperties()
getProperties
in interface ButtonController
ButtonController.getProperties()
public java.util.List<ButtonState> getStateList()
getStateList
in interface ButtonController
ButtonController.getStateList()
public int getVisibilityState()
getVisibilityState
in interface ButtonController
ButtonController.getVisibilityState()
public void syncStates()
syncStates
in interface ButtonController
ButtonController.syncStates()
public boolean onSkipBackward(android.view.KeyEvent event)
RemoteControlKeyState
onSkipBackward
in interface RemoteControlKeyState
event
- the android.view.KeyEventpublic boolean onSkipForward(android.view.KeyEvent event)
RemoteControlKeyState
onSkipForward
in interface RemoteControlKeyState
event
- the android.view.KeyEventpublic boolean onHome(android.view.KeyEvent event)
RemoteControlKeyState
onHome
in interface RemoteControlKeyState
event
- the android.view.KeyEventpublic boolean onMenu(android.view.KeyEvent event)
RemoteControlKeyState
onMenu
in interface RemoteControlKeyState
event
- the android.view.KeyEventpublic boolean onBack(android.view.KeyEvent event)
RemoteControlKeyState
onBack
in interface RemoteControlKeyState
event
- the android.view.KeyEventpublic boolean onRewind(android.view.KeyEvent event)
RemoteControlKeyState
onRewind
in interface RemoteControlKeyState
event
- the android.view.KeyEventpublic boolean onFastForward(android.view.KeyEvent event)
RemoteControlKeyState
onFastForward
in interface RemoteControlKeyState
event
- the android.view.KeyEventpublic boolean onPlayPause(android.view.KeyEvent event)
RemoteControlKeyState
onPlayPause
in interface RemoteControlKeyState
event
- the android.view.KeyEventpublic boolean onPause(android.view.KeyEvent event)
RemoteControlKeyState
onPause
in interface RemoteControlKeyState
event
- the android.view.KeyEventpublic boolean onPlay(android.view.KeyEvent event)
RemoteControlKeyState
onPlay
in interface RemoteControlKeyState
event
- the android.view.KeyEventpublic boolean onDpadCenter(android.view.KeyEvent event)
RemoteControlKeyState
onDpadCenter
in interface RemoteControlKeyState
event
- the android.view.KeyEventpublic boolean onDpadRight(android.view.KeyEvent event)
RemoteControlKeyState
onDpadRight
in interface RemoteControlKeyState
event
- the android.view.KeyEventpublic boolean onDpadLeft(android.view.KeyEvent event)
RemoteControlKeyState
onDpadLeft
in interface RemoteControlKeyState
event
- the android.view.KeyEventpublic boolean onDpadDown(android.view.KeyEvent event)
RemoteControlKeyState
onDpadDown
in interface RemoteControlKeyState
event
- the android.view.KeyEventpublic boolean onDpadUp(android.view.KeyEvent event)
RemoteControlKeyState
onDpadUp
in interface RemoteControlKeyState
event
- the android.view.KeyEventpublic void onAccessibilityStateChanged(boolean enabled)
AccessibilityListener
onAccessibilityStateChanged
in interface AccessibilityListener
enabled
- Whether accessibility is enabled.