Category "android-jetpack-compose"

How to add existing fragment from inside Compose

I want to open an existing fragment from compose or if i can add inside the same compose in full screen, that will also work. Also how to navigate from one exis

Button Long Press Listener in Android jetpack compose

I am having an Android Composable UI with a Button. How can I track button long press events? I got it working for the Text long press, but for Button, It is no

Build Software Keyboard with Jetpack Compose - IME Input Method with Jetpack Compose

Building a simple keyboard is fairly simple and straightforward in Jetpack Compose. I built a really simple KeyRow by using this: Key.kt @Composable fun Key(mod

Sending an ID or an object as String to the next screen in Jetpack Compose?

I have 30 users displayed in a LazyColumn. On user click, I navigate forward to UserDetailsScreen. My question, is it better to pass the ID of the user and crea

How to load image in Kotlin Compose desktop?

How to load images from the hard disk when using Kotlin compose on the desktop?

What's difference between "= remember" and " by remember" (Kotlin, Jetpack Compose)

I think two use case of remember exist. first one is @Composable fun abc() { var aa = remember { mutableStateOf(true) } } and second @Composable fun abc()

Build Software Keyboard with Jetpack Compose - Add 3 additional buttons on top of keyboard

I need to create a custom software keyboard and add 3 buttons in the top: the underline, bold, italic buttons. When clicking on the TextField I need to be able

App/Scaffold white background changing issue in Jetpack Compose

Can anyone please point me out how to change this white background color of the app? Setting a color or background color on the Surface is having no impact. I'v

Why recomposition happens when call ViewModel in a callback?

I completely confused with compose conception. I have a code @Composable fun HomeScreen(viewModel: HomeViewModel = getViewModel()) { Scaffold { val

Type 'State<List<User>?>' has no method 'getValue(Nothing?, KProperty<*>)' and thus it cannot serve as a delegate

I'm trying to get a value from LiveData with observeAsState in jetpack compose, but I get a weird error Type 'State<List?>' has no method 'getValue(Nothi

Why a new ViewModel is created in each Compose Navigation route?

I have a single activity app using only composables for the ui (one activity, no fragments). I use one viewmodel to keep data for the ui in two different screen

How to align Text to Top, Bottom and Center Vertically in Jetpack Compose?

How can I align the text using Text composable function vertically. Is there a way to do it without having to add another extra view to contain the Text. The te

Share Button In Compose

How can I make a share button in compose, which will share a download link, I tried this but the result was different that I expected. Here is the code. Button

Jetpack Compose: How do you position UI elements within their parent with exact (x,y) coordinates?

According to the documentation on custom layouts: "Each UI element has one parent and potentially many children. Each element is also located within its parent,

How to use .svg file in Jetpack Compose for Desktop?

I am trying to use a .svg (vector file) to show an image but I am stuck and not able to do it. Is there any way I can use it, I tried to use it like this Image(

What is the proper way to navigate from ViewModel in Jetpack Compose + Hilt + ViewModel?

I have stumbled upon this quite trivial, but tricky problem. I have spent a decent amount of time searching official docs, but unfortunately found no answer. Of

How to use a condition in a MutableState in Jetpack Compose

I'm trying to change my loginEnabled value to true or false based off two textfield's being not empty, however my current implementation always returns false, c

Can't find Composer Class when Building

I'm trying to add compose to my existing project and getting the following exception when building e: java.lang.IllegalStateException: Cannot find the Compose

Jetpack compose can't preview after updating to 1.0.0-rc01

this happened to me only when I updated to 1.0.0-rc01. it says: The following classes could not be found: - androidx.compose.ui.tooling.preview.ComposeVie

Android Studio compose preview not working

I can't preview any composables with Android Studio Arctic Fox Beta 4. Even the default one that is generated with an empty compose project. Running the default