Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 016f4457 authored by Chet Haase's avatar Chet Haase
Browse files

Fix requestLayout() optimizations

A bug in recent layout optimizations was causing the framework to avoid
laying out containers with WRAP_CONTENT in one axis or the other.
This fix updates the logic in the code that finds dependent layout axes
to correctly account for this case.

Issue #25980198 requestLayout() sometimes doesn't result in measure/layout for view

Change-Id: Ie5f678beef5d8c4ba25291ffdcd59797d4697acc
parent db9df399
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -5631,7 +5631,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
        final int matchAxisFilter = ((lp.width == MATCH_PARENT ? FLAG_LAYOUT_AXIS_HORIZONTAL : 0)
                | (lp.height == MATCH_PARENT ? FLAG_LAYOUT_AXIS_VERTICAL : 0)) & axisFilter;

        if (matchAxisFilter != 0) {
        if (matchAxisFilter != 0 || wrapAxisFilter != 0) {
            final ViewParent parent = getParent();
            if (parent != null) {
                // If our parent depends on us for an axis, then our layout can also be affected
+1 −1
Original line number Diff line number Diff line
@@ -683,7 +683,7 @@ public class LinearLayout extends ViewGroup {
            }
        }

        if (matchAxisFilter != 0) {
        if (matchAxisFilter != 0 || wrapAxisFilter != 0) {
            final ViewParent parent = getParent();
            if (parent != null) {
                // If our parent depends on us for an axis, then our layout can also be affected