Merge pull request #206 from CarlosEsco/minorCodeCleanup

cleaned up some code in the reader sections
This commit is contained in:
Jays2Kings 2020-04-22 20:24:50 -04:00 committed by GitHub
commit a0859148e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 217 additions and 154 deletions

View File

@ -4,8 +4,6 @@ import android.app.Dialog
import android.os.Bundle
import android.view.View
import com.afollestad.materialdialogs.MaterialDialog
import com.afollestad.materialdialogs.WhichButton
import com.afollestad.materialdialogs.actions.setActionButtonEnabled
import com.afollestad.materialdialogs.customview.customView
import com.jakewharton.rxbinding.widget.itemClicks
import com.jakewharton.rxbinding.widget.textChanges
@ -64,7 +62,9 @@ class TrackSearchDialog : DialogController {
customView(viewRes = R.layout.track_search_dialog, scrollable = false)
negativeButton(android.R.string.cancel)
positiveButton(R.string.clear) { onPositiveButtonClick() }
setActionButtonEnabled(WhichButton.POSITIVE, wasPreviouslyTracked)
if (wasPreviouslyTracked) {
positiveButton(R.string.clear) { onPositiveButtonClick() }
}
}
if (subscriptions.isUnsubscribed) {

View File

@ -114,6 +114,7 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>(),
private set
private var coroutine: Job? = null
/**
* System UI helper to hide status & navigation bar on all different API levels.
*/
@ -172,16 +173,14 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>(),
lightStatusBar = a.getBoolean(0, false)
a.recycle()
setNotchCutoutMode()
if (lightStatusBar) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) reader_layout.systemUiVisibility =
reader_layout.systemUiVisibility.or(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR)
reader_layout.systemUiVisibility =
reader_layout.systemUiVisibility.or(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR)
} else {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) reader_layout.systemUiVisibility =
reader_layout.systemUiVisibility.rem(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR)
reader_layout.systemUiVisibility =
reader_layout.systemUiVisibility.rem(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR)
val systemUiFlag = when (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
true -> View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR
false -> View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
}
reader_layout.systemUiVisibility = when (lightStatusBar) {
true -> reader_layout.systemUiVisibility.or(systemUiFlag)
false -> reader_layout.systemUiVisibility.rem(systemUiFlag)
}
if (presenter.needsInit()) {
@ -193,8 +192,11 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>(),
return
}
NotificationReceiver.dismissNotification(this, manga.hashCode(), Notifications.ID_NEW_CHAPTERS)
if (chapter > -1) presenter.init(manga, chapter)
else presenter.init(manga, chapterUrl)
when (chapter > -1) {
true -> presenter.init(manga, chapter)
false -> presenter.init(manga, chapterUrl)
}
}
if (savedInstanceState != null) {
@ -243,10 +245,10 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>(),
override fun onWindowFocusChanged(hasFocus: Boolean) {
super.onWindowFocusChanged(hasFocus)
if (hasFocus) {
if (menuStickyVisible)
setMenuVisibility(false)
else
setMenuVisibility(menuVisible, animate = false)
when (menuStickyVisible) {
true -> setMenuVisibility(false)
false -> setMenuVisibility(menuVisible, animate = false)
}
}
}
@ -312,8 +314,10 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>(),
private fun initializeMenu() {
// Set toolbar
setSupportActionBar(toolbar)
val primaryColor = ColorUtils.setAlphaComponent(getResourceColor(R.attr.colorSecondary),
200)
val primaryColor = ColorUtils.setAlphaComponent(
getResourceColor(R.attr.colorSecondary),
200
)
appbar.setBackgroundColor(primaryColor)
window.statusBarColor = Color.TRANSPARENT
supportActionBar?.setDisplayHomeAsUpEnabled(true)
@ -337,7 +341,8 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>(),
chapters_bottom_sheet.sheetBehavior?.state = BottomSheetBehavior.STATE_HIDDEN
reader_menu.doOnApplyWindowInsets { v, insets, _ ->
sheetManageNavColor = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q && (insets
.systemWindowInsetBottom != insets.tappableElementInsets.bottom)) {
.systemWindowInsetBottom != insets.tappableElementInsets.bottom)
) {
window.navigationBarColor = Color.TRANSPARENT
false
}
@ -372,10 +377,13 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>(),
snackbar?.dismiss()
systemUi?.show()
reader_menu.visibility = View.VISIBLE
if (chapters_bottom_sheet.sheetBehavior?.state == BottomSheetBehavior.STATE_EXPANDED)
if (chapters_bottom_sheet.sheetBehavior?.state == BottomSheetBehavior.STATE_EXPANDED) {
chapters_bottom_sheet.sheetBehavior?.isHideable = false
if (chapters_bottom_sheet.sheetBehavior?.state != BottomSheetBehavior.STATE_EXPANDED && sheetManageNavColor)
}
if (chapters_bottom_sheet.sheetBehavior?.state != BottomSheetBehavior.STATE_EXPANDED && sheetManageNavColor) {
window.navigationBarColor = Color.TRANSPARENT // getResourceColor(R.attr.colorPrimaryDark)
}
if (animate) {
if (!menuStickyVisible) {
val toolbarAnimation = AnimationUtils.loadAnimation(this, R.anim.enter_from_top)
@ -401,8 +409,9 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>(),
appbar.startAnimation(toolbarAnimation)
BottomSheetBehavior.from(chapters_bottom_sheet).isHideable = true
BottomSheetBehavior.from(chapters_bottom_sheet).state = BottomSheetBehavior.STATE_HIDDEN
} else
} else {
reader_menu.visibility = View.GONE
}
}
menuStickyVisible = false
}
@ -524,12 +533,15 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>(),
page_text.text = "${page.number} / ${pages.size}"
if (newChapter) {
if (config?.showNewChapter == false) systemUi?.show()
if (config?.showNewChapter == false) {
systemUi?.show()
}
} else if (chapters_bottom_sheet.shouldCollaspe && chapters_bottom_sheet.sheetBehavior?.state == BottomSheetBehavior.STATE_EXPANDED) {
chapters_bottom_sheet.sheetBehavior?.state = BottomSheetBehavior.STATE_COLLAPSED
}
if (chapters_bottom_sheet.selectedChapterId != page.chapter.chapter.id)
if (chapters_bottom_sheet.selectedChapterId != page.chapter.chapter.id) {
chapters_bottom_sheet.refreshList()
}
chapters_bottom_sheet.shouldCollaspe = true
// Set seekbar progress
@ -632,11 +644,13 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>(),
* depending on the [result].
*/
fun onSetAsCoverResult(result: ReaderPresenter.SetAsCoverResult) {
toast(when (result) {
Success -> R.string.cover_updated
AddToLibraryFirst -> R.string.must_be_in_library_to_edit
Error -> R.string.failed_to_update_cover
})
toast(
when (result) {
Success -> R.string.cover_updated
AddToLibraryFirst -> R.string.must_be_in_library_to_edit
Error -> R.string.failed_to_update_cover
}
)
}
override fun onVisibilityChange(visible: Boolean) {
@ -679,7 +693,7 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>(),
if (currentOrientation == Configuration.ORIENTATION_LANDSCAPE) {
val params = window.attributes
params.layoutInDisplayCutoutMode =
WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_NEVER
WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_NEVER
}
}
}

