AI2 Component  (Version nb184)
com.google.appinventor.components.runtime.util.CustomMediaController Class Reference
Inheritance diagram for com.google.appinventor.components.runtime.util.CustomMediaController:

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)
 

Detailed Description

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.

Author
Vance Turnewitsch

Definition at line 26 of file CustomMediaController.java.

Constructor & Destructor Documentation

◆ CustomMediaController()

com.google.appinventor.components.runtime.util.CustomMediaController.CustomMediaController ( Context  context)

Definition at line 37 of file CustomMediaController.java.

Member Function Documentation

◆ addTo()

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.

Parameters
parentThe android.view.ViewGroup to add the CustomMediaController to.
paramsThe android.view.ViewGroup.LayoutParams to use when adding the CustomMediaController to the parent.

Definition at line 75 of file CustomMediaController.java.

◆ hide()

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.

◆ onTouch()

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.

◆ setAnchorView()

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.

◆ show() [1/2]

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.

◆ show() [2/2]

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).

Parameters
timeoutHow long the GUI should be shown for.

Definition at line 48 of file CustomMediaController.java.


The documentation for this class was generated from the following file: