From 89837e4cedca4fa0c7518c32cd13142ec85b5f97 Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 13 Feb 2021 10:47:17 -0500 Subject: [PATCH] Initial adoption of bottom reader menus from TachiyomiSY Co-authored-by: Jobobby04 Co-authored-by: CrepeTF --- .../tachiyomi/ui/reader/ReaderActivity.kt | 27 +-- .../main/res/drawable/ic_skip_next_24dp.xml | 9 - .../res/drawable/ic_skip_previous_24dp.xml | 9 - .../drawable/reader_seekbar_background.xml | 6 + app/src/main/res/layout/reader_activity.xml | 158 ++++++++++++------ app/src/main/res/menu/reader.xml | 14 -- 6 files changed, 131 insertions(+), 92 deletions(-) delete mode 100644 app/src/main/res/drawable/ic_skip_next_24dp.xml delete mode 100644 app/src/main/res/drawable/ic_skip_previous_24dp.xml create mode 100644 app/src/main/res/drawable/reader_seekbar_background.xml diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt index e060d1cab..5e4baed8b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt @@ -239,18 +239,6 @@ class ReaderActivity : BaseRxActivity() presenter.bookmarkCurrentChapter(false) invalidateOptionsMenu() } - R.id.action_settings -> ReaderSettingsSheet(this).show() - R.id.action_custom_filter -> { - val sheet = ReaderColorFilterSheet(this) - // Remove dimmed backdrop so changes can be previewed - .apply { window?.setDimAmount(0f) } - - // Hide toolbars while sheet is open for better preview - sheet.setOnDismissListener { setMenuVisibility(true) } - setMenuVisibility(false) - - sheet.show() - } } return super.onOptionsItemSelected(item) } @@ -356,6 +344,21 @@ class ReaderActivity : BaseRxActivity() } } + binding.actionCustomFilter.setOnClickListener { + val sheet = ReaderColorFilterSheet(this) + // Remove dimmed backdrop so changes can be previewed + .apply { window?.setDimAmount(0f) } + + // Hide toolbars while sheet is open for better preview + sheet.setOnDismissListener { setMenuVisibility(true) } + setMenuVisibility(false) + + sheet.show() + } + binding.actionSettings.setOnClickListener { + ReaderSettingsSheet(this).show() + } + // Set initial visibility setMenuVisibility(menuVisible) } diff --git a/app/src/main/res/drawable/ic_skip_next_24dp.xml b/app/src/main/res/drawable/ic_skip_next_24dp.xml deleted file mode 100644 index 78ae4da4f..000000000 --- a/app/src/main/res/drawable/ic_skip_next_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_skip_previous_24dp.xml b/app/src/main/res/drawable/ic_skip_previous_24dp.xml deleted file mode 100644 index 2dad0ad04..000000000 --- a/app/src/main/res/drawable/ic_skip_previous_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/reader_seekbar_background.xml b/app/src/main/res/drawable/reader_seekbar_background.xml new file mode 100644 index 000000000..0e6908eca --- /dev/null +++ b/app/src/main/res/drawable/reader_seekbar_background.xml @@ -0,0 +1,6 @@ + + + + + diff --git a/app/src/main/res/layout/reader_activity.xml b/app/src/main/res/layout/reader_activity.xml index a215abd74..05773506c 100644 --- a/app/src/main/res/layout/reader_activity.xml +++ b/app/src/main/res/layout/reader_activity.xml @@ -60,61 +60,123 @@ + android:orientation="vertical"> - - - + android:orientation="horizontal"> - - + - + - + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/menu/reader.xml b/app/src/main/res/menu/reader.xml index e51dfe252..79d1f4484 100644 --- a/app/src/main/res/menu/reader.xml +++ b/app/src/main/res/menu/reader.xml @@ -16,18 +16,4 @@ app:iconTint="?attr/colorOnPrimary" app:showAsAction="ifRoom" /> - - - -