AI2 Component
(Version nb184)
|
Public Member Functions | |
CustomMediaController (Context context) | |
void | show (int timeout) |
void | show () |
boolean | addTo (ViewGroup parent, ViewGroup.LayoutParams params) |
void | setAnchorView (View anchorView) |
void | hide () |
boolean | onTouch (View v, MotionEvent event) |
A modified MediaController that allows adding to a android.view.ViewGroup instead of the Window that Android adds the MediaController to.
This class manages displaying the controller GUI.
Definition at line 26 of file CustomMediaController.java.
com.google.appinventor.components.runtime.util.CustomMediaController.CustomMediaController | ( | Context | context | ) |
Definition at line 37 of file CustomMediaController.java.
boolean com.google.appinventor.components.runtime.util.CustomMediaController.addTo | ( | ViewGroup | parent, |
ViewGroup.LayoutParams | params | ||
) |
Attempts to remove this CustomMediaController from the Window that Android automatically adds it to and add it to another android.view.ViewGroup.
parent | The android.view.ViewGroup to add the CustomMediaController to. |
params | The android.view.ViewGroup.LayoutParams to use when adding the CustomMediaController to the parent. |
Definition at line 75 of file CustomMediaController.java.
void com.google.appinventor.components.runtime.util.CustomMediaController.hide | ( | ) |
Calls android.widget.MediaController#hide() and sets the visibility of this object to android.view.View#INVISIBLE.
Definition at line 104 of file CustomMediaController.java.
boolean com.google.appinventor.components.runtime.util.CustomMediaController.onTouch | ( | View | v, |
MotionEvent | event | ||
) |
Called when the anchorView passed in CustomMediaController#setAnchorView(View) is touched. Shows the controller GUI.
Definition at line 115 of file CustomMediaController.java.
void com.google.appinventor.components.runtime.util.CustomMediaController.setAnchorView | ( | View | anchorView | ) |
Calls android.widget.MediaController#setAnchorView(View) and sets up a listener that shows a GUI when the anchorView is touched.
Definition at line 93 of file CustomMediaController.java.
void com.google.appinventor.components.runtime.util.CustomMediaController.show | ( | ) |
Sets the visibility of the GUI to android.view.View#VISIBLE and calls android.widget.MediaController#show().
Definition at line 58 of file CustomMediaController.java.
void com.google.appinventor.components.runtime.util.CustomMediaController.show | ( | int | timeout | ) |
Sets the visibility of the GUI to android.view.View#VISIBLE and calls android.widget.MediaController#show(int).
timeout | How long the GUI should be shown for. |
Definition at line 48 of file CustomMediaController.java.