Code refactor
This commit is contained in:
parent
3f27463281
commit
1096cea0b4
26 changed files with 353 additions and 486 deletions
|
@ -16,18 +16,16 @@ package code.name.monkey.retromusic.model;
|
|||
|
||||
import android.content.Context;
|
||||
import android.os.Parcel;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* @author Karim Abou Zeid (kabouzeid)
|
||||
*/
|
||||
|
||||
public abstract class AbsCustomPlaylist extends Playlist {
|
||||
|
||||
public AbsCustomPlaylist(int id, String name) {
|
||||
super(id, name);
|
||||
}
|
||||
|
|
|
@ -14,8 +14,7 @@
|
|||
|
||||
package code.name.monkey.retromusic.model
|
||||
|
||||
import java.util.*
|
||||
|
||||
import java.util.ArrayList
|
||||
|
||||
class Album {
|
||||
val songs: ArrayList<Song>?
|
||||
|
|
|
@ -15,8 +15,7 @@
|
|||
package code.name.monkey.retromusic.model
|
||||
|
||||
import code.name.monkey.retromusic.util.MusicUtil
|
||||
import java.util.*
|
||||
|
||||
import java.util.ArrayList
|
||||
|
||||
class Artist {
|
||||
val albums: ArrayList<Album>?
|
||||
|
|
|
@ -16,4 +16,8 @@ package code.name.monkey.retromusic.model
|
|||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
class Contributor(val name: String, val summary: String, val link: String, @SerializedName("profile_image") val profileImage: String)
|
||||
class Contributor(
|
||||
val name: String,
|
||||
val summary: String,
|
||||
val link: String, @SerializedName("profile_image") val profileImage: String
|
||||
)
|
||||
|
|
|
@ -18,10 +18,12 @@ import androidx.annotation.DrawableRes
|
|||
import androidx.annotation.StringRes
|
||||
import code.name.monkey.retromusic.adapter.HomeAdapter.Companion.HomeSection
|
||||
|
||||
class Home(val priority: Int,
|
||||
@StringRes val title: Int,
|
||||
val arrayList: ArrayList<*>,
|
||||
@HomeSection
|
||||
val homeSection: Int,
|
||||
@DrawableRes
|
||||
val icon: Int)
|
||||
class Home(
|
||||
val priority: Int,
|
||||
@StringRes val title: Int,
|
||||
val arrayList: ArrayList<*>,
|
||||
@HomeSection
|
||||
val homeSection: Int,
|
||||
@DrawableRes
|
||||
val icon: Int
|
||||
)
|
|
@ -17,16 +17,13 @@ package code.name.monkey.retromusic.model;
|
|||
import android.content.Context;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import code.name.monkey.retromusic.loaders.PlaylistSongsLoader;
|
||||
import io.reactivex.Observable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
||||
public class Playlist implements Parcelable {
|
||||
|
||||
public static final Creator<Playlist> CREATOR = new Creator<Playlist>() {
|
||||
public Playlist createFromParcel(Parcel source) {
|
||||
return new Playlist(source);
|
||||
|
@ -36,7 +33,9 @@ public class Playlist implements Parcelable {
|
|||
return new Playlist[size];
|
||||
}
|
||||
};
|
||||
|
||||
public final int id;
|
||||
|
||||
public final String name;
|
||||
|
||||
public Playlist(final int id, final String name) {
|
||||
|
@ -54,30 +53,35 @@ public class Playlist implements Parcelable {
|
|||
this.name = in.readString();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public Observable<ArrayList<Song>> getSongsFlowable(@NonNull Context context) {
|
||||
// this default implementation covers static playlists
|
||||
return PlaylistSongsLoader.INSTANCE.getPlaylistSongListFlowable(context, id);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public ArrayList<Song> getSongs(@NonNull Context context) {
|
||||
// this default implementation covers static playlists
|
||||
return PlaylistSongsLoader.INSTANCE.getPlaylistSongList(context, id);
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Playlist playlist = (Playlist) o;
|
||||
|
||||
if (id != playlist.id) return false;
|
||||
if (id != playlist.id) {
|
||||
return false;
|
||||
}
|
||||
return name != null ? name.equals(playlist.name) : playlist.name == null;
|
||||
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public ArrayList<Song> getSongs(@NonNull Context context) {
|
||||
// this default implementation covers static playlists
|
||||
return PlaylistSongsLoader.INSTANCE.getPlaylistSongList(context, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = id;
|
||||
|
@ -93,11 +97,6 @@ public class Playlist implements Parcelable {
|
|||
'}';
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeInt(this.id);
|
||||
|
|
|
@ -14,42 +14,44 @@
|
|||
|
||||
package code.name.monkey.retromusic.model;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import kotlinx.android.parcel.Parcelize;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* Created by hemanths on 3/4/19
|
||||
*/
|
||||
@Parcelize
|
||||
public class PlaylistSong extends Song {
|
||||
final int playlistId;
|
||||
|
||||
final int idInPlayList;
|
||||
|
||||
final int playlistId;
|
||||
|
||||
public PlaylistSong(int id,
|
||||
@NotNull String title,
|
||||
int trackNumber,
|
||||
int year,
|
||||
long duration,
|
||||
@NotNull String data,
|
||||
long dateModified,
|
||||
int albumId,
|
||||
@NotNull String albumName,
|
||||
int artistId,
|
||||
@NotNull String artistName,
|
||||
int playlistId,
|
||||
int idInPlayList,
|
||||
@NotNull String composer) {
|
||||
super(id, title, trackNumber, year, duration, data, dateModified, albumId, albumName, artistId, artistName, composer);
|
||||
@NotNull String title,
|
||||
int trackNumber,
|
||||
int year,
|
||||
long duration,
|
||||
@NotNull String data,
|
||||
long dateModified,
|
||||
int albumId,
|
||||
@NotNull String albumName,
|
||||
int artistId,
|
||||
@NotNull String artistName,
|
||||
int playlistId,
|
||||
int idInPlayList,
|
||||
@NotNull String composer) {
|
||||
super(id, title, trackNumber, year, duration, data, dateModified, albumId, albumName, artistId, artistName,
|
||||
composer);
|
||||
this.playlistId = playlistId;
|
||||
this.idInPlayList = idInPlayList;
|
||||
}
|
||||
|
||||
public int getPlaylistId() {
|
||||
return playlistId;
|
||||
}
|
||||
|
||||
public int getIdInPlayList() {
|
||||
return idInPlayList;
|
||||
}
|
||||
|
||||
public int getPlaylistId() {
|
||||
return playlistId;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,36 +18,36 @@ import kotlinx.android.parcel.Parcelize
|
|||
|
||||
@Parcelize
|
||||
open class Song(
|
||||
val id: Int,
|
||||
val title: String,
|
||||
val trackNumber: Int,
|
||||
val year: Int,
|
||||
val duration: Long,
|
||||
val data: String,
|
||||
val dateModified: Long,
|
||||
val albumId: Int,
|
||||
val albumName: String,
|
||||
val artistId: Int,
|
||||
val artistName: String,
|
||||
val composer: String?
|
||||
val id: Int,
|
||||
val title: String,
|
||||
val trackNumber: Int,
|
||||
val year: Int,
|
||||
val duration: Long,
|
||||
val data: String,
|
||||
val dateModified: Long,
|
||||
val albumId: Int,
|
||||
val albumName: String,
|
||||
val artistId: Int,
|
||||
val artistName: String,
|
||||
val composer: String?
|
||||
) : Parcelable {
|
||||
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
val emptySong = Song(
|
||||
-1,
|
||||
"",
|
||||
-1,
|
||||
-1,
|
||||
-1,
|
||||
"",
|
||||
-1,
|
||||
-1,
|
||||
"",
|
||||
-1,
|
||||
"",
|
||||
""
|
||||
-1,
|
||||
"",
|
||||
-1,
|
||||
-1,
|
||||
-1,
|
||||
"",
|
||||
-1,
|
||||
-1,
|
||||
"",
|
||||
-1,
|
||||
"",
|
||||
""
|
||||
)
|
||||
}
|
||||
}
|
|
@ -17,9 +17,11 @@ package code.name.monkey.retromusic.model.lyrics;
|
|||
import android.util.SparseArray;
|
||||
|
||||
public abstract class AbsSynchronizedLyrics extends Lyrics {
|
||||
|
||||
private static final int TIME_OFFSET_MS = 500; // time adjustment to display line before it actually starts
|
||||
|
||||
protected final SparseArray<String> lines = new SparseArray<>();
|
||||
|
||||
protected int offset = 0;
|
||||
|
||||
public String getLine(int time) {
|
||||
|
@ -40,15 +42,6 @@ public abstract class AbsSynchronizedLyrics extends Lyrics {
|
|||
return lines.get(lastLineTime);
|
||||
}
|
||||
|
||||
public boolean isSynchronized() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
parse(true);
|
||||
return valid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText() {
|
||||
parse(false);
|
||||
|
@ -66,4 +59,13 @@ public abstract class AbsSynchronizedLyrics extends Lyrics {
|
|||
|
||||
return super.getText();
|
||||
}
|
||||
|
||||
public boolean isSynchronized() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
parse(true);
|
||||
return valid;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,39 +15,28 @@
|
|||
package code.name.monkey.retromusic.model.lyrics;
|
||||
|
||||
|
||||
import code.name.monkey.retromusic.model.Song;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import code.name.monkey.retromusic.model.Song;
|
||||
|
||||
public class Lyrics {
|
||||
|
||||
private static final ArrayList<Class<? extends Lyrics>> FORMATS = new ArrayList<>();
|
||||
|
||||
static {
|
||||
Lyrics.FORMATS.add(SynchronizedLyricsLRC.class);
|
||||
}
|
||||
public String data;
|
||||
|
||||
public Song song;
|
||||
public String data;
|
||||
protected boolean parsed = false;
|
||||
protected boolean valid = false;
|
||||
|
||||
public static Lyrics parse(Song song, String data) {
|
||||
for (Class<? extends Lyrics> format : Lyrics.FORMATS) {
|
||||
try {
|
||||
Lyrics lyrics = format.newInstance().setData(song, data);
|
||||
if (lyrics.isValid()) return lyrics.parse(false);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return new Lyrics().setData(song, data).parse(false);
|
||||
}
|
||||
protected boolean parsed = false;
|
||||
|
||||
protected boolean valid = false;
|
||||
|
||||
public static boolean isSynchronized(String data) {
|
||||
for (Class<? extends Lyrics> format : Lyrics.FORMATS) {
|
||||
try {
|
||||
Lyrics lyrics = format.newInstance().setData(null, data);
|
||||
if (lyrics.isValid()) return true;
|
||||
if (lyrics.isValid()) {
|
||||
return true;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
@ -55,16 +44,22 @@ public class Lyrics {
|
|||
return false;
|
||||
}
|
||||
|
||||
public Lyrics setData(Song song, String data) {
|
||||
this.song = song;
|
||||
this.data = data;
|
||||
return this;
|
||||
public static Lyrics parse(Song song, String data) {
|
||||
for (Class<? extends Lyrics> format : Lyrics.FORMATS) {
|
||||
try {
|
||||
Lyrics lyrics = format.newInstance().setData(song, data);
|
||||
if (lyrics.isValid()) {
|
||||
return lyrics.parse(false);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return new Lyrics().setData(song, data).parse(false);
|
||||
}
|
||||
|
||||
public Lyrics parse(boolean check) {
|
||||
this.valid = true;
|
||||
this.parsed = true;
|
||||
return this;
|
||||
public String getText() {
|
||||
return this.data.trim().replaceAll("(\r?\n){3,}", "\r\n\r\n");
|
||||
}
|
||||
|
||||
public boolean isSynchronized() {
|
||||
|
@ -76,7 +71,19 @@ public class Lyrics {
|
|||
return this.valid;
|
||||
}
|
||||
|
||||
public String getText() {
|
||||
return this.data.trim().replaceAll("(\r?\n){3,}", "\r\n\r\n");
|
||||
public Lyrics parse(boolean check) {
|
||||
this.valid = true;
|
||||
this.parsed = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Lyrics setData(Song song, String data) {
|
||||
this.song = song;
|
||||
this.data = data;
|
||||
return this;
|
||||
}
|
||||
|
||||
static {
|
||||
Lyrics.FORMATS.add(SynchronizedLyricsLRC.class);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,11 +18,15 @@ import java.util.regex.Matcher;
|
|||
import java.util.regex.Pattern;
|
||||
|
||||
class SynchronizedLyricsLRC extends AbsSynchronizedLyrics {
|
||||
|
||||
private static final Pattern LRC_LINE_PATTERN = Pattern.compile("((?:\\[.*?\\])+)(.*)");
|
||||
|
||||
private static final Pattern LRC_TIME_PATTERN = Pattern.compile("\\[(\\d+):(\\d{2}(?:\\.\\d+)?)\\]");
|
||||
|
||||
private static final Pattern LRC_ATTRIBUTE_PATTERN = Pattern.compile("\\[(\\D+):(.+)\\]");
|
||||
|
||||
private static final float LRC_SECONDS_TO_MS_MULTIPLIER = 1000f;
|
||||
|
||||
private static final int LRC_MINUTES_TO_MS_MULTIPLIER = 60000;
|
||||
|
||||
@Override
|
||||
|
@ -71,7 +75,9 @@ class SynchronizedLyricsLRC extends AbsSynchronizedLyrics {
|
|||
int ms = (int) (s * LRC_SECONDS_TO_MS_MULTIPLIER) + m * LRC_MINUTES_TO_MS_MULTIPLIER;
|
||||
|
||||
this.valid = true;
|
||||
if (check) return this;
|
||||
if (check) {
|
||||
return this;
|
||||
}
|
||||
|
||||
this.lines.append(ms, text);
|
||||
}
|
||||
|
|
|
@ -16,7 +16,6 @@ package code.name.monkey.retromusic.model.smartplaylist;
|
|||
|
||||
import android.content.Context;
|
||||
import android.os.Parcel;
|
||||
|
||||
import androidx.annotation.DrawableRes;
|
||||
import androidx.annotation.Nullable;
|
||||
import code.name.monkey.retromusic.R;
|
||||
|
@ -24,6 +23,7 @@ import code.name.monkey.retromusic.model.AbsCustomPlaylist;
|
|||
|
||||
|
||||
public abstract class AbsSmartPlaylist extends AbsCustomPlaylist {
|
||||
|
||||
@DrawableRes
|
||||
public final int iconRes;
|
||||
|
||||
|
@ -37,18 +37,16 @@ public abstract class AbsSmartPlaylist extends AbsCustomPlaylist {
|
|||
this.iconRes = R.drawable.ic_queue_music_white_24dp;
|
||||
}
|
||||
|
||||
public abstract void clear(Context context);
|
||||
|
||||
public boolean isClearable() {
|
||||
return true;
|
||||
protected AbsSmartPlaylist(Parcel in) {
|
||||
super(in);
|
||||
this.iconRes = in.readInt();
|
||||
}
|
||||
|
||||
public abstract void clear(Context context);
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = super.hashCode();
|
||||
result = prime * result + iconRes;
|
||||
return result;
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -63,10 +61,16 @@ public abstract class AbsSmartPlaylist extends AbsCustomPlaylist {
|
|||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = super.hashCode();
|
||||
result = prime * result + iconRes;
|
||||
return result;
|
||||
}
|
||||
|
||||
public boolean isClearable() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -74,9 +78,4 @@ public abstract class AbsSmartPlaylist extends AbsCustomPlaylist {
|
|||
super.writeToParcel(dest, flags);
|
||||
dest.writeInt(this.iconRes);
|
||||
}
|
||||
|
||||
protected AbsSmartPlaylist(Parcel in) {
|
||||
super(in);
|
||||
this.iconRes = in.readInt();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,17 +16,13 @@ package code.name.monkey.retromusic.model.smartplaylist;
|
|||
|
||||
import android.content.Context;
|
||||
import android.os.Parcel;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import code.name.monkey.retromusic.R;
|
||||
import code.name.monkey.retromusic.loaders.TopAndRecentlyPlayedTracksLoader;
|
||||
import code.name.monkey.retromusic.model.Song;
|
||||
import code.name.monkey.retromusic.providers.HistoryStore;
|
||||
import java.util.ArrayList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* @author Karim Abou Zeid (kabouzeid)
|
||||
|
@ -51,12 +47,6 @@ public class HistoryPlaylist extends AbsSmartPlaylist {
|
|||
super(in);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ArrayList<Song> getSongs(@NotNull @NonNull Context context) {
|
||||
return TopAndRecentlyPlayedTracksLoader.INSTANCE.getRecentlyPlayedTracks(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear(@NonNull Context context) {
|
||||
HistoryStore.getInstance(context).clear();
|
||||
|
@ -66,4 +56,10 @@ public class HistoryPlaylist extends AbsSmartPlaylist {
|
|||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ArrayList<Song> getSongs(@NotNull @NonNull Context context) {
|
||||
return TopAndRecentlyPlayedTracksLoader.INSTANCE.getRecentlyPlayedTracks(context);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,16 +16,12 @@ package code.name.monkey.retromusic.model.smartplaylist;
|
|||
|
||||
import android.content.Context;
|
||||
import android.os.Parcel;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import code.name.monkey.retromusic.R;
|
||||
import code.name.monkey.retromusic.loaders.LastAddedSongsLoader;
|
||||
import code.name.monkey.retromusic.model.Song;
|
||||
import java.util.ArrayList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
|
||||
public class LastAddedPlaylist extends AbsSmartPlaylist {
|
||||
|
@ -48,23 +44,23 @@ public class LastAddedPlaylist extends AbsSmartPlaylist {
|
|||
super(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear(@NonNull Context context) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ArrayList<Song> getSongs(@NotNull @NonNull Context context) {
|
||||
return LastAddedSongsLoader.INSTANCE.getLastAddedSongs(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear(@NonNull Context context) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isClearable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,17 +16,13 @@ package code.name.monkey.retromusic.model.smartplaylist;
|
|||
|
||||
import android.content.Context;
|
||||
import android.os.Parcel;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import code.name.monkey.retromusic.R;
|
||||
import code.name.monkey.retromusic.loaders.TopAndRecentlyPlayedTracksLoader;
|
||||
import code.name.monkey.retromusic.model.Song;
|
||||
import code.name.monkey.retromusic.providers.SongPlayCountStore;
|
||||
import java.util.ArrayList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* @author Karim Abou Zeid (kabouzeid)
|
||||
|
@ -51,13 +47,6 @@ public class MyTopTracksPlaylist extends AbsSmartPlaylist {
|
|||
super(in);
|
||||
}
|
||||
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ArrayList<Song> getSongs(@NotNull @NonNull Context context) {
|
||||
return TopAndRecentlyPlayedTracksLoader.INSTANCE.getTopTracks(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear(@NonNull Context context) {
|
||||
SongPlayCountStore.getInstance(context).clear();
|
||||
|
@ -67,4 +56,10 @@ public class MyTopTracksPlaylist extends AbsSmartPlaylist {
|
|||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ArrayList<Song> getSongs(@NotNull @NonNull Context context) {
|
||||
return TopAndRecentlyPlayedTracksLoader.INSTANCE.getTopTracks(context);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,17 +16,12 @@ package code.name.monkey.retromusic.model.smartplaylist;
|
|||
|
||||
import android.content.Context;
|
||||
import android.os.Parcel;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import code.name.monkey.retromusic.R;
|
||||
import code.name.monkey.retromusic.loaders.SongLoader;
|
||||
import code.name.monkey.retromusic.model.Song;
|
||||
import io.reactivex.Observable;
|
||||
import java.util.ArrayList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class ShuffleAllPlaylist extends AbsSmartPlaylist {
|
||||
|
||||
|
@ -48,18 +43,6 @@ public class ShuffleAllPlaylist extends AbsSmartPlaylist {
|
|||
super(in);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Observable<ArrayList<Song>> getSongsFlowable(@NotNull @NonNull Context context) {
|
||||
return SongLoader.INSTANCE.getAllSongsFlowable(context);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ArrayList<Song> getSongs(@NotNull Context context) {
|
||||
return SongLoader.INSTANCE.getAllSongs(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear(@NonNull Context context) {
|
||||
// Shuffle all is not a real "Smart Playlist"
|
||||
|
@ -69,4 +52,10 @@ public class ShuffleAllPlaylist extends AbsSmartPlaylist {
|
|||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ArrayList<Song> getSongs(@NotNull Context context) {
|
||||
return SongLoader.INSTANCE.getAllSongs(context);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue