mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-01 22:58:57 +01:00
Add an alternative way to display the chapter title (#54)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user