diff --git a/app/src/main/assets/changelog.html b/app/src/main/assets/changelog.html
index c5dd5071..7e375eb2 100644
--- a/app/src/main/assets/changelog.html
+++ b/app/src/main/assets/changelog.html
@@ -25,10 +25,18 @@
You can view the changelog dialog again at any time from the about section.
+Version 0.9.46 beta 1
+
+
+ - NEW: Fade album covers in the now playing screen in.
+
+
Version 0.9.45
- - NEW: Moved the stuff from the about dialog to a whole new screen and added useful links.
+ - NEW: Moved the stuff from the about dialog to a whole new screen and added
+ useful links.
+
- FIX: Even though the Last.fm app and web page say something is scrobbling, the
scrobble doesn't actually get saved at the end. Thanks to Tim Malseed for that.
diff --git a/app/src/main/java/com/kabouzeid/gramophone/adapter/album/AlbumAdapter.java b/app/src/main/java/com/kabouzeid/gramophone/adapter/album/AlbumAdapter.java
index 0c21bcaf..1c2fcd65 100644
--- a/app/src/main/java/com/kabouzeid/gramophone/adapter/album/AlbumAdapter.java
+++ b/app/src/main/java/com/kabouzeid/gramophone/adapter/album/AlbumAdapter.java
@@ -129,15 +129,10 @@ public class AlbumAdapter extends AbsMultiSelectAdapter
+ *
* Do not use {@link #setContentView(int)} but wrap your layout with
* {@link #wrapSlidingMusicPanelAndFab(int)} first and then return it in {@link #createContentView()}
*/
public abstract class AbsSlidingMusicPanelActivity extends AbsMusicServiceActivity implements SlidingUpPanelLayout.PanelSlideListener, SharedPreferences.OnSharedPreferenceChangeListener, Toolbar.OnMenuItemClickListener {
public static final String TAG = AbsSlidingMusicPanelActivity.class.getSimpleName();
- private static final int FAB_CIRCULAR_REVEAL_ANIMATION_TIME = 1000;
- private static final long DEFAULT_PROGRESS_VIEW_REFRESH_INTERVAL = 500;
private static final int CMD_REFRESH_PROGRESS_VIEWS = 1;
+ private static final int FAB_CIRCULAR_REVEAL_ANIMATION_TIME = 1000;
+
@Bind(R.id.play_pause_fab)
FloatingActionButton playPauseButton;
@Bind(R.id.sliding_layout)
@@ -835,18 +838,39 @@ public abstract class AbsSlidingMusicPanelActivity extends AbsMusicServiceActivi
miniPlayerTitle.setText(song.title);
}
+ private static class ColorHolder {
+ @ColorInt
+ public int color;
+ }
+
private void setUpAlbumArtAndApplyPalette() {
+ final ColorHolder colorHolder = new ColorHolder();
ImageLoader.getInstance().displayImage(
MusicUtil.getSongImageLoaderString(song),
albumArt,
new DisplayImageOptions.Builder()
.cacheInMemory(true)
.showImageOnFail(R.drawable.default_album_art)
+ .postProcessor(new BitmapProcessor() {
+ @Override
+ public Bitmap process(Bitmap bitmap) {
+ colorHolder.color = ColorUtil.generateColor(AbsSlidingMusicPanelActivity.this, bitmap);
+ return bitmap;
+ }
+ })
+ .displayer(new FadeInBitmapDisplayer(ViewUtil.DEFAULT_COLOR_ANIMATION_DURATION) {
+ @Override
+ public void display(Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom) {
+ super.display(bitmap, imageAware, loadedFrom);
+ setColors(colorHolder.color);
+ }
+ })
.build(),
new SimpleImageLoadingListener() {
@Override
public void onLoadingFailed(String imageUri, View view, @Nullable FailReason failReason) {
- applyPalette(null);
+ FadeInBitmapDisplayer.animate(view, ViewUtil.DEFAULT_COLOR_ANIMATION_DURATION);
+ setColors(ColorUtil.resolveColor(AbsSlidingMusicPanelActivity.this, R.attr.default_bar_color));
ImageLoader.getInstance().displayImage(
"drawable://" + R.drawable.default_album_art,
@@ -862,8 +886,6 @@ public abstract class AbsSlidingMusicPanelActivity extends AbsMusicServiceActivi
return;
}
- applyPalette(loadedImage);
-
ImageLoader.getInstance().displayImage(
imageUri,
albumArtBackground,
@@ -874,21 +896,6 @@ public abstract class AbsSlidingMusicPanelActivity extends AbsMusicServiceActivi
);
}
- private void applyPalette(@Nullable Bitmap bitmap) {
- if (bitmap != null) {
- Palette.from(bitmap)
- .resizeBitmapSize(ColorUtil.PALETTE_BITMAP_SIZE)
- .generate(new Palette.PaletteAsyncListener() {
- @Override
- public void onGenerated(@NonNull Palette palette) {
- setColors(ColorUtil.getColor(AbsSlidingMusicPanelActivity.this, palette));
- }
- });
- } else {
- setColors(ColorUtil.getColor(AbsSlidingMusicPanelActivity.this, null));
- }
- }
-
private void setColors(int color) {
animateColorChange(color);
@@ -979,7 +986,7 @@ public abstract class AbsSlidingMusicPanelActivity extends AbsMusicServiceActivi
songTotalTime.setText(MusicUtil.getReadableDurationString(totalMillis));
if (!MusicPlayerRemote.isPlaying()) {
- return DEFAULT_PROGRESS_VIEW_REFRESH_INTERVAL;
+ return 500;
}
// calculate the number of milliseconds until the next full second,