Skip to content

Commit

Permalink
[TIMOB-25678] Fix compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Gary Mathews committed Oct 22, 2018
1 parent fe43726 commit ed8557f
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,13 @@ public void removeAllSharedElements()
protected Bundle createActivityOptionsBundle(Activity activity)
{
ActivityOptionsCompat options = null;
if (hasActivityTransitions() && sharedElementPairs != null && !sharedElementPairs.isEmpty()) {
if (hasActivityTransitions()) {

// NOTE: some versions of Android do not animate the window enter or exit transition
// without returning a valid bundle. If the activity has transitions; always return a bundle.
if (sharedElementPairs.isEmpty()) {
sharedElementPairs.add(new Pair<View, String>(new View(activity), "ti_compatibility_element"));
}
options = ActivityOptionsCompat.makeSceneTransitionAnimation(
activity, sharedElementPairs.toArray(new Pair[sharedElementPairs.size()]));
} else {
Expand Down

0 comments on commit ed8557f

Please sign in to comment.