Questions tagged [android-compose-image]

17 questions
3
votes
2 answers

How to load image from assets in Jetpack Compose

I have hundreds of png files in assets folder and I want to load them into Image composable. But what I can use only images in drawable folder. how to load images from assets into Image?
3
votes
1 answer

Why does the image not render in Android Studio when an integer variable containing the drawable is passed to the painterResource function?

I have a requirement to display different images based on certain user interactions. So, I'm storing the drawable resource ID in an integer variable. However, when I pass this variable into the Image's painterResource function the image is not…
3
votes
1 answer

Icon drawable inside IconButton is black despite it being white

The Icon drawable inside the IconButton composable is black despite it being white. The picture below of the current setup shows the garbage can icon at the top right on an alpha background. How can I fix this issue? @Composable fun AppImage( …
2
votes
2 answers

Is it possible to change the size of the Image composable without triggering recomposition

I have an animateDpAsState(..), whenever this animation is triggered it changes the Modifier.size(value) of an Image(...) thus causing recomposition. Is there a way to skip composition phase for this specific scenario? Allowing an image to change…
2
votes
1 answer

Collapsing Layout in Jetpack Compose

I am trying to build a collapsing layout in jetpackCompose but couldn't figure it out how the lerp function is throwing up a error i am providing the specific size and float. Error say the following arguments is not supplied and there is no import…
2
votes
1 answer

Coil: Loading image from firebase not working - Unable to fetch data. No fetcher supports

Image( modifier = Modifier.size(100.dp).padding(16.dp), painter = rememberImagePainter( ImageRequest.Builder(LocalContext.current) // …
1
vote
1 answer

How to create background checker board for image with Jetpack Compose?

I have an image in Compose which may contain transparency. How can I show a checkered background behind the transparent parts of the picture (like in photoshop)?
1
vote
2 answers

Clip image in Jetpack Compose

I am using clip to trim an Image using Compose, to show only the left edge part of the image. But it maintains the width with blank space. How can I crop the right part(marked in red)? I tried setting a custom width for Image but its not working as…
Basim Sherif
  • 5,384
  • 7
  • 48
  • 90
1
vote
1 answer

Get image uri and display it with Coil in Compose (Android)

I'm trying to fetch image uri and then display it in my application with coil. var imageUri by remember { mutableStateOf(null) } val launcher = rememberLauncherForActivityResult(contract = ActivityResultContracts.GetContent()) { uri:…
1
vote
2 answers

Android Jetpack Compose - make an image fill max size with a border just around the image

I'm new to android compose. I want to put an image with borders that look like this code. preview image Column( verticalArrangement = Arrangement.Bottom, horizontalAlignment = Alignment.CenterHorizontally, modifier = Modifier …
1
vote
2 answers

How to transform Image Composable to match 3 touch points in Compose

I am currently playing with my old Instant Lab device and I am trying to recreate parts of the old app in jetpack compose. A feature of the device is to detect 3 touch points on the screen in order to create the border of the image to display. I was…
rolandl
  • 1,769
  • 1
  • 25
  • 48
1
vote
1 answer

Camera image from FileProvider Uri only displaying for first time

My Jetpack Compose camera app is targeting API Level 32 and is being tested on an Android 11 phone. I'm generating a Uri with FileProvider to take a photo with the stock camera app. Logcat shows the Uri every time I snap a picture, but the image is…
0
votes
1 answer

Android. How to correctly position elements in row?

I'm trying to position elements in my Row like this: text first, immediately followed by an icon, and a second icon that should be nailed to the end (right edge). Here is a visual example of what it should look like: And when text very long I…
0
votes
1 answer

How to minimize number of recompositions of `AsyncImage` from Coli

I am writing simple item displaying image and some text, and also having functionality to add item to favorite. @Composable fun ItemView( item: Item, modifier: Modifier = Modifier, onFavoriteClick: (Item) -> Unit = {}, ) { …
0
votes
1 answer

Jetpack compose not showing bitmap image for very high quality image

When image bitmap is low quality I am able to load and display the image with coil but when image bitmap is very high quality the screen doesn't show anything and pressing back lets to crash the app. I tried bitmap instead the painter but same…
1
2