AnimateLayoutChanges does not animate the removal of the back arrow from the toolbar

I have CoordinatorLayoutwith AppBarLayoutand Toolbarinside it:

CoordinatorLayout
 - AppBarLayout 
   - Toolbar
     animateLayoutChanges=true

Nice. And I use this code to hide / show back arrow button:

private void setBackArrowState(boolean state) {
    actionBar.setDisplayHomeAsUpEnabled(state);
    actionBar.setDisplayShowHomeEnabled(state);
}

As a result, I got the result:

Example

When to back arrow buttonhide, the titlenormal position is not animated on it. How can I solve it?

+4
source share

Source: https://habr.com/ru/post/1626787/


All Articles