From d5a03eb0b3015e8d307299ea2c8771b3b204a6ea Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Mon, 20 Apr 2015 17:09:37 -0700 Subject: Ensuring that we skip item decoration drawing when there are no apps. Bug: 20431579 Change-Id: I870c43ff8a94e2cb2c68869f2a31001d028ad58a --- src/com/android/launcher3/AppsGridAdapter.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/com/android/launcher3/AppsGridAdapter.java b/src/com/android/launcher3/AppsGridAdapter.java index c8ce397f2..954c59ffc 100644 --- a/src/com/android/launcher3/AppsGridAdapter.java +++ b/src/com/android/launcher3/AppsGridAdapter.java @@ -72,6 +72,10 @@ class AppsGridAdapter extends RecyclerView.Adapter { @Override public void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state) { List items = mApps.getAdapterItems(); + if (items.isEmpty()) { + return; + } + for (int i = 0; i < parent.getChildCount(); i++) { View child = parent.getChildAt(i); ViewHolder holder = (ViewHolder) parent.getChildViewHolder(child); -- cgit v1.2.3