Add taskbar icons unfold animation
Adds 'move from center' animation for taskbar icons when unfolding foldable devices. Moves unfold transition progress provider from quickstep launcher activity to TouchInteractionService to widen the scope when this provider is available to cover both launcher activity and taskbar. Launcher activity and taskbar get their own instances of unfold transition progress provider using ScopedUnfoldTransitionProgressProvider wrapper. This wrapper allows to get transition progress provider that emits events only when clients are ready to handle them. Bug: 193794563 Test: manual Change-Id: I27581bd4e145a74f526bf60f2a545e56ded322f9
This commit is contained in:
@@ -90,6 +90,8 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
|
||||
private final PointF mTranslationForReorderBounce = new PointF(0, 0);
|
||||
private final PointF mTranslationForReorderPreview = new PointF(0, 0);
|
||||
|
||||
private float mTranslationXForTaskbarAlignmentAnimation = 0f;
|
||||
|
||||
private final PointF mTranslationForMoveFromCenterAnimation = new PointF(0, 0);
|
||||
|
||||
private float mScaleForReorderBounce = 1f;
|
||||
@@ -825,7 +827,8 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
|
||||
|
||||
private void updateTranslation() {
|
||||
super.setTranslationX(mTranslationForReorderBounce.x + mTranslationForReorderPreview.x
|
||||
+ mTranslationForMoveFromCenterAnimation.x);
|
||||
+ mTranslationForMoveFromCenterAnimation.x
|
||||
+ mTranslationXForTaskbarAlignmentAnimation);
|
||||
super.setTranslationY(mTranslationForReorderBounce.y + mTranslationForReorderPreview.y
|
||||
+ mTranslationForMoveFromCenterAnimation.y);
|
||||
}
|
||||
@@ -860,11 +863,29 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
|
||||
return mScaleForReorderBounce;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets translation values for move from center animation
|
||||
*/
|
||||
public void setTranslationForMoveFromCenterAnimation(float x, float y) {
|
||||
mTranslationForMoveFromCenterAnimation.set(x, y);
|
||||
updateTranslation();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets translationX for taskbar to launcher alignment animation
|
||||
*/
|
||||
public void setTranslationXForTaskbarAlignmentAnimation(float translationX) {
|
||||
mTranslationXForTaskbarAlignmentAnimation = translationX;
|
||||
updateTranslation();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns translationX value for taskbar to launcher alignment animation
|
||||
*/
|
||||
public float getTranslationXForTaskbarAlignmentAnimation() {
|
||||
return mTranslationXForTaskbarAlignmentAnimation;
|
||||
}
|
||||
|
||||
public View getView() {
|
||||
return this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user