feat: Complex Clover icon shape

Signed-off-by: Pun Butrach <pun.butrach@gmail.com>
This commit is contained in:
Pun Butrach
2025-10-18 02:49:04 +07:00
parent deddf4259a
commit 7e92d0f888
4 changed files with 52 additions and 1 deletions
+3
View File
@@ -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
+2 -1
View File
@@ -297,7 +297,8 @@
<string name="icon_shape_square">Square</string>
<string name="icon_shape_squircle">Squircle</string>
<string name="icon_shape_teardrop">Teardrop</string>
<!-- Icon shape (Material 3 Expressive) -->
<!-- Icon shapes (Material 3 Expressive) -->
<string name="icon_shape_complex_clover">Complex clover</string>
<string name="icon_shape_four_sided_cookie">Four-sided cookie</string>
<string name="icon_shape_seven_sided_cookie">Seven-sided cookie</string>
<string name="icon_shape_arch">Arch</string>
@@ -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
@@ -82,6 +82,7 @@ fun iconShapeEntries(context: Context): List<ListPreferenceEntry<IconShape>> {
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) },