1
0
Fork 0

For #689: Adds fade animation to Android <9.0

master
Sawyer Blatz 2019-04-09 09:16:31 -07:00 committed by Colin Lee
parent e6044e56ad
commit 36e9939d9e
1 changed files with 9 additions and 1 deletions

View File

@ -6,6 +6,7 @@ package org.mozilla.fenix
import android.content.Context
import android.content.Intent
import android.os.Build
import android.os.Bundle
import android.preference.PreferenceManager
import android.util.AttributeSet
@ -43,7 +44,14 @@ open class HomeActivity : AppCompatActivity() {
val themeManager = DefaultThemeManager().also {
it.onThemeChange = { theme ->
setTheme(theme)
recreate()
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) {
// Older versions of android do not support window animation style, so we use a transition instead
finish()
overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out)
startActivity(intent)
} else {
recreate()
}
}
}