mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-10 19:18:56 +01:00
Replace ReaderOrientation icon resources
This commit is contained in:
@@ -11,8 +11,6 @@ import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.vector.ImageVector
|
||||
import androidx.compose.ui.res.vectorResource
|
||||
import androidx.compose.ui.tooling.preview.PreviewLightDark
|
||||
import dev.icerock.moko.resources.StringResource
|
||||
import eu.kanade.domain.manga.model.readerOrientation
|
||||
@@ -72,7 +70,7 @@ private fun DialogContent(
|
||||
selected = mode
|
||||
},
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
imageVector = ImageVector.vectorResource(mode.iconRes),
|
||||
imageVector = mode.icon,
|
||||
title = stringResource(mode.stringRes),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ fun BottomReaderBar(
|
||||
|
||||
IconButton(onClick = onClickOrientation) {
|
||||
Icon(
|
||||
painter = painterResource(orientation.iconRes),
|
||||
imageVector = orientation.icon,
|
||||
contentDescription = stringResource(MR.strings.rotation_type),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,57 +1,62 @@
|
||||
package eu.kanade.tachiyomi.ui.reader.setting
|
||||
|
||||
import android.content.pm.ActivityInfo
|
||||
import androidx.annotation.DrawableRes
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.ScreenLockLandscape
|
||||
import androidx.compose.material.icons.filled.ScreenLockPortrait
|
||||
import androidx.compose.material.icons.filled.ScreenRotation
|
||||
import androidx.compose.material.icons.filled.StayCurrentLandscape
|
||||
import androidx.compose.material.icons.filled.StayCurrentPortrait
|
||||
import androidx.compose.ui.graphics.vector.ImageVector
|
||||
import dev.icerock.moko.resources.StringResource
|
||||
import eu.kanade.tachiyomi.R
|
||||
import tachiyomi.i18n.MR
|
||||
|
||||
enum class ReaderOrientation(
|
||||
val flag: Int,
|
||||
val stringRes: StringResource,
|
||||
@DrawableRes val iconRes: Int,
|
||||
val icon: ImageVector,
|
||||
val flagValue: Int,
|
||||
) {
|
||||
DEFAULT(
|
||||
ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED,
|
||||
MR.strings.label_default,
|
||||
R.drawable.ic_screen_rotation_24dp,
|
||||
Icons.Default.ScreenRotation,
|
||||
0x00000000,
|
||||
),
|
||||
FREE(
|
||||
ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED,
|
||||
MR.strings.rotation_free,
|
||||
R.drawable.ic_screen_rotation_24dp,
|
||||
Icons.Default.ScreenRotation,
|
||||
0x00000008,
|
||||
),
|
||||
PORTRAIT(
|
||||
ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT,
|
||||
MR.strings.rotation_portrait,
|
||||
R.drawable.ic_stay_current_portrait_24dp,
|
||||
Icons.Default.StayCurrentPortrait,
|
||||
0x00000010,
|
||||
),
|
||||
LANDSCAPE(
|
||||
ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE,
|
||||
MR.strings.rotation_landscape,
|
||||
R.drawable.ic_stay_current_landscape_24dp,
|
||||
Icons.Default.StayCurrentLandscape,
|
||||
0x00000018,
|
||||
),
|
||||
LOCKED_PORTRAIT(
|
||||
ActivityInfo.SCREEN_ORIENTATION_PORTRAIT,
|
||||
MR.strings.rotation_force_portrait,
|
||||
R.drawable.ic_screen_lock_portrait_24dp,
|
||||
Icons.Default.ScreenLockPortrait,
|
||||
0x00000020,
|
||||
),
|
||||
LOCKED_LANDSCAPE(
|
||||
ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE,
|
||||
MR.strings.rotation_force_landscape,
|
||||
R.drawable.ic_screen_lock_landscape_24dp,
|
||||
Icons.Default.ScreenLockLandscape,
|
||||
0x00000028,
|
||||
),
|
||||
REVERSE_PORTRAIT(
|
||||
ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT,
|
||||
MR.strings.rotation_reverse_portrait,
|
||||
R.drawable.ic_stay_current_portrait_24dp,
|
||||
Icons.Default.StayCurrentPortrait,
|
||||
0x00000030,
|
||||
),
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user