diff options
| author | 2016-06-17 13:15:34 -0400 | |
|---|---|---|
| committer | 2016-06-17 13:15:34 -0400 | |
| commit | 0c0df7943ce2cf463917fa5a72d08ebf6a5336b4 (patch) | |
| tree | 41d7d62456c11bcac09fa5d024022eec1d1d5748 | |
| parent | a3453b8bd9af44566c6a31fd0156cc76e6028f6d (diff) | |
QS Edit: Fix auto-selecting add location
We depend on a layout listener for when we ask for focus, but layout
sometimes doesn't happen. Make it always happen.
Change-Id: I7c805470c6ce9863bf7eac627f59d49191ce8946
Fixes: 29126464
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/qs/customize/TileAdapter.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/qs/customize/TileAdapter.java b/packages/SystemUI/src/com/android/systemui/qs/customize/TileAdapter.java index 60c24d095aa7..f0605020c7d4 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/customize/TileAdapter.java +++ b/packages/SystemUI/src/com/android/systemui/qs/customize/TileAdapter.java @@ -37,6 +37,7 @@ import android.view.ViewGroup; import android.view.accessibility.AccessibilityManager; import android.widget.FrameLayout; import android.widget.TextView; + import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.MetricsProto; import com.android.systemui.R; @@ -227,6 +228,8 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta }); if (mNeedsFocus) { // Wait for this to get laid out then set its focus. + // Ensure that tile gets laid out so we get the callback. + holder.mTileView.requestLayout(); holder.mTileView.addOnLayoutChangeListener(new OnLayoutChangeListener() { @Override public void onLayoutChange(View v, int left, int top, int right, int bottom, |