mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 11:18:21 +00:00
Animate PredictedAppIcon when its icon changes
Reuses the slot machine animation to slide in the new icon. Additionally, staggers based on other icons changing before it. Test: open apps, watch predictions change Bug: 197780290 Change-Id: Ib2bc84193a9e350c915dd3486b6c98c6c88d3f83
This commit is contained in:
@@ -115,6 +115,7 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
|
||||
*/
|
||||
protected void updateHotseatItems(ItemInfo[] hotseatItemInfos) {
|
||||
int nextViewIndex = 0;
|
||||
int numViewsAnimated = 0;
|
||||
|
||||
for (int i = 0; i < hotseatItemInfos.length; i++) {
|
||||
ItemInfo hotseatItemInfo = hotseatItemInfos[i];
|
||||
@@ -170,8 +171,14 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
|
||||
// Apply the Hotseat ItemInfos, or hide the view if there is none for a given index.
|
||||
if (hotseatView instanceof BubbleTextView
|
||||
&& hotseatItemInfo instanceof WorkspaceItemInfo) {
|
||||
((BubbleTextView) hotseatView).applyFromWorkspaceItem(
|
||||
(WorkspaceItemInfo) hotseatItemInfo);
|
||||
BubbleTextView btv = (BubbleTextView) hotseatView;
|
||||
WorkspaceItemInfo workspaceInfo = (WorkspaceItemInfo) hotseatItemInfo;
|
||||
|
||||
boolean animate = btv.shouldAnimateIconChange((WorkspaceItemInfo) hotseatItemInfo);
|
||||
btv.applyFromWorkspaceItem(workspaceInfo, animate, numViewsAnimated);
|
||||
if (animate) {
|
||||
numViewsAnimated++;
|
||||
}
|
||||
}
|
||||
setClickAndLongClickListenersForIcon(hotseatView);
|
||||
nextViewIndex++;
|
||||
|
||||
Reference in New Issue
Block a user