From d4e839f555dccb515da0668f15fc0a7b465174da Mon Sep 17 00:00:00 2001 From: Jay Date: Sun, 9 Feb 2020 02:35:00 -0800 Subject: [PATCH] Edge to edge bottom sheets for reader Added collaspe button to reader sheet Made other reader themes material --- .../design/MigrationBottomSheetDialog.kt | 79 ++++++++----------- .../manga/design/PreMigrationController.kt | 3 +- .../ui/reader/ReaderColorFilterSheet.kt | 23 +++++- .../tachiyomi/ui/reader/ReaderPageSheet.kt | 19 ++++- .../ui/reader/ReaderSettingsSheet.kt | 59 +++++++++++++- .../tachiyomi/util/view/ViewExtensions.kt | 63 ++++++++++++++- app/src/main/res/drawable/round_ripple.xml | 9 +++ .../layout-land/reader_color_filter_sheet.xml | 18 ++--- .../res/layout/migration_bottom_sheet.xml | 21 +++-- .../main/res/layout/reader_color_filter.xml | 4 +- .../res/layout/reader_color_filter_sheet.xml | 9 ++- app/src/main/res/layout/reader_page_sheet.xml | 3 +- .../main/res/layout/reader_settings_sheet.xml | 44 +++++++---- app/src/main/res/values/themes.xml | 4 +- 14 files changed, 262 insertions(+), 96 deletions(-) create mode 100644 app/src/main/res/drawable/round_ripple.xml diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/manga/design/MigrationBottomSheetDialog.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/manga/design/MigrationBottomSheetDialog.kt index d0bd508a14..d6ad69e583 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/manga/design/MigrationBottomSheetDialog.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/manga/design/MigrationBottomSheetDialog.kt @@ -2,13 +2,8 @@ package eu.kanade.tachiyomi.ui.migration.manga.design import android.app.Activity import android.content.res.Configuration -import android.graphics.Color -import android.graphics.drawable.ColorDrawable -import android.graphics.drawable.GradientDrawable import android.os.Build import android.os.Bundle -import android.view.Gravity -import android.view.View import android.view.ViewGroup import android.view.WindowManager import android.widget.CompoundButton @@ -17,7 +12,6 @@ import android.widget.RadioButton import android.widget.RadioGroup import android.widget.Toast import androidx.constraintlayout.widget.ConstraintLayout -import androidx.core.graphics.ColorUtils import com.bluelinelabs.conductor.Controller import com.f2prateek.rx.preferences.Preference import com.google.android.material.bottomsheet.BottomSheetDialog @@ -25,24 +19,18 @@ import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.data.preference.getOrDefault import eu.kanade.tachiyomi.ui.migration.MigrationFlags -import eu.kanade.tachiyomi.util.view.gone +import eu.kanade.tachiyomi.util.system.dpToPx import eu.kanade.tachiyomi.util.system.toast -import eu.kanade.tachiyomi.util.view.marginBottom -import eu.kanade.tachiyomi.util.view.updateLayoutParams +import eu.kanade.tachiyomi.util.view.gone +import eu.kanade.tachiyomi.util.view.setBottomEdge +import eu.kanade.tachiyomi.util.view.setEdgeToEdge import eu.kanade.tachiyomi.util.view.visible import kotlinx.android.synthetic.main.migration_bottom_sheet.* -import kotlinx.android.synthetic.main.migration_bottom_sheet.extra_search_param -import kotlinx.android.synthetic.main.migration_bottom_sheet.extra_search_param_text -import kotlinx.android.synthetic.main.migration_bottom_sheet.mig_categories -import kotlinx.android.synthetic.main.migration_bottom_sheet.mig_chapters -import kotlinx.android.synthetic.main.migration_bottom_sheet.mig_tracking -import kotlinx.android.synthetic.main.migration_bottom_sheet.view.* import uy.kohesive.injekt.injectLazy -class MigrationBottomSheetDialog(private val activity: Activity, theme: Int, private val listener: +class MigrationBottomSheetDialog(activity: Activity, private val listener: StartMigrationListener) : - BottomSheetDialog(activity, - theme) { + BottomSheetDialog(activity, R.style.BottomSheetDialogTheme) { /** * Preferences helper. */ @@ -55,31 +43,35 @@ StartMigrationListener) : // scroll.addView(view) setContentView(view) - if (activity.resources.configuration?.orientation == Configuration.ORIENTATION_LANDSCAPE) + if (activity.resources.configuration?.orientation == Configuration.ORIENTATION_LANDSCAPE) { sourceGroup.orientation = LinearLayout.HORIZONTAL - window?.setBackgroundDrawable(null) - val currentNightMode = activity.resources.configuration.uiMode and Configuration - .UI_MODE_NIGHT_MASK - if (currentNightMode == Configuration.UI_MODE_NIGHT_NO) - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) - window?.decorView?.systemUiVisibility = View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR - else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - val nView = View(context) - val height = activity.window.decorView.rootWindowInsets.systemWindowInsetBottom - val params = ConstraintLayout.LayoutParams( - ViewGroup.LayoutParams.MATCH_PARENT, height - ) - params.bottomToBottom = constraintLayout.id - params.startToStart = constraintLayout.id - params.endToEnd = constraintLayout.id - nView.layoutParams = params - nView.background = GradientDrawable( - GradientDrawable.Orientation.BOTTOM_TOP, intArrayOf( - ColorUtils.setAlphaComponent(Color.BLACK, 179), Color.TRANSPARENT - ) - ) - constraintLayout.addView(nView) + val params = skip_step.layoutParams as ConstraintLayout.LayoutParams + params.apply { + topToBottom = -1 + startToStart = -1 + bottomToBottom = extra_search_param.id + startToEnd = extra_search_param.id + endToEnd = sourceGroup.id + topToTop = extra_search_param.id + marginStart = 16.dpToPx + } + skip_step.layoutParams = params + + + val params2 = extra_search_param_text.layoutParams as ConstraintLayout.LayoutParams + params2.bottomToBottom = options_layout.id + extra_search_param_text.layoutParams = params2 + + + val params3 = extra_search_param.layoutParams as ConstraintLayout.LayoutParams + params3.endToEnd = -1 + extra_search_param.layoutParams = params3 + } + setEdgeToEdge(activity, constraint_layout, view, false) + setBottomEdge( + if (activity.resources.configuration?.orientation == Configuration.ORIENTATION_LANDSCAPE) extra_search_param_text + else skip_step, activity) } /** @@ -92,11 +84,6 @@ StartMigrationListener) : if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { window?.addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS) - val marginB = skip_step.marginBottom - skip_step.updateLayoutParams { - bottomMargin = marginB + - activity.window.decorView.rootWindowInsets.systemWindowInsetBottom - } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/manga/design/PreMigrationController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/manga/design/PreMigrationController.kt index 8cbfc5b5fe..e909fe7c33 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/manga/design/PreMigrationController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/manga/design/PreMigrationController.kt @@ -72,8 +72,7 @@ class PreMigrationController(bundle: Bundle? = null) : BaseController(bundle), F fab.setOnClickListener { if (dialog?.isShowing != true) { - dialog = MigrationBottomSheetDialog(activity!!, R.style.BottomSheetDialogTheme, - this) + dialog = MigrationBottomSheetDialog(activity!!, this) dialog?.show() val bottomSheet = dialog?.findViewById( com.google.android.material.R.id.design_bottom_sheet 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 57f88346dc..eaeb398cd6 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,7 @@ package eu.kanade.tachiyomi.ui.reader import android.graphics.Color +import android.os.Build import android.view.View import android.view.ViewGroup import android.widget.SeekBar @@ -11,11 +12,12 @@ import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.data.preference.getOrDefault import eu.kanade.tachiyomi.util.lang.plusAssign +import eu.kanade.tachiyomi.util.view.setBottomEdge +import eu.kanade.tachiyomi.util.view.setEdgeToEdge import eu.kanade.tachiyomi.widget.IgnoreFirstSpinnerListener import eu.kanade.tachiyomi.widget.SimpleSeekBarListener import kotlinx.android.synthetic.main.reader_color_filter.* -import kotlinx.android.synthetic.main.reader_color_filter_sheet.brightness_overlay -import kotlinx.android.synthetic.main.reader_color_filter_sheet.color_overlay +import kotlinx.android.synthetic.main.reader_color_filter_sheet.* import rx.Subscription import rx.android.schedulers.AndroidSchedulers import rx.subscriptions.CompositeSubscription @@ -26,7 +28,8 @@ import kotlin.math.abs /** * Color filter sheet to toggle custom filter and brightness overlay. */ -class ReaderColorFilterSheet(activity: ReaderActivity) : BottomSheetDialog(activity) { +class ReaderColorFilterSheet(activity: ReaderActivity) : BottomSheetDialog + (activity, R.style.BottomSheetDialogTheme) { private val preferences by injectLazy() @@ -51,6 +54,14 @@ class ReaderColorFilterSheet(activity: ReaderActivity) : BottomSheetDialog(activ val view = activity.layoutInflater.inflate(R.layout.reader_color_filter_sheet, null) setContentView(view) + setEdgeToEdge(activity, constraint_layout, view, true) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && + preferences.readerTheme().getOrDefault() == 0 && + activity.window.decorView.rootWindowInsets.systemWindowInsetRight == 0 && + activity.window.decorView.rootWindowInsets.systemWindowInsetLeft == 0) + window?.decorView?.systemUiVisibility = View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR + setBottomEdge(brightness_seekbar, activity) + sheetBehavior = BottomSheetBehavior.from(view.parent as ViewGroup) // Initialize subscriptions. @@ -90,6 +101,12 @@ class ReaderColorFilterSheet(activity: ReaderActivity) : BottomSheetDialog(activ preferences.customBrightness().set(isChecked) } + /*color_filter_mode.setOnClickListener { + val popupMenu = PopupMenu(context, color_filter_mode) + + popupMenu.menuInflater.inflate(R.menu.download_single, popupMenu.menu) + popupMenu.show() + }*/ color_filter_mode.onItemSelectedListener = IgnoreFirstSpinnerListener { position -> preferences.colorFilterMode().set(position) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPageSheet.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPageSheet.kt index da1acb6a0c..a74e825cf6 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPageSheet.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPageSheet.kt @@ -1,13 +1,21 @@ package eu.kanade.tachiyomi.ui.reader +import android.os.Build import android.os.Bundle +import android.view.View import com.google.android.material.bottomsheet.BottomSheetDialog import android.view.ViewGroup import com.afollestad.materialdialogs.MaterialDialog import eu.kanade.tachiyomi.R +import eu.kanade.tachiyomi.data.preference.PreferencesHelper +import eu.kanade.tachiyomi.data.preference.getOrDefault import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.ui.reader.model.ReaderPage +import eu.kanade.tachiyomi.util.view.setBottomEdge +import eu.kanade.tachiyomi.util.view.setEdgeToEdge import kotlinx.android.synthetic.main.reader_page_sheet.* +import uy.kohesive.injekt.Injekt +import uy.kohesive.injekt.api.get /** * Sheet to show when a page is long clicked. @@ -15,7 +23,7 @@ import kotlinx.android.synthetic.main.reader_page_sheet.* class ReaderPageSheet( private val activity: ReaderActivity, private val page: ReaderPage -) : BottomSheetDialog(activity) { +) : BottomSheetDialog(activity, R.style.BottomSheetDialogTheme) { /** * View used on this sheet. @@ -24,6 +32,15 @@ class ReaderPageSheet( init { setContentView(view) + setEdgeToEdge(activity, view, view, false) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && + Injekt.get().readerTheme().getOrDefault() == 0 && + activity.window.decorView.rootWindowInsets.systemWindowInsetRight == 0 && + activity.window.decorView.rootWindowInsets.systemWindowInsetLeft == 0) + window?.decorView?.systemUiVisibility = View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR + + setBottomEdge(save_layout, activity) + set_as_cover_layout.setOnClickListener { setAsCover() } share_layout.setOnClickListener { share() } 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 3b48be03a6..a1ff69ea07 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 @@ -1,16 +1,25 @@ package eu.kanade.tachiyomi.ui.reader +import android.content.res.Configuration +import android.os.Build import android.os.Bundle +import android.view.View +import android.view.ViewGroup import com.google.android.material.bottomsheet.BottomSheetDialog import androidx.core.widget.NestedScrollView import android.widget.CompoundButton import android.widget.Spinner import com.f2prateek.rx.preferences.Preference +import com.google.android.material.bottomsheet.BottomSheetBehavior import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.data.preference.getOrDefault import eu.kanade.tachiyomi.ui.reader.viewer.pager.PagerViewer import eu.kanade.tachiyomi.ui.reader.viewer.webtoon.WebtoonViewer +import eu.kanade.tachiyomi.util.system.dpToPx +import eu.kanade.tachiyomi.util.view.gone +import eu.kanade.tachiyomi.util.view.setBottomEdge +import eu.kanade.tachiyomi.util.view.setEdgeToEdge import eu.kanade.tachiyomi.util.view.visible import eu.kanade.tachiyomi.widget.IgnoreFirstSpinnerListener import kotlinx.android.synthetic.main.reader_settings_sheet.* @@ -19,19 +28,48 @@ import uy.kohesive.injekt.injectLazy /** * Sheet to show reader and viewer preferences. */ -class ReaderSettingsSheet(private val activity: ReaderActivity) : BottomSheetDialog(activity) { +class ReaderSettingsSheet(private val activity: ReaderActivity) : BottomSheetDialog + (activity, R.style.BottomSheetDialogTheme) { /** * Preferences helper. */ private val preferences by injectLazy() + private var sheetBehavior: BottomSheetBehavior<*> + + val scroll:NestedScrollView + init { // Use activity theme for this layout val view = activity.layoutInflater.inflate(R.layout.reader_settings_sheet, null) - val scroll = NestedScrollView(activity) + scroll = NestedScrollView(activity) scroll.addView(view) setContentView(scroll) + + sheetBehavior = BottomSheetBehavior.from(scroll.parent as ViewGroup) + setEdgeToEdge(activity, constraint_layout, scroll, + context.resources.configuration.orientation == Configuration.ORIENTATION_LANDSCAPE) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && + preferences.readerTheme().getOrDefault() == 0 && + activity.window.decorView.rootWindowInsets.systemWindowInsetRight == 0 && + activity.window.decorView.rootWindowInsets.systemWindowInsetLeft == 0) + window?.decorView?.systemUiVisibility = View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR + val height = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + activity.window.decorView.rootWindowInsets.systemWindowInsetBottom + } else 0 + sheetBehavior.peekHeight = 200.dpToPx + height + + sheetBehavior.addBottomSheetCallback(object : BottomSheetBehavior.BottomSheetCallback() { + override fun onSlide(bottomSheet: View, progress: Float) { } + + override fun onStateChanged(p0: View, state: Int) { + if (state == BottomSheetBehavior.STATE_EXPANDED) { + sheetBehavior.skipCollapsed = true + } + } + }) + } /** @@ -46,6 +84,21 @@ class ReaderSettingsSheet(private val activity: ReaderActivity) : BottomSheetDia is PagerViewer -> initPagerPreferences() is WebtoonViewer -> initWebtoonPreferences() } + + setBottomEdge( + if (activity.viewer is PagerViewer) page_transitions else crop_borders_webtoon, activity + ) + + close_button.setOnClickListener { + dismiss() + } + + } + + override fun onStart() { + super.onStart() + sheetBehavior.skipCollapsed = true + sheetBehavior.state = BottomSheetBehavior.STATE_EXPANDED } /** @@ -70,6 +123,7 @@ class ReaderSettingsSheet(private val activity: ReaderActivity) : BottomSheetDia */ private fun initPagerPreferences() { pager_prefs_group.visible() + webtoon_prefs_group.gone() scale_type.bindToPreference(preferences.imageScaleType(), 1) zoom_start.bindToPreference(preferences.zoomStart(), 1) crop_borders.bindToPreference(preferences.cropBorders()) @@ -81,6 +135,7 @@ class ReaderSettingsSheet(private val activity: ReaderActivity) : BottomSheetDia */ private fun initWebtoonPreferences() { webtoon_prefs_group.visible() + pager_prefs_group.gone() crop_borders_webtoon.bindToPreference(preferences.cropBordersWebtoon()) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/view/ViewExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/util/view/ViewExtensions.kt index 7edb46bd3e..4b363b1eea 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/view/ViewExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/view/ViewExtensions.kt @@ -2,31 +2,35 @@ package eu.kanade.tachiyomi.util.view +import android.app.Activity import android.content.Context +import android.content.res.Configuration import android.graphics.Color import android.graphics.Point import android.graphics.Typeface +import android.graphics.drawable.GradientDrawable +import android.os.Build import android.view.View import android.view.ViewGroup import android.view.WindowInsets import android.widget.TextView import androidx.annotation.Px import androidx.annotation.RequiresApi -import androidx.coordinatorlayout.widget.CoordinatorLayout import androidx.appcompat.widget.SearchView +import androidx.constraintlayout.widget.ConstraintLayout +import androidx.core.graphics.ColorUtils import androidx.core.view.ViewCompat import com.amulyakhare.textdrawable.TextDrawable import com.amulyakhare.textdrawable.util.ColorGenerator import com.bluelinelabs.conductor.Controller +import com.google.android.material.bottomsheet.BottomSheetDialog import com.google.android.material.snackbar.Snackbar import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.preference.PreferencesHelper -import eu.kanade.tachiyomi.util.system.getResourceColor -import eu.kanade.tachiyomi.data.preference.getOrDefault import eu.kanade.tachiyomi.ui.main.MainActivity +import eu.kanade.tachiyomi.util.system.getResourceColor import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get -import uy.kohesive.injekt.injectLazy import kotlin.math.min /** @@ -233,4 +237,55 @@ inline fun View.updatePaddingRelative( @Px bottom: Int = paddingBottom ) { setPaddingRelative(start, top, end, bottom) +} + +fun BottomSheetDialog.setEdgeToEdge(activity: Activity, layout: View, contentView: View, + setTopMargin: Boolean) { + window?.setBackgroundDrawable(null) + val currentNightMode = activity.resources.configuration.uiMode and Configuration + .UI_MODE_NIGHT_MASK + if (currentNightMode == Configuration.UI_MODE_NIGHT_NO) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + if (activity.window.decorView.rootWindowInsets.systemWindowInsetRight == 0 && + activity.window.decorView.rootWindowInsets.systemWindowInsetLeft == 0) + window?.decorView?.systemUiVisibility = View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR + } + else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && layout is ConstraintLayout) { + val nView = View(context) + val height = activity.window.decorView.rootWindowInsets.systemWindowInsetBottom + val params = ConstraintLayout.LayoutParams( + ViewGroup.LayoutParams.MATCH_PARENT, height + ) + params.bottomToBottom = layout.id + params.startToStart = layout.id + params.endToEnd = layout.id + nView.layoutParams = params + nView.background = GradientDrawable( + GradientDrawable.Orientation.BOTTOM_TOP, intArrayOf( + ColorUtils.setAlphaComponent(Color.BLACK, 179), Color.TRANSPARENT + ) + ) + layout.addView(nView) + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + //window?.addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS) + window?.findViewById(com.google.android.material.R.id.container)?.fitsSystemWindows = + false + contentView.updateLayoutParams { + if (setTopMargin) + topMargin = activity.window.decorView.rootWindowInsets.systemWindowInsetTop + leftMargin = activity.window.decorView.rootWindowInsets.systemWindowInsetLeft + rightMargin = activity.window.decorView.rootWindowInsets.systemWindowInsetRight + } + } +} + +fun setBottomEdge(view: View, activity: Activity) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + val marginB = view.marginBottom + view.updateLayoutParams { + bottomMargin = marginB + + activity.window.decorView.rootWindowInsets.systemWindowInsetBottom + } + } } \ No newline at end of file diff --git a/app/src/main/res/drawable/round_ripple.xml b/app/src/main/res/drawable/round_ripple.xml new file mode 100644 index 0000000000..bec0a84b4c --- /dev/null +++ b/app/src/main/res/drawable/round_ripple.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file 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 index 75c1f8424c..4dc4bd9b0d 100644 --- a/app/src/main/res/layout-land/reader_color_filter_sheet.xml +++ b/app/src/main/res/layout-land/reader_color_filter_sheet.xml @@ -4,18 +4,18 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" - android:orientation="horizontal" + android:background="?android:colorBackground" android:baselineAligned="false" - android:background="?android:colorBackground"> + android:orientation="horizontal"> + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="@id/scroll"> + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toEndOf="@id/frame"> - + - + \ No newline at end of file diff --git a/app/src/main/res/layout/migration_bottom_sheet.xml b/app/src/main/res/layout/migration_bottom_sheet.xml index ba3024d5e0..f235d9a29e 100644 --- a/app/src/main/res/layout/migration_bottom_sheet.xml +++ b/app/src/main/res/layout/migration_bottom_sheet.xml @@ -2,8 +2,10 @@ + app:layout_constraintTop_toBottomOf="@+id/extra_search_param_text"/> + + diff --git a/app/src/main/res/layout/reader_color_filter.xml b/app/src/main/res/layout/reader_color_filter.xml index 74940f2cd3..6ce11e2668 100644 --- a/app/src/main/res/layout/reader_color_filter.xml +++ b/app/src/main/res/layout/reader_color_filter.xml @@ -2,8 +2,9 @@ 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 c4d4da941b..23e7ce23d4 100644 --- a/app/src/main/res/layout/reader_color_filter_sheet.xml +++ b/app/src/main/res/layout/reader_color_filter_sheet.xml @@ -1,10 +1,11 @@ + android:background="@drawable/bg_bottom_sheet_dialog_fragment" + android:clipToPadding="false" + android:orientation="vertical"> - + diff --git a/app/src/main/res/layout/reader_page_sheet.xml b/app/src/main/res/layout/reader_page_sheet.xml index 2cd9b7d96a..955a01e19f 100644 --- a/app/src/main/res/layout/reader_page_sheet.xml +++ b/app/src/main/res/layout/reader_page_sheet.xml @@ -2,7 +2,8 @@ diff --git a/app/src/main/res/layout/reader_settings_sheet.xml b/app/src/main/res/layout/reader_settings_sheet.xml index 3725094d1a..5dbe384c5b 100644 --- a/app/src/main/res/layout/reader_settings_sheet.xml +++ b/app/src/main/res/layout/reader_settings_sheet.xml @@ -3,12 +3,16 @@ xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/constraint_layout" android:layout_width="match_parent" - android:layout_height="match_parent" - android:background="?android:colorBackground" + style="@style/BottomSheetDialogTheme" + android:background="@drawable/bg_bottom_sheet_dialog_fragment" + android:layout_height="wrap_content" android:clipToPadding="false" android:orientation="vertical" - android:padding="@dimen/material_component_dialogs_padding_around_content_area" + android:paddingStart="@dimen/material_component_dialogs_padding_around_content_area" + android:paddingEnd="@dimen/material_component_dialogs_padding_around_content_area" + android:paddingTop="16dp" android:forceDarkAllowed="false"> @@ -20,18 +24,22 @@ android:text="@string/pref_category_general" android:textColor="?attr/colorAccent" android:textStyle="bold" + app:layout_constraintEnd_toStartOf="@id/close_button" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> - + @@ -163,6 +171,7 @@ + app:layout_constraintTop_toBottomOf="@id/crop_borders" + app:layout_constraintBottom_toBottomOf="parent"/> @@ -234,7 +245,8 @@ android:layout_marginTop="16dp" android:text="@string/pref_crop_borders" android:textColor="?android:attr/textColorSecondary" - app:layout_constraintTop_toBottomOf="@id/webtoon_prefs" /> + app:layout_constraintTop_toBottomOf="@id/webtoon_prefs" + app:layout_constraintBottom_toBottomOf="parent" /> @@ -243,7 +255,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="gone" - app:constraint_referenced_ids="pager_prefs,scale_type_text,scale_type,zoom_start_text,zoom_start,crop_borders,page_transitions" + app:constraint_referenced_ids="pager_prefs,scale_type,scale_type_text,zoom_start_text,zoom_start,crop_borders,page_transitions" tools:visibility="visible" /> ?colorPrimaryDark - -