diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderActivity.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderActivity.java index cdad40313..e63f8feac 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderActivity.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderActivity.java @@ -57,10 +57,10 @@ public class ReaderActivity extends BaseRxActivity { protected CompositeSubscription subscriptions; private Subscription customBrightnessSubscription; - private static final int LEFT_TO_RIGHT = 1; - private static final int RIGHT_TO_LEFT = 2; - private static final int VERTICAL = 3; - private static final int WEBTOON = 4; + public static final int LEFT_TO_RIGHT = 1; + public static final int RIGHT_TO_LEFT = 2; + public static final int VERTICAL = 3; + public static final int WEBTOON = 4; public static final int BLACK_THEME = 1; diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderMenu.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderMenu.java index da5bd6762..2914dfc74 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderMenu.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderMenu.java @@ -48,6 +48,7 @@ public class ReaderMenu { @State boolean showing; private PopupWindow settingsPopup; private PopupWindow brightnessPopup; + private boolean inverted; private DecimalFormat decimalFormat; @@ -61,6 +62,7 @@ public class ReaderMenu { seekBar.setOnSeekBarChangeListener(new PageSeekBarChangeListener()); decimalFormat = new DecimalFormat("#.##"); + inverted = false; initializeOptions(); } @@ -105,7 +107,19 @@ public class ReaderMenu { } public void onChapterReady(int numPages, Manga manga, Chapter chapter) { + if (manga.viewer == ReaderActivity.RIGHT_TO_LEFT && !inverted) { + // Invert the seekbar and textview fields for the right to left reader + seekBar.setRotation(180); + TextView aux = currentPage; + currentPage = totalPages; + totalPages = aux; + // Don't invert again on chapter change + inverted = true; + } + + // Set initial values totalPages.setText("" + numPages); + currentPage.setText("" + (chapter.last_page_read + 1)); seekBar.setMax(numPages - 1); activity.setToolbarTitle(manga.title);