This commit is contained in:
Karim Abou Zeid 2017-12-26 22:35:07 +01:00
commit 739e565bc4
7 changed files with 107 additions and 159 deletions

View file

@ -1,65 +0,0 @@
package com.kabouzeid.gramophone.model;
import com.kabouzeid.gramophone.R;
import com.google.gson.annotations.SerializedName;
public class Category {
@SerializedName("id")
public Id id;
@SerializedName("index")
public int index;
@SerializedName("checkBox")
public boolean visible;
public Category(Category category) {
this.id = category.id;
this.visible = category.visible;
this.index = index;
}
public Category(Id id, boolean visible, int index) {
this.id = id;
this.visible = visible;
this.index = index;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Category category = (Category) o;
return id == category.id;
}
@Override
public int hashCode() {
int result = 0;
result = 31 * result + id.hashCode();
return result;
}
public String toString()
{
return "{id:"+id + ", pos:"+ index + ", vis=" + visible + "}";
}
public static enum Id
{
SONGS(R.string.songs),
ALBUMS(R.string.albums),
ARTISTS(R.string.artists),
GENRES(R.string.genres),
PLAYLISTS(R.string.playlists);
public final int key;
private Id(int key) {
this.key = key;
}
}
}

View file

@ -0,0 +1,27 @@
package com.kabouzeid.gramophone.model;
import com.kabouzeid.gramophone.R;
public class CategoryInfo {
public Category category;
public boolean visible;
public CategoryInfo(Category category, boolean visible) {
this.category = category;
this.visible = visible;
}
public enum Category {
SONGS(R.string.songs),
ALBUMS(R.string.albums),
ARTISTS(R.string.artists),
GENRES(R.string.genres),
PLAYLISTS(R.string.playlists);
public final int stringRes;
Category(int stringRes) {
this.stringRes = stringRes;
}
}
}