How can I Optimise the performance of a Composable image

46 Views Asked by At

I have an Image composable Im using as a background. How can I optimise this? I know you can use the graphics layer for vectors but this is using a drawable from a png file unfortunately and is not a vector

MainScreen() {
...
scaffold() { innerPadding -> 
           Box(
                modifier = Modifier
                    .padding(innerPadding)
                    .fillMaxSize(),
            ) {
                val painter = painterResource(id = themeDrawableRes)
                // background
                Image(
                    painter = painter,
                    contentDescription = "null",
                    modifier = Modifier
                        .matchParentSize(),
                    contentScale = ContentScale.FillBounds
                )
...
      }
    }
 }

0

There are 0 best solutions below