From 7e92d0f888fe91ac4ff616454d55deafe4d91df5 Mon Sep 17 00:00:00 2001 From: Pun Butrach Date: Sat, 18 Oct 2025 02:49:04 +0700 Subject: [PATCH] feat: Complex Clover icon shape Signed-off-by: Pun Butrach --- GITHUB_CHANGELOG.md | 3 ++ lawnchair/res/values/strings.xml | 3 +- .../app/lawnchair/icons/shape/IconShape.kt | 46 +++++++++++++++++++ .../destinations/IconShapePreference.kt | 1 + 4 files changed, 52 insertions(+), 1 deletion(-) diff --git a/GITHUB_CHANGELOG.md b/GITHUB_CHANGELOG.md index 420130c770..45a1760cdf 100644 --- a/GITHUB_CHANGELOG.md +++ b/GITHUB_CHANGELOG.md @@ -19,6 +19,9 @@ Compatibility list: > [!NOTE] > QuickSwitch compatibility have not been tested at any time during the development of Bubble Tea! +#### Features +* [Lawnchair] Complex Clover icon shape + #### Fixes * Disable OEM override on launcher settings, (reimplement `ENABLE_AUTO_INSTALLS_LAYOUT` | c51b2a221838aefb610b7146fc4ef7cb34e5e495) * [Lawnchair/Iconloaderlib] Reimplement custom app name diff --git a/lawnchair/res/values/strings.xml b/lawnchair/res/values/strings.xml index cb56c6919b..6bcc6d8250 100644 --- a/lawnchair/res/values/strings.xml +++ b/lawnchair/res/values/strings.xml @@ -297,7 +297,8 @@ Square Squircle Teardrop - + + Complex clover Four-sided cookie Seven-sided cookie Arch diff --git a/lawnchair/src/app/lawnchair/icons/shape/IconShape.kt b/lawnchair/src/app/lawnchair/icons/shape/IconShape.kt index 04b7c41082..f68e0938c4 100644 --- a/lawnchair/src/app/lawnchair/icons/shape/IconShape.kt +++ b/lawnchair/src/app/lawnchair/icons/shape/IconShape.kt @@ -467,6 +467,50 @@ open class IconShape( } } + /** + * Material 3 Expressive Shape + */ + object ComplexClover : IconShape( + // Placeholder + Corner.fullArc, + Corner.fullArc, + Corner.fullArc, + Corner.fullArc, + ) { + private val parsedPath: Path = PathParser.createPathFromPathData(ShapesProvider.FOLDER_COMPLEX_CLOVER_PATH) + + private val matrix = Matrix() + + override fun getMaskPath(): Path { + return Path().also { addToPath(it, 0f, 0f, 100f, 100f) } + } + + override fun addToPath( + path: Path, + left: Float, + top: Float, + right: Float, + bottom: Float, + size: Float, + endSize: Float, + progress: Float, + ) { + matrix.reset() + val width = right - left + val height = bottom - top + matrix.setScale(width / 100f, height / 100f) + matrix.postTranslate(left, top) + + val tempPath = Path(parsedPath) + tempPath.transform(matrix) + path.addPath(tempPath) + } + + override fun toString(): String { + return "complexclover" + } + } + /** * Material 3 Expressive Shape */ @@ -620,6 +664,8 @@ open class IconShape( "hexagon" -> Hexagon "diamond" -> Diamond "egg" -> Egg + "clover" -> Clover + "complexclover" -> ComplexClover "foursidedcookie" -> FourSidedCookie "sevensidedcookie" -> SevenSidedCookie "arch" -> Arch diff --git a/lawnchair/src/app/lawnchair/ui/preferences/destinations/IconShapePreference.kt b/lawnchair/src/app/lawnchair/ui/preferences/destinations/IconShapePreference.kt index 86b4a62e36..f0aa333afa 100644 --- a/lawnchair/src/app/lawnchair/ui/preferences/destinations/IconShapePreference.kt +++ b/lawnchair/src/app/lawnchair/ui/preferences/destinations/IconShapePreference.kt @@ -82,6 +82,7 @@ fun iconShapeEntries(context: Context): List> { ListPreferenceEntry(IconShape.Square) { stringResource(id = R.string.icon_shape_square) }, ListPreferenceEntry(IconShape.Squircle) { stringResource(id = R.string.icon_shape_squircle) }, ListPreferenceEntry(IconShape.Teardrop) { stringResource(id = R.string.icon_shape_teardrop) }, + ListPreferenceEntry(IconShape.ComplexClover) { stringResource(id = R.string.icon_shape_complex_clover) }, ListPreferenceEntry(IconShape.FourSidedCookie) { stringResource(id = R.string.icon_shape_four_sided_cookie) }, ListPreferenceEntry(IconShape.SevenSidedCookie) { stringResource(id = R.string.icon_shape_seven_sided_cookie) }, ListPreferenceEntry(IconShape.Arch) { stringResource(id = R.string.icon_shape_arch) },