Fix infinite animation loop when system animations are disabled.

This commit is contained in:
Alex Hart
2022-11-08 09:51:06 -04:00
committed by Greyson Parrelli
parent 2cfa31a9b0
commit b1d1aee373
2 changed files with 16 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
package org.thoughtcrime.securesms.util
import android.content.ContentResolver
import android.provider.Settings
fun ContentResolver.areSystemAnimationsDisabled(): Boolean {
val durationScale = Settings.System.getFloat(this, Settings.Global.ANIMATOR_DURATION_SCALE)
val transitionScale = Settings.System.getFloat(this, Settings.Global.TRANSITION_ANIMATION_SCALE)
return !(durationScale > 0f && transitionScale > 0f)
}