mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-30 22:07:57 +01:00 
			
		
		
		
	Invert seekbar and textviews on right to left reader
This commit is contained in:
		| @@ -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); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user