Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Attachment actions
Unintended behavior
View staffing
Description
Example project
Conditions:
Support library version: com.android.support:transition:24.2.0
Android version: any below API 19 KitKat
When fade animation will finish it will remove the view from the parent. It will call requestLayout(). In framework transitions it works fine because of parent.suppressLayout(true). There are no any analogue for it in the support library.
I've found a way how it can be fixed in my backport library
When ViewGroup have any LayoutTransiton it can prevent real layout calls.
Example:
LayoutTransition emptyLayoutTransition = new LayoutTransition() {
@Override
public boolean isChangingLayout() {
return true;
}
};
emptyLayoutTransition.setAnimator(LayoutTransition.APPEARING, null);
emptyLayoutTransition.setAnimator(LayoutTransition.CHANGE_APPEARING, null);
emptyLayoutTransition.setAnimator(LayoutTransition.CHANGE_DISAPPEARING, null);
emptyLayoutTransition.setAnimator(LayoutTransition.DISAPPEARING, null);
emptyLayoutTransition.setAnimator(LayoutTransition.CHANGING, null);
If we apply that layout transition no more layouts will be called and no animation from LayoutTransition will be applied as well.
So, replacement for the parent.suppressLayout(true) is
parent.setLayoutTransition(emptyLayoutTransition);
And for the parent.suppressLayout(false) is
parent.setLayoutTransition(null);
parent.requestLayout();
Full example: