mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 18:58:19 +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:
@@ -256,9 +256,27 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
|
||||
|
||||
@UiThread
|
||||
public void applyFromWorkspaceItem(WorkspaceItemInfo info) {
|
||||
applyFromWorkspaceItem(info, /* animate = */ false, /* staggerIndex = */ 0);
|
||||
}
|
||||
|
||||
@UiThread
|
||||
public void applyFromWorkspaceItem(WorkspaceItemInfo info, boolean animate, int staggerIndex) {
|
||||
applyFromWorkspaceItem(info, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the newInfo differs from the current getTag().
|
||||
*/
|
||||
public boolean shouldAnimateIconChange(WorkspaceItemInfo newInfo) {
|
||||
WorkspaceItemInfo oldInfo = getTag() instanceof WorkspaceItemInfo
|
||||
? (WorkspaceItemInfo) getTag()
|
||||
: null;
|
||||
boolean changedIcons = oldInfo != null && oldInfo.getTargetComponent() != null
|
||||
&& newInfo.getTargetComponent() != null
|
||||
&& !oldInfo.getTargetComponent().equals(newInfo.getTargetComponent());
|
||||
return changedIcons && isShown();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAccessibilityDelegate(AccessibilityDelegate delegate) {
|
||||
if (delegate instanceof LauncherAccessibilityDelegate) {
|
||||
|
||||
Reference in New Issue
Block a user