From 63257c110a4ee54d5e8872c471cce254cf613c7a Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Thu, 5 May 2011 17:06:13 -0700 Subject: Minor changes to help address some hiccups when panning, changing tabs and rotating in AppsCustomize. - Also removing references to old all-apps 2d/3d Change-Id: Ibe07ad8b4facc5c57b3c82ccf0b55260be61a31b --- src/com/android/launcher2/CustomizePagedView.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/com/android/launcher2/CustomizePagedView.java') diff --git a/src/com/android/launcher2/CustomizePagedView.java b/src/com/android/launcher2/CustomizePagedView.java index b61713a76..fd88eb665 100644 --- a/src/com/android/launcher2/CustomizePagedView.java +++ b/src/com/android/launcher2/CustomizePagedView.java @@ -929,12 +929,13 @@ public class CustomizePagedView extends PagedViewWithDraggableItems final int[] cellSpans = CellLayout.rectToCell(getResources(), info.minWidth, info.minHeight, null); final FastBitmapDrawable icon = getWidgetPreview(info); + final boolean createHolographicOutlines = isHardwareAccelerated() && (numPages > 1); PagedViewWidget l = (PagedViewWidget) mInflater.inflate( R.layout.customize_paged_view_widget, layout, false); l.applyFromAppWidgetProviderInfo(info, icon, mMaxWidgetWidth, cellSpans, - mPageViewIconCache, (numPages > 1)); + mPageViewIconCache, createHolographicOutlines); l.setTag(createItemInfo); l.setOnClickListener(this); l.setOnTouchListener(this); @@ -975,11 +976,12 @@ public class CustomizePagedView extends PagedViewWithDraggableItems for (int i = startIndex; i < endIndex; ++i) { final ResolveInfo info = mWallpaperList.get(i); final FastBitmapDrawable icon = getWallpaperPreview(info); + final boolean createHolographicOutlines = isHardwareAccelerated() && (numPages > 1); PagedViewWidget l = (PagedViewWidget) mInflater.inflate( R.layout.customize_paged_view_wallpaper, layout, false); l.applyFromWallpaperInfo(info, mPackageManager, icon, mMaxWidgetWidth, - mPageViewIconCache, (numPages > 1)); + mPageViewIconCache, createHolographicOutlines); l.setTag(info); l.setOnClickListener(this); @@ -1012,12 +1014,13 @@ public class CustomizePagedView extends PagedViewWithDraggableItems for (int i = startIndex; i < endIndex; ++i) { ResolveInfo info = list.get(i); PendingAddItemInfo createItemInfo = new PendingAddItemInfo(); + final boolean createHolographicOutlines = isHardwareAccelerated() && (numPages > 1); PagedViewIcon icon = (PagedViewIcon) mInflater.inflate( R.layout.customize_paged_view_item, layout, false); icon.applyFromResolveInfo(info, mPackageManager, mPageViewIconCache, ((LauncherApplication) mLauncher.getApplication()).getIconCache(), - (numPages > 1)); + createHolographicOutlines); switch (mCustomizationType) { case WallpaperCustomization: icon.setOnClickListener(this); @@ -1039,7 +1042,8 @@ public class CustomizePagedView extends PagedViewWithDraggableItems final int x = index % mCellCountX; final int y = index / mCellCountX; setupPage(layout); - layout.addViewToCellLayout(icon, -1, i, new PagedViewCellLayout.LayoutParams(x,y, 1,1)); + layout.addViewToCellLayout(icon, -1, i, new PagedViewCellLayout.LayoutParams(x,y, 1,1), + createHolographicOutlines); } } @@ -1071,10 +1075,11 @@ public class CustomizePagedView extends PagedViewWithDraggableItems layout.removeAllViewsOnPage(); for (int i = startIndex; i < endIndex; ++i) { final ApplicationInfo info = mApps.get(i); + final boolean createHolographicOutlines = isHardwareAccelerated() && (numPages > 1); PagedViewIcon icon = (PagedViewIcon) mInflater.inflate( R.layout.all_apps_paged_view_application, layout, false); icon.applyFromApplicationInfo( - info, mPageViewIconCache, true, isHardwareAccelerated() && (numPages > 1)); + info, mPageViewIconCache, true, createHolographicOutlines); icon.setOnClickListener(this); icon.setOnTouchListener(this); icon.setOnLongClickListener(this); @@ -1083,7 +1088,8 @@ public class CustomizePagedView extends PagedViewWithDraggableItems final int x = index % mCellCountX; final int y = index / mCellCountX; setupPage(layout); - layout.addViewToCellLayout(icon, -1, i, new PagedViewCellLayout.LayoutParams(x,y, 1,1)); + layout.addViewToCellLayout(icon, -1, i, new PagedViewCellLayout.LayoutParams(x,y, 1,1), + createHolographicOutlines); } } -- cgit v1.2.3