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

Commit 6235b47c authored by Jim Miller's avatar Jim Miller
Browse files

Fix 5056699: GridLayout should maintain static indices for "gone" views.

GridLayout currently ignores views with visibility="gone" when accounting for rows/columns.
Instead it should count views with visibility="gone" as rows/columns with row/height equal to 0.

This also makes it consistent with other ViewGroups like LinearLayout where "gone" views
don't change order and are still present (but hidden) within a container.

Change-Id: I289d4ee6275d5b49b1e1d79985484216bbf48089
parent 054d5c57
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -596,7 +596,6 @@ public class GridLayout extends ViewGroup {
                int col = 0;
                for (int i = 0, N = getChildCount(); i < N; i++) {
                    View c = getChildAt(i);
                    if (isGone(c)) continue;
                    LayoutParams lp = getLayoutParams1(c);

                    final Spec colSpec = lp.columnSpec;
@@ -1002,7 +1001,6 @@ public class GridLayout extends ViewGroup {
            int count = -1;
            for (int i = 0, N = getChildCount(); i < N; i++) {
                View c = getChildAt(i);
                if (isGone(c)) continue;
                LayoutParams params = getLayoutParams(c);
                Spec spec = horizontal ? params.columnSpec : params.rowSpec;
                count = max(count, spec.span.min);