Relative Content

Tag Archive for androidkotlinandroid-jetpack-composeandroid-jetpack

How to Prevent Recomposition of Entire UI When Using Weight in Jetpack Compose?

I’m building a calculator app in Jetpack Compose and facing an issue with recomposition. My layout has three main components: CalculatorDisplay, CalculatorAdvanced, and CalculatorPad. The layout uses weights for responsive design. However, when I toggle theisExpanded state using CalculatorExpandButton, the whole screen recomposes instead of only the relevant components (CalculatorAdvanced and CalculatorPad).

draggable item on top of all others (jetpack compose)

I have a collection of five items, all of which are draggable. I want to achieve behavior in which the dragged item will overlap all the others. I tried changing the zIndex parameter but it didn’t work, what am I doing wrong?

Can’t import the new Modifier.animateItem()

I want to use the new Modifier.animateItem() API, announced here and here to animate item (dis)appearance inside a LazyColumn, however it is impossible for me to import it. I’ve added "androidx.compose.animation:animation:1.7.0-alpha06" to my dependencies and tried using it from within a LazyListScope, but AndroidStudio can’t find it. Am I missing something?