Category "android-jetpack-compose"

Composable not recomposing when ViewModel updated from a different Composable

I am developing an Android app using Jetpack Compose. The app shows a list of items. It also has a top bar containing a search bar. We have 3 composable: the li

How to use bias in Constraint Layout Compose

How do I set the layout_constraintHorizontal_bias prop on a Composable that is in a Constraint Layout? Here is the XML code: <TextView ... tool:layou

How to use bias in Constraint Layout Compose

How do I set the layout_constraintHorizontal_bias prop on a Composable that is in a Constraint Layout? Here is the XML code: <TextView ... tool:layou

android:autoSizeTextType in Jetpack Compose

Is there a way to adjust the text to always resize depending a fixed height ? I have a column that has a fixed height and in which the text inside should always

Can no longer view Jetpack Compose Previews. Failed to instantiate one or more classes (ComposeViewAdapter)

I've recently got an error preventing any Jetpack Compose previews from being displayed as follows: Failed to instantiate one or more classes The following clas

Compose preview doesn't work at all - project needs to be compiled

I use Android Studio Bumblebee 2021.1.1 Patch 3 built on March 16, 2022 androidx.compose.ui:ui-tooling, androidx.compose.ui:ui-tooling-preview, androidx.compose

How can I get string resource in Jetpack composable test

We can get the string resource in Composable through stringResource like @Composable fun Heading( @StringRes textResource: Int ) { Text( text =

Compose - NavHost recomposition multiple times

During navigation from Navhost, I found out that the composable screens are getting recomposition multiple times. Because of it, my ViewModel is calling API dat

AnimatedVisibility and BringIntoViewRequester not working together

I'm building an expandable Composable which would be expanded when clicked. This would be implemented by using the AnimatedVisibility which works perfectly. Cod

Jetpack compose remember

I was converting my simple paint app to compose and I came across a problem that I was able to fix, this question is for help in trying to understand why it beh

Jetpack compose remember

I was converting my simple paint app to compose and I came across a problem that I was able to fix, this question is for help in trying to understand why it beh

Phone number visual transformation in Jetpack compose

How can I implement phone number visual transformation in jetpack compose? I have read this article for the card number. And I want to format my phone number li

Hidden bottom item in LazyColumn - Jetpack Compose

I am trying to create a list of items with a hidden button at the bottom. By default the button is not visible on the screen. If a user scrolls to the bottom of

Sticky headers like android contacts in Jetpack Compose

I didn't find any way to have a stickyHeader on the same line as an item in a LazyColumn: So I used a Box to put the letter with its background on top of the L

How to change text field cursor position in jetpack compose

I have list of text suggestions chip view above textfield, when user clicking chip I am appending the text into textfield. after that I want to move the cursor

Use Jetpack Compose vertically scrollable component in ConstraintLayout

I have a player layer with subtitle layer like this: Parent of player layer is and XML ConstraintLayout that have a ComposeView child. This ComposeView is my s

Scroll issue with LazyColumn inside BottomSheetDialogFragment

I use LazyColumn inside BottomSheetDialogFragment, but if to scroll LazyColumn list UP then Bottom Sheet Dialog scrolls instead of LazyColumn list. Seems like B

Jetpack Compose + Hilt: java.lang.RuntimeException: Cannot create an instance of class ViewModel

I started trying jetpack Compose recently and used hilt & hilt-navigation-compose for my app. It works fine with the first ViewModel. However, when I try th

How to achieve the layering effect of one Composable on top of another when showing a dialog using Jetpack Compose

I'm hoping to understand how I can achieve this behavior using Jetpack Compose in Android when displaying a dialog on top of the current Composable view. Desire

Create drawable programatticly in jetpack compose

I want to use rectangle with rounded corner for placeholder in coil in jetpack compose. I need use different colors for placeholder depends on my algorithm. The