This commit is contained in:
h4h13 2018-11-13 09:00:08 +05:30
parent a531a1e723
commit ca4e9e7ef0
194 changed files with 1286 additions and 2256 deletions

View file

@ -4,7 +4,6 @@ import android.os.Parcel;
import android.os.Parcelable;
public class PlaylistSong extends Song {
public static final PlaylistSong EMPTY_PLAYLIST_SONG = new PlaylistSong(-1, "", -1, -1, -1, "", -1, -1, "", -1, "", -1, -1, "");
public static final Parcelable.Creator<PlaylistSong> CREATOR = new Parcelable.Creator<PlaylistSong>() {
public PlaylistSong createFromParcel(Parcel source) {
return new PlaylistSong(source);
@ -17,8 +16,8 @@ public class PlaylistSong extends Song {
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, final String composer) {
super(id, title, trackNumber, year, duration, data, dateModified, albumId, albumName, artistId, artistName, composer);
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);
this.playlistId = playlistId;
this.idInPlayList = idInPlayList;
}

View file

@ -5,7 +5,7 @@ import android.os.Parcelable;
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);
@ -26,9 +26,8 @@ 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, 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) {
this.id = id;
this.title = title;
this.trackNumber = trackNumber;
@ -40,7 +39,6 @@ public class Song implements Parcelable {
this.albumName = albumName;
this.artistId = artistId;
this.artistName = artistName;
this.composer = composer;
}
protected Song(Parcel in) {
@ -55,64 +53,6 @@ public class Song implements Parcelable {
this.albumName = in.readString();
this.artistId = in.readInt();
this.artistName = in.readString();
this.composer = in.readString();
}
@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);
result = 31 * result + (composer != null ? composer.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 + '\'' +
", composer='" + composer + '\'' +
'}';
}
@Override
@ -133,6 +73,5 @@ public class Song implements Parcelable {
dest.writeString(this.albumName);
dest.writeInt(this.artistId);
dest.writeString(this.artistName);
dest.writeString(this.composer);
}
}