ma cılay
ma cılay

Reputation: 739

Animate Layout Changes broken in Nested Layout with CollapsingToolbarLayout

I have the following layout in my activity:

CoordinatorLayout ┣━ AppBarLayout ┃ ┗━ CollapsibleToolbarLayout ┃ ┣━ TextView (parallax) ┃ ┣━ TextView (pin) ┃ ┗━ Toolbar ┗━ NestedScrollView ┗━ LinearLayout ┣━ TextView 1 ┣━ LinearLayout 1 ┃ ┗━ 1 to n Views (dynamically added/removed) ... ┣━ TextView n ┗━ LinearLayout n ┗━ 1 to n Views (dynamically added/removed)

When I set the animateLayoutChanges in the Layouts to true, then whenever a Layout change happens inside of the NestedScrollView the resulting layout overlaps with the contents of the AppBarLayout.

I tried the suggestions in this stackoverflow comment, But it didn't help.

Did anyone had a similar/the same problem and found a solution?

Upvotes: 0

Views: 2042

Answers (1)

chriztofr
chriztofr

Reputation: 81

Try calling setAnimateParentHierarchy(false) on the animated layouts. http://developer.android.com/reference/android/animation/LayoutTransition.html#setAnimateParentHierarchy(boolean)

Upvotes: 8

Related Questions