summaryrefslogtreecommitdiff
path: root/core/java/android/widget/MediaControlView2.java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android/widget/MediaControlView2.java')
-rw-r--r--core/java/android/widget/MediaControlView2.java63
1 files changed, 20 insertions, 43 deletions
diff --git a/core/java/android/widget/MediaControlView2.java b/core/java/android/widget/MediaControlView2.java
index f0a27286ea5e..f1d633a23131 100644
--- a/core/java/android/widget/MediaControlView2.java
+++ b/core/java/android/widget/MediaControlView2.java
@@ -16,6 +16,7 @@
package android.widget;
+import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.content.Context;
@@ -28,6 +29,8 @@ import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
/**
* A View that contains the controls for MediaPlayer2.
* It provides a wide range of UI including buttons such as "Play/Pause", "Rewind", "Fast Forward",
@@ -48,7 +51,23 @@ import android.view.View;
* @hide
*/
public class MediaControlView2 extends FrameLayout {
- // TODO: should overflow button be included?
+ /** @hide */
+ @IntDef({
+ BUTTON_PLAY_PAUSE,
+ BUTTON_FFWD,
+ BUTTON_REW,
+ BUTTON_NEXT,
+ BUTTON_PREV,
+ BUTTON_SUBTITLE,
+ BUTTON_FULL_SCREEN,
+ BUTTON_OVERFLOW,
+ BUTTON_MUTE,
+ BUTTON_ASPECT_RATIO,
+ BUTTON_SETTINGS
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface Button {}
+
public static final int BUTTON_PLAY_PAUSE = 1;
public static final int BUTTON_FFWD = 2;
public static final int BUTTON_REW = 3;
@@ -129,48 +148,6 @@ public class MediaControlView2 extends FrameLayout {
}
/**
- * Returns whether the media is currently playing or not.
- */
- public boolean isPlaying() {
- return mProvider.isPlaying_impl();
- }
-
- /**
- * Returns the current position of the media in milliseconds.
- */
- public int getCurrentPosition() {
- return mProvider.getCurrentPosition_impl();
- }
-
- /**
- * Returns the percentage of how much of the media is currently buffered in storage.
- */
- public int getBufferPercentage() {
- return mProvider.getBufferPercentage_impl();
- }
-
- /**
- * Returns whether the media can be paused or not.
- */
- public boolean canPause() {
- return mProvider.canPause_impl();
- }
-
- /**
- * Returns whether the media can be rewound or not.
- */
- public boolean canSeekBackward() {
- return mProvider.canSeekBackward_impl();
- }
-
- /**
- * Returns whether the media can be fast-forwarded or not.
- */
- public boolean canSeekForward() {
- return mProvider.canSeekForward_impl();
- }
-
- /**
* If the media selected has a subtitle track, calling this method will display the subtitle at
* the bottom of the view. If a media has multiple subtitle tracks, this method will select the
* first one of them.