Add an alternative way to display the chapter title (#54)

This commit is contained in:
inorichi
2016-01-25 19:57:13 +01:00
parent 0a31c223e3
commit 6f409c0e3b
8 changed files with 115 additions and 16 deletions

View File

@@ -68,9 +68,13 @@ public class Manga implements Serializable {
public static final int COMPLETED = 2;
public static final int LICENSED = 3;
public static final int SORT_AZ = 0;
public static final int SORT_ZA = 1;
public static final int SORT_MASK = 1;
public static final int SORT_AZ = 0x00000000;
public static final int SORT_ZA = 0x00000001;
public static final int SORT_MASK = 0x00000001;
public static final int DISPLAY_NAME = 0x00000000;
public static final int DISPLAY_NUMBER = 0x00100000;
public static final int DISPLAY_MASK = 0x00100000;
public Manga() {}
@@ -124,16 +128,25 @@ public class Manga implements Serializable {
}
}
public void setFlags(int flag, int mask) {
public void setChapterOrder(int order) {
setFlags(order, SORT_MASK);
}
public void setDisplayMode(int mode) {
setFlags(mode, DISPLAY_MASK);
}
private void setFlags(int flag, int mask) {
chapter_flags = (chapter_flags & ~mask) | (flag & mask);
}
public boolean sortChaptersAZ () {
return (this.chapter_flags & SORT_MASK) == SORT_AZ;
public boolean sortChaptersAZ() {
return (chapter_flags & SORT_MASK) == SORT_AZ;
}
public void setChapterOrder(int order) {
setFlags(order, SORT_MASK);
// Used to display the chapter's title one way or another
public int getDisplayMode() {
return chapter_flags & DISPLAY_MASK;
}
@Override