Fix album cover shrink

This commit is contained in:
Hemanth S 2020-05-12 01:09:44 +05:30
parent adf2d57703
commit e61294d281
7 changed files with 10 additions and 20 deletions

View file

@ -373,7 +373,7 @@ public class MainActivity extends AbsSlidingMusicPanelActivity
public void onSharedPreferenceChanged(final @NonNull SharedPreferences sharedPreferences, public void onSharedPreferenceChanged(final @NonNull SharedPreferences sharedPreferences,
final @NonNull String key) { final @NonNull String key) {
if (key.equals(PreferenceUtil.GENERAL_THEME) || key.equals(PreferenceUtil.BLACK_THEME) || if (key.equals(PreferenceUtil.GENERAL_THEME) || key.equals(PreferenceUtil.BLACK_THEME) ||
key.equals(PreferenceUtil.ADAPTIVE_COLOR_APP) || key.equals(PreferenceUtil.DOMINANT_COLOR) || key.equals(PreferenceUtil.ADAPTIVE_COLOR_APP) ||
key.equals(PreferenceUtil.USER_NAME) || key.equals(PreferenceUtil.TOGGLE_FULL_SCREEN) || key.equals(PreferenceUtil.USER_NAME) || key.equals(PreferenceUtil.TOGGLE_FULL_SCREEN) ||
key.equals(PreferenceUtil.TOGGLE_VOLUME) || key.equals(PreferenceUtil.ROUND_CORNERS) || key.equals(PreferenceUtil.TOGGLE_VOLUME) || key.equals(PreferenceUtil.ROUND_CORNERS) ||
key.equals(PreferenceUtil.CAROUSEL_EFFECT) || key.equals(PreferenceUtil.NOW_PLAYING_SCREEN_ID) || key.equals(PreferenceUtil.CAROUSEL_EFFECT) || key.equals(PreferenceUtil.NOW_PLAYING_SCREEN_ID) ||

View file

@ -222,7 +222,7 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(),
behavior.isHideable = true behavior.isHideable = true
behavior.peekHeight = 0 behavior.peekHeight = 0
bottomNavigationView.elevation = DensityUtil.dip2px(this, 10f).toFloat() bottomNavigationView.elevation = DensityUtil.dip2px(this, 10f).toFloat()
playerFragmentContainer.removeAllViews() collapsePanel()
} else { } else {
if (MusicPlayerRemote.playingQueue.isNotEmpty()) { if (MusicPlayerRemote.playingQueue.isNotEmpty()) {
slidingPanel.elevation = DensityUtil.dip2px(this, 10f).toFloat() slidingPanel.elevation = DensityUtil.dip2px(this, 10f).toFloat()

View file

@ -120,7 +120,7 @@ public class SongGlideRequest {
return createBaseRequest(builder.requestManager, builder.song, builder.ignoreMediaStore) return createBaseRequest(builder.requestManager, builder.song, builder.ignoreMediaStore)
.asBitmap() .asBitmap()
.diskCacheStrategy(DEFAULT_DISK_CACHE_STRATEGY) .diskCacheStrategy(DEFAULT_DISK_CACHE_STRATEGY)
.placeholder(DEFAULT_ERROR_IMAGE) .error(DEFAULT_ERROR_IMAGE)
.animate(DEFAULT_ANIMATION) .animate(DEFAULT_ANIMATION)
.signature(createSignature(builder.song)); .signature(createSignature(builder.song));
} }
@ -141,7 +141,7 @@ public class SongGlideRequest {
.asBitmap() .asBitmap()
.transcode(new BitmapPaletteTranscoder(context), BitmapPaletteWrapper.class) .transcode(new BitmapPaletteTranscoder(context), BitmapPaletteWrapper.class)
.diskCacheStrategy(DEFAULT_DISK_CACHE_STRATEGY) .diskCacheStrategy(DEFAULT_DISK_CACHE_STRATEGY)
.placeholder(DEFAULT_ERROR_IMAGE) .error(DEFAULT_ERROR_IMAGE)
.animate(DEFAULT_ANIMATION) .animate(DEFAULT_ANIMATION)
.signature(createSignature(builder.song)); .signature(createSignature(builder.song));
} }

View file

@ -737,7 +737,6 @@ public class MusicService extends Service implements
updateMediaSessionMetaData(); updateMediaSessionMetaData();
break; break;
case PreferenceUtil.COLORED_NOTIFICATION: case PreferenceUtil.COLORED_NOTIFICATION:
case PreferenceUtil.DOMINANT_COLOR:
updateNotification(); updateNotification();
break; break;
case PreferenceUtil.CLASSIC_NOTIFICATION: case PreferenceUtil.CLASSIC_NOTIFICATION:

View file

@ -41,6 +41,7 @@ import com.bumptech.glide.request.target.Target
class PlayingNotificationImpl : PlayingNotification() { class PlayingNotificationImpl : PlayingNotification() {
private var target: Target<BitmapPaletteWrapper>? = null private var target: Target<BitmapPaletteWrapper>? = null
@Synchronized @Synchronized
override fun update() { override fun update() {
stopped = false stopped = false
@ -83,13 +84,8 @@ class PlayingNotificationImpl : PlayingNotification() {
glideAnimation: GlideAnimation<in BitmapPaletteWrapper> glideAnimation: GlideAnimation<in BitmapPaletteWrapper>
) { ) {
update( update(
resource.bitmap, when {
PreferenceUtil.getInstance(service).isDominantColor -> RetroColorUtil.getDominantColor(
resource.bitmap, resource.bitmap,
Color.TRANSPARENT RetroColorUtil.getColor(resource.palette, Color.TRANSPARENT)
)
else -> RetroColorUtil.getColor(resource.palette, Color.TRANSPARENT)
}
) )
} }

View file

@ -95,8 +95,6 @@ public final class PreferenceUtil {
public static final String TOGGLE_HEADSET = "toggle_headset"; public static final String TOGGLE_HEADSET = "toggle_headset";
public static final String DOMINANT_COLOR = "dominant_color";
public static final String GENERAL_THEME = "general_theme"; public static final String GENERAL_THEME = "general_theme";
public static final String CIRCULAR_ALBUM_ART = "circular_album_art"; public static final String CIRCULAR_ALBUM_ART = "circular_album_art";
@ -772,9 +770,6 @@ public final class PreferenceUtil {
return mPreferences.getBoolean(NOW_PLAYING_SCREEN, false); return mPreferences.getBoolean(NOW_PLAYING_SCREEN, false);
} }
public boolean isDominantColor() {
return mPreferences.getBoolean(DOMINANT_COLOR, false);
}
public boolean isExtraControls() { public boolean isExtraControls() {
return mPreferences.getBoolean(TOGGLE_ADD_CONTROLS, false); return mPreferences.getBoolean(TOGGLE_ADD_CONTROLS, false);

View file

@ -2,7 +2,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="96dp" android:layout_width="112dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="8dp" android:layout_margin="8dp"
android:background="?attr/rectSelector" android:background="?attr/rectSelector"
@ -10,10 +10,10 @@
<code.name.monkey.retromusic.views.RetroShapeableImageView <code.name.monkey.retromusic.views.RetroShapeableImageView
android:id="@+id/image" android:id="@+id/image"
android:layout_width="96dp" android:layout_width="112dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@android:color/transparent" android:background="@android:color/transparent"
app:retroCornerSize="46dp" app:retroCornerSize="56dp"
app:srcCompat="@drawable/default_artist_art" app:srcCompat="@drawable/default_artist_art"
tools:src="@tools:sample/avatars" /> tools:src="@tools:sample/avatars" />