Skip to content

Commit

Permalink
fix(android): prevent duplicate launch animation
Browse files Browse the repository at this point in the history
  • Loading branch information
Gary Mathews committed Dec 21, 2019
1 parent f687e3b commit deb0106
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 deb0106

Please sign in to comment.