Questions tagged [android-jetpack-compose-layout]

62 questions
2
votes
1 answer

How to get the Index of a LazyList Item

Here, I used a LazyRow with the snappingLayout behavior & the items number of that LazyRow is the size of a list which contains listOf some dates GetScrollIndex(dateName = listOf("Monday", "Tuesday", "Wednesday", "Thursday")) I want to change the…
2
votes
1 answer

How to add an image background to a Card object in Android Jetpack Compose?

I'm working on a Jetpack Compose app that uses LazyColumn to display a list of players and I'm trying to add an image background to each Card (in composable function ProfileCard) that represents a player. I'm using a Box object to hold the contents…
2
votes
1 answer

What is the equivalent of Expanded widget of Flutter in Jetpack Compose?

I am pretty much new to Jetpack Compose and I want to create a simple business card app like this: The way I want to achieve this layout is to create two main Columns, one for the upper part (logo with name and title) and one for the lower part of…
1
vote
1 answer

Android Compose horizontal alignment problem

I have a Android Compose layout issue. This example is simplified. So please don't worry about the hierarchy. A card should contain two main content areas. One should take all available space starting from the left side. The other one is located at…
1
vote
1 answer

Avoid side padding from particular child item of LazyColumn in jetpack compose

I want to removed side padding of particular child item in LazyColum. I solved this problem in xml with the help of this post. I have same scenario in the jetpack compose. I am using BOM versions of compose_bom = "2022.11.00" with Material 3. …
1
vote
1 answer

Place an Image Vertically Centered in Jetpack compose

I have the above UI Screen. In that layout the "Trash" icon should be aligned Vertically_centered , as of now its not Vertical Centered. How to achieve this in Jetpack compose without using Padding. Please find my code below in which I'm using a…
1
vote
1 answer

How to show semi-transparent loading overlay above full Composable

I am trying to create a Composable that wraps another content Composable and displays a CircularProgressBar as an overlay on top of it, covering the whole content Composable. I almost got it working as wished, see the following to images: Initial…
1
vote
2 answers

Jetpack Compose Constraint Layout Constraints not linking as expected

I'm using constrainAs with Jetpack Compose to constrain a list of options. To the left of the text there is a space, I believe this is caused by the fact that I constrain the text box to the start to the parent and the end to the start of the…
1
vote
1 answer

verticalArrangement = Arrangement.Bottom for Column not working

I have a Jetpack Compose composable in a column beginning with a icon, title, textbody and a pager row: Box(modifier = Modifier .fillMaxSize() .background(color = TVTheme.colors.blue) ) { val bigPadding = 334.dp val smallPadding = 24.dp …
1
vote
1 answer

The size modifiers are ignored inside a Surface

I am new to Compose. I use the following code: Card( modifier = Modifier .width(100.dp) .height(100.dp), shape = RoundedCornerShape(15.dp), backgroundColor = Color.Gray ) But for some unknown reason Card takes up the…
1
vote
1 answer

How to set Box(contentAlignment=CenterVertically40%DownThePage)? Need advanced alignment option for Box

I'm building this screeen from the Android Jetpack Compose lessons, and I want to somewhat-center-vertically the middle / 'Full Name' red box -- but I don't want it fully centered (i.e. 50% down the page), I want it 40% down the page, but the…
1
vote
1 answer

Ovelapping icons images in compose

I want to display the icons below so the center one is overlapping. I am trying to use the Box but not sure how to arrange them so they are overlapping and in the center of the screen. I have started using a Box with 3 Box stacked on each other.…
ant2009
  • 27,094
  • 154
  • 411
  • 609
1
vote
1 answer

Why the Row in Card out of the scope of Card with fillMaxWidth()

My code: @ExperimentalMaterial3Api @Composable fun Settings() { Card(modifier = Modifier .fillMaxWidth() ) { SettingItem(itemTitle = "Test Title", itemDescription = "Description") …
1
vote
0 answers

Efficient Way to Animate Big Content Changes in a LazyColumn

I have a fully functional list, containing a complex item... a list of complex Composables, that is. I use LazyColumn for the job, but I then wished to allow the user to long-press on an item and then change its content and background. Using…
1
vote
1 answer

Draw two buttons in a Row using Jetpack Compose

I want to have two buttons in a Row, just as in the picture, but in my code I set a specific horizontalArrangment and it wouldn't look good on other devices Row( horizontalArrangement = Arrangement.spacedBy(170.dp), modifier =…