Add teardrop icon shape
This commit is contained in:
parent
d5270ab214
commit
0531628302
@ -450,6 +450,7 @@
|
|||||||
<string name="preference_icon_shape_squircle">Squircle</string>
|
<string name="preference_icon_shape_squircle">Squircle</string>
|
||||||
<string name="preference_icon_shape_triangle">Reuleaux triangle</string>
|
<string name="preference_icon_shape_triangle">Reuleaux triangle</string>
|
||||||
<string name="preference_icon_shape_circle">Circle</string>
|
<string name="preference_icon_shape_circle">Circle</string>
|
||||||
|
<string name="preference_icon_shape_teardrop">Teardrop</string>
|
||||||
<string name="preference_icon_shape_hexagon">Hexagon</string>
|
<string name="preference_icon_shape_hexagon">Hexagon</string>
|
||||||
<string name="preference_category_searchbar">Search bar</string>
|
<string name="preference_category_searchbar">Search bar</string>
|
||||||
<string name="preference_screen_services">Services</string>
|
<string name="preference_screen_services">Services</string>
|
||||||
|
|||||||
@ -219,6 +219,7 @@ message Settings {
|
|||||||
Hexagon = 6;
|
Hexagon = 6;
|
||||||
Pentagon = 7;
|
Pentagon = 7;
|
||||||
EasterEgg = 8;
|
EasterEgg = 8;
|
||||||
|
Teardrop = 9;
|
||||||
}
|
}
|
||||||
IconShape shape = 1;
|
IconShape shape = 1;
|
||||||
bool themed_icons = 2;
|
bool themed_icons = 2;
|
||||||
|
|||||||
@ -368,6 +368,7 @@ fun getShape(iconShape: IconShape): Shape {
|
|||||||
IconShape.Squircle -> SquircleShape
|
IconShape.Squircle -> SquircleShape
|
||||||
IconShape.Hexagon -> HexagonShape
|
IconShape.Hexagon -> HexagonShape
|
||||||
IconShape.Pentagon -> PentagonShape
|
IconShape.Pentagon -> PentagonShape
|
||||||
|
IconShape.Teardrop -> TeardropShape
|
||||||
IconShape.EasterEgg -> EasterEggShape
|
IconShape.EasterEgg -> EasterEggShape
|
||||||
IconShape.UNRECOGNIZED -> CircleShape
|
IconShape.UNRECOGNIZED -> CircleShape
|
||||||
}
|
}
|
||||||
@ -466,6 +467,36 @@ private val PentagonShape: Shape
|
|||||||
close()
|
close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private val TeardropShape: Shape
|
||||||
|
get() = GenericShape { size, _ ->
|
||||||
|
moveTo(0.5f * size.width, 0f)
|
||||||
|
cubicTo(
|
||||||
|
0.776f * size.width, 0f,
|
||||||
|
size.width, 0.224f * size.height,
|
||||||
|
size.width, 0.5f * size.height,
|
||||||
|
)
|
||||||
|
lineTo(
|
||||||
|
size.width, 0.88f * size.height,
|
||||||
|
)
|
||||||
|
cubicTo(
|
||||||
|
size.width, 0.946f * size.height,
|
||||||
|
0.946f * size.width, size.height,
|
||||||
|
0.88f * size.width, size.height,
|
||||||
|
)
|
||||||
|
lineTo(0.5f * size.width, size.height)
|
||||||
|
cubicTo(
|
||||||
|
0.224f * size.width, size.height,
|
||||||
|
0f, 0.776f * size.height,
|
||||||
|
0f, 0.5f * size.height,
|
||||||
|
)
|
||||||
|
cubicTo(
|
||||||
|
0f, 0.224f * size.height,
|
||||||
|
0.224f * size.width, 0f,
|
||||||
|
0.5f * size.width, 0f,
|
||||||
|
)
|
||||||
|
close()
|
||||||
|
}
|
||||||
|
|
||||||
private val EasterEggShape: Shape
|
private val EasterEggShape: Shape
|
||||||
get() = GenericShape { size, _ ->
|
get() = GenericShape { size, _ ->
|
||||||
moveTo(
|
moveTo(
|
||||||
|
|||||||
@ -592,6 +592,7 @@ private fun getShapeName(shape: IconSettings.IconShape?): String? {
|
|||||||
IconSettings.IconShape.Pentagon -> R.string.preference_icon_shape_pentagon
|
IconSettings.IconShape.Pentagon -> R.string.preference_icon_shape_pentagon
|
||||||
IconSettings.IconShape.PlatformDefault -> R.string.preference_icon_shape_platform
|
IconSettings.IconShape.PlatformDefault -> R.string.preference_icon_shape_platform
|
||||||
IconSettings.IconShape.Circle -> R.string.preference_icon_shape_circle
|
IconSettings.IconShape.Circle -> R.string.preference_icon_shape_circle
|
||||||
|
IconSettings.IconShape.Teardrop -> R.string.preference_icon_shape_teardrop
|
||||||
else -> return null
|
else -> return null
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user