From d84215acad73ff8fe796d45e8b0851af3d5819a0 Mon Sep 17 00:00:00 2001 From: Milen Pivchev Date: Wed, 6 Oct 2021 17:20:17 +0200 Subject: [PATCH] Add ability to show or hide notification buttons at runtime (#2) * Add additional getters * Bump version --- constants.gradle | 4 +- .../exoplayer2/ExoPlayerLibraryInfo.java | 6 +-- .../ui/PlayerNotificationManager.java | 40 +++++++++++++++++++ 3 files changed, 45 insertions(+), 5 deletions(-) diff --git a/constants.gradle b/constants.gradle index 75ed24ce1ff..3317e041b03 100644 --- a/constants.gradle +++ b/constants.gradle @@ -13,8 +13,8 @@ // limitations under the License. project.ext { // ExoPlayer version and version code. - releaseVersion = '2.15.2' - releaseVersionCode = 2015002 + releaseVersion = '2.15.3' + releaseVersionCode = 2015003 minSdkVersion = 16 appTargetSdkVersion = 29 targetSdkVersion = 30 diff --git a/library/common/src/main/java/com/google/android/exoplayer2/ExoPlayerLibraryInfo.java b/library/common/src/main/java/com/google/android/exoplayer2/ExoPlayerLibraryInfo.java index d7ea5d13e01..254ad34642e 100644 --- a/library/common/src/main/java/com/google/android/exoplayer2/ExoPlayerLibraryInfo.java +++ b/library/common/src/main/java/com/google/android/exoplayer2/ExoPlayerLibraryInfo.java @@ -26,11 +26,11 @@ public final class ExoPlayerLibraryInfo { /** The version of the library expressed as a string, for example "1.2.3". */ // Intentionally hardcoded. Do not derive from other constants (e.g. VERSION_INT) or vice versa. - public static final String VERSION = "2.15.2"; + public static final String VERSION = "2.15.3"; /** The version of the library expressed as {@code "ExoPlayerLib/" + VERSION}. */ // Intentionally hardcoded. Do not derive from other constants (e.g. VERSION) or vice versa. - public static final String VERSION_SLASHY = "ExoPlayerLib/2.15.2"; + public static final String VERSION_SLASHY = "ExoPlayerLib/2.15.3"; /** * The version of the library expressed as an integer, for example 1002003. @@ -40,7 +40,7 @@ public final class ExoPlayerLibraryInfo { * integer version 123045006 (123-045-006). */ // Intentionally hardcoded. Do not derive from other constants (e.g. VERSION) or vice versa. - public static final int VERSION_INT = 2015002; + public static final int VERSION_INT = 2015003; /** * The default user agent for requests made by the library. diff --git a/library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerNotificationManager.java b/library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerNotificationManager.java index 1103677443b..b5685e4f622 100644 --- a/library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerNotificationManager.java +++ b/library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerNotificationManager.java @@ -849,6 +849,10 @@ public final void setControlDispatcher(ControlDispatcher controlDispatcher) { } } + public final boolean getUseNextAction() { + return this.useNextAction; + } + /** * Sets whether the next action should be used. * @@ -861,6 +865,10 @@ public final void setUseNextAction(boolean useNextAction) { } } + public final boolean getUsePreviousAction() { + return this.usePreviousAction; + } + /** * Sets whether the previous action should be used. * @@ -873,6 +881,10 @@ public final void setUsePreviousAction(boolean usePreviousAction) { } } + public final boolean getUseNextActionInCompactView() { + return this.useNextActionInCompactView; + } + /** * If {@link #setUseNextAction useNextAction} is {@code true}, sets whether the next action should * also be used in compact view. Has no effect if {@link #setUseNextAction useNextAction} is @@ -893,6 +905,10 @@ public final void setUseNextActionInCompactView(boolean useNextActionInCompactVi } } + public final boolean getUsePreviousActionInCompactView() { + return this.usePreviousActionInCompactView; + } + /** * If {@link #setUsePreviousAction usePreviousAction} is {@code true}, sets whether the previous * action should also be used in compact view. Has no effect if {@link #setUsePreviousAction @@ -913,6 +929,10 @@ public final void setUsePreviousActionInCompactView(boolean usePreviousActionInC } } + public final boolean getUseFastForwardAction() { + return this.useFastForwardAction; + } + /** * Sets whether the fast forward action should be used. * @@ -925,6 +945,10 @@ public final void setUseFastForwardAction(boolean useFastForwardAction) { } } + public final boolean getUseRewindAction() { + return this.useRewindAction; + } + /** * Sets whether the rewind action should be used. * @@ -937,6 +961,10 @@ public final void setUseRewindAction(boolean useRewindAction) { } } + public final boolean getUseFastForwardActionInCompactView() { + return this.useFastForwardActionInCompactView; + } + /** * Sets whether the fast forward action should also be used in compact view. Has no effect if * {@link #ACTION_FAST_FORWARD} is not enabled, for instance if the media is not seekable. @@ -958,6 +986,10 @@ public final void setUseFastForwardActionInCompactView( } } + public final boolean getUseRewindActionInCompactView() { + return this.useRewindActionInCompactView; + } + /** * Sets whether the rewind action should also be used in compact view. Has no effect if {@link * #ACTION_REWIND} is not enabled, for instance if the media is not seekable. @@ -977,6 +1009,10 @@ public final void setUseRewindActionInCompactView(boolean useRewindActionInCompa } } + public final boolean getUsePlayPauseActions() { + return this.usePlayPauseActions; + } + /** * Sets whether the play and pause actions should be used. * @@ -989,6 +1025,10 @@ public final void setUsePlayPauseActions(boolean usePlayPauseActions) { } } + public final boolean getUseStopAction() { + return this.useStopAction; + } + /** * Sets whether the stop action should be used. *