summaryrefslogtreecommitdiff
path: root/core/java/android/widget/VideoView2.java
diff options
context:
space:
mode:
authorInsun Kang <insun@google.com>2018-01-27 01:17:49 +0900
committerInsun Kang <insun@google.com>2018-01-29 04:00:23 +0000
commit620b7f328f6e621da4c8fe6695b479bebd147cdb (patch)
tree1910225c2850bcff267dc9979b39a7606ccd09da /core/java/android/widget/VideoView2.java
parent8e2af19744b0d719c2cb75a9223a54c89e95b88a (diff)
VideoView2: Adds Executor paramter to setFooListener methods
- Added Executor parameter to setFooListeners - Removed setFullScreen() - Renamed OnFullScreenChangedListener --> OnFullScreenRequestListener Test: build Change-Id: I1822876ecf55566182281a76ea7919d7c0112146
Diffstat (limited to 'core/java/android/widget/VideoView2.java')
-rw-r--r--core/java/android/widget/VideoView2.java56
1 files changed, 28 insertions, 28 deletions
diff --git a/core/java/android/widget/VideoView2.java b/core/java/android/widget/VideoView2.java
index 3f941309ec2e..ba34ee08c590 100644
--- a/core/java/android/widget/VideoView2.java
+++ b/core/java/android/widget/VideoView2.java
@@ -38,10 +38,9 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.List;
import java.util.Map;
+import java.util.concurrent.Executor;
-// TODO: Use @link tag to refer MediaPlayer2 in docs once MediaPlayer2.java is submitted. Same to
-// MediaSession2.
-// TODO: change the reference from MediaPlayer to MediaPlayer2.
+// TODO: Replace MediaSession wtih MediaSession2 once MediaSession2 is submitted.
/**
* Displays a video file. VideoView2 class is a View class which is wrapping MediaPlayer2 so that
* developers can easily implement a video rendering application.
@@ -203,13 +202,6 @@ public class VideoView2 extends FrameLayout {
}
/**
- * Sets full screen mode.
- */
- public void setFullScreen(boolean fullScreen) {
- mProvider.setFullScreen_impl(fullScreen);
- }
-
- /**
* Sets playback speed.
*
* It is expressed as a multiplicative factor, where normal speed is 1.0f. If it is less than
@@ -327,30 +319,33 @@ public class VideoView2 extends FrameLayout {
* @param actionList A list of {@link PlaybackState.CustomAction}. The return value of
* {@link PlaybackState.CustomAction#getIcon()} will be used to draw buttons
* in {@link MediaControlView2}.
+ * @param executor executor to run callbacks on.
* @param listener A listener to be called when a custom button is clicked.
*/
public void setCustomActions(List<PlaybackState.CustomAction> actionList,
- OnCustomActionListener listener) {
- mProvider.setCustomActions_impl(actionList, listener);
+ Executor executor, OnCustomActionListener listener) {
+ mProvider.setCustomActions_impl(actionList, executor, listener);
}
/**
* Registers a callback to be invoked when the media file is loaded and ready to go.
*
+ * @param executor executor to run callbacks on.
* @param l the callback that will be run.
*/
- public void setOnPreparedListener(OnPreparedListener l) {
- mProvider.setOnPreparedListener_impl(l);
+ public void setOnPreparedListener(Executor executor, OnPreparedListener l) {
+ mProvider.setOnPreparedListener_impl(executor, l);
}
/**
* Registers a callback to be invoked when the end of a media file has been reached during
* playback.
*
+ * @param executor executor to run callbacks on.
* @param l the callback that will be run.
*/
- public void setOnCompletionListener(OnCompletionListener l) {
- mProvider.setOnCompletionListener_impl(l);
+ public void setOnCompletionListener(Executor executor, OnCompletionListener l) {
+ mProvider.setOnCompletionListener_impl(executor, l);
}
/**
@@ -358,36 +353,41 @@ public class VideoView2 extends FrameLayout {
* listener is specified, or if the listener returned false, VideoView2 will inform the user of
* any errors.
*
+ * @param executor executor to run callbacks on.
* @param l The callback that will be run
*/
- public void setOnErrorListener(OnErrorListener l) {
- mProvider.setOnErrorListener_impl(l);
+ public void setOnErrorListener(Executor executor, OnErrorListener l) {
+ mProvider.setOnErrorListener_impl(executor, l);
}
/**
* Registers a callback to be invoked when an informational event occurs during playback or
* setup.
*
+ * @param executor executor to run callbacks on.
* @param l The callback that will be run
*/
- public void setOnInfoListener(OnInfoListener l) {
- mProvider.setOnInfoListener_impl(l);
+ public void setOnInfoListener(Executor executor, OnInfoListener l) {
+ mProvider.setOnInfoListener_impl(executor, l);
}
/**
* Registers a callback to be invoked when a view type change is done.
* {@see #setViewType(int)}
+ * @param executor executor to run callbacks on.
* @param l The callback that will be run
*/
- public void setOnViewTypeChangedListener(OnViewTypeChangedListener l) {
- mProvider.setOnViewTypeChangedListener_impl(l);
+ public void setOnViewTypeChangedListener(Executor executor, OnViewTypeChangedListener l) {
+ mProvider.setOnViewTypeChangedListener_impl(executor, l);
}
/**
* Registers a callback to be invoked when the fullscreen mode should be changed.
+ * @param executor executor to run callbacks on.
+ * @param l The callback that will be run
*/
- public void setFullScreenChangedListener(OnFullScreenChangedListener l) {
- mProvider.setFullScreenChangedListener_impl(l);
+ public void setFullScreenRequestListener(Executor executor, OnFullScreenRequestListener l) {
+ mProvider.setFullScreenRequestListener_impl(executor, l);
}
/**
@@ -461,19 +461,19 @@ public class VideoView2 extends FrameLayout {
/**
* Interface definition of a callback to be invoked to inform the fullscreen mode is changed.
+ * Application should handle the fullscreen mode accordingly.
*/
- public interface OnFullScreenChangedListener {
+ public interface OnFullScreenRequestListener {
/**
* Called to indicate a fullscreen mode change.
*/
- void onFullScreenChanged(View view, boolean fullScreen);
+ void onFullScreenRequest(View view, boolean fullScreen);
}
/**
* Interface definition of a callback to be invoked to inform that a custom action is performed.
- *
- * TODO: When MediaSession2 is ready, modify the method to match the signature.
*/
+ // TODO: When MediaSession2 is ready, modify the method to match the signature.
public interface OnCustomActionListener {
/**
* Called to indicate that a custom action is performed.