Category "android-jetpack-compose"

Jetpack Compose navigate for result

I'm using the Jetpack Navigation library with the Compose version. I'm setting up navigation like it's shown here I want to be able to navigate from screen A to

What is the simplest way to set the focus order in Jetpack Compose?

I have a column of TextFields, something like: Column { TextField( value = ..., onValueChange = { ... }, keyboardOptions = KeyboardO

How to upgrade an Android project to Java 11

I am using the latest Android Studio Arctic Fox 2020.03.01 Canary 8 and AGP 7, and I want to convert my project to use Java 11. Apparently just doing the follow

How to change the outline color of OutlinedTextField from jetpack compose?

Here is how OutlinedTextField code looks like in jetpack-compose: OutlinedTextField( value = "", onValueChange = {}, label = {Text("Input")} ) The

Jetpack Compose Preview not showing

I seem to be having trouble with Preview in compose, the layout panel doesn't appear when I annotate a compose method with @preview. I assume I'm missing a depe

How to show ellipsis (three dots) at the end of a Text line in Android Jetpack Compose?

Whether I use androidx.compose.foundation.text.BasicText or androidx.compose.material.Text, if there isn't enough space for a text it wraps to the next line, fo

Jetpack Compose Applying PorterDuffMode to Image

Based on the images and PorterDuffModes in this page I downloaded images, initially even though they are png they had light and dark gray rectangles which were

Unable to bring window to foreground with compose desktop

With the following code the application window can be hidden using the button and restored using a global shortcut ALT+S. Now I would like to also use the short

How can I get onTouchEvent in Jetpack Compose?

In normal view, we can have onTouchEvent override fun onTouchEvent(event: MotionEvent?): Boolean { when (event?.action) { MotionEvent.AC

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