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.

10142 questions
5
votes
2 answers

Text layout priority in Jetpack Compose

I have two texts in a row: Row { Text( "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi…
Phil Dukhov
  • 67,741
  • 15
  • 184
  • 220
5
votes
1 answer

Migrate to Jetpack Compose in a multi-module app

I'm using Jetpack Compose. I have already used it and everything worked fine. I have configured Compose in the app module and in a feature module and in both modules I have imported the same library (see below). When I try to use it in another…
kingston
  • 11,053
  • 14
  • 62
  • 116
5
votes
4 answers

Jetpack Compose "shortest" rotate animation

I was trying to do a compass in jetpack compose. But I faced a problem with animating it. I have a @Composable that takes user phone rotation and rotate compass image in opposite direction. I use animateFloatAsState like this: val angle: Float by…
iknow
  • 8,358
  • 12
  • 41
  • 68
5
votes
0 answers

Select multiple images from android gallery using Jetpack Compose

How can I select multiple images from gallery using rememberLauncherForActivityResult() in Jetpack Compose? It's onResult callback returns only one Uri I'm using Compose on a project where users can upload multiple files at the same time. But I…
5
votes
1 answer

Is there something like AppBarLayout's "liftOnScroll" property in Jetpack Compose?

The attribute app:liftOnScroll="true" in AppBarLayout allows the view to appear lifted (basically adding a small line of elevation shadow at the bottom) when an associated view with app:layout_behavior="@string/appbar_scrolling_view_behavior" is…
MichaelThePotato
  • 1,523
  • 2
  • 10
  • 19
5
votes
1 answer

Overscrolling at the botton in jetpack compose

I am trying to ensure that there is a visual indication that the user is trying to scroll more to the bottom even though he has reached the end of the list in a LazyColumn. This feature is available by default in XML layouts. How do we implement…
Anudeep Ananth
  • 955
  • 1
  • 8
  • 30
5
votes
2 answers

Unable to find method, Android Studio Arctic Fox (2020.3.1) Beta 3

I am trying to build a Jetpack Compose project with Android Studio Arctic Fox (2020.3.1) Beta 3, and the build fails with the following error. Unable to find method ''void…
5
votes
1 answer

How to get the current padding applied to a modifier in Jetpack Compose?

I am passing a modifier instance to a function like this @Composable fun SomeComposable(modifier : Modifier) { } I want to know the current padding applied to the passed modifier inside the function. How to do this? @Composable fun…
AgentP
  • 6,261
  • 2
  • 31
  • 52
5
votes
2 answers

Jetpack Compose equivalent to InputFilter?

I'm looking for an equivalent method of EditText's InputFilter in Jetpack Compose TextField. Because I'm trying to prevent users input unwanted values like %@*()- characters for example.
5
votes
2 answers

Jetpack Compose infiniteRepeatable, repeats startDelay

I want to create an infinite animation with a one-time start delay in Jetpack Compose. I used infiniteRepeatable() with tween(): val value by rememberInfiniteTransition().animateFloat( initialValue = 0f, targetValue = 1f, animationSpec =…
Ehsan msz
  • 1,774
  • 2
  • 13
  • 26
5
votes
1 answer

How to contribute to Jetpack Compose?

In this blog, Tech Crunch says, Google launches Jetpack Compose, an open-source, Kotlin-based UI development toolkit This means JetPack Compose is an open-source framework (obviously). Then... where's the source code for Jetpack Compose? And how…
Shreemaan Abhishek
  • 1,134
  • 1
  • 7
  • 33
5
votes
3 answers

How to remove space below text baseline in jetpack compose?

Currently I get this: But I want something like this: But also the text from "50" and "min" should be aligned to the top. My code: Row(verticalAlignment = Alignment.Bottom) { Text( text = "18", color =…
5
votes
1 answer

Snackbar not showing in Jetpack Compose

My screen has one button and on click of it, I want to show a snackbar for short duration. So here is my composable: @Composable fun RegisterLocation( navController: NavController, locationVm: LocationViewModel = LocationViewModel() ) { …
Chandra Sekhar
  • 18,914
  • 16
  • 84
  • 125
5
votes
2 answers

How to combine FAB with BottomAppBar without overlapping nav items?

I am using Material's BottomAppBar as my BottomNav in my Jetpack Compose's App. But when I tried to dock my fab on the BottomAppBar, it covers the nav items as the screenshot shows. Is there any way that could auto-add a space beside the fab? I…
5
votes
2 answers

Jetpack compose listener for keyboard actions (setOnKeyListener) (Textfield for SMS)

I have five TextFields. After something entered in first field focus moves for next textfield. If i deleted something in text field - focus moves for pervious textfield. All work with focus goes through onValueChanged section But if value in…