Thread
#compose
    b

    bodo

    1 year ago
    Hi. Can someone tell me how i can achieve the following shape in a surface. i tried cubic and bezier shapes but no one fits perfect. It is a red background and the bottomLeft and bottomRight cornors should be inverted. Thx
    Afzal Najam

    Afzal Najam

    1 year ago
    there isn't a radius modifier?
    b

    bodo

    1 year ago
    no unfortunatelly not, but i got it working. i created the following GenericShape:
    val surfaceShape = GenericShape { size ->
          moveTo(size.width, size.height)
          lineTo(size.width, 0f)
          lineTo(0f, 0f)
          lineTo(0f, size.height)
    
          quadraticBezierTo(
            x1 = 8.dp.value,
            y1 = size.height * 0.9f,
            x2 = 16.dp.value,
            y2 = size.height * 0.9f,
          )
          lineTo(size.width - 16.dp.value, size.height * 0.9f)
          quadraticBezierTo(
            x1 = size.width - 8.dp.value,
            y1 = size.height * 0.9f,
            x2 = size.width,
            y2 = size.height,
          )
        }
    and added this to the
    Surface(shape = surfaceShape, color = Color.RED)