Tusky
Tusky copied to clipboard
Add backwards compatible implementation of overrideActivityTransition()
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
toActivityExtensions.kt
(fix typo).