mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-22 12:01:52 +01:00
Invert seekbar and textviews on right to left reader
This commit is contained in:
parent
04d9176c3c
commit
42cd6ea007
@ -57,10 +57,10 @@ public class ReaderActivity extends BaseRxActivity<ReaderPresenter> {
|
||||
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;
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user