use blurhash for most objects

This commit is contained in:
dkanada 2020-09-23 01:19:44 +09:00
commit a66f0d5fcd
24 changed files with 85 additions and 61 deletions

View file

@ -1,5 +1,6 @@
package com.dkanada.gramophone.service;
import android.annotation.SuppressLint;
import android.app.PendingIntent;
import android.app.Service;
import android.appwidget.AppWidgetManager;
@ -520,6 +521,7 @@ public class MusicService extends Service implements SharedPreferences.OnSharedP
.build());
}
@SuppressLint("CheckResult")
private void updateMediaSessionMetaData() {
final Song song = getCurrentSong();
@ -545,7 +547,7 @@ public class MusicService extends Service implements SharedPreferences.OnSharedP
if (PreferenceUtil.getInstance(this).getShowAlbumCover()) {
final Point screenSize = Util.getScreenSize(MusicService.this);
final RequestBuilder<Bitmap> request = CustomGlideRequest.Builder
.from(Glide.with(MusicService.this), song.primary)
.from(MusicService.this, song.primary, song.blurHash)
.bitmap().build();
if (PreferenceUtil.getInstance(this).getBlurAlbumCover()) {

View file

@ -89,8 +89,9 @@ public class PlayingNotificationImpl extends PlayingNotification {
Glide.with(service).clear(target);
}
target = CustomGlideRequest.Builder.from(Glide.with(service), song.primary)
.palette(service).build()
target = CustomGlideRequest.Builder
.from(service, song.primary, song.blurHash)
.palette().build()
.into(new SimpleTarget<BitmapPaletteWrapper>(bigNotificationImageSize, bigNotificationImageSize) {
@Override
public void onResourceReady(BitmapPaletteWrapper resource, Transition<? super BitmapPaletteWrapper> glideAnimation) {

View file

@ -51,8 +51,8 @@ public class PlayingNotificationImpl24 extends PlayingNotification {
final int bigNotificationImageSize = service.getResources().getDimensionPixelSize(R.dimen.notification_big_image_size);
service.runOnUiThread(() -> CustomGlideRequest.Builder
.from(Glide.with(service), song.primary)
.palette(service).build()
.from(service, song.primary, song.blurHash)
.palette().build()
.into(new SimpleTarget<BitmapPaletteWrapper>(bigNotificationImageSize, bigNotificationImageSize) {
@Override
public void onResourceReady(BitmapPaletteWrapper resource, Transition<? super BitmapPaletteWrapper> glideAnimation) {