简体   繁体   中英

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. Now when I am starting PIPActivity there is some animation that slowly transitions into PIP mode. During this transition, the image is getting stretched weirdly. To avoid this how can stop the animation when entering PIP mode? I have already tried

I want it to be like WhatsApp

Implement this code in the launcher activity and NOT in 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);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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