View File

@ -7,12 +7,12 @@ import android.view.View
import android.widget.FrameLayout
import android.widget.ImageView
import android.widget.TextView
import androidx.core.content.ContextCompat
import com.mikepenz.fastadapter.FastAdapter
import com.mikepenz.fastadapter.items.AbstractItem
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.data.database.models.Chapter
import eu.kanade.tachiyomi.data.database.models.Manga
import eu.kanade.tachiyomi.util.system.contextCompatDrawable
import eu.kanade.tachiyomi.util.system.getResourceColor
import java.text.DecimalFormat
import java.text.DecimalFormatSymbols
@ -53,10 +53,8 @@ class ReaderChapterItem(val chapter: Chapter, val manga: Manga, val isCurrent: B
private var unreadColor = view.context.getResourceColor(android.R.attr.textColorPrimary)
private var activeColor = view.context.getResourceColor(android.R.attr.colorAccent)
private var unbookmark = ContextCompat.getDrawable(view.context, R.drawable
.ic_bookmark_border_24dp)
private var bookmark = ContextCompat.getDrawable(view.context, R.drawable
.ic_bookmark_24dp)
private var unbookmark = view.context.contextCompatDrawable(R.drawable.ic_bookmark_border_24dp)
private var bookmark = view.context.contextCompatDrawable(R.drawable.ic_bookmark_24dp)
override fun bindView(item: ReaderChapterItem, payloads: List<Any>) {
val chapter = item.chapter

View File

@ -3,7 +3,6 @@ package eu.kanade.tachiyomi.ui.reader
import android.content.Context
import android.content.res.ColorStateList
import android.graphics.Color
import android.os.Build
import android.util.AttributeSet
import android.view.View
import android.widget.LinearLayout
@ -16,6 +15,7 @@ import com.mikepenz.fastadapter.adapters.ItemAdapter
import com.mikepenz.fastadapter.listeners.ClickEventHook
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.util.system.dpToPx
import eu.kanade.tachiyomi.util.system.getBottomInsets
import eu.kanade.tachiyomi.util.system.getResourceColor
import eu.kanade.tachiyomi.util.system.launchUI
import eu.kanade.tachiyomi.util.view.doOnApplyWindowInsets
@ -38,28 +38,29 @@ class ReaderChapterSheet @JvmOverloads constructor(context: Context, attrs: Attr
fun setup(activity: ReaderActivity) {
presenter = activity.presenter
val primary = ColorUtils.setAlphaComponent(
activity.getResourceColor(
R.attr.colorSecondary
), 200
)
val fullPrimary = activity.getResourceColor(R.attr.colorSecondary)
val primary = ColorUtils.setAlphaComponent(fullPrimary, 200)
sheetBehavior = BottomSheetBehavior.from(this)
chapters_button.setOnClickListener {
if (sheetBehavior?.state == BottomSheetBehavior.STATE_EXPANDED) sheetBehavior?.state =
BottomSheetBehavior.STATE_COLLAPSED
else sheetBehavior?.state = BottomSheetBehavior.STATE_EXPANDED
if (sheetBehavior?.state == BottomSheetBehavior.STATE_EXPANDED) {
sheetBehavior?.state = BottomSheetBehavior.STATE_COLLAPSED
} else {
sheetBehavior?.state = BottomSheetBehavior.STATE_EXPANDED
}
}
val peek = sheetBehavior?.peekHeight ?: 30.dpToPx
post {
chapter_recycler.alpha =
if (sheetBehavior?.state == BottomSheetBehavior.STATE_EXPANDED) 1f else 0f
chapter_recycler.alpha = when (sheetBehavior?.state == BottomSheetBehavior.STATE_EXPANDED) {
true -> 1f
false -> 0f
}
}
chapters_bottom_sheet.doOnApplyWindowInsets { _, insets, _ ->
sheetBehavior?.peekHeight =
peek + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) insets.mandatorySystemGestureInsets.bottom
else insets.systemWindowInsetBottom
sheetBehavior?.peekHeight = peek + insets.getBottomInsets()
chapters_bottom_sheet.updateLayoutParams<MarginLayoutParams> {
height = 280.dpToPx + insets.systemWindowInsetBottom
}

View File

@ -56,8 +56,6 @@ class ReaderPresenter(
private val preferences: PreferencesHelper = Injekt.get()
) : BasePresenter<ReaderActivity>() {
private var scope = CoroutineScope(Job() + Dispatchers.Default)
/**
* The manga loaded in the reader. It can be null when instantiated for a short time.
*/

View File

@ -48,11 +48,9 @@ class ReaderSeekBar @JvmOverloads constructor(
override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) {
super.onLayout(changed, left, top, right, bottom)
if (Build.VERSION.SDK_INT >= 29) {
if (changed) {
boundingBox.set(left, top, right, bottom)
systemGestureExclusionRects = exclusions
}
if (Build.VERSION.SDK_INT >= 29 && changed) {
boundingBox.set(left, top, right, bottom)
systemGestureExclusionRects = exclusions
}
}
}

View File

@ -52,9 +52,14 @@ class ReaderSettingsSheet(private val activity: ReaderActivity) :
0 else -1
)
window?.navigationBarColor = Color.TRANSPARENT
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
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 = activity.window.decorView.rootWindowInsets.systemWindowInsetBottom
sheetBehavior.peekHeight = 550.dpToPx + height
@ -87,9 +92,14 @@ class ReaderSettingsSheet(private val activity: ReaderActivity) :
is WebtoonViewer -> initWebtoonPreferences()
}
setBottomEdge(
if (activity.viewer is PagerViewer) page_transitions else webtoon_side_padding, activity
)
val bottomEdgeView = when(activity.viewer is PagerViewer){
true -> page_transitions
false -> webtoon_side_padding
}
setBottomEdge(bottomEdgeView, activity)
close_button.setOnClickListener {
dismiss()

View File

@ -115,6 +115,18 @@ class SettingsReaderController : SettingsController() {
titleRes = R.string.crop_borders
defaultValue = false
}
intListPreference(activity) {
key = Keys.webtoonSidePadding
titleRes = R.string.pref_webtoon_side_padding
entriesRes = arrayOf(
R.string.webtoon_side_padding_0,
R.string.webtoon_side_padding_10, R.string.webtoon_side_padding_15,
R.string.webtoon_side_padding_20, R.string.webtoon_side_padding_25
)
entryValues = listOf(0, 10, 15, 20, 25)
defaultValue = "0"
}
}
preferenceCategory {
titleRes = R.string.navigation

View File

@ -9,11 +9,14 @@ import android.content.Intent
import android.content.IntentFilter
import android.content.pm.PackageManager
import android.content.res.Resources
import android.graphics.drawable.Drawable
import android.net.ConnectivityManager
import android.net.Uri
import android.os.PowerManager
import android.widget.Toast
import androidx.annotation.AttrRes
import androidx.annotation.ColorRes
import androidx.annotation.DrawableRes
import androidx.annotation.StringRes
import androidx.browser.customtabs.CustomTabsIntent
import androidx.core.app.NotificationCompat
@ -89,6 +92,24 @@ fun Context.getResourceColor(@AttrRes resource: Int): Int {
return attrValue
}
/**
* Returns the color from ContextCompat
*
* @param resource the color.
*/
fun Context.contextCompatColor(@ColorRes resource: Int): Int {
return ContextCompat.getColor(this, resource)
}
/**
* Returns the color from ContextCompat
*
* @param resource the color.
*/
fun Context.contextCompatDrawable(@DrawableRes resource: Int): Drawable? {
return ContextCompat.getDrawable(this, resource)
}
/**
* Converts to dp.
*/

View File

@ -0,0 +1,13 @@
package eu.kanade.tachiyomi.util.system
import android.annotation.SuppressLint
import android.os.Build
import android.view.WindowInsets
@SuppressLint("NewApi")
fun WindowInsets.getBottomInsets(): Int {
return when (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
true -> mandatorySystemGestureInsets.bottom
false -> systemWindowInsetBottom
}
}

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"

View File

@ -1,9 +1,9 @@
<FrameLayout 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/reader_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/reader_layout"
android:gravity="center">
<FrameLayout
@ -41,26 +41,27 @@
android:background="@android:color/transparent"
android:visibility="invisible"
tools:visibility="visible">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="?attr/actionBarTheme"
android:background="?attr/colorSecondary"
android:stateListAnimator="@null"
android:theme="?attr/actionBarTheme"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@android:color/transparent" />
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@android:color/transparent" />
</com.google.android.material.appbar.AppBarLayout>
<include layout="@layout/reader_chapters_sheet"/>
<include layout="@layout/reader_chapters_sheet" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -4,9 +4,9 @@
android:id="@+id/reader_chapter_layout"
android:layout_width="match_parent"
android:layout_height="60dp"
android:background="@drawable/list_item_selector"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:background="@drawable/list_item_selector"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
@ -59,6 +59,6 @@
android:layout_height="30dp"
android:layout_gravity="center"
android:src="@drawable/ic_bookmark_border_24dp"
android:tint="?android:attr/textColorHint"/>
android:tint="?android:attr/textColorHint" />
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -66,8 +66,8 @@
android:layout_width="100dp"
android:layout_height="match_parent"
android:gravity="center"
android:textSize="15sp"
android:textColor="?actionBarTintColor"
android:textSize="15sp"
tools:text="100 / 105" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,10 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/constraint_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp">
<androidx.legacy.widget.Space
@ -20,9 +19,9 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/use_custom_color_filter"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!-- Red filter -->
@ -30,13 +29,13 @@
android:id="@+id/seekbar_color_filter_red"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:max="255"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:max="255"
android:padding="@dimen/material_component_text_fields_floating_label_padding_between_label_and_input_text"
app:layout_constraintTop_toBottomOf="@id/switch_color_filter"
app:layout_constraintEnd_toStartOf="@id/txt_color_filter_red_value"
app:layout_constraintStart_toEndOf="@id/txt_color_filter_red_symbol"
app:layout_constraintEnd_toStartOf="@id/txt_color_filter_red_value" />
app:layout_constraintTop_toBottomOf="@id/switch_color_filter" />
<TextView
android:id="@+id/txt_color_filter_red_symbol"
@ -44,9 +43,9 @@
android:layout_height="wrap_content"
android:text="@string/red_initial"
android:textAppearance="@style/TextAppearance.Regular.SubHeading.Secondary"
app:layout_constraintTop_toTopOf="@id/seekbar_color_filter_red"
app:layout_constraintBottom_toBottomOf="@id/seekbar_color_filter_red"
app:layout_constraintStart_toStartOf="parent"/>
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/seekbar_color_filter_red" />
<TextView
android:id="@+id/txt_color_filter_red_value"
@ -54,9 +53,9 @@
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:textAppearance="@style/TextAppearance.Regular.SubHeading.Secondary"
app:layout_constraintTop_toTopOf="@id/seekbar_color_filter_red"
app:layout_constraintBottom_toBottomOf="@id/seekbar_color_filter_red"
app:layout_constraintEnd_toEndOf="parent"/>
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/seekbar_color_filter_red" />
<!-- Green filter -->
@ -64,13 +63,13 @@
android:id="@+id/seekbar_color_filter_green"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:max="255"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:max="255"
android:padding="@dimen/material_component_text_fields_floating_label_padding_between_label_and_input_text"
app:layout_constraintTop_toBottomOf="@id/seekbar_color_filter_red"
app:layout_constraintEnd_toStartOf="@id/txt_color_filter_green_value"
app:layout_constraintStart_toEndOf="@id/txt_color_filter_green_symbol"
app:layout_constraintEnd_toStartOf="@id/txt_color_filter_green_value" />
app:layout_constraintTop_toBottomOf="@id/seekbar_color_filter_red" />
<TextView
android:id="@+id/txt_color_filter_green_symbol"
@ -78,9 +77,9 @@
android:layout_height="wrap_content"
android:text="@string/green_initial"
android:textAppearance="@style/TextAppearance.Regular.SubHeading.Secondary"
app:layout_constraintTop_toTopOf="@id/seekbar_color_filter_green"
app:layout_constraintBottom_toBottomOf="@id/seekbar_color_filter_green"
app:layout_constraintStart_toStartOf="parent"/>
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/seekbar_color_filter_green" />
<TextView
android:id="@+id/txt_color_filter_green_value"
@ -88,9 +87,9 @@
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:textAppearance="@style/TextAppearance.Regular.SubHeading.Secondary"
app:layout_constraintTop_toTopOf="@id/seekbar_color_filter_green"
app:layout_constraintBottom_toBottomOf="@id/seekbar_color_filter_green"
app:layout_constraintEnd_toEndOf="parent"/>
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/seekbar_color_filter_green" />
<!-- Blue filter -->
@ -98,13 +97,13 @@
android:id="@+id/seekbar_color_filter_blue"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:max="255"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:max="255"
android:padding="@dimen/material_component_text_fields_floating_label_padding_between_label_and_input_text"
app:layout_constraintTop_toBottomOf="@id/seekbar_color_filter_green"
app:layout_constraintEnd_toStartOf="@id/txt_color_filter_blue_value"
app:layout_constraintStart_toEndOf="@id/txt_color_filter_blue_symbol"
app:layout_constraintEnd_toStartOf="@id/txt_color_filter_blue_value" />
app:layout_constraintTop_toBottomOf="@id/seekbar_color_filter_green" />
<TextView
android:id="@+id/txt_color_filter_blue_symbol"
@ -112,9 +111,9 @@
android:layout_height="wrap_content"
android:text="@string/blue_initial"
android:textAppearance="@style/TextAppearance.Regular.SubHeading.Secondary"
app:layout_constraintTop_toTopOf="@id/seekbar_color_filter_blue"
app:layout_constraintBottom_toBottomOf="@id/seekbar_color_filter_blue"
app:layout_constraintStart_toStartOf="parent"/>
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/seekbar_color_filter_blue" />
<TextView
android:id="@+id/txt_color_filter_blue_value"
@ -122,9 +121,9 @@
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:textAppearance="@style/TextAppearance.Regular.SubHeading.Secondary"
app:layout_constraintTop_toTopOf="@id/seekbar_color_filter_blue"
app:layout_constraintBottom_toBottomOf="@id/seekbar_color_filter_blue"
app:layout_constraintEnd_toEndOf="parent"/>
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/seekbar_color_filter_blue" />
<!-- Alpha filter -->
@ -132,13 +131,13 @@
android:id="@+id/seekbar_color_filter_alpha"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:max="255"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:max="255"
android:padding="@dimen/material_component_text_fields_floating_label_padding_between_label_and_input_text"
app:layout_constraintTop_toBottomOf="@id/seekbar_color_filter_blue"
app:layout_constraintEnd_toStartOf="@id/txt_color_filter_alpha_value"
app:layout_constraintStart_toEndOf="@id/txt_color_filter_alpha_symbol"
app:layout_constraintEnd_toStartOf="@id/txt_color_filter_alpha_value" />
app:layout_constraintTop_toBottomOf="@id/seekbar_color_filter_blue" />
<TextView
android:id="@+id/txt_color_filter_alpha_symbol"
@ -146,9 +145,9 @@
android:layout_height="wrap_content"
android:text="@string/alpha_initial"
android:textAppearance="@style/TextAppearance.Regular.SubHeading.Secondary"
app:layout_constraintTop_toTopOf="@id/seekbar_color_filter_alpha"
app:layout_constraintBottom_toBottomOf="@id/seekbar_color_filter_alpha"
app:layout_constraintStart_toStartOf="parent"/>
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/seekbar_color_filter_alpha" />
<TextView
android:id="@+id/txt_color_filter_alpha_value"
@ -156,9 +155,9 @@
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:textAppearance="@style/TextAppearance.Regular.SubHeading.Secondary"
app:layout_constraintTop_toTopOf="@id/seekbar_color_filter_alpha"
app:layout_constraintBottom_toBottomOf="@id/seekbar_color_filter_alpha"
app:layout_constraintEnd_toEndOf="parent"/>
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/seekbar_color_filter_alpha" />
<!-- Filter mode -->
@ -167,9 +166,9 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/color_filter_blend_mode"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBaseline_toBaselineOf="@id/color_filter_mode"
app:layout_constraintEnd_toStartOf="@id/color_filter_mode"
app:layout_constraintBaseline_toBaselineOf="@id/color_filter_mode"/>
app:layout_constraintStart_toStartOf="parent" />
<androidx.appcompat.widget.AppCompatSpinner
android:id="@+id/color_filter_mode"
@ -177,9 +176,9 @@
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:entries="@array/color_filter_modes"
app:layout_constraintTop_toBottomOf="@id/seekbar_color_filter_alpha"
app:layout_constraintEnd_toEndOf="@id/spinner_end"
app:layout_constraintStart_toEndOf="@id/bottom_line"
app:layout_constraintEnd_toEndOf="@id/spinner_end" />
app:layout_constraintTop_toBottomOf="@id/seekbar_color_filter_alpha" />
<!-- Brightness -->
@ -189,7 +188,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/use_custom_brightness"
app:layout_constraintTop_toBottomOf="@id/color_filter_mode_text"/>
app:layout_constraintTop_toBottomOf="@id/color_filter_mode_text" />
<!-- Brightness value -->
@ -200,10 +199,10 @@
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:padding="@dimen/material_component_text_fields_floating_label_padding_between_label_and_input_text"
app:layout_constraintTop_toBottomOf="@id/custom_brightness"
app:layout_constraintStart_toEndOf="@id/txt_brightness_seekbar_icon"
app:layout_constraintEnd_toStartOf="@id/txt_brightness_seekbar_value"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/txt_brightness_seekbar_value"
app:layout_constraintStart_toEndOf="@id/txt_brightness_seekbar_icon"
app:layout_constraintTop_toBottomOf="@id/custom_brightness"
app:max_seek="100"
app:min_seek="-75" />
@ -213,19 +212,19 @@
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.Regular.SubHeading.Secondary"
android:tint="?android:attr/textColorSecondary"
app:srcCompat="@drawable/ic_brightness_5_black_24dp"
app:layout_constraintTop_toTopOf="@id/brightness_seekbar"
app:layout_constraintBottom_toBottomOf="@id/brightness_seekbar"
app:layout_constraintStart_toStartOf="parent"/>
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/brightness_seekbar"
app:srcCompat="@drawable/ic_brightness_5_black_24dp" />
<TextView
android:id="@+id/txt_brightness_seekbar_value"
android:layout_width="30dp"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.Regular.SubHeading.Secondary"
app:layout_constraintTop_toTopOf="@id/brightness_seekbar"
app:layout_constraintBottom_toBottomOf="@id/brightness_seekbar"
app:layout_constraintEnd_toEndOf="parent"/>
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/brightness_seekbar" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/bottom_line"

View File

@ -1,35 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
style="@style/BottomSheetDialogTheme"
android:background="@drawable/bottom_sheet_rounded_background"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bottom_sheet_rounded_background"
android:orientation="vertical">
<LinearLayout
android:id="@+id/set_as_cover_layout"
android:layout_width="match_parent"
android:layout_height="56dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:gravity="center"
android:clickable="true"
android:focusable="true"
android:foreground="?attr/selectableItemBackground">
android:foreground="?attr/selectableItemBackground"
android:gravity="center"
android:paddingStart="16dp"
android:paddingEnd="16dp">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
app:srcCompat="@drawable/ic_image_black_24dp"
android:tint="@color/md_white_1000_54"/>
android:tint="@color/md_white_1000_54"
app:srcCompat="@drawable/ic_image_black_24dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:text="@string/set_as_cover"/>
android:text="@string/set_as_cover" />
</LinearLayout>
@ -37,23 +36,23 @@
android:id="@+id/share_layout"
android:layout_width="match_parent"
android:layout_height="56dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:gravity="center"
android:clickable="true"
android:focusable="true"
android:foreground="?attr/selectableItemBackground">
android:foreground="?attr/selectableItemBackground"
android:gravity="center"
android:paddingStart="16dp"
android:paddingEnd="16dp">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
app:srcCompat="@drawable/ic_share_grey_24dp"/>
app:srcCompat="@drawable/ic_share_grey_24dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:text="@string/share"/>
android:text="@string/share" />
</LinearLayout>
@ -61,24 +60,24 @@
android:id="@+id/save_layout"
android:layout_width="match_parent"
android:layout_height="56dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:gravity="center"
android:clickable="true"
android:focusable="true"
android:foreground="?attr/selectableItemBackground">
android:foreground="?attr/selectableItemBackground"
android:gravity="center"
android:paddingStart="16dp"
android:paddingEnd="16dp">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
app:srcCompat="@drawable/ic_file_download_black_24dp"
android:tint="@color/md_white_1000_54"/>
android:tint="@color/md_white_1000_54"
app:srcCompat="@drawable/ic_file_download_black_24dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:text="@string/save"/>
android:text="@string/save" />
</LinearLayout>

View File

@ -247,9 +247,9 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/pref_webtoon_side_padding"
app:layout_constraintBaseline_toBaselineOf="@id/webtoon_side_padding"
app:layout_constraintEnd_toStartOf="@id/bottom_line"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBaseline_toBaselineOf="@id/webtoon_side_padding"/>
app:layout_constraintStart_toStartOf="parent" />
<androidx.appcompat.widget.AppCompatSpinner
android:id="@+id/webtoon_side_padding"
@ -257,12 +257,12 @@
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginBottom="8dp"
app:layout_constraintEnd_toEndOf="@id/spinner_end"
app:layout_constraintStart_toEndOf="@id/bottom_line"
app:layout_constraintBottom_toBottomOf="parent"
android:entries="@array/webtoon_side_padding"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@id/spinner_end"
app:layout_constraintRight_toRightOf="@id/spinner_end"
app:layout_constraintTop_toBottomOf="@id/crop_borders_webtoon"/>
app:layout_constraintStart_toEndOf="@id/bottom_line"
app:layout_constraintTop_toBottomOf="@id/crop_borders_webtoon" />
<!-- Groups of preferences -->