mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-09 05:25:08 +01:00
Updates to rotation options
Taken from upstream: Forced orientation are now locked Free-ish modes is now Portrait/Landscape instead of lock Rotation button in bottom sheet toolbar (default off) Popup menu helper method Also because it's getting crowded, updated layouts of the buttons in the sheet to compress themselves a bit if people go crazy (though display options will always be full width) Co-Authored-By: arkon <4098258+arkon@users.noreply.github.com>
This commit is contained in:
parent
fdc976d4f9
commit
820d240997
@ -111,6 +111,10 @@ object Migrations {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (oldVersion < 73) {
|
||||||
|
// Reset rotation to Free after replacing Lock
|
||||||
|
preferences.rotation().set(1)
|
||||||
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
@ -4,7 +4,6 @@ import android.annotation.SuppressLint
|
|||||||
import android.content.ClipData
|
import android.content.ClipData
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.content.pm.ActivityInfo
|
|
||||||
import android.content.res.ColorStateList
|
import android.content.res.ColorStateList
|
||||||
import android.content.res.Configuration
|
import android.content.res.Configuration
|
||||||
import android.graphics.Bitmap
|
import android.graphics.Bitmap
|
||||||
@ -56,6 +55,7 @@ import eu.kanade.tachiyomi.ui.reader.ReaderPresenter.SetAsCoverResult.Success
|
|||||||
import eu.kanade.tachiyomi.ui.reader.model.ReaderChapter
|
import eu.kanade.tachiyomi.ui.reader.model.ReaderChapter
|
||||||
import eu.kanade.tachiyomi.ui.reader.model.ReaderPage
|
import eu.kanade.tachiyomi.ui.reader.model.ReaderPage
|
||||||
import eu.kanade.tachiyomi.ui.reader.model.ViewerChapters
|
import eu.kanade.tachiyomi.ui.reader.model.ViewerChapters
|
||||||
|
import eu.kanade.tachiyomi.ui.reader.settings.OrientationType
|
||||||
import eu.kanade.tachiyomi.ui.reader.settings.ReadingModeType
|
import eu.kanade.tachiyomi.ui.reader.settings.ReadingModeType
|
||||||
import eu.kanade.tachiyomi.ui.reader.settings.TabbedReaderSettingsSheet
|
import eu.kanade.tachiyomi.ui.reader.settings.TabbedReaderSettingsSheet
|
||||||
import eu.kanade.tachiyomi.ui.reader.viewer.BaseViewer
|
import eu.kanade.tachiyomi.ui.reader.viewer.BaseViewer
|
||||||
@ -93,6 +93,7 @@ import eu.kanade.tachiyomi.util.view.hide
|
|||||||
import eu.kanade.tachiyomi.util.view.invisible
|
import eu.kanade.tachiyomi.util.view.invisible
|
||||||
import eu.kanade.tachiyomi.util.view.isCollapsed
|
import eu.kanade.tachiyomi.util.view.isCollapsed
|
||||||
import eu.kanade.tachiyomi.util.view.isExpanded
|
import eu.kanade.tachiyomi.util.view.isExpanded
|
||||||
|
import eu.kanade.tachiyomi.util.view.popupMenu
|
||||||
import eu.kanade.tachiyomi.util.view.snack
|
import eu.kanade.tachiyomi.util.view.snack
|
||||||
import eu.kanade.tachiyomi.util.view.updateLayoutParams
|
import eu.kanade.tachiyomi.util.view.updateLayoutParams
|
||||||
import eu.kanade.tachiyomi.util.view.updatePaddingRelative
|
import eu.kanade.tachiyomi.util.view.updatePaddingRelative
|
||||||
@ -225,6 +226,7 @@ class ReaderActivity :
|
|||||||
ViewChapters("vc", R.string.view_chapters),
|
ViewChapters("vc", R.string.view_chapters),
|
||||||
WebView("wb", R.string.open_in_webview),
|
WebView("wb", R.string.open_in_webview),
|
||||||
ReadingMode("rm", R.string.reading_mode),
|
ReadingMode("rm", R.string.reading_mode),
|
||||||
|
Rotation("rot", R.string.rotation),
|
||||||
CropBordersPaged("cbp", R.string.crop_borders_paged),
|
CropBordersPaged("cbp", R.string.crop_borders_paged),
|
||||||
CropBordersWebtoon("cbw", R.string.crop_borders_webtoon),
|
CropBordersWebtoon("cbw", R.string.crop_borders_webtoon),
|
||||||
PageLayout("pl", R.string.page_layout),
|
PageLayout("pl", R.string.page_layout),
|
||||||
@ -405,6 +407,11 @@ class ReaderActivity :
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun updateRotationShortcut(preference: Int) {
|
||||||
|
val orientation = OrientationType.fromPreference(preference)
|
||||||
|
binding.chaptersSheet.rotationSheetButton.setImageResource(orientation.iconRes)
|
||||||
|
}
|
||||||
|
|
||||||
private fun updateCropBordersShortcut() {
|
private fun updateCropBordersShortcut() {
|
||||||
val isPagerType = viewer is PagerViewer || (viewer as? WebtoonViewer)?.hasMargins == true
|
val isPagerType = viewer is PagerViewer || (viewer as? WebtoonViewer)?.hasMargins == true
|
||||||
val enabled = if (isPagerType) {
|
val enabled = if (isPagerType) {
|
||||||
@ -434,22 +441,25 @@ class ReaderActivity :
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun updateBottomShortcuts() {
|
private fun updateBottomShortcuts() {
|
||||||
|
val enabledButtons = preferences.readerBottomButtons().get()
|
||||||
with(binding.chaptersSheet) {
|
with(binding.chaptersSheet) {
|
||||||
readingMode.isVisible =
|
readingMode.isVisible =
|
||||||
presenter?.manga?.isLongStrip() != true &&
|
presenter?.manga?.isLongStrip() != true &&
|
||||||
BottomButton.ReadingMode.value in preferences.readerBottomButtons().get()
|
BottomButton.ReadingMode.value in enabledButtons
|
||||||
|
rotationSheetButton.isVisible =
|
||||||
|
BottomButton.Rotation.value in enabledButtons
|
||||||
doublePage.isVisible = viewer is PagerViewer &&
|
doublePage.isVisible = viewer is PagerViewer &&
|
||||||
BottomButton.PageLayout.value in preferences.readerBottomButtons().get()
|
BottomButton.PageLayout.value in enabledButtons
|
||||||
cropBordersSheetButton.isVisible =
|
cropBordersSheetButton.isVisible =
|
||||||
if (viewer is PagerViewer) {
|
if (viewer is PagerViewer) {
|
||||||
BottomButton.CropBordersPaged.value in preferences.readerBottomButtons().get()
|
BottomButton.CropBordersPaged.value in enabledButtons
|
||||||
} else {
|
} else {
|
||||||
BottomButton.CropBordersWebtoon.value in preferences.readerBottomButtons().get()
|
BottomButton.CropBordersWebtoon.value in enabledButtons
|
||||||
}
|
}
|
||||||
webviewButton.isVisible =
|
webviewButton.isVisible =
|
||||||
BottomButton.WebView.value in preferences.readerBottomButtons().get()
|
BottomButton.WebView.value in enabledButtons
|
||||||
chaptersButton.isVisible =
|
chaptersButton.isVisible =
|
||||||
BottomButton.ViewChapters.value in preferences.readerBottomButtons().get()
|
BottomButton.ViewChapters.value in enabledButtons
|
||||||
shiftPageButton.isVisible =
|
shiftPageButton.isVisible =
|
||||||
((viewer as? PagerViewer)?.config?.doublePages ?: false) && canShowSplitAtBottom()
|
((viewer as? PagerViewer)?.config?.doublePages ?: false) && canShowSplitAtBottom()
|
||||||
binding.toolbar.menu.findItem(R.id.action_shift_double_page)?.isVisible =
|
binding.toolbar.menu.findItem(R.id.action_shift_double_page)?.isVisible =
|
||||||
@ -613,6 +623,22 @@ class ReaderActivity :
|
|||||||
pref.toggle()
|
pref.toggle()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
with(rotationSheetButton) {
|
||||||
|
compatToolTipText = getString(R.string.rotation)
|
||||||
|
|
||||||
|
setOnClickListener {
|
||||||
|
popupMenu(
|
||||||
|
items = OrientationType.values().map { it.prefValue to it.stringRes },
|
||||||
|
selectedItemId = preferences.rotation().get(),
|
||||||
|
) {
|
||||||
|
val newOrientation = OrientationType.fromPreference(itemId)
|
||||||
|
|
||||||
|
preferences.rotation().set(newOrientation.prefValue)
|
||||||
|
setOrientation(newOrientation.flag)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
webviewButton.setOnClickListener {
|
webviewButton.setOnClickListener {
|
||||||
openMangaInBrowser()
|
openMangaInBrowser()
|
||||||
}
|
}
|
||||||
@ -667,6 +693,7 @@ class ReaderActivity :
|
|||||||
.onEach { updateCropBordersShortcut() }
|
.onEach { updateCropBordersShortcut() }
|
||||||
.launchIn(scope)
|
.launchIn(scope)
|
||||||
}
|
}
|
||||||
|
preferences.rotation().asImmediateFlowIn(scope) { updateRotationShortcut(it) }
|
||||||
|
|
||||||
binding.chaptersSheet.shiftPageButton.setOnClickListener {
|
binding.chaptersSheet.shiftPageButton.setOnClickListener {
|
||||||
shiftDoublePages()
|
shiftDoublePages()
|
||||||
@ -1412,6 +1439,16 @@ class ReaderActivity :
|
|||||||
startActivity(intent)
|
startActivity(intent)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Forces the user preferred [orientation] on the activity.
|
||||||
|
*/
|
||||||
|
private fun setOrientation(orientation: Int) {
|
||||||
|
val newOrientation = OrientationType.fromPreference(orientation)
|
||||||
|
if (newOrientation.flag != requestedOrientation) {
|
||||||
|
requestedOrientation = newOrientation.flag
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class that handles the user preferences of the reader.
|
* Class that handles the user preferences of the reader.
|
||||||
*/
|
*/
|
||||||
@ -1461,33 +1498,6 @@ class ReaderActivity :
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Forces the user preferred [orientation] on the activity.
|
|
||||||
*/
|
|
||||||
private fun setOrientation(orientation: Int) {
|
|
||||||
val newOrientation = when (orientation) {
|
|
||||||
// Lock in current orientation
|
|
||||||
2 -> {
|
|
||||||
val currentOrientation = resources.configuration.orientation
|
|
||||||
if (currentOrientation == Configuration.ORIENTATION_PORTRAIT) {
|
|
||||||
ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT
|
|
||||||
} else {
|
|
||||||
ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Lock in portrait
|
|
||||||
3 -> ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT
|
|
||||||
// Lock in landscape
|
|
||||||
4 -> ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE
|
|
||||||
// Rotation free
|
|
||||||
else -> ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED
|
|
||||||
}
|
|
||||||
|
|
||||||
if (newOrientation != requestedOrientation) {
|
|
||||||
requestedOrientation = newOrientation
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the visibility of the bottom page indicator according to [visible].
|
* Sets the visibility of the bottom page indicator according to [visible].
|
||||||
*/
|
*/
|
||||||
|
@ -0,0 +1,20 @@
|
|||||||
|
package eu.kanade.tachiyomi.ui.reader.settings
|
||||||
|
|
||||||
|
import android.content.pm.ActivityInfo
|
||||||
|
import androidx.annotation.DrawableRes
|
||||||
|
import androidx.annotation.StringRes
|
||||||
|
import eu.kanade.tachiyomi.R
|
||||||
|
|
||||||
|
enum class OrientationType(val prefValue: Int, val flag: Int, @StringRes val stringRes: Int, @DrawableRes val iconRes: Int) {
|
||||||
|
FREE(1, ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED, R.string.free, R.drawable.ic_screen_rotation_24dp),
|
||||||
|
PORTRAIT(2, ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT, R.string.portrait, R.drawable.ic_stay_current_portrait_24dp),
|
||||||
|
LANDSCAPE(3, ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE, R.string.landscape, R.drawable.ic_stay_current_landscape_24dp),
|
||||||
|
LOCKED_PORTRAIT(4, ActivityInfo.SCREEN_ORIENTATION_PORTRAIT, R.string.locked_portrait, R.drawable.ic_screen_lock_portrait_24dp),
|
||||||
|
LOCKED_LANDSCAPE(5, ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE, R.string.locked_landscape, R.drawable.ic_screen_lock_landscape_24dp),
|
||||||
|
;
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
fun fromPreference(preference: Int): OrientationType =
|
||||||
|
values().find { it.prefValue == preference } ?: FREE
|
||||||
|
}
|
||||||
|
}
|
@ -6,6 +6,7 @@ import eu.kanade.tachiyomi.R
|
|||||||
import eu.kanade.tachiyomi.data.preference.asImmediateFlow
|
import eu.kanade.tachiyomi.data.preference.asImmediateFlow
|
||||||
import eu.kanade.tachiyomi.data.preference.asImmediateFlowIn
|
import eu.kanade.tachiyomi.data.preference.asImmediateFlowIn
|
||||||
import eu.kanade.tachiyomi.ui.reader.ReaderActivity
|
import eu.kanade.tachiyomi.ui.reader.ReaderActivity
|
||||||
|
import eu.kanade.tachiyomi.ui.reader.settings.OrientationType
|
||||||
import eu.kanade.tachiyomi.ui.reader.viewer.ViewerNavigation
|
import eu.kanade.tachiyomi.ui.reader.viewer.ViewerNavigation
|
||||||
import eu.kanade.tachiyomi.ui.reader.viewer.pager.PageLayout
|
import eu.kanade.tachiyomi.ui.reader.viewer.pager.PageLayout
|
||||||
import eu.kanade.tachiyomi.util.lang.addBetaTag
|
import eu.kanade.tachiyomi.util.lang.addBetaTag
|
||||||
@ -93,13 +94,9 @@ class SettingsReaderController : SettingsController() {
|
|||||||
intListPreference(activity) {
|
intListPreference(activity) {
|
||||||
key = Keys.rotation
|
key = Keys.rotation
|
||||||
titleRes = R.string.rotation
|
titleRes = R.string.rotation
|
||||||
entriesRes = arrayOf(
|
val enumConstants = OrientationType::class.java.enumConstants
|
||||||
R.string.free,
|
entriesRes = enumConstants?.map { it.stringRes }.orEmpty().toTypedArray()
|
||||||
R.string.lock,
|
entryRange = 1..(enumConstants?.size ?: 5)
|
||||||
R.string.force_portrait,
|
|
||||||
R.string.force_landscape
|
|
||||||
)
|
|
||||||
entryRange = 1..4
|
|
||||||
defaultValue = 1
|
defaultValue = 1
|
||||||
}
|
}
|
||||||
intListPreference(activity) {
|
intListPreference(activity) {
|
||||||
|
@ -8,6 +8,8 @@ import android.content.res.ColorStateList
|
|||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
import android.graphics.Point
|
import android.graphics.Point
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
|
import android.view.Gravity
|
||||||
|
import android.view.MenuItem
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.view.ViewTreeObserver
|
import android.view.ViewTreeObserver
|
||||||
@ -19,8 +21,11 @@ import androidx.annotation.ColorRes
|
|||||||
import androidx.annotation.IdRes
|
import androidx.annotation.IdRes
|
||||||
import androidx.annotation.Px
|
import androidx.annotation.Px
|
||||||
import androidx.appcompat.view.menu.MenuBuilder
|
import androidx.appcompat.view.menu.MenuBuilder
|
||||||
|
import androidx.appcompat.widget.PopupMenu
|
||||||
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.core.graphics.ColorUtils
|
import androidx.core.graphics.ColorUtils
|
||||||
import androidx.core.view.ViewCompat
|
import androidx.core.view.ViewCompat
|
||||||
|
import androidx.core.view.forEach
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import androidx.recyclerview.widget.LinearSmoothScroller
|
import androidx.recyclerview.widget.LinearSmoothScroller
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
@ -33,6 +38,7 @@ import com.google.android.material.bottomsheet.BottomSheetDialog
|
|||||||
import com.google.android.material.button.MaterialButton
|
import com.google.android.material.button.MaterialButton
|
||||||
import com.google.android.material.snackbar.Snackbar
|
import com.google.android.material.snackbar.Snackbar
|
||||||
import eu.kanade.tachiyomi.R
|
import eu.kanade.tachiyomi.R
|
||||||
|
import eu.kanade.tachiyomi.util.lang.tintText
|
||||||
import eu.kanade.tachiyomi.util.system.ThemeUtil
|
import eu.kanade.tachiyomi.util.system.ThemeUtil
|
||||||
import eu.kanade.tachiyomi.util.system.contextCompatColor
|
import eu.kanade.tachiyomi.util.system.contextCompatColor
|
||||||
import eu.kanade.tachiyomi.util.system.getPrefTheme
|
import eu.kanade.tachiyomi.util.system.getPrefTheme
|
||||||
@ -363,3 +369,44 @@ var View.compatToolTipText: CharSequence?
|
|||||||
set(value) {
|
set(value) {
|
||||||
ViewCompat.setTooltipText(this, value)
|
ViewCompat.setTooltipText(this, value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressLint("RestrictedApi")
|
||||||
|
inline fun View.popupMenu(
|
||||||
|
items: List<Pair<Int, Int>>,
|
||||||
|
selectedItemId: Int? = null,
|
||||||
|
noinline onMenuItemClick: MenuItem.() -> Unit
|
||||||
|
): PopupMenu {
|
||||||
|
val popup = PopupMenu(context, this, Gravity.NO_GRAVITY)
|
||||||
|
items.forEach { (id, stringRes) ->
|
||||||
|
popup.menu.add(0, id, 0, stringRes)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (selectedItemId != null) {
|
||||||
|
val blendedAccent = ColorUtils.blendARGB(
|
||||||
|
context.getResourceColor(android.R.attr.colorAccent),
|
||||||
|
context.getResourceColor(android.R.attr.textColorPrimary),
|
||||||
|
0.5f
|
||||||
|
)
|
||||||
|
(popup.menu as? MenuBuilder)?.setOptionalIconsVisible(true)
|
||||||
|
val emptyIcon = ContextCompat.getDrawable(context, R.drawable.ic_blank_24dp)
|
||||||
|
popup.menu.forEach { item ->
|
||||||
|
item.icon = when (item.itemId) {
|
||||||
|
selectedItemId -> ContextCompat.getDrawable(context, R.drawable.ic_check_24dp)?.mutate()?.apply {
|
||||||
|
setTint(blendedAccent)
|
||||||
|
}
|
||||||
|
else -> emptyIcon
|
||||||
|
}
|
||||||
|
if (item.itemId == selectedItemId) {
|
||||||
|
item.title = item.title?.tintText(blendedAccent)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
popup.setOnMenuItemClickListener {
|
||||||
|
it.onMenuItemClick()
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
|
popup.show()
|
||||||
|
return popup
|
||||||
|
}
|
||||||
|
@ -0,0 +1,9 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/black"
|
||||||
|
android:pathData="M21,5L3,5c-1.1,0 -2,0.9 -2,2v10c0,1.1 0.9,2 2,2h18c1.1,0 2,-0.9 2,-2L23,7c0,-1.1 -0.9,-2 -2,-2zM19,17L5,17L5,7h14v10zM10,16h4c0.55,0 1,-0.45 1,-1v-3c0,-0.55 -0.45,-1 -1,-1v-1c0,-1.11 -0.9,-2 -2,-2 -1.11,0 -2,0.9 -2,2v1c-0.55,0 -1,0.45 -1,1v3c0,0.55 0.45,1 1,1zM10.8,10c0,-0.66 0.54,-1.2 1.2,-1.2 0.66,0 1.2,0.54 1.2,1.2v1h-2.4v-1z" />
|
||||||
|
</vector>
|
@ -0,0 +1,9 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/black"
|
||||||
|
android:pathData="M10,16h4c0.55,0 1,-0.45 1,-1v-3c0,-0.55 -0.45,-1 -1,-1v-1c0,-1.11 -0.9,-2 -2,-2 -1.11,0 -2,0.9 -2,2v1c-0.55,0 -1,0.45 -1,1v3c0,0.55 0.45,1 1,1zM10.8,10c0,-0.66 0.54,-1.2 1.2,-1.2 0.66,0 1.2,0.54 1.2,1.2v1h-2.4v-1zM17,1L7,1c-1.1,0 -2,0.9 -2,2v18c0,1.1 0.9,2 2,2h10c1.1,0 2,-0.9 2,-2L19,3c0,-1.1 -0.9,-2 -2,-2zM17,19L7,19L7,5h10v14z" />
|
||||||
|
</vector>
|
9
app/src/main/res/drawable/ic_screen_rotation_24dp.xml
Normal file
9
app/src/main/res/drawable/ic_screen_rotation_24dp.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/black"
|
||||||
|
android:pathData="M16.48,2.52c3.27,1.55 5.61,4.72 5.97,8.48h1.5C23.44,4.84 18.29,0 12,0l-0.66,0.03 3.81,3.81 1.33,-1.32zM10.23,1.75c-0.59,-0.59 -1.54,-0.59 -2.12,0L1.75,8.11c-0.59,0.59 -0.59,1.54 0,2.12l12.02,12.02c0.59,0.59 1.54,0.59 2.12,0l6.36,-6.36c0.59,-0.59 0.59,-1.54 0,-2.12L10.23,1.75zM14.83,21.19L2.81,9.17l6.36,-6.36 12.02,12.02 -6.36,6.36zM7.52,21.48C4.25,19.94 1.91,16.76 1.55,13L0.05,13C0.56,19.16 5.71,24 12,24l0.66,-0.03 -3.81,-3.81 -1.33,1.32z" />
|
||||||
|
</vector>
|
@ -0,0 +1,9 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/black"
|
||||||
|
android:pathData="M1.01,7L1,17c0,1.1 0.9,2 2,2h18c1.1,0 2,-0.9 2,-2V7c0,-1.1 -0.9,-2 -2,-2H3c-1.1,0 -1.99,0.9 -1.99,2zM19,7v10H5V7h14z" />
|
||||||
|
</vector>
|
@ -0,0 +1,9 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/black"
|
||||||
|
android:pathData="M17,1.01L7,1c-1.1,0 -1.99,0.9 -1.99,2v18c0,1.1 0.89,2 1.99,2h10c1.1,0 2,-0.9 2,-2V3c0,-1.1 -0.9,-1.99 -2,-1.99zM17,19H7V5h10v14z" />
|
||||||
|
</vector>
|
@ -25,109 +25,134 @@
|
|||||||
android:alpha="0.25"
|
android:alpha="0.25"
|
||||||
android:contentDescription="@string/drag_handle"
|
android:contentDescription="@string/drag_handle"
|
||||||
android:src="@drawable/draggable_pill"
|
android:src="@drawable/draggable_pill"
|
||||||
app:tint="?actionBarTintColor"
|
|
||||||
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" />
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:tint="?actionBarTintColor" />
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/chapters_button"
|
android:id="@+id/chapters_button"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintWidth_max="wrap"
|
||||||
android:background="?selectableItemBackgroundBorderless"
|
android:background="?selectableItemBackgroundBorderless"
|
||||||
android:contentDescription="@string/next_title"
|
android:contentDescription="@string/next_title"
|
||||||
android:padding="@dimen/material_layout_keylines_screen_edge_margin"
|
android:padding="@dimen/material_layout_keylines_screen_edge_margin"
|
||||||
app:tint="?actionBarTintColor"
|
|
||||||
android:tooltipText="@string/view_chapters"
|
android:tooltipText="@string/view_chapters"
|
||||||
app:layout_constraintHorizontal_chainStyle="spread"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toStartOf="@id/webview_button"
|
app:layout_constraintEnd_toStartOf="@id/webview_button"
|
||||||
|
app:layout_constraintHorizontal_chainStyle="spread"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:srcCompat="@drawable/ic_format_list_numbered_24dp" />
|
app:srcCompat="@drawable/ic_format_list_numbered_24dp"
|
||||||
|
app:tint="?actionBarTintColor" />
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/webview_button"
|
android:id="@+id/webview_button"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?selectableItemBackgroundBorderless"
|
android:background="?selectableItemBackgroundBorderless"
|
||||||
android:contentDescription="@string/open_in_webview"
|
android:contentDescription="@string/open_in_webview"
|
||||||
android:padding="@dimen/material_layout_keylines_screen_edge_margin"
|
android:padding="@dimen/material_layout_keylines_screen_edge_margin"
|
||||||
app:tint="?actionBarTintColor"
|
|
||||||
android:tooltipText="@string/open_in_webview"
|
android:tooltipText="@string/open_in_webview"
|
||||||
app:layout_constraintHorizontal_chainStyle="spread"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@id/chapters_button"
|
|
||||||
app:layout_constraintEnd_toStartOf="@id/reading_mode"
|
app:layout_constraintEnd_toStartOf="@id/reading_mode"
|
||||||
|
app:layout_constraintHorizontal_chainStyle="spread"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/chapters_button"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:srcCompat="@drawable/ic_open_in_webview_24dp" />
|
app:layout_constraintWidth_max="wrap"
|
||||||
|
app:srcCompat="@drawable/ic_open_in_webview_24dp"
|
||||||
|
app:tint="?actionBarTintColor" />
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/reading_mode"
|
android:id="@+id/reading_mode"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?selectableItemBackgroundBorderless"
|
android:background="?selectableItemBackgroundBorderless"
|
||||||
android:contentDescription="@string/reading_mode"
|
android:contentDescription="@string/reading_mode"
|
||||||
android:padding="@dimen/material_layout_keylines_screen_edge_margin"
|
android:padding="@dimen/material_layout_keylines_screen_edge_margin"
|
||||||
app:tint="?actionBarTintColor"
|
|
||||||
android:tooltipText="@string/reading_mode"
|
android:tooltipText="@string/reading_mode"
|
||||||
app:layout_constraintHorizontal_chainStyle="spread"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toStartOf="@id/rotation_sheet_button"
|
||||||
|
app:layout_constraintHorizontal_chainStyle="spread"
|
||||||
app:layout_constraintStart_toEndOf="@id/webview_button"
|
app:layout_constraintStart_toEndOf="@id/webview_button"
|
||||||
app:layout_constraintEnd_toStartOf="@id/crop_borders_sheet_button"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:srcCompat="@drawable/ic_reader_default_24dp" />
|
app:layout_constraintWidth_max="wrap"
|
||||||
|
app:srcCompat="@drawable/ic_reader_default_24dp"
|
||||||
|
app:tint="?actionBarTintColor" />
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/crop_borders_sheet_button"
|
android:id="@+id/rotation_sheet_button"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?selectableItemBackgroundBorderless"
|
android:background="?selectableItemBackgroundBorderless"
|
||||||
android:contentDescription="@string/open_in_webview"
|
android:contentDescription="@string/open_in_webview"
|
||||||
android:padding="@dimen/material_layout_keylines_screen_edge_margin"
|
android:padding="@dimen/material_layout_keylines_screen_edge_margin"
|
||||||
app:tint="?actionBarTintColor"
|
android:tooltipText="@string/rotation"
|
||||||
android:tooltipText="@string/crop_borders"
|
|
||||||
app:layout_constraintHorizontal_chainStyle="spread"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toStartOf="@id/crop_borders_sheet_button"
|
||||||
|
app:layout_constraintHorizontal_chainStyle="spread"
|
||||||
app:layout_constraintStart_toEndOf="@id/reading_mode"
|
app:layout_constraintStart_toEndOf="@id/reading_mode"
|
||||||
app:layout_constraintEnd_toStartOf="@id/double_page"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
tools:visibility="visible"
|
app:layout_constraintWidth_max="wrap"
|
||||||
app:srcCompat="@drawable/anim_crop_to_free" />
|
app:srcCompat="@drawable/ic_screen_rotation_24dp"
|
||||||
|
app:tint="?actionBarTintColor"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<ImageButton
|
||||||
|
android:id="@+id/crop_borders_sheet_button"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="?selectableItemBackgroundBorderless"
|
||||||
|
android:contentDescription="@string/crop_borders"
|
||||||
|
android:padding="@dimen/material_layout_keylines_screen_edge_margin"
|
||||||
|
android:tooltipText="@string/crop_borders"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toStartOf="@id/double_page"
|
||||||
|
app:layout_constraintHorizontal_chainStyle="spread"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/rotation_sheet_button"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintWidth_max="wrap"
|
||||||
|
app:srcCompat="@drawable/anim_crop_to_free"
|
||||||
|
app:tint="?actionBarTintColor"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/double_page"
|
android:id="@+id/double_page"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?selectableItemBackgroundBorderless"
|
android:background="?selectableItemBackgroundBorderless"
|
||||||
android:contentDescription="@string/next_title"
|
android:contentDescription="@string/next_title"
|
||||||
android:padding="@dimen/material_layout_keylines_screen_edge_margin"
|
android:padding="@dimen/material_layout_keylines_screen_edge_margin"
|
||||||
app:tint="?actionBarTintColor"
|
|
||||||
app:layout_constraintHorizontal_chainStyle="spread"
|
|
||||||
android:tooltipText="@string/double_pages"
|
android:tooltipText="@string/double_pages"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toStartOf="@id/shift_page_button"
|
||||||
|
app:layout_constraintHorizontal_chainStyle="spread"
|
||||||
app:layout_constraintStart_toEndOf="@id/crop_borders_sheet_button"
|
app:layout_constraintStart_toEndOf="@id/crop_borders_sheet_button"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintEnd_toStartOf="@id/shift_page_button"
|
app:layout_constraintWidth_max="wrap"
|
||||||
app:srcCompat="@drawable/ic_book_open_variant_24dp" />
|
app:srcCompat="@drawable/ic_book_open_variant_24dp"
|
||||||
|
app:tint="?actionBarTintColor" />
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/shift_page_button"
|
android:id="@+id/shift_page_button"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?selectableItemBackgroundBorderless"
|
android:background="?selectableItemBackgroundBorderless"
|
||||||
android:contentDescription="@string/next_title"
|
android:contentDescription="@string/next_title"
|
||||||
android:padding="@dimen/material_layout_keylines_screen_edge_margin"
|
android:padding="@dimen/material_layout_keylines_screen_edge_margin"
|
||||||
app:tint="?actionBarTintColor"
|
|
||||||
android:visibility="gone"
|
|
||||||
app:layout_constraintHorizontal_chainStyle="spread"
|
|
||||||
android:tooltipText="@string/shift_one_page_over"
|
android:tooltipText="@string/shift_one_page_over"
|
||||||
|
android:visibility="gone"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toStartOf="@id/display_options"
|
||||||
|
app:layout_constraintHorizontal_chainStyle="spread"
|
||||||
app:layout_constraintStart_toEndOf="@id/double_page"
|
app:layout_constraintStart_toEndOf="@id/double_page"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintEnd_toStartOf="@id/display_options"
|
app:layout_constraintWidth_max="wrap"
|
||||||
app:srcCompat="@drawable/ic_page_next_outline_24dp"
|
app:srcCompat="@drawable/ic_page_next_outline_24dp"
|
||||||
|
app:tint="?actionBarTintColor"
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
@ -137,14 +162,14 @@
|
|||||||
android:background="?selectableItemBackgroundBorderless"
|
android:background="?selectableItemBackgroundBorderless"
|
||||||
android:contentDescription="@string/next_title"
|
android:contentDescription="@string/next_title"
|
||||||
android:padding="@dimen/material_layout_keylines_screen_edge_margin"
|
android:padding="@dimen/material_layout_keylines_screen_edge_margin"
|
||||||
app:tint="?actionBarTintColor"
|
|
||||||
app:layout_constraintHorizontal_chainStyle="spread"
|
|
||||||
android:tooltipText="@string/display_options"
|
android:tooltipText="@string/display_options"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintHorizontal_chainStyle="spread"
|
||||||
app:layout_constraintStart_toEndOf="@id/shift_page_button"
|
app:layout_constraintStart_toEndOf="@id/shift_page_button"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:srcCompat="@drawable/ic_tune_24dp"
|
||||||
app:srcCompat="@drawable/ic_tune_24dp" />
|
app:tint="?actionBarTintColor" />
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
@ -79,9 +79,10 @@
|
|||||||
|
|
||||||
<string-array name="rotation_type">
|
<string-array name="rotation_type">
|
||||||
<item>@string/free</item>
|
<item>@string/free</item>
|
||||||
<item>@string/lock</item>
|
<item>@string/portrait</item>
|
||||||
<item>@string/force_portrait</item>
|
<item>@string/landscape</item>
|
||||||
<item>@string/force_landscape</item>
|
<item>@string/locked_portrait</item>
|
||||||
|
<item>@string/locked_landscape</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
<string-array name="color_filter_modes">
|
<string-array name="color_filter_modes">
|
||||||
|
@ -393,8 +393,10 @@
|
|||||||
<string name="single_page">Single page</string>
|
<string name="single_page">Single page</string>
|
||||||
<string name="switch_to_double">Switch to double pages</string>
|
<string name="switch_to_double">Switch to double pages</string>
|
||||||
<string name="switch_to_single">Switch to single page</string>
|
<string name="switch_to_single">Switch to single page</string>
|
||||||
<string name="force_portrait">Force portrait</string>
|
<string name="portrait">Portrait</string>
|
||||||
<string name="force_landscape">Force landscape</string>
|
<string name="landscape">Landscape</string>
|
||||||
|
<string name="locked_portrait">Locked portrait</string>
|
||||||
|
<string name="locked_landscape">Locked landscape</string>
|
||||||
<string name="red_initial">R</string>
|
<string name="red_initial">R</string>
|
||||||
<string name="green_initial">G</string>
|
<string name="green_initial">G</string>
|
||||||
<string name="blue_initial">B</string>
|
<string name="blue_initial">B</string>
|
||||||
|
Loading…
Reference in New Issue
Block a user