Skip to main content

Questions tagged [android-jetpack-compose]

Jetpack Compose is Android’s modern toolkit for building native declarative UI made by Google. If you're targeting desktop with Compose for Desktop, use both this and [compose-desktop] tags.

android-jetpack-compose
2 votes
2 answers
5k views

Jetpack compose AppBarIcon complains that "Functions which invoke @Composable functions must be marked with the @Composable"

I used jetpack compose AppBarIcon element but I got the error: Functions which invoke @Composable functions must be marked with the @Composable" when I call a composable function on the onclick lamba....
paolo achdjian's user avatar
7 votes
0 answers
2k views

Compiler throws warning when trying to get a reference to a composable function

I have an issue whereby returning a reference to the composable function is interpreted as invoking the composable function resulting in the compiler throwing the following warning message: Functions ...
Klaas Kabini's user avatar
1 vote
1 answer
702 views

Unable to start activity ComponentInfo {className} java.lang.IllegalStateException: No colors found! (Android JetPack Compose)

I'm new to Android Jetpack Compose, trying to create a List of buttons with Column but app is crashing by throwing error as Unable to start activity ComponentInfo{com.sample.composeUI/com.sample....
Sachin Varma's user avatar
  • 2,215
175 votes
19 answers
243k views

Jetpack Compose - Column - Gravity center

I'm creating a layout with Jetpack Compose and there is a column. I would like center items inside this column: Column(modifier = ExpandedWidth) { Text(text = item.title) Text(text = ...
mac229's user avatar
  • 4,709
1 vote
1 answer
207 views

A change on the state does not recompose the view

I have the following issue where the state change on the counter variable does not trigger recomposition of the Text component. Any ideas of what might be the problem??? @Model class CounterState(...
Klaas Kabini's user avatar
5 votes
2 answers
6k views

How to test Jetpack Compose?

I use the new Jetpack Compose, now comes time to test UI. Does anyone know the tools for testing it? Since Espresso mainly relies on view I don't think that it can help.
Nurseyit Tursunkulov's user avatar
0 votes
0 answers
78 views

What is the plus sign means in front of jetpack compose method name? [duplicate]

what type of methods are those in android jetpack compose like this one bellow - Text(text = text, style = +themeTextStyle { body1 })
Lalit Behera's user avatar
16 votes
6 answers
20k views

How to handle navigation in Jetpack Compose?

In Jetpack Compose, how is navigation supposed to be done? All (and there aren’t many) examples (including the official sample from Google) use sealed classes and loading new screens in reaction to ...
Dmitri's user avatar
  • 2,807
0 votes
1 answer
1k views

How to use widgets in Jetpack Compose?

I want to use a number of them, but I'm starting with NumberPicker which extends LinearLayout and thus cannot just instantiate an instance in the middle of a view. Just want an embedded numeric ...
Rob's user avatar
  • 11.6k
15 votes
3 answers
4k views

How we can we format Text as superscript or subscript in Android Jetpack Compose UI?

I am working on one example using Android Jetpack Compose, where I am displaying some text equations like below : <html> <body> <!-- Superscript--> <p> E = mc<sup>2</...
pRaNaY's user avatar
  • 25.1k
0 votes
1 answer
270 views

What version of Android Studio to use with Androidx (Android Jetpack) Source Code

Following these instructions how to download android jetpack code. I have an observation to make and a question to post. Observation: Make sure you have 20 GB available at the bare minimum. I ...
Dmitri's user avatar
  • 2,807
20 votes
2 answers
8k views

How to enable capitalization on the virtual keyboard for an Android Compose TextField?

I've recently started moving to Compose to make my UIs in Android. So far I like it, but I'm still struggling to find the right documentation sometimes. So I'm sorry if this question is very obvious! ...
raimund89's user avatar
  • 201
2 votes
2 answers
2k views

A trouble about Jetpack-Compose Column

It couldn't run successfully with the following error: Cannot find a parameter with this name: crossAxisSize How can I fix it? Here's my code: @Composable fun NewsStory() { Column( ...
RomC's user avatar
  • 21
2 votes
1 answer
2k views

Jetpack Compose model list becomes jumbled when adding new items

I have an issue with Jetpack compose displaying a model containing a ModelList of items. When new items are added, the order of the UI elements becomes incorrect. Here's a very simple CounterModel ...
rockgecko's user avatar
  • 4,187
113 votes
5 answers
81k views

How to use Compose inside Fragment?

The documentation describes how to create UI Jetpack Compose inside Activity. class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(...
Nurseyit Tursunkulov's user avatar

15 30 50 per page
1
873 874
875
876 877
879