Category "android-jetpack-compose"

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

TextField is hiding under the keyboard when focused

I have a problem with TextField that is hiding under the keyboard, I've found the answers for the similar question here, but they are not helping me in my case.

Youtube video playing intent only works if Youtube is not open yet

I would like to send intents for a continuous stream of videos, but all intents, except for the first one (sent with youtube closed) seem to be ignored, and you

Jetpack Compose Decrease height of TextField

I am trying to design a search bar like Google search bar with decreased height. But the Input text is getting cropped also the placeholder text. Te

How to align title at layout center in TopAppBar?

TopAppBar( backgroundColor = Color.Transparent, elevation = 0.dp, modifier= Modifier.fillMaxWidth(), navigationIcon = {

Exposed drop-down menu for jetpack compose

I was wondering if there is a solution for Exposed drop-down menu for jetpack compose? I couldn't find a proper solution for this component inside jetpack compo

TextField is overlapped by keyboard in Android Compose

I have a TextField in column with verticalScroll(). When adding a large number of characters, the textfield size goes beyond the keyboard and I stop seeing what

LazyColumn - How do you display the most recent item in LazyColumn?

I have a LazyColumn where the use inputs items into. I want the LazyColumn to display the most recent item. How do I do this? Right now, LazyColumn is reversed,