Skip to content
This repository has been archived by the owner on Nov 12, 2024. It is now read-only.

Update to Compose snapshot #6342451 #582

Merged
merged 11 commits into from
Mar 30, 2020
Merged

Conversation

chrisbanes
Copy link
Owner

No description provided.

} else {
Box(modifier = modifier)
Box(modifier = modifier.onPositioned { childSize = it.size })

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could be nicer to do something like
var modifier = modifier.onPositioned { childSize = it.size }
if (image) {
...
modifier.paint(AndroidColorMatrixImagePainter(image, cf))
}
Box(modifier = modifier)

everytime you have if else blocks emitting different composables the previous Box should be completely disposed and the new Box recreated where in fact you can just update a modifier for the same Box

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, done!

Copy link

@manuelvicnt manuelvicnt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Also managed to get rid of my dodgy onPositioned {}
logic with `Modifier.matchParent()`
@chrisbanes chrisbanes merged commit 1a8e5cc into master Mar 30, 2020
@chrisbanes chrisbanes deleted the cb/compose-snapshot-6342451 branch March 30, 2020 16:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants