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

Commit 7dd4a536 authored by Chet Haase's avatar Chet Haase
Browse files

Adding new CHANGING transition to LayoutTransition.

LayoutTransition used to depend on child views being added/removed or
shown/hidden in the transition container. These evens would trigger animations
to fade the child view as well as those to animate the side-affected changes
to sibling views. This CL enables a new feature in LayoutTransition that
enables animating any changes to the layout of the children in the container
whenever a layout occurs. For example, you can change the LayoutParams of a
child view and call requestLayout() to automatically animate those changes.

This capability is not enabled by default. To enable, call the new
LayoutTransition.enableTransitionType(LayoutTransition.CHANGING) method.

Change-Id: I4d07a3b36245353b2151f0dca4f75080ab6a4592
parent c843642f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2311,6 +2311,8 @@ package android.animation {
    ctor public LayoutTransition();
    method public void addChild(android.view.ViewGroup, android.view.View);
    method public void addTransitionListener(android.animation.LayoutTransition.TransitionListener);
    method public void disableTransitionType(int);
    method public void enableTransitionType(int);
    method public android.animation.Animator getAnimator(int);
    method public long getDuration(int);
    method public android.animation.TimeInterpolator getInterpolator(int);
@@ -2321,6 +2323,7 @@ package android.animation {
    method public void hideChild(android.view.ViewGroup, android.view.View, int);
    method public boolean isChangingLayout();
    method public boolean isRunning();
    method public boolean isTransitionTypeEnabled(int);
    method public void removeChild(android.view.ViewGroup, android.view.View);
    method public void removeTransitionListener(android.animation.LayoutTransition.TransitionListener);
    method public void setAnimateParentHierarchy(boolean);
@@ -2335,6 +2338,7 @@ package android.animation {
    field public static final int APPEARING = 2; // 0x2
    field public static final int CHANGE_APPEARING = 0; // 0x0
    field public static final int CHANGE_DISAPPEARING = 1; // 0x1
    field public static final int CHANGING = 4; // 0x4
    field public static final int DISAPPEARING = 3; // 0x3
  }
+273 −64

File changed.

Preview size limit exceeded, changes collapsed.

+3 −0
Original line number Diff line number Diff line
@@ -4207,6 +4207,9 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
    @Override
    public final void layout(int l, int t, int r, int b) {
        if (mTransition == null || !mTransition.isChangingLayout()) {
            if (mTransition != null) {
                mTransition.layoutChange(this);
            }
            super.layout(l, t, r, b);
        } else {
            // record the fact that we noop'd it; request layout when transition finishes