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

Fixes asynch launchTwa freezing splash screens #297

Merged
merged 5 commits into from
Jun 7, 2021

Conversation

andreban
Copy link
Member

@andreban andreban commented Jun 7, 2021

  • Moved code that builds the splash screen strategy to run on
    onCreate(), so they will already be available when
    onEnterAnimationComplete() is invoked.
  • When finish() is called early, on onCreate(), to bring an
    existing Activity to front, launchTwa() shouldn't be invoked.
  • We update the Firebase demo to reflect that and add a guard in
    launchTwa().

Closes #281

- Moved code that builds the splash screen strategy to run on
  `onCreate()`, so they will already be available when
  `onEnterAnimationComplete()` is invoked.
- When `finish()` is called early, on `onCreate()`, to bring an
  existing Activity to front, `launchTwa()` shouldn't be invoked.
- We update the Firebase demo to reflect that and add a guard in
  `launcTwa()`.
@andreban andreban requested a review from PEConn June 7, 2021 10:12
Copy link
Contributor

@PEConn PEConn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with comment nit.

Comment on lines 39 to 40
// The Activity was finished before the launch because an existing instance of
// the app was brought to front. We don't want to call launchTwa() in this case.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find this comment a little confusing - would you be happy with:

super.onCreate may have called finish, in this case, don't do any work.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@andreban andreban merged commit 52f8353 into GoogleChrome:main Jun 7, 2021
@paulsharratt0
Copy link

You guys work fast, thanks for fixing!

@paulsharratt0
Copy link

Can we bump the version up to include this fix? Thanks!

@andreban
Copy link
Member Author

This has been published on 2.2.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Overriding shouldLaunchImmediately() on the first TWA's launch could have an unexpected behavior
3 participants