mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 01:40:07 +01:00
Fix infinite animation loop when system animations are disabled.
This commit is contained in:
committed by
Greyson Parrelli
parent
2cfa31a9b0
commit
b1d1aee373
@@ -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)
|
||||
}
|
||||
Reference in New Issue
Block a user