The TachiyomiTheme introduced a dependency-injection construct that didn't exist at the time of rendering previews, so I've changed the preview function to use a preview version of the theme that uses declarative configuration over dependency injection (cherry picked from commit cf6f7c521cde88f20c1eef3a6a63a2b73601523f)
50 lines
1.5 KiB
Kotlin
50 lines
1.5 KiB
Kotlin
package eu.kanade.presentation.components
|
|
|
|
import androidx.compose.material.icons.Icons
|
|
import androidx.compose.material.icons.automirrored.outlined.HelpOutline
|
|
import androidx.compose.material.icons.outlined.Refresh
|
|
import androidx.compose.material3.Surface
|
|
import androidx.compose.runtime.Composable
|
|
import androidx.compose.ui.tooling.preview.PreviewLightDark
|
|
import eu.kanade.presentation.theme.TachiyomiPreviewTheme
|
|
import kotlinx.collections.immutable.persistentListOf
|
|
import tachiyomi.i18n.MR
|
|
import tachiyomi.presentation.core.screens.EmptyScreen
|
|
import tachiyomi.presentation.core.screens.EmptyScreenAction
|
|
|
|
@PreviewLightDark
|
|
@Composable
|
|
private fun NoActionPreview() {
|
|
TachiyomiPreviewTheme {
|
|
Surface {
|
|
EmptyScreen(
|
|
stringRes = MR.strings.empty_screen,
|
|
)
|
|
}
|
|
}
|
|
}
|
|
|
|
@PreviewLightDark
|
|
@Composable
|
|
private fun WithActionPreview() {
|
|
TachiyomiPreviewTheme {
|
|
Surface {
|
|
EmptyScreen(
|
|
stringRes = MR.strings.empty_screen,
|
|
actions = persistentListOf(
|
|
EmptyScreenAction(
|
|
stringRes = MR.strings.action_retry,
|
|
icon = Icons.Outlined.Refresh,
|
|
onClick = {},
|
|
),
|
|
EmptyScreenAction(
|
|
stringRes = MR.strings.getting_started_guide,
|
|
icon = Icons.AutoMirrored.Outlined.HelpOutline,
|
|
onClick = {},
|
|
),
|
|
),
|
|
)
|
|
}
|
|
}
|
|
}
|