mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 17:36:49 +00:00
Fixing issue where holographic icons could get out of sync in AllApps (when number of pages changes).
Change-Id: I1a63d4837c5b726a90229430f5fc698aa1db5550
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user