Added suggestions & Updated libs.
This commit is contained in:
parent
865e13a536
commit
547e49507e
20 changed files with 568 additions and 186 deletions
|
@ -15,13 +15,10 @@
|
|||
package code.name.monkey.retromusic.model
|
||||
|
||||
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<*>,
|
||||
val arrayList: List<*>,
|
||||
@HomeSection
|
||||
val homeSection: Int,
|
||||
@DrawableRes
|
||||
|
|
|
@ -23,6 +23,7 @@ import androidx.annotation.NonNull;
|
|||
import java.util.ArrayList;
|
||||
|
||||
import code.name.monkey.retromusic.loaders.PlaylistSongsLoader;
|
||||
import code.name.monkey.retromusic.util.MusicUtil;
|
||||
|
||||
|
||||
public class Playlist implements Parcelable {
|
||||
|
@ -106,5 +107,14 @@ public class Playlist implements Parcelable {
|
|||
dest.writeString(this.name);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public String getInfoString(@NonNull Context context) {
|
||||
int songCount = getSongs(context).size();
|
||||
String songCountString = MusicUtil.getSongCountString(context, songCount);
|
||||
|
||||
return MusicUtil.buildInfoString(
|
||||
songCountString,
|
||||
""
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,69 @@
|
|||
package code.name.monkey.retromusic.model.smartplaylist;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Parcel;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
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.util.MusicUtil;
|
||||
import code.name.monkey.retromusic.util.PreferenceUtil;
|
||||
|
||||
/**
|
||||
* @author SC (soncaokim)
|
||||
*/
|
||||
public class NotRecentlyPlayedPlaylist extends AbsSmartPlaylist {
|
||||
|
||||
public static final Creator<NotRecentlyPlayedPlaylist> CREATOR = new Creator<NotRecentlyPlayedPlaylist>() {
|
||||
public NotRecentlyPlayedPlaylist createFromParcel(Parcel source) {
|
||||
return new NotRecentlyPlayedPlaylist(source);
|
||||
}
|
||||
|
||||
public NotRecentlyPlayedPlaylist[] newArray(int size) {
|
||||
return new NotRecentlyPlayedPlaylist[size];
|
||||
}
|
||||
};
|
||||
|
||||
public NotRecentlyPlayedPlaylist(@NonNull Context context) {
|
||||
super(context.getString(R.string.not_recently_played), R.drawable.ic_watch_later_white_24dp);
|
||||
}
|
||||
|
||||
protected NotRecentlyPlayedPlaylist(Parcel in) {
|
||||
super(in);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String getInfoString(@NonNull Context context) {
|
||||
String cutoff = PreferenceUtil.INSTANCE.getRecentlyPlayedCutoffText(context);
|
||||
|
||||
return MusicUtil.buildInfoString(
|
||||
cutoff,
|
||||
super.getInfoString(context)
|
||||
);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ArrayList<Song> getSongs(@NonNull Context context) {
|
||||
return TopAndRecentlyPlayedTracksLoader.INSTANCE.getNotRecentlyPlayedTracks(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear(@NonNull Context context) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isClearable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue