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 b21cc4ccec..e2a61a623d 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 @@ -139,8 +139,9 @@ class ReaderActivity : BaseRxActivity() { val container: ViewGroup = findViewById(R.id.reader_container) val readerBHeight = reader_menu_bottom.layoutParams.height container.doOnApplyWindowInsets { _, insets, padding -> - val bottomInset = insets.mandatorySystemGestureInsets.bottom - insets - .systemWindowInsetBottom + val bottomInset = if (Build.VERSION.SDK_INT >= 29) + (insets.mandatorySystemGestureInsets.bottom - insets.systemWindowInsetBottom) + else 0 reader_menu_bottom.updateLayoutParams { height = readerBHeight + bottomInset } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderSettingsSheet.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderSettingsSheet.kt index b798f3b49b..58810a3f0a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderSettingsSheet.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderSettingsSheet.kt @@ -58,7 +58,7 @@ class ReaderSettingsSheet(private val activity: ReaderActivity) : BottomSheetDia viewer.setSelection(activity.presenter.manga?.viewer ?: 0, false) rotation_mode.bindToPreference(preferences.rotation(), 1) - background_color.bindToPreference(preferences.readerTheme()) + background_color.bindToPreference(preferences.readerTheme(), 0, true) show_page_number.bindToPreference(preferences.showPageNumber()) fullscreen.bindToPreference(preferences.fullscreen()) keepscreen.bindToPreference(preferences.keepScreenOn()) @@ -95,9 +95,13 @@ class ReaderSettingsSheet(private val activity: ReaderActivity) : BottomSheetDia /** * Binds a spinner to an int preference with an optional offset for the value. */ - private fun Spinner.bindToPreference(pref: Preference, offset: Int = 0) { + private fun Spinner.bindToPreference(pref: Preference, offset: Int = 0, shouldDismiss: + Boolean + = false) { onItemSelectedListener = IgnoreFirstSpinnerListener { position -> pref.set(position + offset) + if (shouldDismiss) + dismiss() } setSelection(pref.getOrDefault() - offset, false) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerPageHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerPageHolder.kt index 4d1559167c..1191453a76 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerPageHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerPageHolder.kt @@ -6,6 +6,7 @@ import android.graphics.BitmapFactory import android.graphics.PointF import android.graphics.drawable.Drawable import android.net.Uri +import android.os.Build import android.view.GestureDetector import android.view.Gravity import android.view.MotionEvent @@ -347,7 +348,8 @@ class PagerPageHolder( }) } addView(subsamplingImageView) - subsamplingImageView?.isForceDarkAllowed = false + if (Build.VERSION.SDK_INT >= 29) + subsamplingImageView?.isForceDarkAllowed = false return subsamplingImageView!! } diff --git a/app/src/main/res/values-night/colors.xml b/app/src/main/res/values-night/colors.xml new file mode 100644 index 0000000000..d55305f50a --- /dev/null +++ b/app/src/main/res/values-night/colors.xml @@ -0,0 +1,6 @@ + + + @color/md_grey_800 + @color/colorAccentDark + #B3000000 + \ No newline at end of file diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml index a34d096b05..1071a9864f 100644 --- a/app/src/main/res/values-night/themes.xml +++ b/app/src/main/res/values-night/themes.xml @@ -25,7 +25,7 @@ - @style/Theme.Widget.NavigationView.Dark + @style/Theme.Widget.NavigationView @drawable/list_item_selector_dark @drawable/library_item_selector_dark @color/textColorPrimaryDark @@ -33,13 +33,13 @@ @color/iconColorDark - - @@ -47,7 +47,7 @@ - - - - - - - - diff --git a/app/src/main/res/values-v27/styles.xml b/app/src/main/res/values-v27/styles.xml index 734630a9ad..4c335fdaad 100644 --- a/app/src/main/res/values-v27/styles.xml +++ b/app/src/main/res/values-v27/styles.xml @@ -1,6 +1,6 @@ - + --> \ No newline at end of file diff --git a/app/src/main/res/values-v29/themes.xml b/app/src/main/res/values-v29/themes.xml index 54e5d44548..3cd718a156 100644 --- a/app/src/main/res/values-v29/themes.xml +++ b/app/src/main/res/values-v29/themes.xml @@ -6,19 +6,4 @@ @android:color/transparent @android:color/transparent - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 9ff1db179d..617870a145 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -3,6 +3,8 @@ #54759E #54759E + @color/md_black_1000_12 + @color/colorPrimary #212121 #212121 @@ -15,6 +17,7 @@ @color/md_black_1000_38 @color/md_black_1000_12 @color/md_black_1000_12 + #B3FFFFFF @color/colorAccentLight diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 585e0e7ddf..6d29eb4692 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -35,13 +35,12 @@ - + diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index bea8fc13d6..d4f136e705 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -32,6 +32,7 @@ + @style/Theme.Widget.NavigationView @drawable/list_item_selector_light @drawable/library_item_selector_light @color/textColorPrimaryLight @@ -39,10 +40,9 @@ @color/iconColorLight - - +