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

Commit 80fc409d authored by Phil Weaver's avatar Phil Weaver Committed by Walter Jang
Browse files

Force children to layout after listview layout.

This works around a bug in ListView in N and N-MR1.

Test: confirmed that the contact picker accepts clicks
  immediately after load when fastscroll enabled on N-MR1

Bug: 31160338

Change-Id: I0aeef3d7554a88b0fb2c083234152be47beb3b2e
parent 9d96196f
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.contacts.common.list;

import android.content.Context;
import android.os.Build;
import android.util.AttributeSet;
import android.widget.ListView;

@@ -114,4 +115,15 @@ public class AutoScrollListView extends ListView {
            smoothScrollToPositionFromTop(position, offset);
        }
    }

    @Override
    protected void onLayout(boolean changed, int l, int t, int r, int b) {
        super.onLayout(changed, l, t, r, b);

        // Workaround for b/31160338.
        if (android.os.Build.VERSION.SDK_INT == Build.VERSION_CODES.N
            || android.os.Build.VERSION.SDK_INT == Build.VERSION_CODES.N_MR1) {
            layoutChildren();
        }
    }
}