Skip to content

Commit

Permalink
fix: postcard transition support 0
Browse files Browse the repository at this point in the history
  • Loading branch information
LinXiaoTao committed Dec 22, 2017
1 parent f7ec450 commit e0d1f2b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ public final class Postcard extends RouteMeta {

// Animation
private Bundle optionsCompat; // The transition animation of activity
private int enterAnim;
private int exitAnim;
private int enterAnim = -1;
private int exitAnim = -1;

public Bundle getOptionsBundle() {
return optionsCompat;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ public void run() {
ActivityCompat.startActivity(currentContext, intent, postcard.getOptionsBundle());
}

if ((0 != postcard.getEnterAnim() || 0 != postcard.getExitAnim()) && currentContext instanceof Activity) { // Old version.
if ((-1 != postcard.getEnterAnim() && -1 != postcard.getExitAnim()) && currentContext instanceof Activity) { // Old version.
((Activity) currentContext).overridePendingTransition(postcard.getEnterAnim(), postcard.getExitAnim());
}

Expand Down

0 comments on commit e0d1f2b

Please sign in to comment.