简体   繁体   English

android进入PIP模式时如何禁用animation

[英]How to disable animation when entering in PIP mode in android

My PIPActivity has only one image view and I am entering in PIP mode in onCreate() ie PIPActivity is there only to show image in PIP mode.我的 PIPActivity 只有一个图像视图,我在 onCreate() 中进入 PIP 模式,即 PIPActivity 仅用于在 PIP 模式下显示图像。 Now when I am starting PIPActivity there is some animation that slowly transitions into PIP mode.现在,当我启动 PIPActivity 时,有一些 animation 会慢慢过渡到 PIP 模式。 During this transition, the image is getting stretched weirdly.在此过渡期间,图像变得奇怪地拉伸。 To avoid this how can stop the animation when entering PIP mode?为了避免这种情况,如何在进入 PIP 模式时停止 animation? I have already tried我已经试过了

I want it to be like WhatsApp我希望它像 WhatsApp

Implement this code in the launcher activity and NOT in PIPActivity.在启动器活动中而不是在 PIPActivity 中实施此代码。

getWindow().requestFeature(android.view.Window.FEATURE_ACTIVITY_TRANSITIONS);

//These functions define the exit transition for the calling activity.
getWindow().setExitTransition(null);
getWindow().setSharedElementExitTransition(null);

setContentView(R.layout.mainActivity);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM