diff options
author | Winson Chung <winsonc@google.com> | 2011-05-17 16:24:49 -0700 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2011-05-17 17:06:59 -0700 |
commit | 6a70e9fc3c62cc83d6abe59323d622dc6cd224a7 (patch) | |
tree | 1844176feea41b6180d2bf4858a31f2aef47f41b /src/com/android/launcher2/PagedViewCellLayout.java | |
parent | 2801cafe62653131fdc9da402e5c44e5ffd0bf47 (diff) | |
download | android_packages_apps_Trebuchet-6a70e9fc3c62cc83d6abe59323d622dc6cd224a7.tar.gz android_packages_apps_Trebuchet-6a70e9fc3c62cc83d6abe59323d622dc6cd224a7.tar.bz2 android_packages_apps_Trebuchet-6a70e9fc3c62cc83d6abe59323d622dc6cd224a7.zip |
Fixing issue where holographic icons could get out of sync in AllApps (when number of pages changes).
Change-Id: I1a63d4837c5b726a90229430f5fc698aa1db5550
Diffstat (limited to 'src/com/android/launcher2/PagedViewCellLayout.java')
-rw-r--r-- | src/com/android/launcher2/PagedViewCellLayout.java | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/com/android/launcher2/PagedViewCellLayout.java b/src/com/android/launcher2/PagedViewCellLayout.java index 6a3c84d03..9022cac18 100644 --- a/src/com/android/launcher2/PagedViewCellLayout.java +++ b/src/com/android/launcher2/PagedViewCellLayout.java @@ -128,8 +128,17 @@ public class PagedViewCellLayout extends ViewGroup implements Page { } } + /** Syncs the holographic icon views to the child icon views */ + public void reloadHolographicIcons(boolean createHolographicOutlines) { + if (createHolographicOutlines) { + mChildren.loadHolographicOutlines(); + } else { + mChildren.clearHolographicOutlines(); + } + } + public boolean addViewToCellLayout(View child, int index, int childId, - PagedViewCellLayout.LayoutParams params, boolean createHolographicOutlines) { + PagedViewCellLayout.LayoutParams params) { final PagedViewCellLayout.LayoutParams lp = params; // Generate an id for each view, this assumes we have at most 256x256 cells @@ -149,10 +158,8 @@ public class PagedViewCellLayout extends ViewGroup implements Page { if (mAllowHardwareLayerCreation) { pagedViewIcon.disableCache(); } - if (createHolographicOutlines) { - mHolographicChildren.addView(pagedViewIcon.getHolographicOutlineView(), - index, lp); - } + mHolographicChildren.addView(pagedViewIcon.getHolographicOutlineView(), + index, lp); } return true; } @@ -169,11 +176,7 @@ public class PagedViewCellLayout extends ViewGroup implements Page { @Override public void removeViewOnPageAt(int index) { mChildren.removeViewAt(index); - // Holographic icons are disabled in certain cases (on lower hardware, or if there is only - // one page), so check before we try and remove the view at a specified index. - if (mHolographicChildren.getChildAt(index) != null) { - mHolographicChildren.removeViewAt(index); - } + mHolographicChildren.removeViewAt(index); } @Override |