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
5,002
questions with no upvoted or accepted answers
21
votes
0
answers
539
views
Provide sign-in credentials to Play Console "Pre-launch report" for Jetpack Compose view
I can see that 'Play Console' expects "old" android.view.View IDs to be passed in for "username/password resource ID" fields:
I'm not able to figure out how to provide resource ID ...
20
votes
0
answers
2k
views
How to get code coverage for Compose UI tests?
I'm now somewhat familiar with UI testing within Jetpack Compose thanks to the extensive Android Documentation, but I can't make Android Studio to run Compose tests with coverage. We are currently ...
19
votes
3
answers
3k
views
Is there a 'touch delegate' equivalent in jetpack compose?
An android view can have a touch delegate to increase the clickable area of an element, without increasing it's padding. Is there something like that in jetpack compose? I can't find a modifier that ...
16
votes
0
answers
2k
views
Unable to type text in interactive mode in Jetpack Compose
I am trying to type text into a text field in interactive mode and it's not working. But, doing it on a physical device works.
MainActivity.kt
@Preview(showSystemUi = true)
@Composable
fun ...
15
votes
0
answers
430
views
StackOverflowError: stack size 8MB from Accessibility of Compose
Starting from April we have StackOverflowError from compose. We didn't have compose or Kotlin version update.
The issue only happens on Android 8.
We cannot reproduce locally and according to our logs,...
15
votes
0
answers
2k
views
Kotlin Compose Preview reference unresolved
I am working on a Kotlin Multiplatform project for Android and Desktop using Compose and have the Compose Multiplatform IDE Support plugin installed.
What I am trying to do is add the @Preview ...
15
votes
0
answers
860
views
How to avoid prop drilling in Jetpack Compose
I'll try to describe the problem with a short example.
Lets assume we have a child composable representing a custom switch, and we want to keep it immutable, so we need to pass the initial state and ...
15
votes
1
answer
3k
views
How to set half expand ratio to bottom sheet in Compose?
In XML we have material3 bottom sheet. It allows us to set behavior of bottom sheet. It can be updated like:
bottomSheetBehavior.halfExpandedRatio = 0.6
bottomSheetBehavior.state = BottomSheetBehavior....
15
votes
2
answers
957
views
How to scroll screen down automatically when text cursor is out of visible area in android jetpack compose
In Android View System, when cursor(cursor of EditText view in ScrollView) is out of visible area, Android automatically scroll screen to down to make cursor always visible.
Is there way to achieve ...
15
votes
0
answers
870
views
SwipeToDismiss & nestedScroll does not work well together - Jetpack Compose
I am trying to implement a list of items with the ability to delete items with swipe. I've basically used LazyColumn and SwipeToDismiss composables.
With default configuration vertical scrolling of ...
15
votes
0
answers
3k
views
How to dispatch touch events to parent composables in Jetpack Compose
I can't seem to find much information on touch handling in Compose.
In the specific case I'm looking at I have a list like this:
@Composable
fun MyListComposable(items: List<Item>) {
...
14
votes
0
answers
2k
views
ViewDataBinding XML file in Jetpack Compose Preview
I can't preview ViewDataBinding with data in Jetpack Compose version 1.0.5
I managed to use :
Xml file without < layout > tags thanks to : https://stackoverflow.com/a/67016873/13170425
...
14
votes
1
answer
3k
views
ComposeView is not attached to window - Jetpack Compose
I was trying to use FlexBox layout with JetpackCompose. I assumed that I can use normal RecyclerView and use ComposeView to render my view.
So I started with the documentation and attempted all the ...
14
votes
0
answers
2k
views
Make AndroidView propagate touch events to underlying Composable
Having the following layout, is it possible to make Button (or any other views under AndroidView) receive touch events even though the AndroidView overlays the whole screen? I was able to make it work ...
12
votes
0
answers
1k
views
Poor performance HorizontalPager Jetpack Compose
My apps performance is pretty good overall, the only part where the FPS drops is when swiping through the HorizontalPager by accompanist.
Each Page has a simple LazyVerticalGrid with 3 fixed columns ...