Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(android): prevent duplicate launch animation #11394

Merged
merged 1 commit into from
Jan 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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