summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/folder/FolderPagedView.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2017-06-22 09:53:59 -0700
committerSunny Goyal <sunnygoyal@google.com>2017-06-22 10:25:43 -0700
commit828b11e5a934af781f620620dd20d312defa49b8 (patch)
tree1796b97550999a0e435add39fd49a76f52685278 /src/com/android/launcher3/folder/FolderPagedView.java
parent0d52bca39e23af789217869fc19fa719b063475f (diff)
downloadandroid_packages_apps_Trebuchet-828b11e5a934af781f620620dd20d312defa49b8.tar.gz
android_packages_apps_Trebuchet-828b11e5a934af781f620620dd20d312defa49b8.tar.bz2
android_packages_apps_Trebuchet-828b11e5a934af781f620620dd20d312defa49b8.zip
Setting the callback for previewItems to folderIcon. This allows the FolderIcon to get updated
without going through the child'draw pass. Also simplifying the draw code for the FolderIcon to remove any cycling invalidate calls Bug: 62900800 Change-Id: I17009a5347a1c3c35426313ac759e0240ce6a395
Diffstat (limited to 'src/com/android/launcher3/folder/FolderPagedView.java')
-rw-r--r--src/com/android/launcher3/folder/FolderPagedView.java20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/com/android/launcher3/folder/FolderPagedView.java b/src/com/android/launcher3/folder/FolderPagedView.java
index f3f337dc0..d0ac9f4b1 100644
--- a/src/com/android/launcher3/folder/FolderPagedView.java
+++ b/src/com/android/launcher3/folder/FolderPagedView.java
@@ -19,6 +19,7 @@ package com.android.launcher3.folder;
import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Canvas;
+import android.graphics.drawable.Drawable;
import android.util.ArrayMap;
import android.util.AttributeSet;
import android.util.Log;
@@ -27,6 +28,7 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewDebug;
import android.view.animation.DecelerateInterpolator;
+
import com.android.launcher3.BubbleTextView;
import com.android.launcher3.CellLayout;
import com.android.launcher3.DeviceProfile;
@@ -44,6 +46,7 @@ import com.android.launcher3.Workspace.ItemOperator;
import com.android.launcher3.keyboard.ViewGroupFocusHelper;
import com.android.launcher3.pageindicators.PageIndicator;
import com.android.launcher3.util.Thunk;
+
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Map;
@@ -178,14 +181,6 @@ public class FolderPagedView extends PagedView {
super.dispatchDraw(canvas);
}
- public void onIconInvalidated(BubbleTextView icon) {
- FolderIcon folderIcon = mFolder.mFolderIcon;
- if (icon.getTag() instanceof ItemInfo
- && folderIcon.mPreviewVerifier.isItemInPreview(((ItemInfo) icon.getTag()).rank)) {
- folderIcon.invalidate();
- }
- }
-
/**
* Binds items to the layout.
* @return list of items that could not be bound, probably because we hit the max size limit.
@@ -562,7 +557,14 @@ public class FolderPagedView extends PagedView {
if (page != null) {
ShortcutAndWidgetContainer parent = page.getShortcutsAndWidgets();
for (int i = parent.getChildCount() - 1; i >= 0; i--) {
- ((BubbleTextView) parent.getChildAt(i)).verifyHighRes();
+ BubbleTextView icon = ((BubbleTextView) parent.getChildAt(i));
+ icon.verifyHighRes();
+ // Set the callback back to the actual icon, in case
+ // it was captured by the FolderIcon
+ Drawable d = icon.getCompoundDrawables()[1];
+ if (d != null) {
+ d.setCallback(icon);
+ }
}
}
}