Текущая настройка:
- Все представления изначально ИСКЛЮЧАЮТСЯ в макете XML.
- После ответа API представления становятся ВИДИМЫМИ.
- Использование MotionLayout для анимации слайдов при нажатии кнопки
Мой макет:Код: Выделить всё
> > motion:constraintSetStart="@+id/expanded" > motion:constraintSetEnd="@+id/collapsed" > motion:duration="300"> > > motion:targetId="@id/button" > motion:clickAction="toggle"/> > > > > android:id="@+id/contentLayout" > android:layout_width="0dp" > android:layout_height="wrap_content" > motion:layout_constraintTop_toBottomOf="@id/headerLayout" > motion:layout_constraintStart_toStartOf="parent" > motion:layout_constraintEnd_toEndOf="parent" > android:translationY="0dp"/> > > > > android:id="@+id/contentLayout" > android:layout_width="0dp" > android:layout_height="wrap_content" > motion:layout_constraintTop_toBottomOf="@id/headerLayout" > motion:layout_constraintStart_toStartOf="parent" > motion:layout_constraintEnd_toEndOf="parent" > android:translationY="-1000dp"/> >
Подробнее здесь: https://stackoverflow.com/questions/792 ... -in-animat