https://kotlinlang.org logo
Title
i

iamthevoid

05/31/2021, 6:59 AM
Is it possible to animate AppBar navigationIcon appearance? I mean not only of navigationIcon anim in-out, but navigation title slide. I mean exactly smooth swithing between next AppBar states
a

Arkadii Ivanov

05/31/2021, 9:21 AM
I would put separate AppBars on each screen, so they would animate together with the content.
i

iamthevoid

05/31/2021, 9:38 AM
Do you mean transition animation for full screen?
a

Arkadii Ivanov

05/31/2021, 9:39 AM
Yeah, this is how I am doing it usually.
But if you really need separate animations for AppBars elements, the you need another solution.
i

iamthevoid

05/31/2021, 9:43 AM
I think that the best solution for what i am trying to do is to create custom app bar )
a

Arkadii Ivanov

05/31/2021, 9:46 AM
It depends on the UI design and architecture requirements. In all apps I worked on - the AppBar was always screens' implementation details. But if you have such a design requirement, to animate items of the AppBar individually, then you need a custom solution indeed.
If you need to animate items individually, then maybe
AnimatedVisibity
will help?
i

iamthevoid

05/31/2021, 10:12 AM
I am afraid that it doesn’t ) Maybe it could works for nav icon (I am new in compose and don’t sure), but as i understood from code below row with fixed size just appears if set and title move to right with no anim
a

Arkadii Ivanov

05/31/2021, 10:14 AM
Yeah, I meant if you will ever implement a custom app bar 😀