From e1f473d3018de91ad543f21b264c4c3fe3a4445f Mon Sep 17 00:00:00 2001 From: FooIbar <118464521+FooIbar@users.noreply.github.com> Date: Sun, 10 Mar 2024 20:56:01 +0800 Subject: [PATCH] Convert remaining icons to ImageVector --- app/build.gradle.kts | 3 + .../com/hippo/ehviewer/icons/EhIcons.kt | 2 + .../com/hippo/ehviewer/icons/filled/Crop.kt | 10 ++ .../hippo/ehviewer/icons/filled/CropOff.kt | 11 +++ .../com/hippo/ehviewer/icons/filled/GoTo.kt | 10 ++ .../hippo/ehviewer/icons/filled/SadPanda.kt | 10 ++ .../ehviewer/icons/filled/Subscriptions.kt | 10 ++ .../icons/reader/ContinuousVertical.kt | 53 ++++++++++ .../hippo/ehviewer/icons/reader/Default.kt | 99 +++++++++++++++++++ .../hippo/ehviewer/icons/reader/Landscape.kt | 39 ++++++++ .../ehviewer/icons/reader/LandscapeLocked.kt | 59 +++++++++++ .../ehviewer/icons/reader/LeftToRight.kt | 75 ++++++++++++++ .../hippo/ehviewer/icons/reader/Portrait.kt | 39 ++++++++ .../ehviewer/icons/reader/PortraitLocked.kt | 59 +++++++++++ .../ehviewer/icons/reader/RightToLeft.kt | 75 ++++++++++++++ .../ehviewer/icons/reader/ScreenRotation.kt | 55 +++++++++++ .../hippo/ehviewer/icons/reader/Vertical.kt | 58 +++++++++++ .../hippo/ehviewer/icons/reader/Webtoon.kt | 48 +++++++++ .../tachiyomi/ui/reader/BottomReaderBar.kt | 5 +- .../ui/reader/setting/OrientationType.kt | 24 +++-- .../ui/reader/setting/ReadingModeType.kt | 23 +++-- .../ic_reader_continuous_vertical_24dp.xml | 15 --- .../res/drawable/ic_reader_default_24dp.xml | 12 --- .../main/res/drawable/ic_reader_ltr_24dp.xml | 21 ---- .../main/res/drawable/ic_reader_rtl_24dp.xml | 21 ---- .../res/drawable/ic_reader_vertical_24dp.xml | 12 --- .../res/drawable/ic_reader_webtoon_24dp.xml | 12 --- .../ic_screen_lock_landscape_24dp.xml | 9 -- .../drawable/ic_screen_lock_portrait_24dp.xml | 9 -- .../res/drawable/ic_screen_rotation_24dp.xml | 9 -- .../ic_stay_current_landscape_24dp.xml | 9 -- .../ic_stay_current_portrait_24dp.xml | 9 -- gradle/libs.versions.toml | 2 + 33 files changed, 749 insertions(+), 158 deletions(-) create mode 100644 app/src/main/kotlin/com/hippo/ehviewer/icons/reader/ContinuousVertical.kt create mode 100644 app/src/main/kotlin/com/hippo/ehviewer/icons/reader/Default.kt create mode 100644 app/src/main/kotlin/com/hippo/ehviewer/icons/reader/Landscape.kt create mode 100644 app/src/main/kotlin/com/hippo/ehviewer/icons/reader/LandscapeLocked.kt create mode 100644 app/src/main/kotlin/com/hippo/ehviewer/icons/reader/LeftToRight.kt create mode 100644 app/src/main/kotlin/com/hippo/ehviewer/icons/reader/Portrait.kt create mode 100644 app/src/main/kotlin/com/hippo/ehviewer/icons/reader/PortraitLocked.kt create mode 100644 app/src/main/kotlin/com/hippo/ehviewer/icons/reader/RightToLeft.kt create mode 100644 app/src/main/kotlin/com/hippo/ehviewer/icons/reader/ScreenRotation.kt create mode 100644 app/src/main/kotlin/com/hippo/ehviewer/icons/reader/Vertical.kt create mode 100644 app/src/main/kotlin/com/hippo/ehviewer/icons/reader/Webtoon.kt delete mode 100644 app/src/main/res/drawable/ic_reader_continuous_vertical_24dp.xml delete mode 100644 app/src/main/res/drawable/ic_reader_default_24dp.xml delete mode 100644 app/src/main/res/drawable/ic_reader_ltr_24dp.xml delete mode 100644 app/src/main/res/drawable/ic_reader_rtl_24dp.xml delete mode 100644 app/src/main/res/drawable/ic_reader_vertical_24dp.xml delete mode 100644 app/src/main/res/drawable/ic_reader_webtoon_24dp.xml delete mode 100644 app/src/main/res/drawable/ic_screen_lock_landscape_24dp.xml delete mode 100644 app/src/main/res/drawable/ic_screen_lock_portrait_24dp.xml delete mode 100644 app/src/main/res/drawable/ic_screen_rotation_24dp.xml delete mode 100644 app/src/main/res/drawable/ic_stay_current_landscape_24dp.xml delete mode 100644 app/src/main/res/drawable/ic_stay_current_portrait_24dp.xml diff --git a/app/build.gradle.kts b/app/build.gradle.kts index ca932564c..25d2ef903 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -269,6 +269,9 @@ dependencies { coreLibraryDesugaring(libs.desugar) "gmsImplementation"(libs.bundles.cronet) + + debugImplementation(libs.compose.ui.tooling) + implementation(libs.compose.ui.tooling.preview) } kotlin { diff --git a/app/src/main/kotlin/com/hippo/ehviewer/icons/EhIcons.kt b/app/src/main/kotlin/com/hippo/ehviewer/icons/EhIcons.kt index 2c7a8c3d0..2232513a4 100644 --- a/app/src/main/kotlin/com/hippo/ehviewer/icons/EhIcons.kt +++ b/app/src/main/kotlin/com/hippo/ehviewer/icons/EhIcons.kt @@ -14,6 +14,8 @@ object EhIcons { val Default = Filled } + object Reader + val Default = Filled } diff --git a/app/src/main/kotlin/com/hippo/ehviewer/icons/filled/Crop.kt b/app/src/main/kotlin/com/hippo/ehviewer/icons/filled/Crop.kt index a3ff9eedc..10ca24cd6 100644 --- a/app/src/main/kotlin/com/hippo/ehviewer/icons/filled/Crop.kt +++ b/app/src/main/kotlin/com/hippo/ehviewer/icons/filled/Crop.kt @@ -1,7 +1,10 @@ package com.hippo.ehviewer.icons.filled +import androidx.compose.foundation.Image import androidx.compose.material.icons.materialIcon import androidx.compose.material.icons.materialPath +import androidx.compose.runtime.Composable +import androidx.compose.ui.tooling.preview.Preview import com.hippo.ehviewer.icons.EhIcons import com.hippo.ehviewer.util.unsafeLazy @@ -37,3 +40,10 @@ val EhIcons.Filled.Crop by unsafeLazy { } } } + +@Preview +@Composable +@Suppress("UnusedPrivateMember") +private fun IconCropPreview() { + Image(imageVector = EhIcons.Default.Crop, contentDescription = null) +} diff --git a/app/src/main/kotlin/com/hippo/ehviewer/icons/filled/CropOff.kt b/app/src/main/kotlin/com/hippo/ehviewer/icons/filled/CropOff.kt index c4fdc4893..d36b50eca 100644 --- a/app/src/main/kotlin/com/hippo/ehviewer/icons/filled/CropOff.kt +++ b/app/src/main/kotlin/com/hippo/ehviewer/icons/filled/CropOff.kt @@ -1,10 +1,14 @@ package com.hippo.ehviewer.icons.filled +import androidx.compose.foundation.Image import androidx.compose.material.icons.materialIcon import androidx.compose.material.icons.materialPath +import androidx.compose.runtime.Composable +import androidx.compose.ui.tooling.preview.Preview import com.hippo.ehviewer.icons.EhIcons import com.hippo.ehviewer.util.unsafeLazy +@Suppress("BooleanLiteralArgument") val EhIcons.Filled.CropOff by unsafeLazy { materialIcon(name = "CropOff") { materialPath { @@ -58,3 +62,10 @@ val EhIcons.Filled.CropOff by unsafeLazy { } } } + +@Preview +@Composable +@Suppress("UnusedPrivateMember") +private fun IconCropOffPreview() { + Image(imageVector = EhIcons.Default.CropOff, contentDescription = null) +} diff --git a/app/src/main/kotlin/com/hippo/ehviewer/icons/filled/GoTo.kt b/app/src/main/kotlin/com/hippo/ehviewer/icons/filled/GoTo.kt index 9a62ad99f..465153618 100644 --- a/app/src/main/kotlin/com/hippo/ehviewer/icons/filled/GoTo.kt +++ b/app/src/main/kotlin/com/hippo/ehviewer/icons/filled/GoTo.kt @@ -1,7 +1,10 @@ package com.hippo.ehviewer.icons.filled +import androidx.compose.foundation.Image import androidx.compose.material.icons.materialIcon import androidx.compose.material.icons.materialPath +import androidx.compose.runtime.Composable +import androidx.compose.ui.tooling.preview.Preview import com.hippo.ehviewer.icons.EhIcons import com.hippo.ehviewer.util.unsafeLazy @@ -31,3 +34,10 @@ val EhIcons.Filled.GoTo by unsafeLazy { } } } + +@Preview +@Composable +@Suppress("UnusedPrivateMember") +private fun IconGoToPreview() { + Image(imageVector = EhIcons.Default.GoTo, contentDescription = null) +} diff --git a/app/src/main/kotlin/com/hippo/ehviewer/icons/filled/SadPanda.kt b/app/src/main/kotlin/com/hippo/ehviewer/icons/filled/SadPanda.kt index 4591a2e67..e39dc2553 100644 --- a/app/src/main/kotlin/com/hippo/ehviewer/icons/filled/SadPanda.kt +++ b/app/src/main/kotlin/com/hippo/ehviewer/icons/filled/SadPanda.kt @@ -1,7 +1,10 @@ package com.hippo.ehviewer.icons.filled +import androidx.compose.foundation.Image import androidx.compose.material.icons.materialIcon import androidx.compose.material.icons.materialPath +import androidx.compose.runtime.Composable +import androidx.compose.ui.tooling.preview.Preview import com.hippo.ehviewer.icons.EhIcons import com.hippo.ehviewer.util.unsafeLazy @@ -45,3 +48,10 @@ val EhIcons.Filled.SadPanda by unsafeLazy { } } } + +@Preview +@Composable +@Suppress("UnusedPrivateMember") +private fun IconSadPandaPreview() { + Image(imageVector = EhIcons.Default.SadPanda, contentDescription = null) +} diff --git a/app/src/main/kotlin/com/hippo/ehviewer/icons/filled/Subscriptions.kt b/app/src/main/kotlin/com/hippo/ehviewer/icons/filled/Subscriptions.kt index 422267473..fa07d6f01 100644 --- a/app/src/main/kotlin/com/hippo/ehviewer/icons/filled/Subscriptions.kt +++ b/app/src/main/kotlin/com/hippo/ehviewer/icons/filled/Subscriptions.kt @@ -1,7 +1,10 @@ package com.hippo.ehviewer.icons.filled +import androidx.compose.foundation.Image import androidx.compose.material.icons.materialIcon import androidx.compose.material.icons.materialPath +import androidx.compose.runtime.Composable +import androidx.compose.ui.tooling.preview.Preview import com.hippo.ehviewer.icons.EhIcons import com.hippo.ehviewer.util.unsafeLazy @@ -59,3 +62,10 @@ val EhIcons.Filled.Subscriptions by unsafeLazy { } } } + +@Preview +@Composable +@Suppress("UnusedPrivateMember") +private fun IconSubscriptionsPreview() { + Image(imageVector = EhIcons.Default.Subscriptions, contentDescription = null) +} diff --git a/app/src/main/kotlin/com/hippo/ehviewer/icons/reader/ContinuousVertical.kt b/app/src/main/kotlin/com/hippo/ehviewer/icons/reader/ContinuousVertical.kt new file mode 100644 index 000000000..702156709 --- /dev/null +++ b/app/src/main/kotlin/com/hippo/ehviewer/icons/reader/ContinuousVertical.kt @@ -0,0 +1,53 @@ +package com.hippo.ehviewer.icons.reader + +import androidx.compose.foundation.Image +import androidx.compose.material.icons.materialIcon +import androidx.compose.material.icons.materialPath +import androidx.compose.runtime.Composable +import androidx.compose.ui.tooling.preview.Preview +import com.hippo.ehviewer.icons.EhIcons +import com.hippo.ehviewer.util.unsafeLazy + +@Suppress("BooleanLiteralArgument") +val EhIcons.Reader.ContinuousVertical by unsafeLazy { + materialIcon(name = "ContinuousVertical") { + materialPath { + moveTo(17.3159F, 1.0F) + horizontalLineToRelative(-10.0F) + arcToRelative(2.0059F, 2.0059F, 0.0F, false, false, -2.0F, 2.0F) + lineTo(5.3159F, 21.0F) + arcToRelative(2.0059F, 2.0059F, 0.0F, false, false, 2.0F, 2.0F) + horizontalLineToRelative(10.0F) + arcToRelative(2.0059F, 2.0059F, 0.0F, false, false, 2.0F, -2.0F) + lineTo(19.3159F, 3.0F) + arcTo(2.0059F, 2.0059F, 0.0F, false, false, 17.3159F, 1.0F) + close() + moveTo(17.3159F, 21.0F) + horizontalLineToRelative(-10.0F) + lineTo(7.3159F, 3.0F) + horizontalLineToRelative(10.0F) + close() + moveTo(11.3083F, 5.0F) + horizontalLineToRelative(2.0F) + verticalLineToRelative(5.5F) + horizontalLineToRelative(-2.0F) + close() + moveTo(15.308F, 16.0F) + lineToRelative(-2.0F, 0.0F) + lineToRelative(0.0F, -4.5F) + lineToRelative(-2.0F, 0.0F) + lineToRelative(0.0F, 4.5F) + lineToRelative(-2.0F, 0.0F) + lineToRelative(3.0F, 3.0F) + lineToRelative(3.0F, -3.0F) + close() + } + } +} + +@Preview +@Composable +@Suppress("UnusedPrivateMember") +private fun IconContinuousVerticalPreview() { + Image(imageVector = EhIcons.Reader.ContinuousVertical, contentDescription = null) +} diff --git a/app/src/main/kotlin/com/hippo/ehviewer/icons/reader/Default.kt b/app/src/main/kotlin/com/hippo/ehviewer/icons/reader/Default.kt new file mode 100644 index 000000000..b5aa4f8b3 --- /dev/null +++ b/app/src/main/kotlin/com/hippo/ehviewer/icons/reader/Default.kt @@ -0,0 +1,99 @@ +package com.hippo.ehviewer.icons.reader + +import androidx.compose.foundation.Image +import androidx.compose.material.icons.materialIcon +import androidx.compose.material.icons.materialPath +import androidx.compose.runtime.Composable +import androidx.compose.ui.tooling.preview.Preview +import com.hippo.ehviewer.icons.EhIcons +import com.hippo.ehviewer.util.unsafeLazy + +@Suppress("BooleanLiteralArgument") +val EhIcons.Reader.Default by unsafeLazy { + materialIcon(name = "Default") { + materialPath { + moveTo(6.9906F, 18.0F) + lineTo(6.9906F, 6.0F) + horizontalLineToRelative(12.0F) + lineTo(18.9906F, 3.0F) + arcToRelative(2.0059F, 2.0059F, 0.0F, false, false, -2.0F, -2.0F) + horizontalLineToRelative(-10.0F) + arcToRelative(2.0059F, 2.0059F, 0.0F, false, false, -2.0F, 2.0F) + lineTo(4.9906F, 21.0F) + arcToRelative(2.0059F, 2.0059F, 0.0F, false, false, 2.0F, 2.0F) + horizontalLineToRelative(10.0F) + arcToRelative(2.0059F, 2.0059F, 0.0F, false, false, 2.0F, -2.0F) + lineTo(18.9906F, 18.0F) + horizontalLineToRelative(-12.0F) + close() + moveTo(6.9906F, 3.0F) + horizontalLineToRelative(10.0F) + lineTo(16.9906F, 4.0F) + horizontalLineToRelative(-10.0F) + close() + moveTo(16.9906F, 21.0F) + horizontalLineToRelative(-10.0F) + lineTo(6.9906F, 20.0F) + horizontalLineToRelative(10.0F) + close() + moveTo(21.7706F, 12.44F) + lineToRelative(-0.02F, 0.03F) + arcToRelative(3.5546F, 3.5546F, 0.0F, false, false, 0.05F, -0.47F) + arcToRelative(3.9031F, 3.9031F, 0.0F, false, false, -0.05F, -0.48F) + lineToRelative(0.02F, 0.03F) + lineToRelative(0.85F, -0.68F) + arcToRelative(0.5068F, 0.5068F, 0.0F, false, false, 0.12F, -0.64F) + lineToRelative(-0.84F, -1.46F) + arcToRelative(0.4986F, 0.4986F, 0.0F, false, false, -0.61F, -0.22F) + lineToRelative(-1.01F, 0.39F) + lineToRelative(0.0099F, 0.04F) + arcToRelative(3.6135F, 3.6135F, 0.0F, false, false, -0.8F, -0.48F) + lineToRelative(-0.17F, -1.07F) + arcToRelative(0.4879F, 0.4879F, 0.0F, false, false, -0.49F, -0.43F) + horizontalLineToRelative(-1.68F) + arcToRelative(0.4876F, 0.4876F, 0.0F, false, false, -0.49F, 0.42F) + lineToRelative(-0.17F, 1.08F) + arcToRelative(3.6149F, 3.6149F, 0.0F, false, false, -0.8F, 0.48F) + lineToRelative(0.02F, -0.03F) + lineToRelative(-1.01F, -0.39F) + arcToRelative(0.4878F, 0.4878F, 0.0F, false, false, -0.61F, 0.22F) + lineToRelative(-0.84F, 1.46F) + arcToRelative(0.5068F, 0.5068F, 0.0F, false, false, 0.12F, 0.64F) + lineToRelative(0.85F, 0.68F) + lineToRelative(0.02F, -0.03F) + arcToRelative(3.9148F, 3.9148F, 0.0F, false, false, -0.05F, 0.48F) + arcToRelative(3.915F, 3.915F, 0.0F, false, false, 0.05F, 0.48F) + lineToRelative(-0.02F, -0.03F) + lineToRelative(-0.85F, 0.68F) + arcToRelative(0.5068F, 0.5068F, 0.0F, false, false, -0.12F, 0.64F) + lineToRelative(0.84F, 1.46F) + arcToRelative(0.4985F, 0.4985F, 0.0F, false, false, 0.61F, 0.22F) + lineToRelative(1.01F, -0.39F) + lineToRelative(-0.02F, -0.03F) + arcToRelative(4.4991F, 4.4991F, 0.0F, false, false, 0.8F, 0.46F) + lineToRelative(0.17F, 1.08F) + arcToRelative(0.4876F, 0.4876F, 0.0F, false, false, 0.49F, 0.42F) + horizontalLineToRelative(1.68F) + arcToRelative(0.4876F, 0.4876F, 0.0F, false, false, 0.49F, -0.42F) + lineToRelative(0.17F, -1.08F) + arcToRelative(3.6138F, 3.6138F, 0.0F, false, false, 0.8F, -0.48F) + lineToRelative(-0.02F, 0.03F) + lineToRelative(1.02F, 0.39F) + arcToRelative(0.4879F, 0.4879F, 0.0F, false, false, 0.61F, -0.22F) + lineToRelative(0.84F, -1.46F) + arcToRelative(0.5068F, 0.5068F, 0.0F, false, false, -0.12F, -0.64F) + close() + moveTo(17.9906F, 14.0F) + arcToRelative(2.0F, 2.0F, 0.0F, true, true, 2.0F, -2.0F) + arcTo(2.0059F, 2.0059F, 0.0F, false, true, 17.9906F, 14.0F) + close() + } + } +} + +@Preview +@Composable +@Suppress("UnusedPrivateMember") +private fun IconDefaultPreview() { + Image(imageVector = EhIcons.Reader.Default, contentDescription = null) +} diff --git a/app/src/main/kotlin/com/hippo/ehviewer/icons/reader/Landscape.kt b/app/src/main/kotlin/com/hippo/ehviewer/icons/reader/Landscape.kt new file mode 100644 index 000000000..13aaee24b --- /dev/null +++ b/app/src/main/kotlin/com/hippo/ehviewer/icons/reader/Landscape.kt @@ -0,0 +1,39 @@ +package com.hippo.ehviewer.icons.reader + +import androidx.compose.foundation.Image +import androidx.compose.material.icons.materialIcon +import androidx.compose.material.icons.materialPath +import androidx.compose.runtime.Composable +import androidx.compose.ui.tooling.preview.Preview +import com.hippo.ehviewer.icons.EhIcons +import com.hippo.ehviewer.util.unsafeLazy + +val EhIcons.Reader.Landscape by unsafeLazy { + materialIcon(name = "Landscape") { + materialPath { + moveTo(1.01F, 7.0F) + lineTo(1.0F, 17.0F) + curveToRelative(0.0F, 1.1F, 0.9F, 2.0F, 2.0F, 2.0F) + horizontalLineToRelative(18.0F) + curveToRelative(1.1F, 0.0F, 2.0F, -0.9F, 2.0F, -2.0F) + verticalLineTo(7.0F) + curveToRelative(0.0F, -1.1F, -0.9F, -2.0F, -2.0F, -2.0F) + horizontalLineTo(3.0F) + curveToRelative(-1.1F, 0.0F, -1.99F, 0.9F, -1.99F, 2.0F) + close() + moveTo(19.0F, 7.0F) + verticalLineToRelative(10.0F) + horizontalLineTo(5.0F) + verticalLineTo(7.0F) + horizontalLineToRelative(14.0F) + close() + } + } +} + +@Preview +@Composable +@Suppress("UnusedPrivateMember") +private fun IconLandscapePreview() { + Image(imageVector = EhIcons.Reader.Landscape, contentDescription = null) +} diff --git a/app/src/main/kotlin/com/hippo/ehviewer/icons/reader/LandscapeLocked.kt b/app/src/main/kotlin/com/hippo/ehviewer/icons/reader/LandscapeLocked.kt new file mode 100644 index 000000000..479395c86 --- /dev/null +++ b/app/src/main/kotlin/com/hippo/ehviewer/icons/reader/LandscapeLocked.kt @@ -0,0 +1,59 @@ +package com.hippo.ehviewer.icons.reader + +import androidx.compose.foundation.Image +import androidx.compose.material.icons.materialIcon +import androidx.compose.material.icons.materialPath +import androidx.compose.runtime.Composable +import androidx.compose.ui.tooling.preview.Preview +import com.hippo.ehviewer.icons.EhIcons +import com.hippo.ehviewer.util.unsafeLazy + +val EhIcons.Reader.LandscapeLocked by unsafeLazy { + materialIcon(name = "LandscapeLocked") { + materialPath { + moveTo(21.0F, 5.0F) + lineTo(3.0F, 5.0F) + curveToRelative(-1.1F, 0.0F, -2.0F, 0.9F, -2.0F, 2.0F) + verticalLineToRelative(10.0F) + curveToRelative(0.0F, 1.1F, 0.9F, 2.0F, 2.0F, 2.0F) + horizontalLineToRelative(18.0F) + curveToRelative(1.1F, 0.0F, 2.0F, -0.9F, 2.0F, -2.0F) + lineTo(23.0F, 7.0F) + curveToRelative(0.0F, -1.1F, -0.9F, -2.0F, -2.0F, -2.0F) + close() + moveTo(19.0F, 17.0F) + lineTo(5.0F, 17.0F) + lineTo(5.0F, 7.0F) + horizontalLineToRelative(14.0F) + verticalLineToRelative(10.0F) + close() + moveTo(10.0F, 16.0F) + horizontalLineToRelative(4.0F) + curveToRelative(0.55F, 0.0F, 1.0F, -0.45F, 1.0F, -1.0F) + verticalLineToRelative(-3.0F) + curveToRelative(0.0F, -0.55F, -0.45F, -1.0F, -1.0F, -1.0F) + verticalLineToRelative(-1.0F) + curveToRelative(0.0F, -1.11F, -0.9F, -2.0F, -2.0F, -2.0F) + curveToRelative(-1.11F, 0.0F, -2.0F, 0.9F, -2.0F, 2.0F) + verticalLineToRelative(1.0F) + curveToRelative(-0.55F, 0.0F, -1.0F, 0.45F, -1.0F, 1.0F) + verticalLineToRelative(3.0F) + curveToRelative(0.0F, 0.55F, 0.45F, 1.0F, 1.0F, 1.0F) + close() + moveTo(10.8F, 10.0F) + curveToRelative(0.0F, -0.66F, 0.54F, -1.2F, 1.2F, -1.2F) + curveToRelative(0.66F, 0.0F, 1.2F, 0.54F, 1.2F, 1.2F) + verticalLineToRelative(1.0F) + horizontalLineToRelative(-2.4F) + verticalLineToRelative(-1.0F) + close() + } + } +} + +@Preview +@Composable +@Suppress("UnusedPrivateMember") +private fun IconLandscapeLockedPreview() { + Image(imageVector = EhIcons.Reader.LandscapeLocked, contentDescription = null) +} diff --git a/app/src/main/kotlin/com/hippo/ehviewer/icons/reader/LeftToRight.kt b/app/src/main/kotlin/com/hippo/ehviewer/icons/reader/LeftToRight.kt new file mode 100644 index 000000000..198e7092c --- /dev/null +++ b/app/src/main/kotlin/com/hippo/ehviewer/icons/reader/LeftToRight.kt @@ -0,0 +1,75 @@ +package com.hippo.ehviewer.icons.reader + +import androidx.compose.foundation.Image +import androidx.compose.material.icons.materialIcon +import androidx.compose.material.icons.materialPath +import androidx.compose.runtime.Composable +import androidx.compose.ui.tooling.preview.Preview +import com.hippo.ehviewer.icons.EhIcons +import com.hippo.ehviewer.util.unsafeLazy + +@Suppress("BooleanLiteralArgument") +val EhIcons.Reader.LeftToRight by unsafeLazy { + materialIcon(name = "LeftToRight") { + materialPath { + moveTo(17.3159F, 18.0F) + horizontalLineToRelative(-10.0F) + lineTo(7.3159F, 16.0F) + horizontalLineToRelative(-2.0F) + verticalLineToRelative(5.0F) + arcToRelative(2.0059F, 2.0059F, 0.0F, false, false, 2.0F, 2.0F) + horizontalLineToRelative(10.0F) + arcToRelative(2.0059F, 2.0059F, 0.0F, false, false, 2.0F, -2.0F) + lineTo(19.3159F, 16.0F) + horizontalLineToRelative(-2.0F) + close() + moveTo(17.3159F, 21.0F) + horizontalLineToRelative(-10.0F) + lineTo(7.3159F, 20.0F) + horizontalLineToRelative(10.0F) + close() + moveTo(7.3159F, 6.0F) + horizontalLineToRelative(10.0F) + lineTo(17.3159F, 8.0F) + horizontalLineToRelative(2.0F) + lineTo(19.3159F, 3.0F) + arcToRelative(2.0059F, 2.0059F, 0.0F, false, false, -2.0F, -2.0F) + horizontalLineToRelative(-10.0F) + arcToRelative(2.0059F, 2.0059F, 0.0F, false, false, -2.0F, 2.0F) + lineTo(5.3159F, 8.0F) + horizontalLineToRelative(2.0F) + close() + moveTo(7.3159F, 3.0F) + horizontalLineToRelative(10.0F) + lineTo(17.3159F, 4.0F) + horizontalLineToRelative(-10.0F) + close() + moveTo(22.311F, 12.0F) + lineToRelative(-3.0F, -3.0F) + lineToRelative(0.0F, 2.0F) + lineToRelative(-11.99F, 0.0F) + lineToRelative(0.0F, 2.0F) + lineToRelative(11.99F, 0.0F) + lineToRelative(0.0F, 2.0F) + lineToRelative(3.0F, -3.0F) + close() + moveTo(2.3206F, 11.0F) + horizontalLineToRelative(1.5F) + verticalLineToRelative(2.0F) + horizontalLineToRelative(-1.5F) + close() + moveTo(4.8206F, 11.0F) + horizontalLineToRelative(1.5F) + verticalLineToRelative(2.0F) + horizontalLineToRelative(-1.5F) + close() + } + } +} + +@Preview +@Composable +@Suppress("UnusedPrivateMember") +private fun IconLeftToRightPreview() { + Image(imageVector = EhIcons.Reader.LeftToRight, contentDescription = null) +} diff --git a/app/src/main/kotlin/com/hippo/ehviewer/icons/reader/Portrait.kt b/app/src/main/kotlin/com/hippo/ehviewer/icons/reader/Portrait.kt new file mode 100644 index 000000000..729da3fce --- /dev/null +++ b/app/src/main/kotlin/com/hippo/ehviewer/icons/reader/Portrait.kt @@ -0,0 +1,39 @@ +package com.hippo.ehviewer.icons.reader + +import androidx.compose.foundation.Image +import androidx.compose.material.icons.materialIcon +import androidx.compose.material.icons.materialPath +import androidx.compose.runtime.Composable +import androidx.compose.ui.tooling.preview.Preview +import com.hippo.ehviewer.icons.EhIcons +import com.hippo.ehviewer.util.unsafeLazy + +val EhIcons.Reader.Portrait by unsafeLazy { + materialIcon(name = "Portrait") { + materialPath { + moveTo(17.0F, 1.01F) + lineTo(7.0F, 1.0F) + curveToRelative(-1.1F, 0.0F, -1.99F, 0.9F, -1.99F, 2.0F) + verticalLineToRelative(18.0F) + curveToRelative(0.0F, 1.1F, 0.89F, 2.0F, 1.99F, 2.0F) + horizontalLineToRelative(10.0F) + curveToRelative(1.1F, 0.0F, 2.0F, -0.9F, 2.0F, -2.0F) + verticalLineTo(3.0F) + curveToRelative(0.0F, -1.1F, -0.9F, -1.99F, -2.0F, -1.99F) + close() + moveTo(17.0F, 19.0F) + horizontalLineTo(7.0F) + verticalLineTo(5.0F) + horizontalLineToRelative(10.0F) + verticalLineToRelative(14.0F) + close() + } + } +} + +@Preview +@Composable +@Suppress("UnusedPrivateMember") +private fun IconPortraitPreview() { + Image(imageVector = EhIcons.Reader.Portrait, contentDescription = null) +} diff --git a/app/src/main/kotlin/com/hippo/ehviewer/icons/reader/PortraitLocked.kt b/app/src/main/kotlin/com/hippo/ehviewer/icons/reader/PortraitLocked.kt new file mode 100644 index 000000000..538fe641e --- /dev/null +++ b/app/src/main/kotlin/com/hippo/ehviewer/icons/reader/PortraitLocked.kt @@ -0,0 +1,59 @@ +package com.hippo.ehviewer.icons.reader + +import androidx.compose.foundation.Image +import androidx.compose.material.icons.materialIcon +import androidx.compose.material.icons.materialPath +import androidx.compose.runtime.Composable +import androidx.compose.ui.tooling.preview.Preview +import com.hippo.ehviewer.icons.EhIcons +import com.hippo.ehviewer.util.unsafeLazy + +val EhIcons.Reader.PortraitLocked by unsafeLazy { + materialIcon(name = "PortraitLocked") { + materialPath { + moveTo(10.0F, 16.0F) + horizontalLineToRelative(4.0F) + curveToRelative(0.55F, 0.0F, 1.0F, -0.45F, 1.0F, -1.0F) + verticalLineToRelative(-3.0F) + curveToRelative(0.0F, -0.55F, -0.45F, -1.0F, -1.0F, -1.0F) + verticalLineToRelative(-1.0F) + curveToRelative(0.0F, -1.11F, -0.9F, -2.0F, -2.0F, -2.0F) + curveToRelative(-1.11F, 0.0F, -2.0F, 0.9F, -2.0F, 2.0F) + verticalLineToRelative(1.0F) + curveToRelative(-0.55F, 0.0F, -1.0F, 0.45F, -1.0F, 1.0F) + verticalLineToRelative(3.0F) + curveToRelative(0.0F, 0.55F, 0.45F, 1.0F, 1.0F, 1.0F) + close() + moveTo(10.8F, 10.0F) + curveToRelative(0.0F, -0.66F, 0.54F, -1.2F, 1.2F, -1.2F) + curveToRelative(0.66F, 0.0F, 1.2F, 0.54F, 1.2F, 1.2F) + verticalLineToRelative(1.0F) + horizontalLineToRelative(-2.4F) + verticalLineToRelative(-1.0F) + close() + moveTo(17.0F, 1.0F) + lineTo(7.0F, 1.0F) + curveToRelative(-1.1F, 0.0F, -2.0F, 0.9F, -2.0F, 2.0F) + verticalLineToRelative(18.0F) + curveToRelative(0.0F, 1.1F, 0.9F, 2.0F, 2.0F, 2.0F) + horizontalLineToRelative(10.0F) + curveToRelative(1.1F, 0.0F, 2.0F, -0.9F, 2.0F, -2.0F) + lineTo(19.0F, 3.0F) + curveToRelative(0.0F, -1.1F, -0.9F, -2.0F, -2.0F, -2.0F) + close() + moveTo(17.0F, 19.0F) + lineTo(7.0F, 19.0F) + lineTo(7.0F, 5.0F) + horizontalLineToRelative(10.0F) + verticalLineToRelative(14.0F) + close() + } + } +} + +@Preview +@Composable +@Suppress("UnusedPrivateMember") +private fun IconPortraitLockedPreview() { + Image(imageVector = EhIcons.Reader.PortraitLocked, contentDescription = null) +} diff --git a/app/src/main/kotlin/com/hippo/ehviewer/icons/reader/RightToLeft.kt b/app/src/main/kotlin/com/hippo/ehviewer/icons/reader/RightToLeft.kt new file mode 100644 index 000000000..31eea14d9 --- /dev/null +++ b/app/src/main/kotlin/com/hippo/ehviewer/icons/reader/RightToLeft.kt @@ -0,0 +1,75 @@ +package com.hippo.ehviewer.icons.reader + +import androidx.compose.foundation.Image +import androidx.compose.material.icons.materialIcon +import androidx.compose.material.icons.materialPath +import androidx.compose.runtime.Composable +import androidx.compose.ui.tooling.preview.Preview +import com.hippo.ehviewer.icons.EhIcons +import com.hippo.ehviewer.util.unsafeLazy + +@Suppress("BooleanLiteralArgument") +val EhIcons.Reader.RightToLeft by unsafeLazy { + materialIcon(name = "RightToLeft") { + materialPath { + moveTo(7.0F, 6.0F) + horizontalLineTo(17.0F) + verticalLineTo(8.0F) + horizontalLineToRelative(2.0F) + verticalLineTo(3.0F) + arcToRelative(2.0059F, 2.0059F, 0.0F, false, false, -2.0F, -2.0F) + horizontalLineTo(7.0F) + arcTo(2.0059F, 2.0059F, 0.0F, false, false, 5.0F, 3.0F) + verticalLineTo(8.0F) + horizontalLineTo(7.0F) + close() + moveTo(7.0F, 3.0F) + horizontalLineTo(17.0F) + verticalLineTo(4.0F) + horizontalLineTo(7.0F) + close() + moveTo(17.0F, 18.0F) + lineTo(7.0F, 18.0F) + lineTo(7.0F, 16.0F) + lineTo(5.0F, 16.0F) + verticalLineToRelative(5.0F) + arcToRelative(2.0059F, 2.0059F, 0.0F, false, false, 2.0F, 2.0F) + lineTo(17.0F, 23.0F) + arcToRelative(2.0059F, 2.0059F, 0.0F, false, false, 2.0F, -2.0F) + lineTo(19.0F, 16.0F) + lineTo(17.0F, 16.0F) + close() + moveTo(17.0F, 21.0F) + lineTo(7.0F, 21.0F) + lineTo(7.0F, 20.0F) + lineTo(17.0F, 20.0F) + close() + moveTo(5.005F, 13.0F) + lineToRelative(11.99F, 0.0F) + lineToRelative(0.0F, -2.0F) + lineToRelative(-11.99F, 0.0F) + lineToRelative(0.0F, -2.0F) + lineToRelative(-3.0F, 3.0F) + lineToRelative(3.0F, 3.0F) + lineToRelative(0.0F, -2.0F) + close() + moveTo(20.4953F, 11.0F) + horizontalLineToRelative(1.5F) + verticalLineToRelative(2.0F) + horizontalLineToRelative(-1.5F) + close() + moveTo(17.9953F, 11.0F) + horizontalLineToRelative(1.5F) + verticalLineToRelative(2.0F) + horizontalLineToRelative(-1.5F) + close() + } + } +} + +@Preview +@Composable +@Suppress("UnusedPrivateMember") +private fun IconRightToLeftPreview() { + Image(imageVector = EhIcons.Reader.RightToLeft, contentDescription = null) +} diff --git a/app/src/main/kotlin/com/hippo/ehviewer/icons/reader/ScreenRotation.kt b/app/src/main/kotlin/com/hippo/ehviewer/icons/reader/ScreenRotation.kt new file mode 100644 index 000000000..0f2b373b8 --- /dev/null +++ b/app/src/main/kotlin/com/hippo/ehviewer/icons/reader/ScreenRotation.kt @@ -0,0 +1,55 @@ +package com.hippo.ehviewer.icons.reader + +import androidx.compose.foundation.Image +import androidx.compose.material.icons.materialIcon +import androidx.compose.material.icons.materialPath +import androidx.compose.runtime.Composable +import androidx.compose.ui.tooling.preview.Preview +import com.hippo.ehviewer.icons.EhIcons +import com.hippo.ehviewer.util.unsafeLazy + +val EhIcons.Reader.ScreenRotation by unsafeLazy { + materialIcon(name = "ScreenRotation") { + materialPath { + moveTo(16.48F, 2.52F) + curveToRelative(3.27F, 1.55F, 5.61F, 4.72F, 5.97F, 8.48F) + horizontalLineToRelative(1.5F) + curveTo(23.44F, 4.84F, 18.29F, 0.0F, 12.0F, 0.0F) + lineToRelative(-0.66F, 0.03F) + lineToRelative(3.81F, 3.81F) + lineToRelative(1.33F, -1.32F) + close() + moveTo(10.23F, 1.75F) + curveToRelative(-0.59F, -0.59F, -1.54F, -0.59F, -2.12F, 0.0F) + lineTo(1.75F, 8.11F) + curveToRelative(-0.59F, 0.59F, -0.59F, 1.54F, 0.0F, 2.12F) + lineToRelative(12.02F, 12.02F) + curveToRelative(0.59F, 0.59F, 1.54F, 0.59F, 2.12F, 0.0F) + lineToRelative(6.36F, -6.36F) + curveToRelative(0.59F, -0.59F, 0.59F, -1.54F, 0.0F, -2.12F) + lineTo(10.23F, 1.75F) + close() + moveTo(14.83F, 21.19F) + lineTo(2.81F, 9.17F) + lineToRelative(6.36F, -6.36F) + lineToRelative(12.02F, 12.02F) + lineToRelative(-6.36F, 6.36F) + close() + moveTo(7.52F, 21.48F) + curveTo(4.25F, 19.94F, 1.91F, 16.76F, 1.55F, 13.0F) + lineTo(0.05F, 13.0F) + curveTo(0.56F, 19.16F, 5.71F, 24.0F, 12.0F, 24.0F) + lineToRelative(0.66F, -0.03F) + lineToRelative(-3.81F, -3.81F) + lineToRelative(-1.33F, 1.32F) + close() + } + } +} + +@Preview +@Composable +@Suppress("UnusedPrivateMember") +private fun IconScreenRotationPreview() { + Image(imageVector = EhIcons.Reader.ScreenRotation, contentDescription = null) +} diff --git a/app/src/main/kotlin/com/hippo/ehviewer/icons/reader/Vertical.kt b/app/src/main/kotlin/com/hippo/ehviewer/icons/reader/Vertical.kt new file mode 100644 index 000000000..9e41408fc --- /dev/null +++ b/app/src/main/kotlin/com/hippo/ehviewer/icons/reader/Vertical.kt @@ -0,0 +1,58 @@ +package com.hippo.ehviewer.icons.reader + +import androidx.compose.foundation.Image +import androidx.compose.material.icons.materialIcon +import androidx.compose.material.icons.materialPath +import androidx.compose.runtime.Composable +import androidx.compose.ui.tooling.preview.Preview +import com.hippo.ehviewer.icons.EhIcons +import com.hippo.ehviewer.util.unsafeLazy + +@Suppress("BooleanLiteralArgument") +val EhIcons.Reader.Vertical by unsafeLazy { + materialIcon(name = "Vertical") { + materialPath { + moveTo(17.0F, 1.0F) + lineTo(7.0F, 1.0F) + arcTo(2.0059F, 2.0059F, 0.0F, false, false, 5.0F, 3.0F) + lineTo(5.0F, 21.0F) + arcToRelative(2.0059F, 2.0059F, 0.0F, false, false, 2.0F, 2.0F) + lineTo(17.0F, 23.0F) + arcToRelative(2.0059F, 2.0059F, 0.0F, false, false, 2.0F, -2.0F) + lineTo(19.0F, 3.0F) + arcTo(2.0059F, 2.0059F, 0.0F, false, false, 17.0F, 1.0F) + close() + moveTo(17.0F, 3.0F) + verticalLineToRelative(1.0462F) + lineTo(7.0F, 4.0462F) + lineTo(7.0F, 3.0F) + close() + moveTo(17.0F, 6.0462F) + verticalLineToRelative(12.0F) + lineTo(7.0F, 18.0462F) + verticalLineToRelative(-12.0F) + close() + moveTo(7.0F, 21.0F) + verticalLineToRelative(-0.9538F) + lineTo(17.0F, 20.0462F) + lineTo(17.0F, 21.0F) + close() + moveTo(9.0F, 13.0F) + lineToRelative(3.0F, 3.0F) + lineToRelative(3.0F, -3.0F) + lineToRelative(-2.0F, 0.0F) + lineToRelative(0.0F, -5.0F) + lineToRelative(-2.0F, 0.0F) + lineToRelative(0.0F, 5.0F) + lineToRelative(-2.0F, 0.0F) + close() + } + } +} + +@Preview +@Composable +@Suppress("UnusedPrivateMember") +private fun IconVerticalPreview() { + Image(imageVector = EhIcons.Reader.Vertical, contentDescription = null) +} diff --git a/app/src/main/kotlin/com/hippo/ehviewer/icons/reader/Webtoon.kt b/app/src/main/kotlin/com/hippo/ehviewer/icons/reader/Webtoon.kt new file mode 100644 index 000000000..ce9cb6f2a --- /dev/null +++ b/app/src/main/kotlin/com/hippo/ehviewer/icons/reader/Webtoon.kt @@ -0,0 +1,48 @@ +package com.hippo.ehviewer.icons.reader + +import androidx.compose.foundation.Image +import androidx.compose.material.icons.materialIcon +import androidx.compose.material.icons.materialPath +import androidx.compose.runtime.Composable +import androidx.compose.ui.tooling.preview.Preview +import com.hippo.ehviewer.icons.EhIcons +import com.hippo.ehviewer.util.unsafeLazy + +@Suppress("BooleanLiteralArgument") +val EhIcons.Reader.Webtoon by unsafeLazy { + materialIcon(name = "Webtoon") { + materialPath { + moveTo(11.992F, 19.0F) + lineToRelative(3.0F, -3.0F) + lineToRelative(-2.0F, 0.0F) + lineToRelative(0.0F, -11.0F) + lineToRelative(-2.0F, 0.0F) + lineToRelative(0.0F, 11.0F) + lineToRelative(-2.0F, 0.0F) + lineToRelative(3.0F, 3.0F) + close() + moveTo(17.0F, 1.0F) + lineTo(7.0F, 1.0F) + arcTo(2.0059F, 2.0059F, 0.0F, false, false, 5.0F, 3.0F) + lineTo(5.0F, 21.0F) + arcToRelative(2.0059F, 2.0059F, 0.0F, false, false, 2.0F, 2.0F) + lineTo(17.0F, 23.0F) + arcToRelative(2.0059F, 2.0059F, 0.0F, false, false, 2.0F, -2.0F) + lineTo(19.0F, 3.0F) + arcTo(2.0059F, 2.0059F, 0.0F, false, false, 17.0F, 1.0F) + close() + moveTo(17.0F, 21.0F) + lineTo(7.0F, 21.0F) + lineTo(7.0F, 3.0F) + lineTo(17.0F, 3.0F) + close() + } + } +} + +@Preview +@Composable +@Suppress("UnusedPrivateMember") +private fun IconWebtoonPreview() { + Image(imageVector = EhIcons.Reader.Webtoon, contentDescription = null) +} diff --git a/app/src/main/kotlin/eu/kanade/tachiyomi/ui/reader/BottomReaderBar.kt b/app/src/main/kotlin/eu/kanade/tachiyomi/ui/reader/BottomReaderBar.kt index 0397e6db5..e97c44090 100644 --- a/app/src/main/kotlin/eu/kanade/tachiyomi/ui/reader/BottomReaderBar.kt +++ b/app/src/main/kotlin/eu/kanade/tachiyomi/ui/reader/BottomReaderBar.kt @@ -25,7 +25,6 @@ import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.DpOffset import androidx.compose.ui.unit.dp @@ -102,13 +101,13 @@ fun BottomReaderBar(onClickSettings: () -> Unit) { ) { IconButton(onClick = { readingModeExpanded = true }) { Icon( - painter = painterResource(readingMode.iconRes), + imageVector = readingMode.icon, contentDescription = stringResource(R.string.viewer), ) } IconButton(onClick = { orientationModeExpanded = true }) { Icon( - painter = painterResource(orientationMode.iconRes), + imageVector = orientationMode.icon, contentDescription = stringResource(R.string.pref_rotation_type), ) } diff --git a/app/src/main/kotlin/eu/kanade/tachiyomi/ui/reader/setting/OrientationType.kt b/app/src/main/kotlin/eu/kanade/tachiyomi/ui/reader/setting/OrientationType.kt index d709ffc3e..076e718e8 100644 --- a/app/src/main/kotlin/eu/kanade/tachiyomi/ui/reader/setting/OrientationType.kt +++ b/app/src/main/kotlin/eu/kanade/tachiyomi/ui/reader/setting/OrientationType.kt @@ -1,18 +1,24 @@ package eu.kanade.tachiyomi.ui.reader.setting import android.content.pm.ActivityInfo -import androidx.annotation.DrawableRes import androidx.annotation.StringRes +import androidx.compose.ui.graphics.vector.ImageVector import com.hippo.ehviewer.R +import com.hippo.ehviewer.icons.EhIcons +import com.hippo.ehviewer.icons.reader.Landscape +import com.hippo.ehviewer.icons.reader.LandscapeLocked +import com.hippo.ehviewer.icons.reader.Portrait +import com.hippo.ehviewer.icons.reader.PortraitLocked +import com.hippo.ehviewer.icons.reader.ScreenRotation -enum class OrientationType(val prefValue: Int, val flag: Int, @StringRes val stringRes: Int, @DrawableRes val iconRes: Int, val flagValue: Int) { - DEFAULT(0, ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED, R.string.label_default, R.drawable.ic_screen_rotation_24dp, 0x00000000), - FREE(1, ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED, R.string.rotation_free, R.drawable.ic_screen_rotation_24dp, 0x00000008), - PORTRAIT(2, ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT, R.string.rotation_portrait, R.drawable.ic_stay_current_portrait_24dp, 0x00000010), - LANDSCAPE(3, ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE, R.string.rotation_landscape, R.drawable.ic_stay_current_landscape_24dp, 0x00000018), - LOCKED_PORTRAIT(4, ActivityInfo.SCREEN_ORIENTATION_PORTRAIT, R.string.rotation_force_portrait, R.drawable.ic_screen_lock_portrait_24dp, 0x00000020), - LOCKED_LANDSCAPE(5, ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE, R.string.rotation_force_landscape, R.drawable.ic_screen_lock_landscape_24dp, 0x00000028), - REVERSE_PORTRAIT(6, ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT, R.string.rotation_reverse_portrait, R.drawable.ic_stay_current_portrait_24dp, 0x00000030), +enum class OrientationType(val prefValue: Int, val flag: Int, @StringRes val stringRes: Int, val icon: ImageVector, val flagValue: Int) { + DEFAULT(0, ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED, R.string.label_default, EhIcons.Reader.ScreenRotation, 0x00000000), + FREE(1, ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED, R.string.rotation_free, EhIcons.Reader.ScreenRotation, 0x00000008), + PORTRAIT(2, ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT, R.string.rotation_portrait, EhIcons.Reader.Portrait, 0x00000010), + LANDSCAPE(3, ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE, R.string.rotation_landscape, EhIcons.Reader.Landscape, 0x00000018), + LOCKED_PORTRAIT(4, ActivityInfo.SCREEN_ORIENTATION_PORTRAIT, R.string.rotation_force_portrait, EhIcons.Reader.PortraitLocked, 0x00000020), + LOCKED_LANDSCAPE(5, ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE, R.string.rotation_force_landscape, EhIcons.Reader.LandscapeLocked, 0x00000028), + REVERSE_PORTRAIT(6, ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT, R.string.rotation_reverse_portrait, EhIcons.Reader.Portrait, 0x00000030), ; companion object { diff --git a/app/src/main/kotlin/eu/kanade/tachiyomi/ui/reader/setting/ReadingModeType.kt b/app/src/main/kotlin/eu/kanade/tachiyomi/ui/reader/setting/ReadingModeType.kt index 3a3dae42a..28ee20fc7 100644 --- a/app/src/main/kotlin/eu/kanade/tachiyomi/ui/reader/setting/ReadingModeType.kt +++ b/app/src/main/kotlin/eu/kanade/tachiyomi/ui/reader/setting/ReadingModeType.kt @@ -1,9 +1,16 @@ package eu.kanade.tachiyomi.ui.reader.setting -import androidx.annotation.DrawableRes import androidx.annotation.StringRes import androidx.compose.runtime.Stable +import androidx.compose.ui.graphics.vector.ImageVector import com.hippo.ehviewer.R +import com.hippo.ehviewer.icons.EhIcons +import com.hippo.ehviewer.icons.reader.ContinuousVertical +import com.hippo.ehviewer.icons.reader.Default +import com.hippo.ehviewer.icons.reader.LeftToRight +import com.hippo.ehviewer.icons.reader.RightToLeft +import com.hippo.ehviewer.icons.reader.Vertical +import com.hippo.ehviewer.icons.reader.Webtoon import eu.kanade.tachiyomi.ui.reader.ReaderActivity import eu.kanade.tachiyomi.ui.reader.viewer.BaseViewer import eu.kanade.tachiyomi.ui.reader.viewer.pager.L2RPagerViewer @@ -12,13 +19,13 @@ import eu.kanade.tachiyomi.ui.reader.viewer.pager.VerticalPagerViewer import eu.kanade.tachiyomi.ui.reader.viewer.webtoon.WebtoonViewer @Stable -enum class ReadingModeType(val prefValue: Int, @StringRes val stringRes: Int, @DrawableRes val iconRes: Int, val flagValue: Int) { - DEFAULT(0, R.string.label_default, R.drawable.ic_reader_default_24dp, 0x00000000), - LEFT_TO_RIGHT(1, R.string.left_to_right_viewer, R.drawable.ic_reader_ltr_24dp, 0x00000001), - RIGHT_TO_LEFT(2, R.string.right_to_left_viewer, R.drawable.ic_reader_rtl_24dp, 0x00000002), - VERTICAL(3, R.string.vertical_viewer, R.drawable.ic_reader_vertical_24dp, 0x00000003), - WEBTOON(4, R.string.webtoon_viewer, R.drawable.ic_reader_webtoon_24dp, 0x00000004), - CONTINUOUS_VERTICAL(5, R.string.vertical_plus_viewer, R.drawable.ic_reader_continuous_vertical_24dp, 0x00000005), +enum class ReadingModeType(val prefValue: Int, @StringRes val stringRes: Int, val icon: ImageVector, val flagValue: Int) { + DEFAULT(0, R.string.label_default, EhIcons.Reader.Default, 0x00000000), + LEFT_TO_RIGHT(1, R.string.left_to_right_viewer, EhIcons.Reader.LeftToRight, 0x00000001), + RIGHT_TO_LEFT(2, R.string.right_to_left_viewer, EhIcons.Reader.RightToLeft, 0x00000002), + VERTICAL(3, R.string.vertical_viewer, EhIcons.Reader.Vertical, 0x00000003), + WEBTOON(4, R.string.webtoon_viewer, EhIcons.Reader.Webtoon, 0x00000004), + CONTINUOUS_VERTICAL(5, R.string.vertical_plus_viewer, EhIcons.Reader.ContinuousVertical, 0x00000005), ; companion object { diff --git a/app/src/main/res/drawable/ic_reader_continuous_vertical_24dp.xml b/app/src/main/res/drawable/ic_reader_continuous_vertical_24dp.xml deleted file mode 100644 index 7997bba7b..000000000 --- a/app/src/main/res/drawable/ic_reader_continuous_vertical_24dp.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - diff --git a/app/src/main/res/drawable/ic_reader_default_24dp.xml b/app/src/main/res/drawable/ic_reader_default_24dp.xml deleted file mode 100644 index 3ec2d7598..000000000 --- a/app/src/main/res/drawable/ic_reader_default_24dp.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - diff --git a/app/src/main/res/drawable/ic_reader_ltr_24dp.xml b/app/src/main/res/drawable/ic_reader_ltr_24dp.xml deleted file mode 100644 index 2c44474e9..000000000 --- a/app/src/main/res/drawable/ic_reader_ltr_24dp.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/app/src/main/res/drawable/ic_reader_rtl_24dp.xml b/app/src/main/res/drawable/ic_reader_rtl_24dp.xml deleted file mode 100644 index bce2932fc..000000000 --- a/app/src/main/res/drawable/ic_reader_rtl_24dp.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/app/src/main/res/drawable/ic_reader_vertical_24dp.xml b/app/src/main/res/drawable/ic_reader_vertical_24dp.xml deleted file mode 100644 index def93b2c2..000000000 --- a/app/src/main/res/drawable/ic_reader_vertical_24dp.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - diff --git a/app/src/main/res/drawable/ic_reader_webtoon_24dp.xml b/app/src/main/res/drawable/ic_reader_webtoon_24dp.xml deleted file mode 100644 index b7683822d..000000000 --- a/app/src/main/res/drawable/ic_reader_webtoon_24dp.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - diff --git a/app/src/main/res/drawable/ic_screen_lock_landscape_24dp.xml b/app/src/main/res/drawable/ic_screen_lock_landscape_24dp.xml deleted file mode 100644 index f78d9a5d4..000000000 --- a/app/src/main/res/drawable/ic_screen_lock_landscape_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_screen_lock_portrait_24dp.xml b/app/src/main/res/drawable/ic_screen_lock_portrait_24dp.xml deleted file mode 100644 index 718ca70ba..000000000 --- a/app/src/main/res/drawable/ic_screen_lock_portrait_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_screen_rotation_24dp.xml b/app/src/main/res/drawable/ic_screen_rotation_24dp.xml deleted file mode 100644 index 3243d5a75..000000000 --- a/app/src/main/res/drawable/ic_screen_rotation_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_stay_current_landscape_24dp.xml b/app/src/main/res/drawable/ic_stay_current_landscape_24dp.xml deleted file mode 100644 index ac185cda4..000000000 --- a/app/src/main/res/drawable/ic_stay_current_landscape_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_stay_current_portrait_24dp.xml b/app/src/main/res/drawable/ic_stay_current_portrait_24dp.xml deleted file mode 100644 index 23e9f4f26..000000000 --- a/app/src/main/res/drawable/ic_stay_current_portrait_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 7f30acaf9..aa416bc03 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -73,6 +73,8 @@ compose-foundation = { module = "androidx.compose.foundation:foundation-android" compose-material-icons-extended = { module = "androidx.compose.material:material-icons-extended" } compose-material3 = { module = "androidx.compose.material3:material3", version = "1.3.0-SNAPSHOT" } compose-material3-windowsizeclass = { module = "androidx.compose.material3:material3-window-size-class" } +compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling" } +compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview" } compose-ui-util = { module = "androidx.compose.ui:ui-util" } compose-destinations-core = { module = "io.github.raamcosta.compose-destinations:core", version.ref = "compose-destinations" }