Fix warnings.

This commit is contained in:
Benoit Marty 2023-09-20 12:23:49 +02:00 committed by Benoit Marty
parent c9574f48e6
commit 5fafd51e40

View file

@ -33,13 +33,15 @@ import io.element.android.libraries.designsystem.preview.ElementPreview
import io.element.android.libraries.designsystem.theme.components.Icon import io.element.android.libraries.designsystem.theme.components.Icon
import io.element.android.libraries.designsystem.theme.components.Text import io.element.android.libraries.designsystem.theme.components.Text
import io.element.android.libraries.theme.ElementTheme import io.element.android.libraries.theme.ElementTheme
import kotlinx.collections.immutable.ImmutableList
import kotlinx.collections.immutable.toPersistentList
@DayNightPreviews @DayNightPreviews
@Composable @Composable
internal fun IconsCompoundPreview() = ElementPreview { internal fun IconsCompoundPreview() = ElementPreview {
IconsPreview( IconsPreview(
title = "R.drawable.ic_compound_*", title = "R.drawable.ic_compound_*",
iconsList = iconsCompound, iconsList = iconsCompound.toPersistentList(),
iconNameTransform = { name -> iconNameTransform = { name ->
name.removePrefix("ic_compound_") name.removePrefix("ic_compound_")
.replace("_", " ") .replace("_", " ")
@ -51,7 +53,7 @@ internal fun IconsCompoundPreview() = ElementPreview {
internal fun IconsSeptemberPreview() = ElementPreview { internal fun IconsSeptemberPreview() = ElementPreview {
IconsPreview( IconsPreview(
title = "R.drawable.ic_september_*", title = "R.drawable.ic_september_*",
iconsList = iconsSeptember, iconsList = iconsSeptember.toPersistentList(),
iconNameTransform = { name -> iconNameTransform = { name ->
name.removePrefix("ic_september_") name.removePrefix("ic_september_")
.replace("_", " ") .replace("_", " ")
@ -63,7 +65,7 @@ internal fun IconsSeptemberPreview() = ElementPreview {
internal fun IconsOtherPreview() = ElementPreview { internal fun IconsOtherPreview() = ElementPreview {
IconsPreview( IconsPreview(
title = "R.drawable.ic_*", title = "R.drawable.ic_*",
iconsList = iconsOther, iconsList = iconsOther.toPersistentList(),
iconNameTransform = { name -> iconNameTransform = { name ->
name.removePrefix("ic_") name.removePrefix("ic_")
.replace("_", " ") .replace("_", " ")
@ -73,7 +75,7 @@ internal fun IconsOtherPreview() = ElementPreview {
@Composable @Composable
private fun IconsPreview( private fun IconsPreview(
title: String, title: String,
iconsList: List<Int>, iconsList: ImmutableList<Int>,
iconNameTransform: (String) -> String, iconNameTransform: (String) -> String,
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
) = ElementPreview { ) = ElementPreview {