During android jetpack compose development I use this code to see some preview result:

GlideImage(
  imageModel = { imageUrl },
  modifier = Modifier.aspectRatio(0.8f),
  previewPlaceholder = R.drawable.poster
)

Let's say that the poster preview resource is rather large, and I only use it for the preview placeholder. Will this affect my final app size in the end?

2

There are 2 best solutions below

0
A. Patrik On BEST ANSWER

Response from the landscapist team: https://github.com/skydoves/landscapist/issues/267

Your sample images will really increase APK size

Currently the suggestion is to use some mandatory resource for the previews like the launcher icon, as there's no way to add "preview only" resources for compose

0
Halifax On

Of course, because you put the image resources in the drawable folder, it will increase the size of the app. You can consider putting them in the assets folder and compressing your images into a compressed package. When the application starts, unpack it. compression.