Using common transition elements between actions with different orientations

I have an Activity A that is constantly set to landscape orientation and Activity B without any predefined orientation.

If I start activity B from activity A, and the phone’s rotation is in landscape angle, the transition of the common element works correctly, and activity B starts in landscape orientation, as expected. The problem occurs if the phone is rotated at an angle of view during the start of action B. Then activity B starts in portrait orientation (as expected), but the transition does not occur.

Has anyone encountered this problem before? Any help would be greatly appreciated. This triggers activity B from action A:

Intent mIntent = new Intent(context, ActivityB.class); ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(this, sharedView,sharedViewTransitionName); startActivity(mIntent,options.toBundle());

+6
source share
1 answer

You can check this library for activity transitions and fragments for preinstalled devices. It supports scene transitions

  dependencies { compile 'com.albinmathew:PreLollipopTransition:1.1.2' 

}

https://github.com/albinmathew/PreLollipopTransition

0
source

Source: https://habr.com/ru/post/987328/


All Articles