方向更改后,Android反向共享元素转换回了吗? [英] Android reverse shared element transition on back after orientation change?

本文介绍了方向更改后,Android反向共享元素转换回了吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于共享元素转换,我正在关注 github项目.它有2个屏幕-一个带有recyclerview的屏幕,其中包含卡片数量和其次是详细信息屏幕.不出所料,它展现了imageview&的共享元素过渡.从recyclerview项目到详细信息屏幕的文本视图&反向按反向转换.

但是,如果用户在详细信息屏幕上更改了方向,则&然后按返回按钮,则反向过渡动画不起作用.观看这部该视频的帧在2:49到2:57之间,即使在更改方向后,这似乎也是有可能的.有什么想法吗?

请查看此视频以更好地理解.

解决方案

最后,我可以通过将单独的主题应用于详细信息屏幕来覆盖此属性值来解决此问题,但不确定为什么该参数会更改动画行为.

>

<item name="android:windowIsTranslucent">true</item>

For shared element transition I am following this github project. It has 2 screens - one with recyclerview having number of cards & second the detail screen. As expected, it exhibits shared element transition of imageview & textview from recyclerview item to detail screen & reverse transition on back press.

But, if user changes orientation on detail screen, & then presses back button then the reverse transition animation doesn't work. Looking at this video's frames between 2:49 to 2:57 it seems to be possible even after orientation change. Any idea on this?

Edit:

Please check this video for better understanding.

解决方案

At last, I could fix this by applying separate theme to detail screen overriding following attribute value, but not sure why did this parameter change the animation behavior.

<item name="android:windowIsTranslucent">true</item>

这篇关于方向更改后,Android反向共享元素转换回了吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