Tusky icon indicating copy to clipboard operation
Tusky copied to clipboard

Add backwards compatible implementation of overrideActivityTransition()

Open cbeyls opened this issue 2 months ago • 0 comments

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).

cbeyls avatar May 03 '24 11:05 cbeyls