https://kotlinlang.org logo
#compose
Title
# compose
g

Guy Bieber

08/19/2020, 7:49 PM
Moving to dev17 I used to draw a RadialGadient with:
Copy code
@Composable 
    override fun GradiantScreen() {
        var colors = listOf<Color>(nikolaColors.color2,
            nikolaColors.color1)
        var gradientBrush = RadialGradient(
            colors = colors,
            centerX = getScreenWidth().toFloat() / 2.0f,
            centerY = getScreenHeight().toFloat() / 2.0f,
            radius = getScreenHeight().toFloat() / 2.0f,
            tileMode = TileMode.Clamp
        )

        Box(
            Modifier
                .drawBackground(brush = gradientBrush)
                .fillMaxSize()
        )
    }
Unfortunately, drawBackground has been deprecated. What is the recommended way to do this with dev17?
m

matvei

08/19/2020, 8:10 PM
Modifier.drawBackground
has been replaced by
Modifier.background
😁 1
g

Guy Bieber

08/19/2020, 8:12 PM
Cool.
z

Zach Klippenstein (he/him) [MOD]

08/19/2020, 8:40 PM
There’s a few of those, they’re documented in the release notes