Skip to content

Commit

Permalink
Skipped shared elements if fluently navigated
Browse files Browse the repository at this point in the history
Fluently navigate from A --> B --> C and navigate back one to B. If sharedElements return non-empty array then it went down the finishAfterTransition path. But postponeEnterTransition hadn't been called on B, because B was fluently navigated over, so it threw and error.
  • Loading branch information
grahammendick committed Jun 8, 2019
1 parent 043072a commit 22fe29e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ protected void onAfterUpdateTransaction() {
int enter = this.getAnimationResourceId(enterAnim, this.activityCloseEnterAnimationId);
int exit = this.getAnimationResourceId(exitAnim, this.activityCloseExitAnimationId);
final HashMap<String, View> oldSharedElementsMap = getSharedElementMap();
Pair[] oldSharedElements = currentCrumb - crumb == 1 ? getSharedElements(oldSharedElementsMap, oldSharedElementNames) : null;
Boolean shared = currentActivity.getIntent().getSerializableExtra(SceneActivity.SHARED_ELEMENTS) != null;
Pair[] oldSharedElements = (shared && currentCrumb - crumb == 1) ? getSharedElements(oldSharedElementsMap, oldSharedElementNames) : null;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && oldSharedElements != null && oldSharedElements.length != 0) {
final SharedElementTransitioner transitioner = new SharedElementTransitioner(currentActivity, getSharedElementSet(oldSharedElementNames));
currentActivity.setEnterSharedElementCallback(new SharedElementCallback() {
Expand Down

0 comments on commit 22fe29e

Please sign in to comment.