diff --git a/app/build.gradle b/app/build.gradle
index f43cd5a4..cfe2f3f6 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -32,8 +32,8 @@ android {
vectorDrawables.useSupportLibrary = true
applicationId "code.name.monkey.retromusic"
- versionCode 292
- versionName '3.1.100'
+ versionCode 295
+ versionName '3.1.200'
multiDexEnabled true
diff --git a/app/src/main/assets/retro-changelog.html b/app/src/main/assets/retro-changelog.html
index 6f7edf82..4fc520a8 100644
--- a/app/src/main/assets/retro-changelog.html
+++ b/app/src/main/assets/retro-changelog.html
@@ -1 +1 @@
-
v3.1.100
- Fix Crash in Album tag editor while selecting options
- Added Classic theme
- Added Filter song length
- Added Favourites playlist icon will be accent color
- Added Colorful settings icons
- Added Corners for dialog
v3.0.570
- Fix Album/Artist square image
- Fix Delete dialog text format
- Fix Profile picture not showing after coming back from folders
- Fix Play button color i Simple and Plain themes
- Fix Sleep timer dialog crashing
- Fix Share song dialog title and text
If you see entire app white or dark or black select same theme in settings to fix
FAQ's
*If you face any UI related issues you clear app data and cache, if its
not working try to
uninstall and install again.
\ No newline at end of file
+
v3.1.230
- Improved full theme appearances
- Now playing theme preview updated
- Fix composer error
v3.1.200
- Added composer sort and editing
- Fix Crash in Album tag editor while selecting options
- Added Filter song length
- Added Favourites playlist icon will be accent color
- Added Colorful settings icons
- Added Corners for dialog
v3.0.570
- Fix Album/Artist square image
- Fix Delete dialog text format
- Fix Profile picture not showing after coming back from folders
- Fix Play button color i Simple and Plain themes
- Fix Sleep timer dialog crashing
- Fix Share song dialog title and text
If you see entire app white or dark or black select same theme in settings to fix
FAQ's
*If you face any UI related issues you clear app data and cache, if its
not working try to
uninstall and install again.
\ No newline at end of file
diff --git a/app/src/main/java/code/name/monkey/retromusic/Constants.kt b/app/src/main/java/code/name/monkey/retromusic/Constants.kt
index ec6742ab..4329fea2 100644
--- a/app/src/main/java/code/name/monkey/retromusic/Constants.kt
+++ b/app/src/main/java/code/name/monkey/retromusic/Constants.kt
@@ -81,6 +81,7 @@ object Constants {
val CAST_SERVER_PORT = 8080
const val BASE_SELECTION = MediaStore.Audio.AudioColumns.IS_MUSIC + "=1" + " AND " + MediaStore.Audio.AudioColumns.TITLE + " != ''"
+
@JvmField
val BASE_PROJECTION = arrayOf(BaseColumns._ID, // 0
MediaStore.Audio.AudioColumns.TITLE, // 1
@@ -92,7 +93,8 @@ object Constants {
MediaStore.Audio.AudioColumns.ALBUM_ID, // 7
MediaStore.Audio.AudioColumns.ALBUM, // 8
MediaStore.Audio.AudioColumns.ARTIST_ID, // 9
- MediaStore.Audio.AudioColumns.ARTIST)// 10
+ MediaStore.Audio.AudioColumns.ARTIST,// 10
+ MediaStore.Audio.AudioColumns.COMPOSER)// 11
const val NUMBER_OF_TOP_TRACKS = 99
diff --git a/app/src/main/java/code/name/monkey/retromusic/extensions/ViewExtensions.kt b/app/src/main/java/code/name/monkey/retromusic/extensions/ViewExtensions.kt
new file mode 100644
index 00000000..86b61231
--- /dev/null
+++ b/app/src/main/java/code/name/monkey/retromusic/extensions/ViewExtensions.kt
@@ -0,0 +1,22 @@
+package code.name.monkey.retromusic.extensions
+
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import androidx.annotation.LayoutRes
+
+
+@Suppress("UNCHECKED_CAST")
+fun ViewGroup.inflate(@LayoutRes layout: Int): T {
+ return LayoutInflater.from(context).inflate(layout, this, false) as T
+}
+
+fun View.show() {
+ visibility = View.VISIBLE
+}
+
+fun View.hide() {
+ visibility = View.GONE
+}
+
+fun View.showOrHide(show: Boolean) = if (show) show() else hide()
\ No newline at end of file
diff --git a/app/src/main/java/code/name/monkey/retromusic/glide/RetroGlideExtension.java b/app/src/main/java/code/name/monkey/retromusic/glide/RetroGlideExtension.java
index 338ed471..7d0226ed 100644
--- a/app/src/main/java/code/name/monkey/retromusic/glide/RetroGlideExtension.java
+++ b/app/src/main/java/code/name/monkey/retromusic/glide/RetroGlideExtension.java
@@ -1,7 +1,5 @@
package code.name.monkey.retromusic.glide;
-import androidx.annotation.NonNull;
-
import com.bumptech.glide.GenericTransitionOptions;
import com.bumptech.glide.Priority;
import com.bumptech.glide.RequestBuilder;
@@ -10,11 +8,11 @@ import com.bumptech.glide.annotation.GlideOption;
import com.bumptech.glide.annotation.GlideType;
import com.bumptech.glide.load.Key;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
-import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions;
import com.bumptech.glide.request.RequestOptions;
import com.bumptech.glide.request.target.Target;
import com.bumptech.glide.signature.MediaStoreSignature;
+import androidx.annotation.NonNull;
import code.name.monkey.retromusic.App;
import code.name.monkey.retromusic.R;
import code.name.monkey.retromusic.glide.artistimage.ArtistImage;
diff --git a/app/src/main/java/code/name/monkey/retromusic/helper/SortOrder.kt b/app/src/main/java/code/name/monkey/retromusic/helper/SortOrder.kt
index e79a290f..44baba09 100644
--- a/app/src/main/java/code/name/monkey/retromusic/helper/SortOrder.kt
+++ b/app/src/main/java/code/name/monkey/retromusic/helper/SortOrder.kt
@@ -92,6 +92,9 @@ class SortOrder {
/* Song sort order date */
const val SONG_DATE = MediaStore.Audio.Media.DATE_ADDED + " DESC"
+
+ /* Song sort order composer*/
+ const val COMPOSER = MediaStore.Audio.Media.COMPOSER
}
}
diff --git a/app/src/main/java/code/name/monkey/retromusic/loaders/PlaylistSongsLoader.kt b/app/src/main/java/code/name/monkey/retromusic/loaders/PlaylistSongsLoader.kt
index 9c69ffeb..e0b9a802 100644
--- a/app/src/main/java/code/name/monkey/retromusic/loaders/PlaylistSongsLoader.kt
+++ b/app/src/main/java/code/name/monkey/retromusic/loaders/PlaylistSongsLoader.kt
@@ -56,8 +56,9 @@ object PlaylistSongsLoader {
val artistId = cursor.getInt(9)
val artistName = cursor.getString(10)
val idInPlaylist = cursor.getInt(11)
+ val composer = cursor.getString(12)
- return PlaylistSong(id, title, trackNumber, year, duration, data, dateModified, albumId, albumName, artistId, artistName, playlistId, idInPlaylist)
+ return PlaylistSong(id, title, trackNumber, year, duration, data, dateModified, albumId, albumName, artistId, artistName, playlistId, idInPlaylist, composer)
}
private fun makePlaylistSongCursor(@NonNull context: Context, playlistId: Int): Cursor? {
@@ -75,7 +76,8 @@ object PlaylistSongsLoader {
AudioColumns.ALBUM, // 8
AudioColumns.ARTIST_ID, // 9
AudioColumns.ARTIST, // 10
- MediaStore.Audio.Playlists.Members._ID)// 11
+ MediaStore.Audio.Playlists.Members._ID,//11
+ AudioColumns.COMPOSER)// 12
, BASE_SELECTION, null,
MediaStore.Audio.Playlists.Members.DEFAULT_SORT_ORDER)
} catch (e: SecurityException) {
diff --git a/app/src/main/java/code/name/monkey/retromusic/loaders/SongLoader.kt b/app/src/main/java/code/name/monkey/retromusic/loaders/SongLoader.kt
index 34651232..3ea3ba71 100644
--- a/app/src/main/java/code/name/monkey/retromusic/loaders/SongLoader.kt
+++ b/app/src/main/java/code/name/monkey/retromusic/loaders/SongLoader.kt
@@ -57,10 +57,10 @@ object SongLoader {
val albumName = cursor.getString(8)
val artistId = cursor.getInt(9)
val artistName = cursor.getString(10)
+ val composer = cursor.getString(11)
- return Song(id, title, trackNumber, year, duration, data, dateModified, albumId, albumName
- ?: "",
- artistId, artistName)
+ return Song(id, title, trackNumber, year, duration, data, dateModified, albumId,
+ albumName ?: "", artistId, artistName, composer ?: "")
}
@JvmOverloads
diff --git a/app/src/main/java/code/name/monkey/retromusic/model/PlaylistSong.java b/app/src/main/java/code/name/monkey/retromusic/model/PlaylistSong.java
index c44f1f6a..d603c684 100644
--- a/app/src/main/java/code/name/monkey/retromusic/model/PlaylistSong.java
+++ b/app/src/main/java/code/name/monkey/retromusic/model/PlaylistSong.java
@@ -3,17 +3,30 @@ package code.name.monkey.retromusic.model;
import android.os.Parcel;
public class PlaylistSong extends Song {
- public static PlaylistSong EMPTY_PLAYLIST_SONG = new PlaylistSong(-1, "", -1, -1, -1, "", -1, -1, "", -1, "", -1, -1);
+ public static final Creator CREATOR = new Creator() {
+ public PlaylistSong createFromParcel(Parcel source) {
+ return new PlaylistSong(source);
+ }
+ public PlaylistSong[] newArray(int size) {
+ return new PlaylistSong[size];
+ }
+ };
public final int playlistId;
public final int idInPlayList;
- public PlaylistSong(int id, String title, int trackNumber, int year, long duration, String data, int dateModified, int albumId, String albumName, int artistId, String artistName, final int playlistId, final int idInPlayList) {
- super(id, title, trackNumber, year, duration, data, dateModified, albumId, albumName, artistId, artistName);
+ public PlaylistSong(int id, String title, int trackNumber, int year, long duration, String data, int dateModified, int albumId, String albumName, int artistId, String artistName, final int playlistId, final int idInPlayList, String composer) {
+ super(id, title, trackNumber, year, duration, data, dateModified, albumId, albumName, artistId, artistName, composer);
this.playlistId = playlistId;
this.idInPlayList = idInPlayList;
}
+ protected PlaylistSong(Parcel in) {
+ super(in);
+ this.playlistId = in.readInt();
+ this.idInPlayList = in.readInt();
+ }
+
@Override
public boolean equals(Object o) {
if (this == o) return true;
@@ -44,7 +57,6 @@ public class PlaylistSong extends Song {
'}';
}
-
@Override
public int describeContents() {
return 0;
@@ -56,20 +68,4 @@ public class PlaylistSong extends Song {
dest.writeInt(this.playlistId);
dest.writeInt(this.idInPlayList);
}
-
- protected PlaylistSong(Parcel in) {
- super(in);
- this.playlistId = in.readInt();
- this.idInPlayList = in.readInt();
- }
-
- public static final Creator CREATOR = new Creator() {
- public PlaylistSong createFromParcel(Parcel source) {
- return new PlaylistSong(source);
- }
-
- public PlaylistSong[] newArray(int size) {
- return new PlaylistSong[size];
- }
- };
}
diff --git a/app/src/main/java/code/name/monkey/retromusic/model/Song.java b/app/src/main/java/code/name/monkey/retromusic/model/Song.java
index 05e33a23..186fb9d2 100644
--- a/app/src/main/java/code/name/monkey/retromusic/model/Song.java
+++ b/app/src/main/java/code/name/monkey/retromusic/model/Song.java
@@ -7,8 +7,16 @@ import android.os.Parcelable;
* @author Karim Abou Zeid (kabouzeid)
*/
public class Song implements Parcelable {
- public static final Song EMPTY_SONG = new Song(-1, "", -1, -1, -1, "", -1, -1, "", -1, "");
+ public static final Song EMPTY_SONG = new Song(-1, "", -1, -1, -1, "", -1, -1, "", -1, "", "");
+ public static final Creator CREATOR = new Creator() {
+ public Song createFromParcel(Parcel source) {
+ return new Song(source);
+ }
+ public Song[] newArray(int size) {
+ return new Song[size];
+ }
+ };
public final int id;
public final String title;
public final int trackNumber;
@@ -20,8 +28,9 @@ public class Song implements Parcelable {
public final String albumName;
public final int artistId;
public final String artistName;
+ public final String composer;
- public Song(int id, String title, int trackNumber, int year, long duration, String data, long dateModified, int albumId, String albumName, int artistId, String artistName) {
+ public Song(int id, String title, int trackNumber, int year, long duration, String data, long dateModified, int albumId, String albumName, int artistId, String artistName, String composer) {
this.id = id;
this.title = title;
this.trackNumber = trackNumber;
@@ -33,61 +42,22 @@ public class Song implements Parcelable {
this.albumName = albumName;
this.artistId = artistId;
this.artistName = artistName;
+ this.composer = composer;
}
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- Song song = (Song) o;
-
- if (id != song.id) return false;
- if (trackNumber != song.trackNumber) return false;
- if (year != song.year) return false;
- if (duration != song.duration) return false;
- if (dateModified != song.dateModified) return false;
- if (albumId != song.albumId) return false;
- if (artistId != song.artistId) return false;
- if (title != null ? !title.equals(song.title) : song.title != null) return false;
- if (data != null ? !data.equals(song.data) : song.data != null) return false;
- if (albumName != null ? !albumName.equals(song.albumName) : song.albumName != null)
- return false;
- return artistName != null ? artistName.equals(song.artistName) : song.artistName == null;
-
- }
-
- @Override
- public int hashCode() {
- int result = id;
- result = 31 * result + (title != null ? title.hashCode() : 0);
- result = 31 * result + trackNumber;
- result = 31 * result + year;
- result = 31 * result + (int) (duration ^ (duration >>> 32));
- result = 31 * result + (data != null ? data.hashCode() : 0);
- result = 31 * result + (int) (dateModified ^ (dateModified >>> 32));
- result = 31 * result + albumId;
- result = 31 * result + (albumName != null ? albumName.hashCode() : 0);
- result = 31 * result + artistId;
- result = 31 * result + (artistName != null ? artistName.hashCode() : 0);
- return result;
- }
-
- @Override
- public String toString() {
- return "Song{" +
- "id=" + id +
- ", title='" + title + '\'' +
- ", trackNumber=" + trackNumber +
- ", year=" + year +
- ", duration=" + duration +
- ", data='" + data + '\'' +
- ", dateModified=" + dateModified +
- ", albumId=" + albumId +
- ", albumName='" + albumName + '\'' +
- ", artistId=" + artistId +
- ", artistName='" + artistName + '\'' +
- '}';
+ protected Song(Parcel in) {
+ this.id = in.readInt();
+ this.title = in.readString();
+ this.trackNumber = in.readInt();
+ this.year = in.readInt();
+ this.duration = in.readLong();
+ this.data = in.readString();
+ this.dateModified = in.readLong();
+ this.albumId = in.readInt();
+ this.albumName = in.readString();
+ this.artistId = in.readInt();
+ this.artistName = in.readString();
+ this.composer = in.readString();
}
@@ -109,29 +79,6 @@ public class Song implements Parcelable {
dest.writeString(this.albumName);
dest.writeInt(this.artistId);
dest.writeString(this.artistName);
+ dest.writeString(this.composer);
}
-
- protected Song(Parcel in) {
- this.id = in.readInt();
- this.title = in.readString();
- this.trackNumber = in.readInt();
- this.year = in.readInt();
- this.duration = in.readLong();
- this.data = in.readString();
- this.dateModified = in.readLong();
- this.albumId = in.readInt();
- this.albumName = in.readString();
- this.artistId = in.readInt();
- this.artistName = in.readString();
- }
-
- public static final Creator CREATOR = new Creator() {
- public Song createFromParcel(Parcel source) {
- return new Song(source);
- }
-
- public Song[] newArray(int size) {
- return new Song[size];
- }
- };
}
diff --git a/app/src/main/java/code/name/monkey/retromusic/providers/MusicPlaybackQueueStore.java b/app/src/main/java/code/name/monkey/retromusic/providers/MusicPlaybackQueueStore.java
index 1e7c652f..36c055f8 100644
--- a/app/src/main/java/code/name/monkey/retromusic/providers/MusicPlaybackQueueStore.java
+++ b/app/src/main/java/code/name/monkey/retromusic/providers/MusicPlaybackQueueStore.java
@@ -41,7 +41,7 @@ public class MusicPlaybackQueueStore extends SQLiteOpenHelper {
public static final String DATABASE_NAME = "music_playback_state.db";
public static final String PLAYING_QUEUE_TABLE_NAME = "playing_queue";
public static final String ORIGINAL_PLAYING_QUEUE_TABLE_NAME = "original_playing_queue";
- private static final int VERSION = 5;
+ private static final int VERSION = 7;
@Nullable
private static MusicPlaybackQueueStore sInstance = null;
@@ -50,7 +50,7 @@ public class MusicPlaybackQueueStore extends SQLiteOpenHelper {
*
* @param context The {@link Context} to use
*/
- public MusicPlaybackQueueStore(final Context context) {
+ public MusicPlaybackQueueStore(final @NonNull Context context) {
super(context, DATABASE_NAME, null, VERSION);
}
@@ -110,6 +110,9 @@ public class MusicPlaybackQueueStore extends SQLiteOpenHelper {
builder.append(" INT NOT NULL,");
builder.append(AudioColumns.ARTIST);
+ builder.append(" STRING NOT NULL,");
+
+ builder.append(AudioColumns.COMPOSER);
builder.append(" STRING NOT NULL);");
db.execSQL(builder.toString());
@@ -173,6 +176,7 @@ public class MusicPlaybackQueueStore extends SQLiteOpenHelper {
values.put(AudioColumns.ALBUM, song.albumName);
values.put(AudioColumns.ARTIST_ID, song.artistId);
values.put(AudioColumns.ARTIST, song.artistName);
+ values.put(AudioColumns.COMPOSER, song.composer);
database.insert(tableName, null, values);
}
diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/activities/base/AbsSlidingMusicPanelActivity.kt b/app/src/main/java/code/name/monkey/retromusic/ui/activities/base/AbsSlidingMusicPanelActivity.kt
index 74155697..36236f32 100644
--- a/app/src/main/java/code/name/monkey/retromusic/ui/activities/base/AbsSlidingMusicPanelActivity.kt
+++ b/app/src/main/java/code/name/monkey/retromusic/ui/activities/base/AbsSlidingMusicPanelActivity.kt
@@ -192,7 +192,7 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(), Sliding
NowPlayingScreen.SIMPLE -> SimplePlayerFragment()
NowPlayingScreen.MATERIAL -> MaterialFragment()
NowPlayingScreen.COLOR -> ColorFragment()
- NowPlayingScreen.CLASSIC -> ClassicPlayerFragment()
+ //NowPlayingScreen.CLASSIC -> ClassicPlayerFragment()
else -> PlayerFragment()
} // must implement AbsPlayerFragment
supportFragmentManager.beginTransaction().replace(R.id.playerFragmentContainer, fragment).commit()
@@ -260,7 +260,7 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(), Sliding
super.setLightNavigationBar(true)
super.setLightStatusbar(isColorLight)
} else if (currentNowPlayingScreen == NowPlayingScreen.FULL || currentNowPlayingScreen == NowPlayingScreen.CARD ||
- currentNowPlayingScreen == NowPlayingScreen.FIT || currentNowPlayingScreen == NowPlayingScreen.CLASSIC ||
+ currentNowPlayingScreen == NowPlayingScreen.FIT || /*currentNowPlayingScreen == NowPlayingScreen.CLASSIC ||*/
currentNowPlayingScreen == NowPlayingScreen.BLUR || currentNowPlayingScreen == NowPlayingScreen.BLUR_CARD) {
super.setLightStatusbar(false)
super.setLightNavigationBar(true)
diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/activities/tageditor/AbsTagEditorActivity.kt b/app/src/main/java/code/name/monkey/retromusic/ui/activities/tageditor/AbsTagEditorActivity.kt
index 0a8208c5..2465420b 100755
--- a/app/src/main/java/code/name/monkey/retromusic/ui/activities/tageditor/AbsTagEditorActivity.kt
+++ b/app/src/main/java/code/name/monkey/retromusic/ui/activities/tageditor/AbsTagEditorActivity.kt
@@ -67,6 +67,15 @@ abstract class AbsTagEditorActivity : AbsBaseActivity() {
}
}
+ protected val composer: String?
+ get() {
+ return try {
+ getAudioFile(songPaths!![0]).tagOrCreateAndSetDefault.getFirst(FieldKey.COMPOSER)
+ } catch (ignored: Exception) {
+ null
+ }
+
+ }
protected val albumTitle: String?
get() {
diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/activities/tageditor/SongTagEditorActivity.kt b/app/src/main/java/code/name/monkey/retromusic/ui/activities/tageditor/SongTagEditorActivity.kt
index f16aa273..d7504337 100755
--- a/app/src/main/java/code/name/monkey/retromusic/ui/activities/tageditor/SongTagEditorActivity.kt
+++ b/app/src/main/java/code/name/monkey/retromusic/ui/activities/tageditor/SongTagEditorActivity.kt
@@ -51,6 +51,7 @@ class SongTagEditorActivity : AbsTagEditorActivity(), TextWatcher {
yearText.addTextChangedListener(this)
trackNumberText.addTextChangedListener(this)
lyricsText.addTextChangedListener(this)
+ songComposerText.addTextChangedListener(this)
}
private fun fillViewsWithFileTags() {
@@ -62,6 +63,7 @@ class SongTagEditorActivity : AbsTagEditorActivity(), TextWatcher {
yearText.setText(songYear)
trackNumberText.setText(trackNumber)
lyricsText.setText(lyrics)
+ songComposerText.setText(composer)
}
override fun loadCurrentImage() {
@@ -90,6 +92,7 @@ class SongTagEditorActivity : AbsTagEditorActivity(), TextWatcher {
fieldKeyValueMap[FieldKey.TRACK] = trackNumberText.text.toString()
fieldKeyValueMap[FieldKey.LYRICS] = lyricsText.text.toString()
fieldKeyValueMap[FieldKey.ALBUM_ARTIST] = albumArtistText.text.toString()
+ fieldKeyValueMap[FieldKey.COMPOSER] = songComposerText.text.toString()
writeValuesToFiles(fieldKeyValueMap, null)
}
diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/adapter/base/AbsMultiSelectAdapter.java b/app/src/main/java/code/name/monkey/retromusic/ui/adapter/base/AbsMultiSelectAdapter.java
index d557916f..6718654e 100644
--- a/app/src/main/java/code/name/monkey/retromusic/ui/adapter/base/AbsMultiSelectAdapter.java
+++ b/app/src/main/java/code/name/monkey/retromusic/ui/adapter/base/AbsMultiSelectAdapter.java
@@ -2,6 +2,7 @@ package code.name.monkey.retromusic.ui.adapter.base;
import android.content.Context;
import androidx.annotation.MenuRes;
+import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;
import android.view.Menu;
@@ -23,7 +24,7 @@ public abstract class AbsMultiSelectAdapter checked;
private int menuRes;
- public AbsMultiSelectAdapter(Context context, @Nullable CabHolder cabHolder, @MenuRes int menuRes) {
+ public AbsMultiSelectAdapter(@NonNull Context context, @Nullable CabHolder cabHolder, @MenuRes int menuRes) {
this.cabHolder = cabHolder;
checked = new ArrayList<>();
this.menuRes = menuRes;
diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/NowPlayingScreen.kt b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/NowPlayingScreen.kt
index 84ed5160..a84eea0c 100644
--- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/NowPlayingScreen.kt
+++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/NowPlayingScreen.kt
@@ -14,13 +14,13 @@ enum class NowPlayingScreen constructor(@param:StringRes @field:StringRes
BLUR_CARD(R.string.blur_card, R.drawable.np_blur_card, 9),
CARD(R.string.card, R.drawable.np_card, 6),
COLOR(R.string.color, R.drawable.np_color, 5),
- FIT(R.string.fit, R.drawable.np_adaptive, 12),
+ FIT(R.string.fit, R.drawable.np_fit, 12),
FLAT(R.string.flat, R.drawable.np_flat, 1),
FULL(R.string.full, R.drawable.np_full, 2),
MATERIAL(R.string.material, R.drawable.np_material, 11),
NORMAL(R.string.normal, R.drawable.np_normal, 0),
PLAIN(R.string.plain, R.drawable.np_plain, 3),
- CLASSIC(R.string.classic, R.drawable.np_normal, 7),
+ //CLASSIC(R.string.classic, R.drawable.np_normal, 7),
SIMPLE(R.string.simple, R.drawable.np_simple, 8)
}
diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/VolumeFragment.kt b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/VolumeFragment.kt
index 307f544c..67c6d393 100755
--- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/VolumeFragment.kt
+++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/VolumeFragment.kt
@@ -107,9 +107,8 @@ class VolumeFragment : Fragment(), SeekBar.OnSeekBarChangeListener, OnAudioVolum
}
-
fun setTintable(color: Int) {
- TintHelper.setTintAuto(volumeSeekBar, color, false)
+ TintHelper.setTintAuto(volumeSeekBar, color, true)
}
fun removeThumb() {
diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/base/AbsPlayerFragment.kt b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/base/AbsPlayerFragment.kt
index 78ae3e6d..fbb9aeec 100644
--- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/base/AbsPlayerFragment.kt
+++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/base/AbsPlayerFragment.kt
@@ -194,7 +194,7 @@ abstract class AbsPlayerFragment : AbsMusicServiceFragment(), Toolbar.OnMenuItem
else
code.name.monkey.retromusic.R.drawable.ic_favorite_border_white_24dp
val drawable = RetroUtil.getTintedVectorDrawable(activity, res, toolbarIconColor())
- toolbarGet().menu.findItem(R.id.action_toggle_favorite).setIcon(drawable).title = if (isFavorite) getString(R.string.action_remove_from_favorites) else getString(R.string.action_add_to_favorites)
+ toolbarGet().menu.findItem(R.id.action_toggle_favorite)?.setIcon(drawable)?.title = if (isFavorite) getString(R.string.action_remove_from_favorites) else getString(R.string.action_add_to_favorites)
}
}
}.execute(MusicPlayerRemote.currentSong)
diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/mainactivity/LibraryFragment.java b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/mainactivity/LibraryFragment.java
index bd5a9f0d..9309c359 100644
--- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/mainactivity/LibraryFragment.java
+++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/mainactivity/LibraryFragment.java
@@ -44,7 +44,6 @@ import code.name.monkey.retromusic.loaders.SongLoader;
import code.name.monkey.retromusic.ui.activities.SettingsActivity;
import code.name.monkey.retromusic.ui.fragments.base.AbsLibraryPagerRecyclerViewCustomGridSizeFragment;
import code.name.monkey.retromusic.ui.fragments.base.AbsMainActivityFragment;
-import code.name.monkey.retromusic.ui.fragments.mainactivity.home.BannerHomeFragment;
import code.name.monkey.retromusic.util.Compressor;
import code.name.monkey.retromusic.util.NavigationUtil;
import code.name.monkey.retromusic.util.PreferenceUtil;
@@ -69,13 +68,7 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
private MaterialCab cab;
private FragmentManager fragmentManager;
private ImageView userImage;
- private CompositeDisposable disposable ;
-
- @Override
- public void onDestroyView() {
- super.onDestroyView();
- disposable.dispose();
- }
+ private CompositeDisposable disposable;
public static Fragment newInstance(int tab) {
Bundle args = new Bundle();
@@ -89,6 +82,12 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
return new LibraryFragment();
}
+ @Override
+ public void onDestroyView() {
+ super.onDestroyView();
+ disposable.dispose();
+ }
+
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
@@ -295,9 +294,10 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
.setChecked(currentSortOrder.equals(SortOrder.SongSortOrder.SONG_ALBUM));
sortOrderMenu.add(0, R.id.action_song_sort_order_year, 4, R.string.sort_order_year)
.setChecked(currentSortOrder.equals(SortOrder.SongSortOrder.SONG_YEAR));
- sortOrderMenu.add(0, R.id.action_song_sort_order_date, 4, R.string.sort_order_date)
+ sortOrderMenu.add(0, R.id.action_song_sort_order_date, 5, R.string.sort_order_date)
.setChecked(currentSortOrder.equals(SortOrder.SongSortOrder.SONG_DATE));
-
+ sortOrderMenu.add(0, R.id.action_song_sort_order_composer, 6, R.string.sort_order_composer)
+ .setChecked(currentSortOrder.equals(SortOrder.SongSortOrder.COMPOSER));
}
sortOrderMenu.setGroupCheckable(0, true, true);
@@ -351,6 +351,9 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
case R.id.action_song_sort_order_date:
sortOrder = SortOrder.SongSortOrder.SONG_DATE;
break;
+ case R.id.action_song_sort_order_composer:
+ sortOrder = SortOrder.SongSortOrder.COMPOSER;
+ break;
}
}
diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/mainactivity/home/BannerHomeFragment.kt b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/mainactivity/home/BannerHomeFragment.kt
index 047b2bf8..49789339 100644
--- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/mainactivity/home/BannerHomeFragment.kt
+++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/mainactivity/home/BannerHomeFragment.kt
@@ -173,7 +173,6 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
private fun setupToolbar() {
toolbar.navigationIcon = TintHelper.createTintedDrawable(ContextCompat.getDrawable(context!!, R.drawable.ic_search_white_24dp), ThemeStore.textColorSecondary(context!!))
mainActivity.title = null
- mainActivity.setSupportActionBar(toolbar)
toolbar.setBackgroundColor(Color.TRANSPARENT)
}
diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/blur/BlurPlaybackControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/blur/BlurPlaybackControlsFragment.kt
index 95ed2a35..0fb2c592 100644
--- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/blur/BlurPlaybackControlsFragment.kt
+++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/blur/BlurPlaybackControlsFragment.kt
@@ -27,7 +27,6 @@ import code.name.monkey.retromusic.util.MusicUtil
import code.name.monkey.retromusic.util.ViewUtil
import kotlinx.android.synthetic.main.fragment_player_playback_controls.*
import kotlinx.android.synthetic.main.media_button.*
-import kotlinx.android.synthetic.main.player_time.*
class BlurPlaybackControlsFragment : AbsPlayerControlsFragment() {
diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/color/ColorPlaybackControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/color/ColorPlaybackControlsFragment.kt
index ba75e2f6..9e15c50f 100644
--- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/color/ColorPlaybackControlsFragment.kt
+++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/color/ColorPlaybackControlsFragment.kt
@@ -25,7 +25,6 @@ import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment
import code.name.monkey.retromusic.util.MusicUtil
import kotlinx.android.synthetic.main.fragment_player_playback_controls.*
import kotlinx.android.synthetic.main.media_button.*
-import kotlinx.android.synthetic.main.player_time.*
class ColorPlaybackControlsFragment : AbsPlayerControlsFragment() {
diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/fit/FitPlaybackControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/fit/FitPlaybackControlsFragment.kt
index e836ee96..6ff2f6a8 100644
--- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/fit/FitPlaybackControlsFragment.kt
+++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/fit/FitPlaybackControlsFragment.kt
@@ -27,7 +27,6 @@ import code.name.monkey.retromusic.util.MusicUtil
import code.name.monkey.retromusic.util.PreferenceUtil
import kotlinx.android.synthetic.main.fragment_player_playback_controls.*
import kotlinx.android.synthetic.main.media_button.*
-import kotlinx.android.synthetic.main.player_time.*
class FitPlaybackControlsFragment : AbsPlayerControlsFragment() {
diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/flat/FlatPlaybackControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/flat/FlatPlaybackControlsFragment.kt
index a3292173..b0c50770 100644
--- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/flat/FlatPlaybackControlsFragment.kt
+++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/flat/FlatPlaybackControlsFragment.kt
@@ -27,7 +27,6 @@ import code.name.monkey.retromusic.util.MusicUtil
import code.name.monkey.retromusic.util.PreferenceUtil
import code.name.monkey.retromusic.util.ViewUtil
import kotlinx.android.synthetic.main.fragment_flat_player_playback_controls.*
-import kotlinx.android.synthetic.main.player_time.*
class FlatPlaybackControlsFragment : AbsPlayerControlsFragment(), Callback {
diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/full/FullPlaybackControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/full/FullPlaybackControlsFragment.kt
index 83908bb5..5e0bb6c3 100644
--- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/full/FullPlaybackControlsFragment.kt
+++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/full/FullPlaybackControlsFragment.kt
@@ -1,22 +1,32 @@
package code.name.monkey.retromusic.ui.fragments.player.full
import android.animation.ObjectAnimator
+import android.annotation.SuppressLint
+import android.app.AlertDialog
+import android.content.res.ColorStateList
import android.graphics.Color
import android.graphics.PorterDuff
+import android.os.AsyncTask
import android.os.Bundle
import android.view.LayoutInflater
+import android.view.MenuItem
import android.view.View
import android.view.ViewGroup
import android.view.animation.DecelerateInterpolator
import android.view.animation.LinearInterpolator
+import android.widget.PopupMenu
import android.widget.SeekBar
import androidx.core.content.ContextCompat
import code.name.monkey.appthemehelper.ThemeStore
+import code.name.monkey.appthemehelper.util.ColorUtil
+import code.name.monkey.appthemehelper.util.MaterialValueHelper
+import code.name.monkey.appthemehelper.util.TintHelper
import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.helper.MusicPlayerRemote
import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper
import code.name.monkey.retromusic.helper.PlayPauseButtonOnClickHandler
import code.name.monkey.retromusic.misc.SimpleOnSeekbarChangeListener
+import code.name.monkey.retromusic.model.Song
import code.name.monkey.retromusic.service.MusicService
import code.name.monkey.retromusic.ui.fragments.VolumeFragment
import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment
@@ -24,13 +34,12 @@ import code.name.monkey.retromusic.util.MusicUtil
import code.name.monkey.retromusic.util.PreferenceUtil
import code.name.monkey.retromusic.util.ViewUtil
import kotlinx.android.synthetic.main.fragment_full_player_controls.*
-import kotlinx.android.synthetic.main.player_time.*
/**
* Created by hemanths on 20/09/17.
*/
-class FullPlaybackControlsFragment : AbsPlayerControlsFragment() {
+class FullPlaybackControlsFragment : AbsPlayerControlsFragment(), PopupMenu.OnMenuItemClickListener {
private var lastPlaybackControlsColor: Int = 0
private var lastDisabledPlaybackControlsColor: Int = 0
@@ -107,7 +116,11 @@ class FullPlaybackControlsFragment : AbsPlayerControlsFragment() {
} else {
ThemeStore.accentColor(context!!)
}
- setProgressBarColor(colorFinal)
+ text.setTextColor(colorFinal)
+ ViewUtil.setProgressDrawable(progressSlider, colorFinal, true)
+
+ playPauseButton.backgroundTintList = ColorStateList.valueOf(colorFinal)
+ playPauseButton.imageTintList = ColorStateList.valueOf(MaterialValueHelper.getPrimaryTextColor(context, ColorUtil.isColorLight(colorFinal)))
updateRepeatState()
updateShuffleState()
@@ -115,10 +128,6 @@ class FullPlaybackControlsFragment : AbsPlayerControlsFragment() {
}
- private fun setProgressBarColor(dark: Int) {
- ViewUtil.setProgressDrawable(progressSlider, dark)
- }
-
override fun onServiceConnected() {
updatePlayPauseDrawableState()
updateRepeatState()
@@ -130,6 +139,7 @@ class FullPlaybackControlsFragment : AbsPlayerControlsFragment() {
val song = MusicPlayerRemote.currentSong
title.text = song.title
text.text = song.artistName
+ updateIsFavorite()
}
override fun onPlayingMetaChanged() {
@@ -166,6 +176,21 @@ class FullPlaybackControlsFragment : AbsPlayerControlsFragment() {
setUpRepeatButton()
setUpShuffleButton()
setUpProgressSlider()
+ setupFavourite()
+ setupMenu()
+ }
+
+ private fun setupMenu() {
+ playerMenu.setOnClickListener {
+ val popupMenu = PopupMenu(context!!, it)
+ popupMenu.setOnMenuItemClickListener(this)
+ popupMenu.inflate(R.menu.menu_player)
+ popupMenu.show()
+ }
+ }
+
+ override fun onMenuItemClick(item: MenuItem?): Boolean {
+ return (parentFragment as FullPlayerFragment).onMenuItemClick(item!!)
}
private fun setUpPrevNext() {
@@ -231,4 +256,55 @@ class FullPlaybackControlsFragment : AbsPlayerControlsFragment() {
}
}
}
+
+ private fun setupFavourite() {
+ songFavourite?.setOnClickListener {
+ toggleFavorite(MusicPlayerRemote.currentSong)
+ }
+ }
+
+ private fun toggleFavorite(song: Song) {
+ MusicUtil.toggleFavorite(activity!!, song)
+ if (song.id == MusicPlayerRemote.currentSong.id) {
+ updateIsFavorite()
+ }
+ }
+
+ private var updateIsFavoriteTask: AsyncTask<*, *, *>? = null
+
+ @SuppressLint("StaticFieldLeak")
+ fun updateIsFavorite() {
+ if (updateIsFavoriteTask != null) {
+ updateIsFavoriteTask!!.cancel(false)
+ }
+ updateIsFavoriteTask = object : AsyncTask() {
+ override fun doInBackground(vararg params: Song): Boolean? {
+ val activity = activity
+ return if (activity != null) {
+ MusicUtil.isFavorite(getActivity()!!, params[0])
+ } else {
+ cancel(false)
+ null
+ }
+ }
+
+ override fun onPostExecute(isFavorite: Boolean?) {
+ val activity = activity
+ if (activity != null) {
+ val res = if (isFavorite!!)
+ R.drawable.ic_favorite_white_24dp
+ else
+ R.drawable.ic_favorite_border_white_24dp
+
+ val drawable = TintHelper.createTintedDrawable(activity, res, Color.WHITE)
+ songFavourite?.setImageDrawable(drawable)
+ }
+ }
+ }.execute(MusicPlayerRemote.currentSong)
+ }
+
+ fun onFavoriteToggled() {
+ toggleFavorite(MusicPlayerRemote.currentSong)
+ }
+
}
diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/full/FullPlayerFragment.kt b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/full/FullPlayerFragment.kt
index d76f41fc..8d1c182b 100644
--- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/full/FullPlayerFragment.kt
+++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/full/FullPlayerFragment.kt
@@ -8,10 +8,20 @@ import android.view.ViewGroup
import androidx.appcompat.widget.Toolbar
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper
import code.name.monkey.retromusic.R
+import code.name.monkey.retromusic.extensions.hide
+import code.name.monkey.retromusic.extensions.show
+import code.name.monkey.retromusic.glide.GlideApp
+import code.name.monkey.retromusic.glide.RetroGlideExtension
+import code.name.monkey.retromusic.glide.RetroMusicColoredTarget
import code.name.monkey.retromusic.helper.MusicPlayerRemote
+import code.name.monkey.retromusic.loaders.ArtistLoader
import code.name.monkey.retromusic.model.Song
import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerFragment
import code.name.monkey.retromusic.ui.fragments.player.PlayerAlbumCoverFragment
+import code.name.monkey.retromusic.util.NavigationUtil
+import io.reactivex.android.schedulers.AndroidSchedulers
+import io.reactivex.disposables.CompositeDisposable
+import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.fragment_full.*
class FullPlayerFragment : AbsPlayerFragment(), PlayerAlbumCoverFragment.Callbacks {
@@ -26,10 +36,8 @@ class FullPlayerFragment : AbsPlayerFragment(), PlayerAlbumCoverFragment.Callbac
private fun setUpPlayerToolbar() {
playerToolbar.apply {
- inflateMenu(R.menu.menu_player)
setNavigationIcon(R.drawable.ic_close_white_24dp)
setNavigationOnClickListener { activity!!.onBackPressed() }
- setOnMenuItemClickListener(this@FullPlayerFragment)
}
}
@@ -42,6 +50,13 @@ class FullPlayerFragment : AbsPlayerFragment(), PlayerAlbumCoverFragment.Callbac
super.onViewCreated(view, savedInstanceState)
setUpSubFragments()
setUpPlayerToolbar()
+ setupArtist()
+ }
+
+ private fun setupArtist() {
+ artistImage.setOnClickListener {
+ NavigationUtil.goToArtist(activity!!, MusicPlayerRemote.currentSong.artistId)
+ }
}
private fun setUpSubFragments() {
@@ -77,6 +92,7 @@ class FullPlayerFragment : AbsPlayerFragment(), PlayerAlbumCoverFragment.Callbac
override fun onFavoriteToggled() {
toggleFavorite(MusicPlayerRemote.currentSong)
+ fullPlaybackControlsFragment.onFavoriteToggled()
}
override fun toggleFavorite(song: Song) {
@@ -85,4 +101,64 @@ class FullPlayerFragment : AbsPlayerFragment(), PlayerAlbumCoverFragment.Callbac
updateIsFavorite()
}
}
+
+ override fun onServiceConnected() {
+ super.onServiceConnected()
+ updateArtistImage()
+ updateLabel()
+ }
+
+ override fun onPlayingMetaChanged() {
+ super.onPlayingMetaChanged()
+ updateArtistImage()
+ updateLabel()
+ }
+
+ override fun onDestroyView() {
+ super.onDestroyView()
+ compositeDisposable.dispose()
+ }
+
+ private val compositeDisposable = CompositeDisposable()
+
+ private fun updateArtistImage() {
+ compositeDisposable.addAll(ArtistLoader.getArtist(context!!, MusicPlayerRemote.currentSong.artistId)
+ .subscribeOn(Schedulers.io())
+ .observeOn(AndroidSchedulers.mainThread())
+ .subscribe {
+ GlideApp.with(activity!!)
+ .asBitmapPalette()
+ .load(RetroGlideExtension.getArtistModel(it))
+ .transition(RetroGlideExtension.getDefaultTransition())
+ .artistOptions(it)
+ .dontAnimate()
+ .into(object : RetroMusicColoredTarget(artistImage) {
+ override fun onColorReady(color: Int) {
+
+ }
+ })
+ })
+ }
+
+ override fun onQueueChanged() {
+ super.onQueueChanged()
+ if (MusicPlayerRemote.playingQueue.isNotEmpty()) updateLabel()
+ }
+
+ private fun updateLabel() {
+ (MusicPlayerRemote.playingQueue.size - 1).apply {
+ println("Log Position $this ${MusicPlayerRemote.position}")
+ if (this == (MusicPlayerRemote.position)) {
+ nextSongLabel.setText(R.string.last_song)
+ nextSong.hide()
+ } else {
+ val title = MusicPlayerRemote.playingQueue[MusicPlayerRemote.position + 1].title
+ nextSongLabel.setText(R.string.next_song)
+ nextSong.apply {
+ text = title
+ show()
+ }
+ }
+ }
+ }
}
diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/material/MaterialControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/material/MaterialControlsFragment.kt
index 92f51380..d40c98c1 100644
--- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/material/MaterialControlsFragment.kt
+++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/material/MaterialControlsFragment.kt
@@ -24,7 +24,6 @@ import code.name.monkey.retromusic.util.MusicUtil
import code.name.monkey.retromusic.util.PreferenceUtil
import code.name.monkey.retromusic.util.ViewUtil
import kotlinx.android.synthetic.main.fragment_material_playback_controls.*
-import kotlinx.android.synthetic.main.player_time.*
/**
* @author Hemanth S (h4h13).
@@ -114,6 +113,7 @@ class MaterialControlsFragment : AbsPlayerControlsFragment() {
}
text.setTextColor(colorFinal)
ViewUtil.setProgressDrawable(progressSlider, ColorUtil.stripAlpha(colorFinal), true)
+
volumeFragment.setTintable(colorFinal)
updatePlayPauseColor()
diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/normal/PlayerFragment.kt b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/normal/PlayerFragment.kt
index 85ad5fb9..d58d9eec 100644
--- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/normal/PlayerFragment.kt
+++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/normal/PlayerFragment.kt
@@ -76,18 +76,19 @@ class PlayerFragment : AbsPlayerFragment(), PlayerAlbumCoverFragment.Callbacks {
}
- if (Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP) {
- val display = activity?.windowManager?.defaultDisplay
- val outMetrics = DisplayMetrics()
- display?.getMetrics(outMetrics)
+ val display = activity?.windowManager?.defaultDisplay
+ val outMetrics = DisplayMetrics()
+ display?.getMetrics(outMetrics)
- val density = resources.displayMetrics.density
- val dpHeight = outMetrics.heightPixels / density
- val dpWidth = outMetrics.widthPixels / density
+ val density = resources.displayMetrics.density
+ val dpHeight = outMetrics.heightPixels / density
+ val dpWidth = outMetrics.widthPixels / density
- playerAlbumCoverContainer?.layoutParams?.width = RetroUtil.convertDpToPixel(dpWidth - 20, context!!).toInt()
- }
+ playerAlbumCoverContainer?.layoutParams?.height = RetroUtil.convertDpToPixel((dpWidth - getCutOff()), context!!).toInt()
+ }
+ private fun getCutOff(): Int {
+ return if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.LOLLIPOP_MR1) 20 else 0
}
override fun toggleFavorite(song: Song) {
diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/normal/PlayerPlaybackControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/normal/PlayerPlaybackControlsFragment.kt
index fe620d52..eab3babd 100644
--- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/normal/PlayerPlaybackControlsFragment.kt
+++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/normal/PlayerPlaybackControlsFragment.kt
@@ -27,7 +27,6 @@ import code.name.monkey.retromusic.util.PreferenceUtil
import code.name.monkey.retromusic.util.ViewUtil
import kotlinx.android.synthetic.main.fragment_player_playback_controls.*
import kotlinx.android.synthetic.main.media_button.*
-import kotlinx.android.synthetic.main.player_time.*
class PlayerPlaybackControlsFragment : AbsPlayerControlsFragment() {
@@ -79,11 +78,14 @@ class PlayerPlaybackControlsFragment : AbsPlayerControlsFragment() {
ThemeStore.accentColor(context!!)
}
- volumeFragment.setTintable(colorFinal)
+
TintHelper.setTintAuto(playPauseButton, MaterialValueHelper.getPrimaryTextColor(context!!, ColorUtil.isColorLight(colorFinal)), false)
TintHelper.setTintAuto(playPauseButton, colorFinal, true)
ViewUtil.setProgressDrawable(progressSlider, colorFinal)
+ volumeFragment.setTintable(colorFinal)
+
+
updateRepeatState()
updateShuffleState()
updatePrevNextColor()
diff --git a/app/src/main/java/code/name/monkey/retromusic/util/NavigationUtil.java b/app/src/main/java/code/name/monkey/retromusic/util/NavigationUtil.java
index 74736484..1ee83720 100755
--- a/app/src/main/java/code/name/monkey/retromusic/util/NavigationUtil.java
+++ b/app/src/main/java/code/name/monkey/retromusic/util/NavigationUtil.java
@@ -12,7 +12,6 @@ import androidx.annotation.Nullable;
import androidx.core.app.ActivityCompat;
import androidx.core.app.ActivityOptionsCompat;
import androidx.core.util.Pair;
-
import code.name.monkey.retromusic.R;
import code.name.monkey.retromusic.helper.MusicPlayerRemote;
import code.name.monkey.retromusic.model.Genre;
@@ -57,6 +56,14 @@ public class NavigationUtil {
ActivityOptionsCompat.makeSceneTransitionAnimation(activity, sharedElements).toBundle());
}
+ public static void goToArtist(@NonNull Activity activity, int i) {
+ Intent intent = new Intent(activity, ArtistDetailActivity.class);
+ intent.putExtra(ArtistDetailActivity.EXTRA_ARTIST_ID, i);
+ //noinspection unchecked
+ ActivityCompat.startActivity(activity, intent,
+ ActivityOptionsCompat.makeSceneTransitionAnimation(activity, null).toBundle());
+ }
+
public static void goToPlaylistNew(@NonNull Activity activity, Playlist playlist) {
Intent intent = new Intent(activity, PlaylistDetailActivity.class);
intent.putExtra(PlaylistDetailActivity.Companion.getEXTRA_PLAYLIST(), playlist);
diff --git a/app/src/main/java/code/name/monkey/retromusic/views/ColorIconsImageView.kt b/app/src/main/java/code/name/monkey/retromusic/views/ColorIconsImageView.kt
index 532ef480..5781c63f 100644
--- a/app/src/main/java/code/name/monkey/retromusic/views/ColorIconsImageView.kt
+++ b/app/src/main/java/code/name/monkey/retromusic/views/ColorIconsImageView.kt
@@ -40,7 +40,7 @@ class ColorIconsImageView : AppCompatImageView {
0.12f
}
val filterColor = if (ATHUtil.isWindowBackgroundDark(context)) {
- ThemeStore.textColorPrimary(context)
+ ThemeStore.primaryColor(context)
} else {
color
}
diff --git a/app/src/main/java/code/name/monkey/retromusic/views/RoundedBottomSheetDialogFragment.java b/app/src/main/java/code/name/monkey/retromusic/views/RoundedBottomSheetDialogFragment.java
index 07e967ce..548a7b33 100644
--- a/app/src/main/java/code/name/monkey/retromusic/views/RoundedBottomSheetDialogFragment.java
+++ b/app/src/main/java/code/name/monkey/retromusic/views/RoundedBottomSheetDialogFragment.java
@@ -56,7 +56,7 @@ public class RoundedBottomSheetDialogFragment extends AppCompatDialogFragment {
@NonNull
@Override
- public Dialog onCreateDialog(Bundle savedInstanceState) {
+ public Dialog onCreateDialog(@NonNull Bundle savedInstanceState) {
//noinspection ConstantConditions
return new CustomWidthBottomSheetDialog(getContext(), getTheme());
}
diff --git a/app/src/main/java/code/name/monkey/retromusic/views/StatusBarMarginFrameLayout.java b/app/src/main/java/code/name/monkey/retromusic/views/StatusBarMarginFrameLayout.java
index 05e83dd8..00508ebe 100644
--- a/app/src/main/java/code/name/monkey/retromusic/views/StatusBarMarginFrameLayout.java
+++ b/app/src/main/java/code/name/monkey/retromusic/views/StatusBarMarginFrameLayout.java
@@ -6,23 +6,26 @@ import android.util.AttributeSet;
import android.view.WindowInsets;
import android.widget.FrameLayout;
+import androidx.annotation.NonNull;
+
public class StatusBarMarginFrameLayout extends FrameLayout {
- public StatusBarMarginFrameLayout(Context context) {
+ public StatusBarMarginFrameLayout(@NonNull Context context) {
super(context);
}
- public StatusBarMarginFrameLayout(Context context, AttributeSet attrs) {
+ public StatusBarMarginFrameLayout(@NonNull Context context, @NonNull AttributeSet attrs) {
super(context, attrs);
}
- public StatusBarMarginFrameLayout(Context context, AttributeSet attrs, int defStyleAttr) {
+ public StatusBarMarginFrameLayout(@NonNull Context context, @NonNull AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
+ @NonNull
@Override
- public WindowInsets onApplyWindowInsets(WindowInsets insets) {
+ public WindowInsets onApplyWindowInsets(@NonNull WindowInsets insets) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
MarginLayoutParams lp = (MarginLayoutParams) getLayoutParams();
lp.topMargin = insets.getSystemWindowInsetTop();
diff --git a/app/src/main/res/drawable-xxxhdpi/np_adaptive.png b/app/src/main/res/drawable-xxxhdpi/np_adaptive.png
new file mode 100644
index 00000000..774bb5ca
Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/np_adaptive.png differ
diff --git a/app/src/main/res/drawable-xxxhdpi/np_adaptive.webp b/app/src/main/res/drawable-xxxhdpi/np_adaptive.webp
deleted file mode 100644
index 4cd9c432..00000000
Binary files a/app/src/main/res/drawable-xxxhdpi/np_adaptive.webp and /dev/null differ
diff --git a/app/src/main/res/drawable-xxxhdpi/np_blur.png b/app/src/main/res/drawable-xxxhdpi/np_blur.png
new file mode 100644
index 00000000..1a1be050
Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/np_blur.png differ
diff --git a/app/src/main/res/drawable-xxxhdpi/np_blur.webp b/app/src/main/res/drawable-xxxhdpi/np_blur.webp
deleted file mode 100644
index 5baaa5e4..00000000
Binary files a/app/src/main/res/drawable-xxxhdpi/np_blur.webp and /dev/null differ
diff --git a/app/src/main/res/drawable-xxxhdpi/np_blur_card.png b/app/src/main/res/drawable-xxxhdpi/np_blur_card.png
new file mode 100644
index 00000000..50977cfa
Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/np_blur_card.png differ
diff --git a/app/src/main/res/drawable-xxxhdpi/np_blur_card.webp b/app/src/main/res/drawable-xxxhdpi/np_blur_card.webp
deleted file mode 100644
index 876064df..00000000
Binary files a/app/src/main/res/drawable-xxxhdpi/np_blur_card.webp and /dev/null differ
diff --git a/app/src/main/res/drawable-xxxhdpi/np_card.png b/app/src/main/res/drawable-xxxhdpi/np_card.png
new file mode 100644
index 00000000..2ca27062
Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/np_card.png differ
diff --git a/app/src/main/res/drawable-xxxhdpi/np_card.webp b/app/src/main/res/drawable-xxxhdpi/np_card.webp
deleted file mode 100644
index a55044c5..00000000
Binary files a/app/src/main/res/drawable-xxxhdpi/np_card.webp and /dev/null differ
diff --git a/app/src/main/res/drawable-xxxhdpi/np_color.png b/app/src/main/res/drawable-xxxhdpi/np_color.png
new file mode 100644
index 00000000..409ed46b
Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/np_color.png differ
diff --git a/app/src/main/res/drawable-xxxhdpi/np_color.webp b/app/src/main/res/drawable-xxxhdpi/np_color.webp
deleted file mode 100644
index c662015c..00000000
Binary files a/app/src/main/res/drawable-xxxhdpi/np_color.webp and /dev/null differ
diff --git a/app/src/main/res/drawable-xxxhdpi/np_fit.png b/app/src/main/res/drawable-xxxhdpi/np_fit.png
new file mode 100644
index 00000000..2d3470f6
Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/np_fit.png differ
diff --git a/app/src/main/res/drawable-xxxhdpi/np_flat.png b/app/src/main/res/drawable-xxxhdpi/np_flat.png
new file mode 100644
index 00000000..7f6a1b47
Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/np_flat.png differ
diff --git a/app/src/main/res/drawable-xxxhdpi/np_flat.webp b/app/src/main/res/drawable-xxxhdpi/np_flat.webp
deleted file mode 100644
index f479144b..00000000
Binary files a/app/src/main/res/drawable-xxxhdpi/np_flat.webp and /dev/null differ
diff --git a/app/src/main/res/drawable-xxxhdpi/np_full.png b/app/src/main/res/drawable-xxxhdpi/np_full.png
new file mode 100644
index 00000000..3e517169
Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/np_full.png differ
diff --git a/app/src/main/res/drawable-xxxhdpi/np_full.webp b/app/src/main/res/drawable-xxxhdpi/np_full.webp
deleted file mode 100644
index 96f66d30..00000000
Binary files a/app/src/main/res/drawable-xxxhdpi/np_full.webp and /dev/null differ
diff --git a/app/src/main/res/drawable-xxxhdpi/np_material.png b/app/src/main/res/drawable-xxxhdpi/np_material.png
new file mode 100644
index 00000000..03f50f8c
Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/np_material.png differ
diff --git a/app/src/main/res/drawable-xxxhdpi/np_material.webp b/app/src/main/res/drawable-xxxhdpi/np_material.webp
deleted file mode 100644
index e2006f78..00000000
Binary files a/app/src/main/res/drawable-xxxhdpi/np_material.webp and /dev/null differ
diff --git a/app/src/main/res/drawable-xxxhdpi/np_normal.png b/app/src/main/res/drawable-xxxhdpi/np_normal.png
new file mode 100644
index 00000000..0b4c0a93
Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/np_normal.png differ
diff --git a/app/src/main/res/drawable-xxxhdpi/np_normal.webp b/app/src/main/res/drawable-xxxhdpi/np_normal.webp
deleted file mode 100644
index e943b35c..00000000
Binary files a/app/src/main/res/drawable-xxxhdpi/np_normal.webp and /dev/null differ
diff --git a/app/src/main/res/drawable-xxxhdpi/np_plain.png b/app/src/main/res/drawable-xxxhdpi/np_plain.png
new file mode 100644
index 00000000..04c3d19d
Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/np_plain.png differ
diff --git a/app/src/main/res/drawable-xxxhdpi/np_plain.webp b/app/src/main/res/drawable-xxxhdpi/np_plain.webp
deleted file mode 100644
index 711c56b4..00000000
Binary files a/app/src/main/res/drawable-xxxhdpi/np_plain.webp and /dev/null differ
diff --git a/app/src/main/res/drawable-xxxhdpi/np_simple.png b/app/src/main/res/drawable-xxxhdpi/np_simple.png
new file mode 100644
index 00000000..f9b1fe44
Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/np_simple.png differ
diff --git a/app/src/main/res/drawable-xxxhdpi/np_simple.webp b/app/src/main/res/drawable-xxxhdpi/np_simple.webp
deleted file mode 100644
index 3a53aa96..00000000
Binary files a/app/src/main/res/drawable-xxxhdpi/np_simple.webp and /dev/null differ
diff --git a/app/src/main/res/layout-v21/fragment_player.xml b/app/src/main/res/layout-v21/fragment_player.xml
deleted file mode 100644
index eecebf7c..00000000
--- a/app/src/main/res/layout-v21/fragment_player.xml
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/abs_playlists.xml b/app/src/main/res/layout/abs_playlists.xml
index cc0be0c0..4ff42f35 100644
--- a/app/src/main/res/layout/abs_playlists.xml
+++ b/app/src/main/res/layout/abs_playlists.xml
@@ -22,7 +22,7 @@
android:id="@+id/sectionTitle"
style="@style/SubTitleTextAppearance"
android:text="@string/for_you"
- android:textStyle="bold" />
+ />
diff --git a/app/src/main/res/layout/activity_song_tag_editor.xml b/app/src/main/res/layout/activity_song_tag_editor.xml
index 3e09afd3..02d96da7 100755
--- a/app/src/main/res/layout/activity_song_tag_editor.xml
+++ b/app/src/main/res/layout/activity_song_tag_editor.xml
@@ -143,6 +143,23 @@
+
+
+
+
+
+
-
-
-
-
-
+ android:layout_height="@dimen/progress_container_height"
+ android:layout_marginTop="8dp"
+ android:layout_marginBottom="8dp"
+ android:paddingStart="12dp"
+ android:paddingEnd="12dp">
-
+ tools:ignore="RtlHardcoded,RtlSymmetry" />
-
+ tools:ignore="RtlHardcoded,RtlSymmetry" />
+
+
+
+
-
+ android:layout_height="@dimen/progress_container_height"
+ android:layout_marginTop="8dp"
+ android:layout_marginBottom="8dp"
+ android:paddingStart="12dp"
+ android:paddingEnd="12dp">
+
-
+
+
+
+ android:background="#90000000" />
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/fragment_full_player_controls.xml b/app/src/main/res/layout/fragment_full_player_controls.xml
index c2d6260b..468cb288 100644
--- a/app/src/main/res/layout/fragment_full_player_controls.xml
+++ b/app/src/main/res/layout/fragment_full_player_controls.xml
@@ -5,50 +5,127 @@
android:id="@+id/player_footer_frame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:orientation="vertical">
+ android:orientation="vertical"
+ tools:background="@color/md_grey_800">
-
+ android:layout_height="wrap_content">
-
+
+
+
+
+
+
+
+
+
+
+
+ android:layout_height="28dp"
+ android:layout_marginTop="8dp"
+ android:layout_marginBottom="8dp"
+ android:paddingStart="12dp"
+ android:paddingEnd="12dp">
-
+
-
+
+
+
+
-
diff --git a/app/src/main/res/layout/fragment_material_playback_controls.xml b/app/src/main/res/layout/fragment_material_playback_controls.xml
index 6dd093d8..3afd2e79 100644
--- a/app/src/main/res/layout/fragment_material_playback_controls.xml
+++ b/app/src/main/res/layout/fragment_material_playback_controls.xml
@@ -9,17 +9,54 @@
android:orientation="vertical"
tools:ignore="MissingPrefix">
-
+ android:layout_height="28dp"
+ android:layout_marginTop="8dp"
+ android:layout_marginBottom="8dp"
+ android:paddingStart="12dp"
+ android:paddingEnd="12dp">
-
+
+
+
+
+
+
-
+ android:layout_height="wrap_content"
+ android:layout_weight="0">
-
+
diff --git a/app/src/main/res/layout/fragment_player_playback_controls.xml b/app/src/main/res/layout/fragment_player_playback_controls.xml
index d13b0280..841f6626 100755
--- a/app/src/main/res/layout/fragment_player_playback_controls.xml
+++ b/app/src/main/res/layout/fragment_player_playback_controls.xml
@@ -8,19 +8,53 @@
android:orientation="vertical"
tools:ignore="MissingPrefix">
-
+ android:layout_height="28dp">
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/metal_section_recycler_view.xml b/app/src/main/res/layout/metal_section_recycler_view.xml
index c3e63159..a8395735 100644
--- a/app/src/main/res/layout/metal_section_recycler_view.xml
+++ b/app/src/main/res/layout/metal_section_recycler_view.xml
@@ -20,8 +20,7 @@
+ style="@style/SubTitleTextAppearance" />
diff --git a/app/src/main/res/layout/section_item_collage.xml b/app/src/main/res/layout/section_item_collage.xml
index 1fc9d62d..d834215b 100644
--- a/app/src/main/res/layout/section_item_collage.xml
+++ b/app/src/main/res/layout/section_item_collage.xml
@@ -20,8 +20,7 @@
+ style="@style/SubTitleTextAppearance" />
diff --git a/app/src/main/res/layout/section_recycler_view.xml b/app/src/main/res/layout/section_recycler_view.xml
index 888894e2..138af94e 100644
--- a/app/src/main/res/layout/section_recycler_view.xml
+++ b/app/src/main/res/layout/section_recycler_view.xml
@@ -22,8 +22,7 @@
+ style="@style/SubTitleTextAppearance" />
diff --git a/app/src/main/res/values/ids.xml b/app/src/main/res/values/ids.xml
index afd6e385..a5b9b02d 100644
--- a/app/src/main/res/values/ids.xml
+++ b/app/src/main/res/values/ids.xml
@@ -16,6 +16,7 @@
+
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index a387b827..0edcd265 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -598,5 +598,9 @@
Error
Permission error
Classic
+ Composer
+ Composer
+ Next Song
+ Last song
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index d046f690..d09d1049 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Fri Jan 18 19:55:16 IST 2019
+#Sun Feb 24 22:42:48 IST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl = https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
\ No newline at end of file
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
\ No newline at end of file