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

Add backwards compatible implementation of overrideActivityTransition() #4408

Merged

Conversation

cbeyls
Copy link
Contributor

@cbeyls cbeyls commented May 3, 2024

This pull request adds overrideActivityTransitionCompat(), a backwards-compatible version of Activity.overrideActivityTransition() to be called in Activity.onCreate() in all Android versions.

This avoids duplicating the transition logic in different places of the app to support older Android versions (in the activity launching code, in Activity.onCreate() or in Activity.finish()).

  • On API 34+, the implementation simply delegates to Activity.overrideActivityTransition().
  • On API < 34, the implementation calls Activity.overridePendingTransition() either immediately (opening transition) or schedules it to be called later when the Activity is finishing (closing transition).
  • Rename ActivityExensions.kt to ActivityExtensions.kt (fix typo).

@connyduck connyduck merged commit d151895 into tuskyapp:develop May 10, 2024
3 checks passed
@cbeyls cbeyls deleted the refactor/override_activity_transition branch May 10, 2024 16:45
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.

None yet

2 participants