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

Commit f102d426 authored by Doris Liu's avatar Doris Liu
Browse files

Allow null child view when checking whether divider should draw

The beginning divider should draw before the first child that is not
set to GONE. Incidentally, there needs to be a check for such a child,
which involves checking the visibility of all the children with lower
indices. This CL takes into account the scenarios where children with
lower indices could be null, in which case we'll treat them as if they
were GONE.

Bug: 22199594
Change-Id: Iefc73ef87beec219898c967b9a3ccebd1e3b5b4c
parent 3acd1603
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -659,7 +659,8 @@ public class LinearLayout extends ViewGroup {
     */
    private boolean allViewsAreGoneBefore(int childIndex) {
        for (int i = childIndex - 1; i >= 0; i--) {
            if (getVirtualChildAt(i).getVisibility() != GONE) {
            View child = getVirtualChildAt(i);
            if (child != null && child.getVisibility() != GONE) {
                return false;
            }
        }