Merge changes Ib2bc8419,Ia41cb0e3,I43bfbc41 into sc-v2-dev

* changes:
  Animate PredictedAppIcon when its icon changes
  Add "wave" animation when entering taskbar edu
  Add slot machine animation for PredictedAppIcon
This commit is contained in:
Android Build Prod User
2021-08-26 21:48:07 +00:00
committed by Android (Google) Code Review
11 changed files with 359 additions and 11 deletions

View File

@@ -118,6 +118,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];
@@ -173,8 +174,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++;
@@ -259,6 +266,18 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
return mIconLayoutBounds;
}
/**
* Returns the app icons currently shown in the taskbar.
*/
public View[] getIconViews() {
final int count = getChildCount();
View[] icons = new View[count];
for (int i = 0; i < count; i++) {
icons[i] = getChildAt(i);
}
return icons;
}
// FolderIconParent implemented methods.
@Override