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 ad192f7d29..aee6a53321 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 @@ -232,7 +232,12 @@ class ReaderActivity : BaseRxActivity() invalidateOptionsMenu() } R.id.action_settings -> ReaderSettingsSheet(this).show() - R.id.action_custom_filter -> ReaderColorFilterSheet(this).show() + R.id.action_custom_filter -> { + ReaderColorFilterSheet(this) + // Remove dimmed backdrop so changes can be previewd + .apply { window?.setDimAmount(0f) } + .show() + } } return super.onOptionsItemSelected(item) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderColorFilterSheet.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderColorFilterSheet.kt index d4d064edad..b70f3f2c00 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderColorFilterSheet.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderColorFilterSheet.kt @@ -1,6 +1,5 @@ package eu.kanade.tachiyomi.ui.reader -import android.graphics.Color import android.view.View import android.view.ViewGroup import android.widget.SeekBar @@ -9,11 +8,8 @@ import com.google.android.material.bottomsheet.BottomSheetBehavior import com.google.android.material.bottomsheet.BottomSheetDialog import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.preference.PreferencesHelper -import eu.kanade.tachiyomi.util.view.gone -import eu.kanade.tachiyomi.util.view.visible import eu.kanade.tachiyomi.widget.IgnoreFirstSpinnerListener import eu.kanade.tachiyomi.widget.SimpleSeekBarListener -import kotlin.math.abs import kotlinx.android.synthetic.main.reader_color_filter.brightness_seekbar import kotlinx.android.synthetic.main.reader_color_filter.color_filter_mode import kotlinx.android.synthetic.main.reader_color_filter.custom_brightness @@ -27,8 +23,6 @@ import kotlinx.android.synthetic.main.reader_color_filter.txt_color_filter_alpha import kotlinx.android.synthetic.main.reader_color_filter.txt_color_filter_blue_value import kotlinx.android.synthetic.main.reader_color_filter.txt_color_filter_green_value import kotlinx.android.synthetic.main.reader_color_filter.txt_color_filter_red_value -import kotlinx.android.synthetic.main.reader_color_filter_sheet.brightness_overlay -import kotlinx.android.synthetic.main.reader_color_filter_sheet.color_overlay import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.flow.sample @@ -39,7 +33,7 @@ import uy.kohesive.injekt.injectLazy */ class ReaderColorFilterSheet(private val activity: ReaderActivity) : BottomSheetDialog(activity) { - private val preferences by injectLazy() + private val preferences: PreferencesHelper by injectLazy() private var sheetBehavior: BottomSheetBehavior<*>? = null @@ -205,15 +199,6 @@ class ReaderColorFilterSheet(private val activity: ReaderActivity) : BottomSheet * 0 sets system brightness and hides the overlay. */ private fun setCustomBrightnessValue(value: Int, view: View, isDisabled: Boolean = false) = with(view) { - // Set black overlay visibility. - if (value < 0) { - brightness_overlay.visible() - val alpha = (abs(value) * 2.56).toInt() - brightness_overlay.setBackgroundColor(Color.argb(alpha, 0, 0, 0)) - } else { - brightness_overlay.gone() - } - if (!isDisabled) { txt_brightness_seekbar_value.text = value.toString() } @@ -230,8 +215,6 @@ class ReaderColorFilterSheet(private val activity: ReaderActivity) : BottomSheet .sample(100) .onEach { setColorFilterValue(it, view) } .launchIn(activity.scope) - } else { - color_overlay.gone() } setColorFilterSeekBar(enabled, view) } @@ -242,8 +225,6 @@ class ReaderColorFilterSheet(private val activity: ReaderActivity) : BottomSheet * @param view view of the dialog */ private fun setColorFilterValue(@ColorInt color: Int, view: View) = with(view) { - color_overlay.visible() - color_overlay.setFilterColor(color, preferences.colorFilterMode().get()) setValues(color, view) } diff --git a/app/src/main/res/drawable-nodpi/filter_mock.webp b/app/src/main/res/drawable-nodpi/filter_mock.webp deleted file mode 100644 index c65b390cb6..0000000000 Binary files a/app/src/main/res/drawable-nodpi/filter_mock.webp and /dev/null differ diff --git a/app/src/main/res/layout-land/reader_color_filter_sheet.xml b/app/src/main/res/layout-land/reader_color_filter_sheet.xml deleted file mode 100644 index b150ec02ed..0000000000 --- a/app/src/main/res/layout-land/reader_color_filter_sheet.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/reader_color_filter_sheet.xml b/app/src/main/res/layout/reader_color_filter_sheet.xml index c18fc3a091..64e9b0fe6e 100644 --- a/app/src/main/res/layout/reader_color_filter_sheet.xml +++ b/app/src/main/res/layout/reader_color_filter_sheet.xml @@ -4,30 +4,6 @@ android:layout_height="match_parent" android:orientation="vertical"> - - - - - - - - - -