@@ -27,6 +27,7 @@ import android.util.Log
2727import com.android.launcher3.R
2828import com.android.launcher3.Utilities
2929import com.android.launcher3.shapes.IconShapeModel
30+ import com.neoapps.neolauncher.util.Config
3031
3132open class IconShape (
3233 private val topLeft : Corner ,
@@ -424,21 +425,19 @@ open class IconShape(
424425 }
425426
426427 fun fromString (value : String ): IconShape = when (value) {
427- // TODO add constants instead of string literals
428- " circle" -> Circle
429- " square" -> Square
430- " sharpSquare" -> SharpSquare
431- " roundedSquare" -> RoundedSquare
432- " squircle" -> Squircle
433- " sammy" -> Sammy
434- " teardrop" -> Teardrop
435- " cylinder" -> Cylinder
436- " cupertino" -> Cupertino
437- " hexagon" -> Hexagon
438- " octagon" -> Octagon
439- " egg" -> Egg
440- " " -> Circle
441- else -> runCatching { parseCustomShape(value) }.getOrDefault(Circle )
428+ Config .SHAPE_CIRCLE -> Circle
429+ Config .SHAPE_SQUARE -> Square
430+ Config .SHAPE_SHARP_SQUARE -> SharpSquare
431+ Config .SHAPE_ROUNDED_SQUARE -> RoundedSquare
432+ Config .SHAPE_SQUIRCLE -> Squircle
433+ Config .SHAPE_SAMMY -> Sammy
434+ Config .SHAPE_TEARDROP -> Teardrop
435+ Config .SHAPE_CYLINDER -> Cylinder
436+ Config .SHAPE_CUPERTINO -> Cupertino
437+ Config .SHAPE_HEXAGON -> Hexagon
438+ Config .SHAPE_OCTAGON -> Octagon
439+ Config .SHAPE_EGG -> Egg
440+ else -> runCatching { parseCustomShape(value) }.getOrDefault(Circle )
442441 }
443442
444443 private fun parseCustomShape (value : String ): IconShape {
0 commit comments