From 99a33b8428a5f4020067b9b32d3ffa77c35b38bb Mon Sep 17 00:00:00 2001 From: brianwernick Date: Wed, 26 Aug 2015 09:43:32 -0600 Subject: [PATCH] Fixed javadoc issues due to java 8 --- .../FullScreenVideoPlayerActivity.java | 2 +- library/build.gradle | 4 +++ .../android/exomedia/DefaultControls.java | 4 +-- .../android/exomedia/EMAudioPlayer.java | 4 +-- .../android/exomedia/EMVideoView.java | 12 ++++---- .../listener/InternalErrorListener.java | 2 +- .../exomedia/manager/EMPlaylistManager.java | 25 +++++++++++----- .../exomedia/service/EMPlaylistService.java | 29 +++++++++++-------- 8 files changed, 51 insertions(+), 31 deletions(-) diff --git a/demo/src/main/java/com/devbrackets/android/exomediademo/FullScreenVideoPlayerActivity.java b/demo/src/main/java/com/devbrackets/android/exomediademo/FullScreenVideoPlayerActivity.java index 13002a57..6174725c 100644 --- a/demo/src/main/java/com/devbrackets/android/exomediademo/FullScreenVideoPlayerActivity.java +++ b/demo/src/main/java/com/devbrackets/android/exomediademo/FullScreenVideoPlayerActivity.java @@ -9,7 +9,7 @@ /** * A simple example of making a fullscreen video player activity. - *

+ *

* NOTE: the EMVideoView setup is done in the {@link VideoPlayerActivity} */ public class FullScreenVideoPlayerActivity extends VideoPlayerActivity { diff --git a/library/build.gradle b/library/build.gradle index f2f80319..17d8e2e5 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -35,6 +35,10 @@ android { targetCompatibility JavaVersion.VERSION_1_7 } + lintOptions { + abortOnError false + } + packagingOptions { exclude 'META-INF/LICENSE' exclude 'META-INF/LICENSE.txt' diff --git a/library/src/main/java/com/devbrackets/android/exomedia/DefaultControls.java b/library/src/main/java/com/devbrackets/android/exomedia/DefaultControls.java index 56ab1c2c..324dc2db 100644 --- a/library/src/main/java/com/devbrackets/android/exomedia/DefaultControls.java +++ b/library/src/main/java/com/devbrackets/android/exomedia/DefaultControls.java @@ -285,7 +285,7 @@ public void updatePlayPauseImage(boolean isPlaying) { * Sets the button state for the Previous button. This will just * change the images specified with {@link #setPreviousImageResource(int)}, * or use the defaults if they haven't been set, and block any click events. - *

+ *

* This method will NOT re-add buttons that have previously been removed with * {@link #setNextButtonRemoved(boolean)}. * @@ -299,7 +299,7 @@ public void setPreviousButtonEnabled(boolean enabled) { * Sets the button state for the Next button. This will just * change the images specified with {@link #setNextImageResource(int)}, * or use the defaults if they haven't been set, and block any click events. - *

+ *

* This method will NOT re-add buttons that have previously been removed with * {@link #setPreviousButtonRemoved(boolean)}. * diff --git a/library/src/main/java/com/devbrackets/android/exomedia/EMAudioPlayer.java b/library/src/main/java/com/devbrackets/android/exomedia/EMAudioPlayer.java index 959e1106..b8709df1 100644 --- a/library/src/main/java/com/devbrackets/android/exomedia/EMAudioPlayer.java +++ b/library/src/main/java/com/devbrackets/android/exomedia/EMAudioPlayer.java @@ -41,7 +41,7 @@ * An AudioPlayer that uses the ExoPlayer as the backing architecture. If the current device * does NOT pass the Android Compatibility Test Suite (CTS) then the backing architecture * will fall back to using the default Android MediaPlayer. - *

+ *

* To help with quick conversions from the Android MediaPlayer this class follows the APIs * the MediaPlayer provides. */ @@ -476,7 +476,7 @@ public long getDuration() { * only be used when the item doesn't return the correct duration such as with audio streams. * This only overrides the current audio item. * - * @param duration The duration for the current media item or < 0 to disable + * @param duration The duration for the current media item or < 0 to disable */ public void overrideDuration(int duration) { overriddenDuration = duration; diff --git a/library/src/main/java/com/devbrackets/android/exomedia/EMVideoView.java b/library/src/main/java/com/devbrackets/android/exomedia/EMVideoView.java index 40a65c68..8561bbd9 100644 --- a/library/src/main/java/com/devbrackets/android/exomedia/EMVideoView.java +++ b/library/src/main/java/com/devbrackets/android/exomedia/EMVideoView.java @@ -57,7 +57,7 @@ * JellyBean. On devices with JellyBean and up we will use the ExoPlayer in order to * better support HLS streaming and full 1080p video resolutions which the VideoView * struggles with, and in some cases crashes. - *

+ *

* To an external user this view should have the same APIs used with the standard VideoView * to help with quick implementations. */ @@ -497,10 +497,10 @@ public void showDefaultControls() { * Sets the button state for the Previous button on the default controls; see * {@link #setDefaultControlsEnabled(boolean)}. * {@link #setDefaultControlsEnabled(boolean)} must be called prior to this. - *

+ *

* This will just change the images specified with {@link #setPreviousImageResource(int)}, * or use the defaults if they haven't been set, and block any click events. - *

+ *

* This method will NOT re-add buttons that have previously been removed with * {@link #setPreviousButtonRemoved(boolean)}. * @@ -516,10 +516,10 @@ public void setPreviousButtonEnabled(boolean enabled) { * Sets the button state for the Next button on the default controls; see * {@link #setDefaultControlsEnabled(boolean)}. * {@link #setDefaultControlsEnabled(boolean)} must be called prior to this. - *

+ *

* This will just change the images specified with {@link #setNextImageResource(int)}, * or use the defaults if they haven't been set, and block any click events. - *

+ *

* This method will NOT re-add buttons that have previously been removed with * {@link #setNextButtonRemoved(boolean)}. * @@ -834,7 +834,7 @@ public long getDuration() { * only be used when the item doesn't return the correct duration such as with audio streams. * This only overrides the current audio item. * - * @param duration The duration for the current media item or < 0 to disable + * @param duration The duration for the current media item or < 0 to disable */ public void overrideDuration(int duration) { overriddenDuration = duration; diff --git a/library/src/main/java/com/devbrackets/android/exomedia/listener/InternalErrorListener.java b/library/src/main/java/com/devbrackets/android/exomedia/listener/InternalErrorListener.java index 2664d3da..f886824b 100644 --- a/library/src/main/java/com/devbrackets/android/exomedia/listener/InternalErrorListener.java +++ b/library/src/main/java/com/devbrackets/android/exomedia/listener/InternalErrorListener.java @@ -25,7 +25,7 @@ /** * A listener for internal errors. - *

+ *

* These errors are not visible to the user, and hence this listener is provided for * informational purposes only. Note however that an internal error may cause a fatal * error if the player fails to recover. If this happens, {@link ExoPlayerListener#onError(Exception)} diff --git a/library/src/main/java/com/devbrackets/android/exomedia/manager/EMPlaylistManager.java b/library/src/main/java/com/devbrackets/android/exomedia/manager/EMPlaylistManager.java index d22fc413..16c618c7 100644 --- a/library/src/main/java/com/devbrackets/android/exomedia/manager/EMPlaylistManager.java +++ b/library/src/main/java/com/devbrackets/android/exomedia/manager/EMPlaylistManager.java @@ -57,15 +57,25 @@ public enum MediaType { public interface PlaylistItem { long getId(); + long getPlaylistId(); + boolean isAudio(); + boolean isVideo(); + String getMediaUrl(); + String getDownloadedMediaUri(); + String getThumbnailUrl(); + String getArtworkUrl(); + String getTitle(); + String getAlbum(); + String getArtist(); } @@ -86,6 +96,7 @@ public interface PlaylistItem { private Intent seekEndedIntent, allowedTypeChangedIntent; protected abstract Application getApplication(); + protected abstract Class getMediaServiceClass(); /** @@ -224,9 +235,9 @@ public void unRegisterServiceCallbacks(EMPlaylistServiceCallback callback) { * item as specified by the passed parameters. * * @param playListItems The list of items to play - * @param startIndex The index in the playlistItems to start playback - * @param seekPosition The position in the startIndex item to start at (in milliseconds) - * @param startPaused True if the media item should start paused instead of playing + * @param startIndex The index in the playlistItems to start playback + * @param seekPosition The position in the startIndex item to start at (in milliseconds) + * @param startPaused True if the media item should start paused instead of playing */ public void play(List playListItems, int startIndex, int seekPosition, boolean startPaused) { setParameters(playListItems, startIndex); @@ -257,7 +268,7 @@ public void play(int seekPosition, boolean startPaused) { * and video items. * * @param playListItems The List of items to play - * @param startIndex The index in the list to start playback with + * @param startIndex The index in the list to start playback with */ public void setParameters(List playListItems, int startIndex) { playList = playListItems; @@ -576,7 +587,7 @@ public void invokeSeekEnded(int seekPosition) { * Creates the Intents that will be used to interact with the playlist service * * @param mediaServiceClass The class to inform of any media playback controls - * @param application The application to use when constructing the intents used to inform the playlist service of invocations + * @param application The application to use when constructing the intents used to inform the playlist service of invocations */ protected void constructControlIntents(Class mediaServiceClass, Application application) { //Creates the pending intents @@ -681,9 +692,9 @@ private boolean isAllowedType(I item) { /** * Creates a PendingIntent for the given action to the specified service * - * @param application The application to use when creating the pending intent + * @param application The application to use when creating the pending intent * @param serviceClass The service class to notify of intents - * @param action The action to use + * @param action The action to use * @return The resulting PendingIntent */ private PendingIntent createPendingIntent(Application application, Class serviceClass, String action) { diff --git a/library/src/main/java/com/devbrackets/android/exomedia/service/EMPlaylistService.java b/library/src/main/java/com/devbrackets/android/exomedia/service/EMPlaylistService.java index e64161f6..e825654c 100644 --- a/library/src/main/java/com/devbrackets/android/exomedia/service/EMPlaylistService.java +++ b/library/src/main/java/com/devbrackets/android/exomedia/service/EMPlaylistService.java @@ -54,7 +54,7 @@ /** * NOTE: This service will request a wifi wakelock if the item * being played isn't downloaded (see {@link #isDownloaded(EMPlaylistManager.PlaylistItem)}). - *

+ *

* This requires the manifest permission <uses-permission android:name="android.permission.WAKE_LOCK" /> */ @SuppressWarnings("unused") @@ -103,10 +103,15 @@ public enum MediaState { protected List callbackList = new LinkedList<>(); protected abstract String getAppName(); + protected abstract int getNotificationId(); + protected abstract float getAudioDuckVolume(); + protected abstract M getMediaPlaylistManager(); + protected abstract PendingIntent getNotificationClickPendingIntent(); + protected abstract Bitmap getDefaultLargeNotificationImage(); /** @@ -185,7 +190,7 @@ protected void onMediaPlayerResetting() { * * @param playlistItem The playlist item that has been stopped */ - protected void onMediaStopped(I playlistItem){ + protected void onMediaStopped(I playlistItem) { //Purposefully left blank } @@ -193,9 +198,9 @@ protected void onMediaStopped(I playlistItem){ * Called when a current audio item has ended playback. This is called when we * are unable to play an audio item. * - * @param playlistItem The PlaylistItem that has ended + * @param playlistItem The PlaylistItem that has ended * @param currentPosition The position the playlist item ended at - * @param duration The duration of the PlaylistItem + * @param duration The duration of the PlaylistItem */ protected void onAudioPlaybackEnded(I playlistItem, long currentPosition, long duration) { //Purposefully left blank @@ -204,9 +209,9 @@ protected void onAudioPlaybackEnded(I playlistItem, long currentPosition, long d /** * Called when an audio item has started playback. * - * @param playlistItem The PlaylistItem that has started playback + * @param playlistItem The PlaylistItem that has started playback * @param currentPosition The position the playback has started at - * @param duration The duration of the PlaylistItem + * @param duration The duration of the PlaylistItem */ protected void onAudioPlaybackStarted(I playlistItem, long currentPosition, long duration) { //Purposefully left blank @@ -241,7 +246,7 @@ protected Bitmap getLargeNotificationImage() { /** * Retrieves the image that will be displayed in the notification as a secondary * image. This can be used to specify playback type (e.g. Chromecast). - * + *

* This will be called any time the notification is updated * * @return The image to display in the secondary position @@ -265,7 +270,7 @@ protected Bitmap getDefaultLargeNotificationSecondaryImage() { /** * Called when the image in the notification needs to be updated. * - * @param size The square size for the image to display + * @param size The square size for the image to display * @param playlistItem The media item to get the image for */ protected void updateLargeNotificationImage(int size, I playlistItem) { @@ -787,7 +792,7 @@ protected void onLockScreenArtworkUpdated() { /** * Starts the actual item playback, correctly determining if the * item is a video or an audio item. - * + *

* NOTE: In order to play videos you will need to specify the * VideoView with {@link EMPlaylistManager#setVideoView(EMVideoView)} */ @@ -959,14 +964,14 @@ protected void seekToNextPlayableItem() { } //Only iterate through the list if we aren't connected to the internet - if(!isNetworkAvailable()) { - while(currentItem != null && !isDownloaded(currentItem)) { + if (!isNetworkAvailable()) { + while (currentItem != null && !isDownloaded(currentItem)) { currentItem = getMediaPlaylistManager().next(); } } //If we are unable to get a next playable item, post a network error - if(currentItem == null) { + if (currentItem == null) { onNoNonNetworkItemsAvailable(); }