Rename some classes which implement PreviewParameterProvider according to the new naming convention.

`Provider` suffix is enough and more used than `PreviewProvider`, so let's make the codebase more consistent.
This commit is contained in:
Benoit Marty 2024-10-14 16:51:12 +02:00 committed by Benoit Marty
parent 2513ae769f
commit 0113cd522d
11 changed files with 15 additions and 15 deletions

View file

@ -126,7 +126,7 @@ object BigIcon {
internal fun BigIconPreview() {
ElementPreview {
Row(horizontalArrangement = Arrangement.spacedBy(10.dp), modifier = Modifier.padding(10.dp)) {
val provider = BigIconStylePreviewProvider()
val provider = BigIconStyleProvider()
for (style in provider.values) {
BigIcon(style = style)
}
@ -134,7 +134,7 @@ internal fun BigIconPreview() {
}
}
internal class BigIconStylePreviewProvider : PreviewParameterProvider<BigIcon.Style> {
internal class BigIconStyleProvider : PreviewParameterProvider<BigIcon.Style> {
override val values: Sequence<BigIcon.Style>
get() = sequenceOf(
BigIcon.Style.Default(Icons.Filled.CatchingPokemon),

View file

@ -99,7 +99,7 @@ fun PageTitle(
@PreviewsDayNight
@Composable
internal fun PageTitleWithIconFullPreview(@PreviewParameter(BigIconStylePreviewProvider::class) style: BigIcon.Style) {
internal fun PageTitleWithIconFullPreview(@PreviewParameter(BigIconStyleProvider::class) style: BigIcon.Style) {
ElementPreview {
PageTitle(
modifier = Modifier.padding(top = 24.dp),

View file

@ -30,7 +30,7 @@ import io.element.android.libraries.designsystem.theme.components.Text
import kotlinx.collections.immutable.ImmutableList
import kotlinx.collections.immutable.toPersistentList
internal class CompoundIconListPreviewProvider : PreviewParameterProvider<IconChunk> {
internal class CompoundIconChunkProvider : PreviewParameterProvider<IconChunk> {
override val values: Sequence<IconChunk>
get() {
val chunks = CompoundIcons.allResIds.chunked(36)
@ -41,7 +41,7 @@ internal class CompoundIconListPreviewProvider : PreviewParameterProvider<IconCh
}
}
internal class OtherIconListPreviewProvider : PreviewParameterProvider<IconChunk> {
internal class OtherIconChunkProvider : PreviewParameterProvider<IconChunk> {
override val values: Sequence<IconChunk>
get() {
val chunks = iconsOther.chunked(36)
@ -60,7 +60,7 @@ internal data class IconChunk(
@PreviewsDayNight
@Composable
internal fun IconsCompoundPreview(@PreviewParameter(CompoundIconListPreviewProvider::class) chunk: IconChunk) = ElementPreview {
internal fun IconsCompoundPreview(@PreviewParameter(CompoundIconChunkProvider::class) chunk: IconChunk) = ElementPreview {
IconsPreview(
title = "R.drawable.ic_compound_* ${chunk.index}/${chunk.total}",
iconsList = chunk.icons,
@ -73,7 +73,7 @@ internal fun IconsCompoundPreview(@PreviewParameter(CompoundIconListPreviewProvi
@PreviewsDayNight
@Composable
internal fun IconsOtherPreview(@PreviewParameter(OtherIconListPreviewProvider::class) iconChunk: IconChunk) = ElementPreview {
internal fun IconsOtherPreview(@PreviewParameter(OtherIconChunkProvider::class) iconChunk: IconChunk) = ElementPreview {
IconsPreview(
title = "R.drawable.ic_* ${iconChunk.index}/${iconChunk.total}",
iconsList = iconChunk.icons,