diff options
| author | 2018-11-21 19:34:43 -0800 | |
|---|---|---|
| committer | 2018-11-28 15:38:20 -0800 | |
| commit | 9dfb388d99f51fd21d0f31133d13e9382bb460ac (patch) | |
| tree | e5d678c19ec553c334ce4edf00606c13b74a26c3 | |
| parent | 10bbc0ea784fa74c0851b1ee8a0dad92424ef0fd (diff) | |
Fade other text out properly when transforming messages
Test: send message and then image, observe normal transformation
Fixes: 110855884
Change-Id: I21eef8c0e23bd21dbe761d428f0757c8bc4538ea
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/notification/MessagingLayoutTransformState.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/MessagingLayoutTransformState.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/MessagingLayoutTransformState.java index 314a31d336fd..0a2e04fd9430 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/MessagingLayoutTransformState.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/MessagingLayoutTransformState.java @@ -250,23 +250,24 @@ public class MessagingLayoutTransformState extends TransformState { otherChild = null; } } - if (otherChild == null) { + if (otherChild == null && previousTranslation < 0) { + // Let's fade out as we approach the top of the screen. We can only do this if + // we're actually moving up float distanceToTop = child.getTop() + child.getHeight() + previousTranslation; transformationAmount = distanceToTop / child.getHeight(); transformationAmount = Math.max(0.0f, Math.min(1.0f, transformationAmount)); - if (to) { - transformationAmount = 1.0f - transformationAmount; - } } transformView(transformationAmount, to, child, otherChild, false, /* sameAsAny */ useLinearTransformation); - if (transformationAmount == 0.0f - && otherGroup.getIsolatedMessage() == otherChild) { + boolean otherIsIsolated = otherGroup.getIsolatedMessage() == otherChild; + if (transformationAmount == 0.0f && otherIsIsolated) { ownGroup.setTransformingImages(true); } if (otherChild == null) { child.setTranslationY(previousTranslation); setClippingDeactivated(child, true); + } else if (ownGroup.getIsolatedMessage() == child || otherIsIsolated) { + // We don't want to add any translation for the image that is transforming } else if (to) { float totalTranslation = child.getTop() + ownGroup.getTop() - otherChild.getTop() - otherChild.getTop(); |