mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 11:18:21 +00:00
Added FolderIconPreviewVerifier class.
This class verifies whether an item in a Foder is displayed in the FolderIcon preview, based on the item's rank. We use this class to determine which items in a Folder will be displayed in the preview. Bug: 35064148 Change-Id: Ia21bccbd95c348efeac62591ae3696a4c60b5339
This commit is contained in:
@@ -129,24 +129,4 @@ public class ClippedFolderIconLayoutRule implements FolderIcon.PreviewLayoutRule
|
||||
public boolean clipToBackground() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<View> getItemsToDisplay(Folder folder) {
|
||||
List<View> items = new ArrayList<>(folder.getItemsInReadingOrder());
|
||||
int numItems = items.size();
|
||||
if (FeatureFlags.LAUNCHER3_NEW_FOLDER_ANIMATION && numItems > MAX_NUM_ITEMS_IN_PREVIEW) {
|
||||
// We match the icons in the preview with the layout of the opened folder (b/27944225),
|
||||
// but we still need to figure out how we want to handle updating the preview when the
|
||||
// upper left quadrant changes.
|
||||
int appsPerRow = folder.mContent.getPageAt(0).getCountX();
|
||||
int appsToDelete = appsPerRow - MAX_NUM_ITEMS_PER_ROW;
|
||||
|
||||
// We only display the upper left quadrant.
|
||||
while (appsToDelete > 0) {
|
||||
items.remove(MAX_NUM_ITEMS_PER_ROW);
|
||||
appsToDelete--;
|
||||
}
|
||||
}
|
||||
return items.subList(0, Math.min(numItems, MAX_NUM_ITEMS_IN_PREVIEW));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user