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.
Questions tagged [android-jetpack-compose]
10142 questions
5
votes
1 answer
How can I detect a click with the view behind a Jetpack Compose Button?
The below code is for Jetbrains Desktop Compose. It shows a card with a button on it, right now if you click the card "clicked card" will be echoed to console. If you click the button it will echo "Clicked button"
However, I'm looking for a way for…

willow512
- 122
- 1
- 7
5
votes
2 answers
How do I get the whole offset of a compose component
I know how to get the X,Y coordinates of a button/or component, but I want to know every corner offset or at least the right bottom offset.
For example I'm getting the left top coordiantes from:
Modifier.onGloballyPositioned{
…

Barrufet
- 495
- 1
- 11
- 33
5
votes
1 answer
Can you set up NavController with TopAppBar in Jetpack Compose?
I know with Navigation Component, you can easily set up your toolbar to work with it (https://developer.android.com/guide/navigation/navigation-ui#create_a_toolbar).
You call setupWithNavController and it all magically happens. Then, you get a back…

SmallGrammer
- 893
- 9
- 19
5
votes
1 answer
How to set default focus item in Android jetpack Compose
I have a screen with several focusable widgets for TV.
Every time I have to click the direction key then Box01 get focused.
Does anyone know how to set Box01 focused by default?
My Code:
@Composable
fun DefaultFocusSample(){
…

TangSir
- 147
- 11
5
votes
0 answers
Jetpack Compose Scrollbars on LazyColumn and LazyRow
Is there any way to add the scrollbars on the LazyColumn and LazyRow component? Something equivalent of these RecyclerView XML…

Rafael de Azeredo
- 131
- 1
- 4
5
votes
1 answer
Jetpack Compose: How to avoid Button Text disappearing when Button size is small?
I am trying to create a custom button that is small and can show a numerical value between 0 and 99 as Text. Depending on the fontsize the Text disappears from the Button when the size of the Button is set too low, even though there still is space.…

bill
- 167
- 1
- 2
- 7
5
votes
2 answers
Problem with Jetpack Compose Navigation in BottomNavigationBar
Based on the following image, my App currently contains 2 main routes : Auth and Dashboard. When the user started the App, an observer will check whether the user is logged in and direct he/she to the Login Page/Dashboard.
Navigation Flow
From the…

EverDream
- 51
- 1
- 4
5
votes
4 answers
Jetpack Compose MutableLiveData not updating UI Components
I am trying to display several download progress bars at once via a list of data objects containing the download ID and the progress value. The values of this list of objects is being updated fine (shown via logging) but the UI components WILL NOT…

Nicolas Mage
- 291
- 1
- 4
- 19
5
votes
5 answers
BiometricPrompt with Jetpack Compose
BiometricPrompt requires either Fragment or FragmentActivity in its constructor. I cannot find out how to use BiometricPrompt from a Composable screen, not in the documentation, not in any tutorial. Has anyone in here dealt with the same problem? Or…

Martin
- 65
- 1
- 7
5
votes
1 answer
Jetpack Compose + Navigation: rememberSaveable loses state on rotate
I've encountered a strange behavior with Jetpack Compose in combination with Navigation: If you use rememberSaveable inside some navigation composable, then the state is not saved as promised (e.g. it is lost after rotation). Here is a simple…

Lucas Mann
- 377
- 1
- 3
- 7
5
votes
1 answer
Jetpack Compose - stop focused elements from stealing back presses?
I've got some elements that have focus in a bottom sheet. I want to collapse the bottom sheet when the system back button is pressed, which is easy enough:
BackHandler(enabled = bottomSheetState.isExpanded) {
scope.launch {
…

Carter Hudson
- 1,176
- 1
- 11
- 23
5
votes
2 answers
Error migrating to new jetpack compose version
I'm trying to update my app to a new compose version but it gave me an error that I don't know how to fix. when I run the error persists in my run. my old project works normally but mine what I want is to change versions follow my error if anyone…

Rafael Souza
- 1,143
- 2
- 13
- 29
5
votes
1 answer
Android Compose. Error when I try run the base code
I'm starting in Android Jetpack Compose. I installed Canary, when I create an Empty Compose Activity and run it without changes (Hello Android!) I have the next error:
Process: com.example.jetpacktest2, PID: 24788
…

Rafael Vidal
- 123
- 10
5
votes
1 answer
AnimatedImageVector missing in Jetpack Compose RC01
AnimatedImageVector is no more present in Jetpack Compose 1.0.0-rc01
Also function animatedVectorResource is missing.
How to replace them?

Solvek
- 5,158
- 5
- 41
- 64
5
votes
1 answer
Dynamically add views on click of Button using Jetpack Compose
I want to dynamically add Text Fields to my layout everytime user click "Add" button.Added Text Field should be added above "Add" button .i.e.between Step 1 TextField and Add Button.How can this be achieved through Jetpack Compose?Below is…

Android Developer
- 9,157
- 18
- 82
- 139