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 24, 2018
1 parent fe43726 commit 47614be
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ protected void handleOpen(KrollDict options)
int exitAnimation = TiConvert.toInt(options.get(TiC.PROPERTY_ACTIVITY_EXIT_ANIMATION), 0);
topActivity.overridePendingTransition(enterAnimation, exitAnimation);
} else {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN && Build.VERSION.SDK_INT != Build.VERSION_CODES.M) {
topActivity.startActivity(intent, createActivityOptionsBundle(topActivity));
} else {
topActivity.startActivity(intent);
Expand Down
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 47614be

Please sign in to comment.