Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9dfb388d authored by Selim Cinek's avatar Selim Cinek
Browse files

Fade other text out properly when transforming messages

Test: send message and then image, observe normal transformation
Fixes: 	110855884
Change-Id: I21eef8c0e23bd21dbe761d428f0757c8bc4538ea
parent 10bbc0ea
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -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();