Merge "Ensuring that ShortcutInfo always has an icon" into ub-launcher3-master

This commit is contained in:
Sunny Goyal
2016-12-16 00:21:29 +00:00
committed by Android (Google) Code Review
17 changed files with 87 additions and 147 deletions

View File

@@ -170,7 +170,6 @@ public class Workspace extends PagedView
private CellLayout mDropToLayout = null;
@Thunk Launcher mLauncher;
@Thunk IconCache mIconCache;
@Thunk DragController mDragController;
// These are temporary variables to prevent having to allocate a new object just to
@@ -514,9 +513,7 @@ public class Workspace extends PagedView
*/
protected void initWorkspace() {
mCurrentPage = getDefaultPage();
LauncherAppState app = LauncherAppState.getInstance();
DeviceProfile grid = mLauncher.getDeviceProfile();
mIconCache = app.getIconCache();
setWillNotDraw(false);
setClipChildren(false);
setClipToPadding(false);
@@ -3391,7 +3388,7 @@ public class Workspace extends PagedView
break;
case LauncherSettings.Favorites.ITEM_TYPE_FOLDER:
view = FolderIcon.fromXml(R.layout.folder_icon, mLauncher, cellLayout,
(FolderInfo) info, mIconCache);
(FolderInfo) info);
break;
default:
throw new IllegalStateException("Unknown item type: " + info.itemType);
@@ -3999,8 +3996,7 @@ public class Workspace extends PagedView
Drawable oldIcon = getTextViewIcon(shortcut);
boolean oldPromiseState = (oldIcon instanceof PreloadIconDrawable)
&& ((PreloadIconDrawable) oldIcon).hasNotCompleted();
shortcut.applyFromShortcutInfo(si, mIconCache,
si.isPromise() != oldPromiseState);
shortcut.applyFromShortcutInfo(si, si.isPromise() != oldPromiseState);
}
// process all the shortcuts
return false;