Skip to content

Commit 75606bc

Browse files
authored
Fix fire animation (#1199)
* Fix fire animation * Animator duration scale lookup defaults to 0.0f
1 parent ae3bc5a commit 75606bc

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

app/src/main/java/com/duckduckgo/app/global/view/FireDialog.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ import android.animation.Animator
2020
import android.animation.ValueAnimator
2121
import android.content.Context
2222
import android.os.Bundle
23+
import android.provider.Settings
24+
import android.provider.Settings.Global.ANIMATOR_DURATION_SCALE
2325
import androidx.core.content.ContextCompat
2426
import androidx.core.view.doOnDetach
2527
import androidx.core.view.isVisible
@@ -140,7 +142,12 @@ class FireDialog(
140142
}
141143
}
142144

143-
private fun animationEnabled() = settingsDataStore.fireAnimationEnabled
145+
private fun animationEnabled() = settingsDataStore.fireAnimationEnabled && animatorDurationEnabled()
146+
147+
private fun animatorDurationEnabled(): Boolean {
148+
val animatorScale = Settings.Global.getFloat(context.contentResolver, ANIMATOR_DURATION_SCALE, 0.0f)
149+
return animatorScale != 0.0f
150+
}
144151

145152
private fun playAnimation() {
146153
window?.navigationBarColor = ContextCompat.getColor(context, R.color.black)

0 commit comments

Comments
 (0)