abbic
04/04/2022, 8:55 AMabbic
04/04/2022, 8:57 AMBottomSheetScaffold(
        scaffoldState = scaffoldState,
        topBar = {
            //***
        },
        content = {
            //***
        },
        sheetContent = {
            //***
        },
        sheetShape = RoundedCornerShape(topStart = 16.dp, topEnd = 16.dp),
        sheetElevation = 16.dp
    )abbic
04/04/2022, 8:59 AMandrew
04/04/2022, 3:20 PMandrew
04/04/2022, 3:20 PMandrew
04/04/2022, 3:29 PMfun Modifier.coloredShadow(
    color: Color,
    shape: Shape,
    alpha: Float = 0.2F,
    shadowRadius: Dp = 0.dp,
    offsetY: Dp = 0.dp,
    offsetX: Dp = 0.dp,
) = composed {
    val density = LocalDensity.current
    val shadowColor = remember(color, alpha) { color.copy(alpha).toArgb() }
    val paint = remember(shadowRadius, offsetX, offsetY, shadowColor, density) { Paint().apply {
        val frameworkPaint = asFrameworkPaint()
        with(density) {
            frameworkPaint.color = Color.Transparent.toArgb()
            frameworkPaint.setShadowLayer(
                shadowRadius.toPx(),
                offsetX.toPx(),
                offsetY.toPx(),
                shadowColor
            )
        }
    }}
    drawBehind {
        drawIntoCanvas {
            it.drawOutline(
                shape.createOutline(size, layoutDirection, density),
                paint
            )
        }
    }
}abbic
04/04/2022, 3:30 PMandrew
04/04/2022, 3:30 PMabbic
04/04/2022, 3:30 PMandrew
04/04/2022, 3:32 PMabbic
04/04/2022, 3:32 PMandrew
04/04/2022, 3:33 PMandrew
04/04/2022, 3:34 PMval shadowModifier = Modifier.coloredShadow(
        Color.Black, shape, offsetY = (-4).dp, shadowRadius = 2.dp, alpha = 0.12F
    )andrew
04/04/2022, 3:34 PMabbic
04/04/2022, 3:35 PMandrew
04/04/2022, 3:36 PMsharif saleh
03/29/2024, 3:16 PMandrew
03/29/2024, 3:18 PMandrew
03/29/2024, 3:19 PM