Use immutable shouldBeAnimated during Unfold Animation

Context:
We decide to run animations by using shouldBeAnimated lambda function. It represents mutable state which is combination of the
StatusBar and some external business logic.

It shows that shouldBeAnimated value may change for some reasons after the animation is fired.
This may cause some visual issues like wrong translationX values in the view(animation started but not completed properly).

Solution:
We make shouldBeAnimated immutable variable instead of lambda func in ViewToTranslate and use it during the animation.
We already map `ViewIdToTranslate` to `ViewToTranslate` on each animation start.  It also verifies that we invalidate the preserved value on each animation start.

Test: atest UnfoldConstantTranslateAnimatorTest
Bug: 264454435

Change-Id: I75f84a668ab3395193901cff569ca56e55456316
3 files changed