[Android] Call AudioUtil.readCoverBitmap with full mrl
Geoffrey Métais
git at videolan.org
Fri Feb 24 16:32:08 CET 2017
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Feb 24 16:30:34 2017 +0100| [a5e0634d855935f8d453fb949947a87df712a2f7] | committer: Geoffrey Métais
Call AudioUtil.readCoverBitmap with full mrl
> https://code.videolan.org/videolan/vlc-android/commit/a5e0634d855935f8d453fb949947a87df712a2f7
---
vlc-android/src/org/videolan/vlc/RecommendationsService.java | 3 +--
vlc-android/src/org/videolan/vlc/gui/InfoActivity.java | 2 +-
vlc-android/src/org/videolan/vlc/gui/PlaylistActivity.java | 2 +-
vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java | 3 +--
vlc-android/src/org/videolan/vlc/gui/tv/CardPresenter.java | 3 +--
.../src/org/videolan/vlc/gui/tv/audioplayer/AudioPlayerActivity.java | 3 +--
vlc-android/src/org/videolan/vlc/media/BrowserProvider.java | 3 +--
7 files changed, 7 insertions(+), 12 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/RecommendationsService.java b/vlc-android/src/org/videolan/vlc/RecommendationsService.java
index 9e0d32b..3b552fd 100644
--- a/vlc-android/src/org/videolan/vlc/RecommendationsService.java
+++ b/vlc-android/src/org/videolan/vlc/RecommendationsService.java
@@ -37,7 +37,6 @@ import org.videolan.medialibrary.media.MediaWrapper;
import org.videolan.vlc.gui.helpers.AudioUtil;
import org.videolan.vlc.gui.helpers.BitmapUtil;
import org.videolan.vlc.gui.video.VideoPlayerActivity;
-import org.videolan.vlc.util.Strings;
import org.videolan.vlc.util.Util;
import java.util.Arrays;
@@ -118,7 +117,7 @@ public class RecommendationsService extends IntentService {
Bitmap pic;
Collections.shuffle(videoList);
for (MediaWrapper mediaWrapper : videoList){
- pic = AudioUtil.readCoverBitmap(Strings.removeFileProtocole(Uri.decode(mediaWrapper.getArtworkMrl())), 256);
+ pic = AudioUtil.readCoverBitmap(Uri.decode(mediaWrapper.getArtworkMrl()), 256);
if (pic != null && pic.getByteCount() > 4)
buildRecommendation(mediaWrapper, ++id, Notification.PRIORITY_DEFAULT);
if (id == MAX_RECOMMENDATIONS)
diff --git a/vlc-android/src/org/videolan/vlc/gui/InfoActivity.java b/vlc-android/src/org/videolan/vlc/gui/InfoActivity.java
index f233da0..160d7fe 100644
--- a/vlc-android/src/org/videolan/vlc/gui/InfoActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/InfoActivity.java
@@ -71,7 +71,7 @@ public class InfoActivity extends AudioPlayerContainerActivity implements View.O
VLCApplication.runBackground(new Runnable() {
@Override
public void run() {
- final Bitmap cover = AudioUtil.readCoverBitmap(Strings.removeFileProtocole(Uri.decode(mItem.getArtworkMrl())), 0);
+ final Bitmap cover = AudioUtil.readCoverBitmap(Uri.decode(mItem.getArtworkMrl()), 0);
if (cover != null) {
mBinding.setCover(new BitmapDrawable(InfoActivity.this.getResources(), cover));
VLCApplication.runOnMainThread(new Runnable() {
diff --git a/vlc-android/src/org/videolan/vlc/gui/PlaylistActivity.java b/vlc-android/src/org/videolan/vlc/gui/PlaylistActivity.java
index 5b12a7f..14404cb 100644
--- a/vlc-android/src/org/videolan/vlc/gui/PlaylistActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/PlaylistActivity.java
@@ -104,7 +104,7 @@ public class PlaylistActivity extends AudioPlayerContainerActivity implements IE
VLCApplication.runBackground(new Runnable() {
@Override
public void run() {
- final Bitmap cover = AudioUtil.readCoverBitmap(Strings.removeFileProtocole(Uri.decode(mPlaylist.getArtworkMrl())), 0);
+ final Bitmap cover = AudioUtil.readCoverBitmap(Uri.decode(mPlaylist.getArtworkMrl()), 0);
if (cover != null) {
mBinding.setCover(new BitmapDrawable(PlaylistActivity.this.getResources(), cover));
VLCApplication.runOnMainThread(new Runnable() {
diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java
index 24e810b..4be5b2a 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java
@@ -73,7 +73,6 @@ import org.videolan.vlc.gui.helpers.UiTools;
import org.videolan.vlc.gui.preferences.PreferencesActivity;
import org.videolan.vlc.gui.view.AudioMediaSwitcher.AudioMediaSwitcherListener;
import org.videolan.vlc.util.AndroidDevices;
-import org.videolan.vlc.util.Strings;
public class AudioPlayer extends PlaybackServiceFragment implements PlaybackService.Callback, PlaylistAdapter.IPlayer, TextWatcher {
public static final String TAG = "VLC/AudioPlayer";
@@ -289,7 +288,7 @@ public class AudioPlayer extends PlaybackServiceFragment implements PlaybackServ
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
@Override
public void run() {
- final Bitmap blurredCover = UiTools.blurBitmap(AudioUtil.readCoverBitmap(Strings.removeFileProtocole(Uri.decode(mw.getArtworkMrl())), mBinding.contentLayout.getWidth()));
+ final Bitmap blurredCover = UiTools.blurBitmap(AudioUtil.readCoverBitmap(Uri.decode(mw.getArtworkMrl()), mBinding.contentLayout.getWidth()));
if (blurredCover != null)
VLCApplication.runOnMainThread(new Runnable() {
@Override
diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/CardPresenter.java b/vlc-android/src/org/videolan/vlc/gui/tv/CardPresenter.java
index ce38f6c..734c792 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/CardPresenter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/CardPresenter.java
@@ -46,7 +46,6 @@ import org.videolan.vlc.VLCApplication;
import org.videolan.vlc.gui.helpers.AsyncImageLoader;
import org.videolan.vlc.gui.helpers.AudioUtil;
import org.videolan.vlc.util.HttpImageLoader;
-import org.videolan.vlc.util.Strings;
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
public class CardPresenter extends Presenter {
@@ -245,7 +244,7 @@ public class CardPresenter extends Presenter {
else
picture = BitmapFactory.decodeResource(res, R.drawable.ic_menu_network_big);
} else
- picture = AudioUtil.readCoverBitmap(Strings.removeFileProtocole(Uri.decode(mediaLibraryItem.getArtworkMrl())), res.getDimensionPixelSize(R.dimen.tv_grid_card_thumb_width));
+ picture = AudioUtil.readCoverBitmap(Uri.decode(mediaLibraryItem.getArtworkMrl()), res.getDimensionPixelSize(R.dimen.tv_grid_card_thumb_width));
if (picture == null) {
int resId;
switch (mediaLibraryItem.getItemType()) {
diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/audioplayer/AudioPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/tv/audioplayer/AudioPlayerActivity.java
index 543fe77..5c46c67 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/audioplayer/AudioPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/audioplayer/AudioPlayerActivity.java
@@ -51,7 +51,6 @@ import org.videolan.vlc.gui.helpers.UiTools;
import org.videolan.vlc.gui.preferences.PreferencesActivity;
import org.videolan.vlc.gui.tv.browser.BaseTvActivity;
import org.videolan.vlc.util.AndroidDevices;
-import org.videolan.vlc.util.Strings;
import java.util.ArrayList;
import java.util.Collections;
@@ -183,7 +182,7 @@ public class AudioPlayerActivity extends BaseTvActivity implements PlaybackServi
VLCApplication.runBackground(new Runnable() {
@Override
public void run() {
- final Bitmap cover = AudioUtil.readCoverBitmap(Strings.removeFileProtocole(Uri.decode(mCurrentCoverArt)), mCover.getWidth());
+ final Bitmap cover = AudioUtil.readCoverBitmap(Uri.decode(mCurrentCoverArt), mCover.getWidth());
final Bitmap blurredCover = UiTools.blurBitmap(cover);
VLCApplication.runOnMainThread(new Runnable() {
@Override
diff --git a/vlc-android/src/org/videolan/vlc/media/BrowserProvider.java b/vlc-android/src/org/videolan/vlc/media/BrowserProvider.java
index 7d46896..66bf464 100644
--- a/vlc-android/src/org/videolan/vlc/media/BrowserProvider.java
+++ b/vlc-android/src/org/videolan/vlc/media/BrowserProvider.java
@@ -38,7 +38,6 @@ import org.videolan.medialibrary.media.MediaWrapper;
import org.videolan.vlc.R;
import org.videolan.vlc.VLCApplication;
import org.videolan.vlc.gui.helpers.AudioUtil;
-import org.videolan.vlc.util.Strings;
import java.util.ArrayList;
import java.util.List;
@@ -137,7 +136,7 @@ public class BrowserProvider {
for (MediaLibraryItem libraryItem : list) {
if (libraryItem.getItemType() == MediaLibraryItem.TYPE_MEDIA && ((MediaWrapper)libraryItem).getType() != MediaWrapper.TYPE_AUDIO)
continue;
- Bitmap cover = AudioUtil.readCoverBitmap(Strings.removeFileProtocole(Uri.decode(libraryItem.getArtworkMrl())), 256);
+ Bitmap cover = AudioUtil.readCoverBitmap(Uri.decode(libraryItem.getArtworkMrl()), 256);
if (cover == null)
cover = DEFAULT_AUDIO_COVER;
item.setTitle(libraryItem.getTitle())
More information about the Android
mailing list