androidx / constraintlayout

ConstraintLayout is an Android layout component which allows you to position and size widgets in a flexible way
Apache License 2.0
1.07k stars 177 forks source link

Overlapping TextViews when optimizations are on #397

Open vanniktech opened 3 years ago

vanniktech commented 3 years ago

Left image is with optimizations turned on, clearly showing an overlap between the two TextViews. Right image is rendering everything correctly:

overlapping

Here's a reproducible sample PR using constraint layout 2.1.0: https://github.com/vanniktech/playground/pull/1

My use case:

I have an RSS Reader where I'm loading images and depending whether the image is portrait or landscape I want to either

In my PR, I've quickly summed up this functionality.

For now my workaround is to:

constraintLayout.optimizationLevel = 0
vanniktech commented 3 years ago

@jafu888 is there any further information you need?

vanniktech commented 3 years ago

Also an issue with Constraint Layout 2.1.1 - potentially making it even worse:

Screenshot 2021-10-09 at 20 33 15