From ded734ce74b537a821119936942de6d9176f21c7 Mon Sep 17 00:00:00 2001 From: Jasper Reddin Date: Fri, 7 Oct 2022 11:23:49 -0500 Subject: [PATCH] fix: restore compatibility with react-native <0.68 (#1890) --- android/src/main/java/com/horcrux/svg/SvgViewManager.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/android/src/main/java/com/horcrux/svg/SvgViewManager.java b/android/src/main/java/com/horcrux/svg/SvgViewManager.java index c6258854d..54aa57af4 100644 --- a/android/src/main/java/com/horcrux/svg/SvgViewManager.java +++ b/android/src/main/java/com/horcrux/svg/SvgViewManager.java @@ -21,6 +21,7 @@ import com.facebook.react.views.view.ReactViewManager; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import java.util.Locale; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -174,7 +175,8 @@ public void setPointerEvents(SvgView view, @Nullable String pointerEventsStr) { if (superclass != null) { Method method = superclass.getDeclaredMethod("setPointerEvents", PointerEvents.class); method.setAccessible(true); - method.invoke(view, PointerEvents.parsePointerEvents(pointerEventsStr)); + method.invoke( + view, PointerEvents.valueOf(pointerEventsStr.toUpperCase(Locale.US).replace("-", "_"))); } } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e) { e.printStackTrace();