Fix album cover shrink

main
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,
final @NonNull String key) {
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.TOGGLE_VOLUME) || key.equals(PreferenceUtil.ROUND_CORNERS) ||
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.peekHeight = 0
bottomNavigationView.elevation = DensityUtil.dip2px(this, 10f).toFloat()
playerFragmentContainer.removeAllViews()
collapsePanel()
} else {
if (MusicPlayerRemote.playingQueue.isNotEmpty()) {
slidingPanel.elevation = DensityUtil.dip2px(this, 10f).toFloat()

View File

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

View File

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

View File

@ -41,6 +41,7 @@ import com.bumptech.glide.request.target.Target
class PlayingNotificationImpl : PlayingNotification() {
private var target: Target<BitmapPaletteWrapper>? = null
@Synchronized
override fun update() {
stopped = false
@ -83,13 +84,8 @@ class PlayingNotificationImpl : PlayingNotification() {
glideAnimation: GlideAnimation<in BitmapPaletteWrapper>
) {
update(
resource.bitmap, when {
PreferenceUtil.getInstance(service).isDominantColor -> RetroColorUtil.getDominantColor(
resource.bitmap,
Color.TRANSPARENT
)
else -> RetroColorUtil.getColor(resource.palette, Color.TRANSPARENT)
}
resource.bitmap,
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 DOMINANT_COLOR = "dominant_color";
public static final String GENERAL_THEME = "general_theme";
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);
}
public boolean isDominantColor() {
return mPreferences.getBoolean(DOMINANT_COLOR, false);
}
public boolean isExtraControls() {
return mPreferences.getBoolean(TOGGLE_ADD_CONTROLS, false);

View File

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