Address overridePendingTransition deprecation (#410)

This function is deprecated starting with API 34 "UpsideDownCake" and
should be replaced with `overrideActivityTransition`.
This commit is contained in:
MajorTanya
2024-02-17 16:26:47 +01:00
committed by GitHub
parent 1b0bbb8440
commit 840b647b4b
3 changed files with 51 additions and 5 deletions
@@ -1,6 +1,8 @@
package eu.kanade.tachiyomi.ui.base.delegate
import android.app.Activity
import android.content.Intent
import android.os.Build
import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.DefaultLifecycleObserver
import androidx.lifecycle.LifecycleOwner
@@ -106,7 +108,12 @@ class SecureActivityDelegateImpl : SecureActivityDelegate, DefaultLifecycleObser
if (activity.isAuthenticationSupported()) {
if (!SecureActivityDelegate.requireUnlock) return
activity.startActivity(Intent(activity, UnlockActivity::class.java))
activity.overridePendingTransition(0, 0)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
activity.overrideActivityTransition(Activity.OVERRIDE_TRANSITION_OPEN, 0, 0)
} else {
@Suppress("DEPRECATION")
activity.overridePendingTransition(0, 0)
}
} else {
securityPreferences.useAuthenticator().set(false)
}