Category "android-jetpack-compose"

How to pass an image from one composable function to another in Jetpack Compose?

I am developing an app with texts and images. The images appear small, like thumbnails, on one composable (activity), alongside the text. The idea is: when the

How to restrict drawables only shown inside canvas?

I have a canvas positioned on the right side of the screen. To the left are some buttons. If x values of some drawbles are negative, they are drawn on the lef

JetPack Compose accompanist Pager lerp not found

I'm learning accompanist pager and I want to set effect on the pager. I want to use the lerp method like the document Modifier.graphicsLayer {

LazyColumn that respects MotionEvent.ACTION_SCROLL

How to force compose' LazyColumn to act like traditional scrollable elements like RecyclerView or ListView? Useful when want to scroll with mouse, e.g. with vys

Dropdown Button/Wheel Picker/Spinner in Jetpack Compose

Is there any standard implementation in Jetpack Compose for visual component like Spinner/Wheel Picker or Dropdown Button?

Hilt Unsupported metadata version in Kotlin

I was tried to run my code in Kotlin 1.5.10 With plugin as plugins { id 'com.android.application' id 'kotlin-android' id 'kotlin-kapt' id 'dagger.hilt.android.p

Jetpack Compose LazyVerticalGrid items having a different size

When I'm trying to use LazyVerticalGrid to display a list of images, some grid items have a different size even the images itself have exactly same size 240x178

What is the proper way to get status bar height in compose?

Usually when using Accompanist Modifier.statusBarsHeight() the height will change depends on the status bar visibility, if it's visible either 24.dp or more and

How to Convert androidx.compose.ui.graphics.Color to android.graphics.Color (int)

How to convert from Compose Color to Android Color Int? I am using this code for the moment and it seems to be working, I can't seem to find a function to get t

How to match color attributes between theme and icon in Jetpack Compose?

I have a vector drawable which has two paths with different attributes referencing to different theme colors. And these attributes' values are being changed by

Can I store a composable function in a variable?

In Kotlin, function is a first-class citizen. We can store a function in a variable as below val functionVariable: () -> Unit = ::myFunction fun myFunction(

Ripple with rounded corners Jetpack Compose

In this answer I got wrong ripple animation. Do you know how to create ripple with rounded corners using Jetpack Compose? With default ripple I have this: Code:

How to make element fill the remaining space inside a Row or a Column in Jetpack Compose

I am trying to show two text messages besides each other in a row but when the size of the first text is big, the second view gets pushed out of the screen as s

Using rememberCoroutineScope() vs LaunchedEffect

Context In Jetpack compose, we have the option of using rememberCoroutineScope() as well as using the LaunchedEffect composable in order to use coroutines / run

how to progressively add drawable to a canvas?

I have points generated one by one, and when a new point is generated, I want to draw a line segment connecting with the previous point. Like this: var x by re

An alternative solution to set negative padding values in Jetpack Compose? (java.lang.IllegalArgumentException: Padding must be non-negative)

I'm trying to assign a negative value to the padding modifier but the app had crashed. Have a look at my code. Thanks if you can help or give me an alternative

Jetpack Compose Scrollbars

Is there any way to add Scrollbars to add LazyColumn (ScrollableColumn is deprecated). The Javadoc doesn't mention anything about Scrollbars in Jetpack Compose.

What is the difference between "remember" and "mutableState" in android jetpack compose?

I'm new in jetpack compose and trying to understand the difference between remember and mutableStateOf In other words the deference between this line val text

Jetpack Compose Desktop switch to new window

Hey I'm pretty new to Kotlin and am trying my hand at a GUI as my first small project. For this I am using Jetpack Compose Desktop. I have already written a fir

Jetpack compose Google Maps does not load properly when using bottom navigation

I have been stuck on this all day. I am using the official jetpack compose google maps composable. The map is displayed on one tab of my bottom navigation. I ha