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
13,181
questions
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....
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 ...
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....
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 = ...
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(...
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.
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 })
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 ...
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 ...
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</...
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 ...
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!
...
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(
...
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 ...
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(...