Composer, Now playing preview, Full screen theme
This commit is contained in:
parent
c179d8772d
commit
e9309ebdd3
76 changed files with 718 additions and 373 deletions
|
@ -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<PlaylistSong> CREATOR = new Creator<PlaylistSong>() {
|
||||
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<PlaylistSong> CREATOR = new Creator<PlaylistSong>() {
|
||||
public PlaylistSong createFromParcel(Parcel source) {
|
||||
return new PlaylistSong(source);
|
||||
}
|
||||
|
||||
public PlaylistSong[] newArray(int size) {
|
||||
return new PlaylistSong[size];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -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<Song> CREATOR = new Creator<Song>() {
|
||||
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<Song> CREATOR = new Creator<Song>() {
|
||||
public Song createFromParcel(Parcel source) {
|
||||
return new Song(source);
|
||||
}
|
||||
|
||||
public Song[] newArray(int size) {
|
||||
return new Song[size];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue