Skip to content

Commit

Permalink
fix(android): prevent duplicate launch animation (#11394)
Browse files Browse the repository at this point in the history
Fixes TIMOB-27684
  • Loading branch information
garymathews authored and sgtcoolguy committed Jan 2, 2020
1 parent f687e3b commit 135e3dc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,18 @@ public static TiApplication getInstance()
return tiApp;
}

/**
* Determine if activity is first on stack.
* @return boolean to determine if activity is first.
*/
public static boolean firstOnActivityStack()
{
if (activityStack.size() == 1) {
return true;
}
return false;
}

public static void addToActivityStack(Activity activity)
{
if (activity != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,12 @@ protected void onResume()
Log.d(TAG, "Launched in " + (SystemClock.uptimeMillis() - TiApplication.START_TIME_MS) + " ms");
}
super.onResume();

// Prevent duplicate launch animation.
// Windows opened before TiRootActivity has animated may cause an unwanted stutter animation.
if (TiApplication.firstOnActivityStack()) {
overridePendingTransition(0, 0);
}
}

@Override
Expand Down

0 comments on commit 135e3dc

Please sign in to comment.