android enter popenter区别,What is the difference between enterAnim & popEnterAnim & exitAnim & popExi...

问题

What is the difference between animation tags in latest Navigation Architecture Component? I got confused with enterAnim & popEnterAnim. Similarly, exitAnim & popExitAnim.

Any visual expansions is more than welcomed.

回答1:

The Animate transitions between destinations documentation details the four types of animations:

Entering a destination

Exiting a destination

Entering a destination via a pop action

Exiting a destination via a pop action

"Entering" refers to the destination that is coming onto the screen, while "exiting" refers to the destination leaving the screen.

Therefore when you navigate from destination A to destination B, the entering destination B will have the enterAnim applied to it and the exiting destination A will have the exitAnim applied to it.

When the user hits the system Back button, going from B back to A, the reverse happens: the entering destination A will have the popEnterAnim applied to it and the exiting destination B will have the popExitAnim applied to it.

回答2:

Pop is related to the back stack, I use back stack for helping understanding

e.g.

A is showing on screen now, we are going to put B on screen, then A will Exit(Anim/transaction) from screen, B will Enter to screen.

Now what’s going to happen if you tap back key/up button? Yes, the reverse happens. Which means B is going to be replaced by A.

B is popped off the back stack and Exit from screen (Pop

Exit)

A is entered to the view from the back stack (Pop Enter)

来源:https://stackoverflow.com/questions/56285197/what-is-the-difference-between-enteranim-popenteranim-exitanim-popexitanim

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值