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

View File

@ -114,6 +114,7 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>(),
private set private set
private var coroutine: Job? = null private var coroutine: Job? = null
/** /**
* System UI helper to hide status & navigation bar on all different API levels. * 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) lightStatusBar = a.getBoolean(0, false)
a.recycle() a.recycle()
setNotchCutoutMode() setNotchCutoutMode()
if (lightStatusBar) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) reader_layout.systemUiVisibility = val systemUiFlag = when (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
reader_layout.systemUiVisibility.or(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR) true -> View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR
reader_layout.systemUiVisibility = false -> View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
reader_layout.systemUiVisibility.or(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR) }
} else { reader_layout.systemUiVisibility = when (lightStatusBar) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) reader_layout.systemUiVisibility = true -> reader_layout.systemUiVisibility.or(systemUiFlag)
reader_layout.systemUiVisibility.rem(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR) false -> reader_layout.systemUiVisibility.rem(systemUiFlag)
reader_layout.systemUiVisibility =
reader_layout.systemUiVisibility.rem(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR)
} }
if (presenter.needsInit()) { if (presenter.needsInit()) {
@ -193,8 +192,11 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>(),
return return
} }
NotificationReceiver.dismissNotification(this, manga.hashCode(), Notifications.ID_NEW_CHAPTERS) 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) { if (savedInstanceState != null) {
@ -243,10 +245,10 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>(),
override fun onWindowFocusChanged(hasFocus: Boolean) { override fun onWindowFocusChanged(hasFocus: Boolean) {
super.onWindowFocusChanged(hasFocus) super.onWindowFocusChanged(hasFocus)
if (hasFocus) { if (hasFocus) {
if (menuStickyVisible) when (menuStickyVisible) {
setMenuVisibility(false) true -> setMenuVisibility(false)
else false -> setMenuVisibility(menuVisible, animate = false)
setMenuVisibility(menuVisible, animate = false) }
} }
} }
@ -312,8 +314,10 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>(),
private fun initializeMenu() { private fun initializeMenu() {
// Set toolbar // Set toolbar
setSupportActionBar(toolbar) setSupportActionBar(toolbar)
val primaryColor = ColorUtils.setAlphaComponent(getResourceColor(R.attr.colorSecondary), val primaryColor = ColorUtils.setAlphaComponent(
200) getResourceColor(R.attr.colorSecondary),
200
)
appbar.setBackgroundColor(primaryColor) appbar.setBackgroundColor(primaryColor)
window.statusBarColor = Color.TRANSPARENT window.statusBarColor = Color.TRANSPARENT
supportActionBar?.setDisplayHomeAsUpEnabled(true) supportActionBar?.setDisplayHomeAsUpEnabled(true)
@ -337,7 +341,8 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>(),
chapters_bottom_sheet.sheetBehavior?.state = BottomSheetBehavior.STATE_HIDDEN chapters_bottom_sheet.sheetBehavior?.state = BottomSheetBehavior.STATE_HIDDEN
reader_menu.doOnApplyWindowInsets { v, insets, _ -> reader_menu.doOnApplyWindowInsets { v, insets, _ ->
sheetManageNavColor = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q && (insets sheetManageNavColor = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q && (insets
.systemWindowInsetBottom != insets.tappableElementInsets.bottom)) { .systemWindowInsetBottom != insets.tappableElementInsets.bottom)
) {
window.navigationBarColor = Color.TRANSPARENT window.navigationBarColor = Color.TRANSPARENT
false false
} }
@ -372,10 +377,13 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>(),
snackbar?.dismiss() snackbar?.dismiss()
systemUi?.show() systemUi?.show()
reader_menu.visibility = View.VISIBLE 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 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) window.navigationBarColor = Color.TRANSPARENT // getResourceColor(R.attr.colorPrimaryDark)
}
if (animate) { if (animate) {
if (!menuStickyVisible) { if (!menuStickyVisible) {
val toolbarAnimation = AnimationUtils.loadAnimation(this, R.anim.enter_from_top) val toolbarAnimation = AnimationUtils.loadAnimation(this, R.anim.enter_from_top)
@ -401,8 +409,9 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>(),
appbar.startAnimation(toolbarAnimation) appbar.startAnimation(toolbarAnimation)
BottomSheetBehavior.from(chapters_bottom_sheet).isHideable = true BottomSheetBehavior.from(chapters_bottom_sheet).isHideable = true
BottomSheetBehavior.from(chapters_bottom_sheet).state = BottomSheetBehavior.STATE_HIDDEN BottomSheetBehavior.from(chapters_bottom_sheet).state = BottomSheetBehavior.STATE_HIDDEN
} else } else {
reader_menu.visibility = View.GONE reader_menu.visibility = View.GONE
}
} }
menuStickyVisible = false menuStickyVisible = false
} }
@ -524,12 +533,15 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>(),
page_text.text = "${page.number} / ${pages.size}" page_text.text = "${page.number} / ${pages.size}"
if (newChapter) { 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) { } else if (chapters_bottom_sheet.shouldCollaspe && chapters_bottom_sheet.sheetBehavior?.state == BottomSheetBehavior.STATE_EXPANDED) {
chapters_bottom_sheet.sheetBehavior?.state = BottomSheetBehavior.STATE_COLLAPSED 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.refreshList()
}
chapters_bottom_sheet.shouldCollaspe = true chapters_bottom_sheet.shouldCollaspe = true
// Set seekbar progress // Set seekbar progress
@ -632,11 +644,13 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>(),
* depending on the [result]. * depending on the [result].
*/ */
fun onSetAsCoverResult(result: ReaderPresenter.SetAsCoverResult) { fun onSetAsCoverResult(result: ReaderPresenter.SetAsCoverResult) {
toast(when (result) { toast(
Success -> R.string.cover_updated when (result) {
AddToLibraryFirst -> R.string.must_be_in_library_to_edit Success -> R.string.cover_updated
Error -> R.string.failed_to_update_cover AddToLibraryFirst -> R.string.must_be_in_library_to_edit
}) Error -> R.string.failed_to_update_cover
}
)
} }
override fun onVisibilityChange(visible: Boolean) { override fun onVisibilityChange(visible: Boolean) {
@ -679,7 +693,7 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>(),
if (currentOrientation == Configuration.ORIENTATION_LANDSCAPE) { if (currentOrientation == Configuration.ORIENTATION_LANDSCAPE) {
val params = window.attributes val params = window.attributes
params.layoutInDisplayCutoutMode = 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.FrameLayout
import android.widget.ImageView import android.widget.ImageView
import android.widget.TextView import android.widget.TextView
import androidx.core.content.ContextCompat
import com.mikepenz.fastadapter.FastAdapter import com.mikepenz.fastadapter.FastAdapter
import com.mikepenz.fastadapter.items.AbstractItem import com.mikepenz.fastadapter.items.AbstractItem
import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.data.database.models.Chapter import eu.kanade.tachiyomi.data.database.models.Chapter
import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.database.models.Manga
import eu.kanade.tachiyomi.util.system.contextCompatDrawable
import eu.kanade.tachiyomi.util.system.getResourceColor import eu.kanade.tachiyomi.util.system.getResourceColor
import java.text.DecimalFormat import java.text.DecimalFormat
import java.text.DecimalFormatSymbols 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 unreadColor = view.context.getResourceColor(android.R.attr.textColorPrimary)
private var activeColor = view.context.getResourceColor(android.R.attr.colorAccent) private var activeColor = view.context.getResourceColor(android.R.attr.colorAccent)
private var unbookmark = ContextCompat.getDrawable(view.context, R.drawable private var unbookmark = view.context.contextCompatDrawable(R.drawable.ic_bookmark_border_24dp)
.ic_bookmark_border_24dp) private var bookmark = view.context.contextCompatDrawable(R.drawable.ic_bookmark_24dp)
private var bookmark = ContextCompat.getDrawable(view.context, R.drawable
.ic_bookmark_24dp)
override fun bindView(item: ReaderChapterItem, payloads: List<Any>) { override fun bindView(item: ReaderChapterItem, payloads: List<Any>) {
val chapter = item.chapter val chapter = item.chapter

View File

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

View File

@ -56,8 +56,6 @@ class ReaderPresenter(
private val preferences: PreferencesHelper = Injekt.get() private val preferences: PreferencesHelper = Injekt.get()
) : BasePresenter<ReaderActivity>() { ) : 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. * 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) { override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) {
super.onLayout(changed, left, top, right, bottom) super.onLayout(changed, left, top, right, bottom)
if (Build.VERSION.SDK_INT >= 29) { if (Build.VERSION.SDK_INT >= 29 && changed) {
if (changed) { boundingBox.set(left, top, right, bottom)
boundingBox.set(left, top, right, bottom) systemGestureExclusionRects = exclusions
systemGestureExclusionRects = exclusions
}
} }
} }
} }

View File

@ -52,9 +52,14 @@ class ReaderSettingsSheet(private val activity: ReaderActivity) :
0 else -1 0 else -1
) )
window?.navigationBarColor = Color.TRANSPARENT window?.navigationBarColor = Color.TRANSPARENT
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && preferences.readerTheme() if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O &&
.getOrDefault() == 0 && activity.window.decorView.rootWindowInsets.systemWindowInsetRight == 0 && activity.window.decorView.rootWindowInsets.systemWindowInsetLeft == 0 preferences.readerTheme().getOrDefault() == 0 &&
) window?.decorView?.systemUiVisibility = View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR 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 val height = activity.window.decorView.rootWindowInsets.systemWindowInsetBottom
sheetBehavior.peekHeight = 550.dpToPx + height sheetBehavior.peekHeight = 550.dpToPx + height
@ -87,9 +92,14 @@ class ReaderSettingsSheet(private val activity: ReaderActivity) :
is WebtoonViewer -> initWebtoonPreferences() 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 { close_button.setOnClickListener {
dismiss() dismiss()

View File

@ -115,6 +115,18 @@ class SettingsReaderController : SettingsController() {
titleRes = R.string.crop_borders titleRes = R.string.crop_borders
defaultValue = false 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 { preferenceCategory {
titleRes = R.string.navigation titleRes = R.string.navigation

View File

@ -9,11 +9,14 @@ import android.content.Intent
import android.content.IntentFilter import android.content.IntentFilter
import android.content.pm.PackageManager import android.content.pm.PackageManager
import android.content.res.Resources import android.content.res.Resources
import android.graphics.drawable.Drawable
import android.net.ConnectivityManager import android.net.ConnectivityManager
import android.net.Uri import android.net.Uri
import android.os.PowerManager import android.os.PowerManager
import android.widget.Toast import android.widget.Toast
import androidx.annotation.AttrRes import androidx.annotation.AttrRes
import androidx.annotation.ColorRes
import androidx.annotation.DrawableRes
import androidx.annotation.StringRes import androidx.annotation.StringRes
import androidx.browser.customtabs.CustomTabsIntent import androidx.browser.customtabs.CustomTabsIntent
import androidx.core.app.NotificationCompat import androidx.core.app.NotificationCompat
@ -89,6 +92,24 @@ fun Context.getResourceColor(@AttrRes resource: Int): Int {
return attrValue 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. * 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"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -247,9 +247,9 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/pref_webtoon_side_padding" android:text="@string/pref_webtoon_side_padding"
app:layout_constraintBaseline_toBaselineOf="@id/webtoon_side_padding"
app:layout_constraintEnd_toStartOf="@id/bottom_line" app:layout_constraintEnd_toStartOf="@id/bottom_line"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent" />
app:layout_constraintBaseline_toBaselineOf="@id/webtoon_side_padding"/>
<androidx.appcompat.widget.AppCompatSpinner <androidx.appcompat.widget.AppCompatSpinner
android:id="@+id/webtoon_side_padding" android:id="@+id/webtoon_side_padding"
@ -257,12 +257,12 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:layout_marginBottom="8dp" 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" 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_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 --> <!-- Groups of preferences -->