Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 18a28c36 authored by Chaohui Wang's avatar Chaohui Wang Committed by Android (Google) Code Review
Browse files

Merge "[Spa] ZeroStatePreference horizontal alignment" into main

parents ce342337 825fafc7
Loading
Loading
Loading
Loading
+25 −12
Original line number Diff line number Diff line
@@ -89,6 +89,7 @@ fun ZeroStatePreference(icon: ImageVector, text: String = "", description: Strin
                    bottom = SettingsSpace.small1,
                ),
            verticalArrangement = Arrangement.spacedBy(SettingsSpace.extraSmall2),
            horizontalAlignment = Alignment.CenterHorizontally,
        ) {
            if (text.isNotEmpty()) {
                Text(
@@ -110,18 +111,6 @@ fun ZeroStatePreference(icon: ImageVector, text: String = "", description: Strin
    }
}

@Preview
@Composable
private fun ZeroStatePreferencePreview() {
    SettingsTheme {
        ZeroStatePreference(
            Icons.Filled.History,
            "No recent search history No recent search history",
            "Description Description Description Description Description",
        )
    }
}

private class RoundedPolygonShape(
    private val polygon: RoundedPolygon,
    private var matrix: Matrix = Matrix(),
@@ -145,3 +134,27 @@ private class RoundedPolygonShape(
        return Outline.Generic(path)
    }
}

@Preview
@Composable
private fun ZeroStatePreferencePreview() {
    SettingsTheme {
        ZeroStatePreference(
            icon = Icons.Filled.History,
            text = "No recent search history",
            description = "Description",
        )
    }
}

@Preview
@Composable
private fun ZeroStatePreferenceMultiLinesPreview() {
    SettingsTheme {
        ZeroStatePreference(
            icon = Icons.Filled.History,
            text = "No recent search history No recent search history",
            description = "Description Description Description Description Description",
        )
    }
}