Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FlowRow affects Modifier.height(IntrinsicSize) #622

Closed
C5FR7Q opened this issue Aug 8, 2021 · 9 comments
Closed

FlowRow affects Modifier.height(IntrinsicSize) #622

C5FR7Q opened this issue Aug 8, 2021 · 9 comments
Labels
stale Stale issues which are marked for closure

Comments

@C5FR7Q
Copy link

C5FR7Q commented Aug 8, 2021

Describe the bug

FlowRow somehow affects Modifier.height(IntrinsicSize.Max), that's so resulting height is wrong

To Reproduce

Steps to reproduce the behavior:
Use LazyColumn the items of which are some containers with Modifier.height(IntrinsicSize.Max) and including FlowRow with different items count.

Example:

@Composable
fun Screen() {
	val items = listOf<List<String>>(
		listOf("a", "b", "c"),
		listOf("a", "b", "c", "d"),
		listOf("a"),
		listOf("a", "b"),
		listOf("c")
	)
	LazyColumn {
		items(items) {
			Item(it)
		}
	}
}

@Composable
fun Item(strings: List<String>) {
	Box(
		modifier = Modifier
			.fillMaxWidth()
			.height(IntrinsicSize.Max)
	) {
		Spacer(
			modifier = Modifier
				.background(Color(Random.nextInt(), Random.nextInt(), Random.nextInt()))
				.width(4.dp)
				.fillMaxHeight()
				.align(Alignment.CenterStart)
		)
		FlowRow {
			strings.forEach {
				Text(text = it)
			}
		}
	}
}

Expected behavior

(In accordance with example code) Resulting height of Item is equal to the height of FlowRow

Actual behavior

Item's height somehow depends on FlowRow items count.
image

Environment:

  • Android OS version: Android 10
  • Device: Nokia 5.3
  • Accompanist version: 0.16.0
  • Compose version: 1.0.0
@github-actions
Copy link

github-actions bot commented Sep 8, 2021

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the stale Stale issues which are marked for closure label Sep 8, 2021
@C5FR7Q
Copy link
Author

C5FR7Q commented Sep 9, 2021

Waiting for #650 to be merged

@github-actions github-actions bot removed the stale Stale issues which are marked for closure label Sep 10, 2021
@mihirrai
Copy link

mihirrai commented Oct 1, 2021

Facing a similar issue where FlowRow is somehow adding extra height to the layout.

@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the stale Stale issues which are marked for closure label Oct 31, 2021
@github-actions github-actions bot closed this as completed Nov 5, 2021
@PaulWoitaschek
Copy link

Remove the stale label please, this forced us to create our own flowlayout.

@6uilhermeAlmeida
Copy link

@C5FR7Q Any way you could re-open the issue? The PR that was supposed to fix it seems abandoned

@C5FR7Q
Copy link
Author

C5FR7Q commented Jan 14, 2022

Waiting for #650 to be merged or any other fix

@PaulWoitaschek
Copy link

@bentrengrove
Could you re-open this ticket please?

@bentrengrove
Copy link
Collaborator

We are currently working on an official version of Flow Layouts in Compose as seen on the Compose roadmap, as such I don't think we will get to fixing this bug in Accompanist. Flow Layouts in Accompanist will soon be deprecated with the release of Flow Layouts in Compose main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Stale issues which are marked for closure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants