diff --git a/app/src/main/java/code/name/monkey/retromusic/activities/AlbumDetailsActivity.kt b/app/src/main/java/code/name/monkey/retromusic/activities/AlbumDetailsActivity.kt index 2c5ab858..c9b349c1 100644 --- a/app/src/main/java/code/name/monkey/retromusic/activities/AlbumDetailsActivity.kt +++ b/app/src/main/java/code/name/monkey/retromusic/activities/AlbumDetailsActivity.kt @@ -177,8 +177,16 @@ class AlbumDetailsActivity : AbsSlidingMusicPanelActivity(), AlbumDetailsView, C } private fun loadAlbumCover() { + /* Glide.with(this).load(RetroUtil.getAlbumArtUri(album.id)).placeholder(R.drawable.default_album_art) + .error(R.drawable.default_album_art) + .dontTransform() + .dontAnimate().into(image)*/ + SongGlideRequest.Builder.from(Glide.with(this), album.safeGetFirstSong()) - .checkIgnoreMediaStore(this).generatePalette(this).build().dontAnimate().dontTransform() + .checkIgnoreMediaStore(this) + .ignoreMediaStore(PreferenceUtil.getInstance(this).ignoreMediaStoreArtwork()) + .generatePalette(this) + .build().dontAnimate().dontTransform() .into(object : RetroMusicColoredTarget(image) { override fun onColorReady(color: Int) { setColors(color) diff --git a/app/src/main/java/code/name/monkey/retromusic/glide/SongGlideRequest.java b/app/src/main/java/code/name/monkey/retromusic/glide/SongGlideRequest.java index 1696865c..71ee1629 100644 --- a/app/src/main/java/code/name/monkey/retromusic/glide/SongGlideRequest.java +++ b/app/src/main/java/code/name/monkey/retromusic/glide/SongGlideRequest.java @@ -41,15 +41,16 @@ import code.name.monkey.retromusic.util.PreferenceUtil; */ public class SongGlideRequest { - public static final DiskCacheStrategy DEFAULT_DISK_CACHE_STRATEGY = DiskCacheStrategy.NONE; - public static final int DEFAULT_ERROR_IMAGE = R.drawable.default_album_art; - public static final int DEFAULT_ANIMATION = android.R.anim.fade_in; + private static final DiskCacheStrategy DEFAULT_DISK_CACHE_STRATEGY = DiskCacheStrategy.NONE; + private static final int DEFAULT_ERROR_IMAGE = R.drawable.default_album_art; + private static final int DEFAULT_ANIMATION = android.R.anim.fade_in; public static class Builder { final RequestManager requestManager; final Song song; boolean ignoreMediaStore; + @NonNull public static Builder from(@NonNull RequestManager requestManager, Song song) { return new Builder(requestManager, song); } @@ -59,23 +60,28 @@ public class SongGlideRequest { this.song = song; } - public PaletteBuilder generatePalette(Context context) { + @NonNull + public PaletteBuilder generatePalette(@NonNull Context context) { return new PaletteBuilder(this, context); } + @NonNull public BitmapBuilder asBitmap() { return new BitmapBuilder(this); } - public Builder checkIgnoreMediaStore(Context context) { + @NonNull + public Builder checkIgnoreMediaStore(@NonNull Context context) { return ignoreMediaStore(PreferenceUtil.getInstance(context).ignoreMediaStoreArtwork()); } + @NonNull public Builder ignoreMediaStore(boolean ignoreMediaStore) { this.ignoreMediaStore = ignoreMediaStore; return this; } + @NonNull public DrawableRequestBuilder build() { //noinspection unchecked return createBaseRequest(requestManager, song, ignoreMediaStore) @@ -125,7 +131,10 @@ public class SongGlideRequest { } } - public static DrawableTypeRequest createBaseRequest(RequestManager requestManager, Song song, boolean ignoreMediaStore) { + @NonNull + private static DrawableTypeRequest createBaseRequest(@NonNull RequestManager requestManager, + @NonNull Song song, + boolean ignoreMediaStore) { if (ignoreMediaStore) { return requestManager.load(new AudioFileCover(song.getData())); } else { @@ -133,7 +142,8 @@ public class SongGlideRequest { } } - public static Key createSignature(Song song) { + @NonNull + private static Key createSignature(@NonNull Song song) { return new MediaStoreSignature("", song.getDateModified(), 0); } } diff --git a/app/src/main/java/code/name/monkey/retromusic/util/MusicUtil.java b/app/src/main/java/code/name/monkey/retromusic/util/MusicUtil.java index eca52b84..86483e4b 100644 --- a/app/src/main/java/code/name/monkey/retromusic/util/MusicUtil.java +++ b/app/src/main/java/code/name/monkey/retromusic/util/MusicUtil.java @@ -58,10 +58,9 @@ public class MusicUtil { public static final String TAG = MusicUtil.class.getSimpleName(); private static Playlist playlist; + @NonNull public static Uri getMediaStoreAlbumCoverUri(int albumId) { - final Uri sArtworkUri = Uri - .parse("content://media/external/audio/albumart"); - + final Uri sArtworkUri = Uri.parse("content://media/external/audio/albumart"); return ContentUris.withAppendedId(sArtworkUri, albumId); } diff --git a/app/src/main/java/code/name/monkey/retromusic/util/RetroUtil.java b/app/src/main/java/code/name/monkey/retromusic/util/RetroUtil.java index 601d1770..36f65da4 100755 --- a/app/src/main/java/code/name/monkey/retromusic/util/RetroUtil.java +++ b/app/src/main/java/code/name/monkey/retromusic/util/RetroUtil.java @@ -58,10 +58,6 @@ public class RetroUtil { return (int) (dpWidth / 180); } - public static Uri getAlbumArtUri(long paramInt) { - return ContentUris.withAppendedId(Uri.parse("content://media/external/audio/albumart"), paramInt); - } - public static boolean isTablet() { return App.Companion.getContext().getResources().getConfiguration().smallestScreenWidthDp >= 600; } diff --git a/app/src/main/res/drawable-xxxhdpi/np_tiny.webp b/app/src/main/res/drawable-xxxhdpi/np_tiny.webp index 3cc976cd..780f8815 100644 Binary files a/app/src/main/res/drawable-xxxhdpi/np_tiny.webp and b/app/src/main/res/drawable-xxxhdpi/np_tiny.webp differ diff --git a/app/src/main/res/layout/abs_playlists.xml b/app/src/main/res/layout/abs_playlists.xml index ead07cc6..1107b4cd 100644 --- a/app/src/main/res/layout/abs_playlists.xml +++ b/app/src/main/res/layout/abs_playlists.xml @@ -1,7 +1,6 @@ + app:layout_constraintTop_toBottomOf="@+id/v1" /> @@ -78,8 +76,7 @@ android:text="@string/last_added" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/v2" - tools:text="@tools:sample/lorem" /> + app:layout_constraintTop_toBottomOf="@+id/v2" /> @@ -115,8 +112,7 @@ android:text="@string/my_top_tracks" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/v3" - tools:text="@tools:sample/lorem" /> + app:layout_constraintTop_toBottomOf="@+id/v3" /> @@ -152,8 +148,7 @@ android:text="@string/shuffle" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/v4" - tools:text="@tools:sample/lorem" /> + app:layout_constraintTop_toBottomOf="@+id/v4" /> diff --git a/app/src/main/res/layout/fragment_plain_player.xml b/app/src/main/res/layout/fragment_plain_player.xml index d0a66c0a..28e75a69 100644 --- a/app/src/main/res/layout/fragment_plain_player.xml +++ b/app/src/main/res/layout/fragment_plain_player.xml @@ -57,7 +57,6 @@ android:ellipsize="end" android:maxLines="1" android:paddingTop="8dp" - android:textColor="?colorOnBackground" tools:text="Text" /> diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml index 0fcbd99c..568ace1a 100644 --- a/app/src/main/res/values/attrs.xml +++ b/app/src/main/res/values/attrs.xml @@ -5,73 +5,14 @@ - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/values/baseline_textview_attrs.xml b/app/src/main/res/values/baseline_textview_attrs.xml new file mode 100644 index 00000000..5d70ed11 --- /dev/null +++ b/app/src/main/res/values/baseline_textview_attrs.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/color_icon_view_attrs.xml b/app/src/main/res/values/color_icon_view_attrs.xml new file mode 100644 index 00000000..f5476840 --- /dev/null +++ b/app/src/main/res/values/color_icon_view_attrs.xml @@ -0,0 +1,21 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/contributor_attrs.xml b/app/src/main/res/values/contributor_attrs.xml new file mode 100644 index 00000000..fb21402b --- /dev/null +++ b/app/src/main/res/values/contributor_attrs.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/lrc_view_attrs.xml b/app/src/main/res/values/lrc_view_attrs.xml new file mode 100644 index 00000000..e26803d7 --- /dev/null +++ b/app/src/main/res/values/lrc_view_attrs.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file