Animating All Layout

Transition.allLayout() allows easily animating all layout changes, without having to assign transitionKeys to all Components

@OnCreateTransition
static Transition onCreateTransition(ComponentContext c) {
return Transition.allLayout().animator(ANIMATOR);
}

Note, that Transition.allLayout():

  1. Targets AnimatedProperty.X, Y, HEIGHT and WIDTH of all Components present in layout tree.
  2. Could be used to define transitions of change type only. For defining appearing and disappearing transitions, transitionKeys still need to be assigned.
  3. Could be used as a part of more complex choreography.
@OnCreateTransition
static Transition onCreateTransition(ComponentContext c) {
return Transition.parallel(
Transition.allLayout().animator(ANIMATOR),
Transition.create(TRANSITION_KEY_TEXT)
.animate(AnimatedProperties.WIDTH)
.appearFrom(0f)
.disappearTo(0f)
.animator(ANIMATOR),
Transition.create(TRANSITION_KEY_TEXT)
.animate(AnimatedProperties.ALPHA)
.appearFrom(0f)
.disappearTo(0f)
.animator(ANIMATOR));
}