diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/layoutanimation/InterpolatorType.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/layoutanimation/InterpolatorType.java index e92b6b54f..9334ab28a 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/layoutanimation/InterpolatorType.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/layoutanimation/InterpolatorType.java @@ -5,6 +5,8 @@ package com.facebook.react.uimanager.layoutanimation; +import java.util.Locale; + /** * Enum representing the different interpolators that can be used in layout animation configuration. */ @@ -16,7 +18,7 @@ package com.facebook.react.uimanager.layoutanimation; SPRING; public static InterpolatorType fromString(String name) { - switch (name.toLowerCase()) { + switch (name.toLowerCase(Locale.US)) { case "linear": return LINEAR; case "easein": diff --git a/ReactAndroid/src/test/java/com/facebook/react/uimanager/layoutanimation/InterpolatorTypeTest.java b/ReactAndroid/src/test/java/com/facebook/react/uimanager/layoutanimation/InterpolatorTypeTest.java index b28fad7bb..291d1c4fa 100644 --- a/ReactAndroid/src/test/java/com/facebook/react/uimanager/layoutanimation/InterpolatorTypeTest.java +++ b/ReactAndroid/src/test/java/com/facebook/react/uimanager/layoutanimation/InterpolatorTypeTest.java @@ -8,6 +8,7 @@ package com.facebook.react.uimanager.layoutanimation; import com.facebook.react.uimanager.layoutanimation.InterpolatorType; +import java.util.Locale; import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.RobolectricTestRunner; @@ -32,6 +33,12 @@ public class InterpolatorTypeTest { assertThat(InterpolatorType.fromString("easeineaseout")).isEqualTo(InterpolatorType.EASE_IN_EASE_OUT); } + @Test + public void testLocales() { + Locale.setDefault(Locale.forLanguageTag("tr-TR")); + assertThat(InterpolatorType.fromString("easeInEaseOut")).isEqualTo(InterpolatorType.EASE_IN_EASE_OUT); + } + @Test(expected = IllegalArgumentException.class) public void testInvalidInterpolatorTypes() throws IllegalArgumentException { InterpolatorType.fromString("ease_in_ease_out");