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

Commit 81e8c9ca authored by Evan Laird's avatar Evan Laird Committed by android-build-merger
Browse files

Merge "Don't animate status icons when the container changes size" into qt-dev...

Merge "Don't animate status icons when the container changes size" into qt-dev am: 58517b7b am: a113a508
am: c74b8612

Change-Id: I186a5929c776b63efef8aac570d85a968c985408
parents 7a3c0edf c74b8612
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -378,8 +378,18 @@ public class StatusIconContainer extends AlphaOptimizedLinearLayout {
        public int visibleState = STATE_ICON;
        public boolean justAdded = true;

        // How far we are from the end of the view actually is the most relevant for animation
        float distanceToViewEnd = -1;

        @Override
        public void applyToView(View view) {
            float parentWidth = 0;
            if (view.getParent() instanceof View) {
                parentWidth = ((View) view.getParent()).getWidth();
            }

            float currentDistanceToEnd = parentWidth - xTranslation;

            if (!(view instanceof StatusIconDisplayable)) {
                return;
            }
@@ -403,7 +413,7 @@ public class StatusIconContainer extends AlphaOptimizedLinearLayout {
                    // all other transitions (to/from dot, etc)
                    animationProperties = ANIMATE_ALL_PROPERTIES;
                }
            } else if (visibleState != STATE_HIDDEN && xTranslation != view.getTranslationX()) {
            } else if (visibleState != STATE_HIDDEN && distanceToViewEnd != currentDistanceToEnd) {
                // Visibility isn't changing, just animate position
                animationProperties = X_ANIMATION_PROPERTIES;
            }
@@ -416,6 +426,8 @@ public class StatusIconContainer extends AlphaOptimizedLinearLayout {
            }

            justAdded = false;
            distanceToViewEnd = currentDistanceToEnd;

        }
    }