My Vector drawable appear very small on the emulator, I can put 1000.dp width and height it is also small.
Don't pay attention to the sky and the moon I'm working on. The first image show with 1000.dp width and height and the 2nd show with my custom size (maxWidth / 1.5F for width and maxHeight / 3 for height)
Here is my code:
Image(
painter = painterResource(id = R.drawable.ic_book_sun),
contentDescription = "Book",
contentScale = ContentScale.Fit,
modifier = Modifier
.size(
maxWidth / 1.5F,
maxHeight / 3
)
.constrainAs(bookIcon) {
centerTo(parent)
},
)
maxWidth and maxHeight are coming from BoxWithConstraints composable so I get the width and height of the screen and display the icon in function of screen size.
Vector drawable code:
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="141dp"
android:height="200dp"
android:viewportWidth="841"
android:viewportHeight="1189">
// Some paths...
>/vector>