summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2015-04-21 00:09:37 (GMT)
committerWinson Chung <winsonc@google.com>2015-04-21 00:27:53 (GMT)
commitd5a03eb0b3015e8d307299ea2c8771b3b204a6ea (patch)
treee80100c1222f23170b9d61d7acb41d7dbd1b8e09
parent4897af520533115aebf375e554e0b140be95d3c5 (diff)
downloadandroid_packages_apps_Trebuchet-d5a03eb0b3015e8d307299ea2c8771b3b204a6ea.zip
android_packages_apps_Trebuchet-d5a03eb0b3015e8d307299ea2c8771b3b204a6ea.tar.gz
android_packages_apps_Trebuchet-d5a03eb0b3015e8d307299ea2c8771b3b204a6ea.tar.bz2
Ensuring that we skip item decoration drawing when there are no apps.
Bug: 20431579 Change-Id: I870c43ff8a94e2cb2c68869f2a31001d028ad58a
-rw-r--r--src/com/android/launcher3/AppsGridAdapter.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/com/android/launcher3/AppsGridAdapter.java b/src/com/android/launcher3/AppsGridAdapter.java
index c8ce397..954c59f 100644
--- a/src/com/android/launcher3/AppsGridAdapter.java
+++ b/src/com/android/launcher3/AppsGridAdapter.java
@@ -72,6 +72,10 @@ class AppsGridAdapter extends RecyclerView.Adapter<AppsGridAdapter.ViewHolder> {
@Override
public void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state) {
List<AlphabeticalAppsList.AdapterItem> 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);