Skip to content

Commit 2c7356a

Browse files
authored
Merge pull request lottie-react-native#634 from muratakkas/fix/colorfilter-android
fix(colorfilter): colorfilter path issue has been fixed for android
2 parents 692fbdb + 073d68b commit 2c7356a

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/android/src/main/java/com/airbnb/android/react/lottie/LottieAnimationViewPropertyManager.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import com.facebook.react.bridge.ReadableArray;
1515
import com.facebook.react.bridge.ReadableMap;
1616
import java.lang.ref.WeakReference;
17-
17+
import java.util.regex.Pattern;
1818
/**
1919
* Class responsible for applying the properties to the LottieView.
2020
* The way react-native works makes it impossible to predict in which order properties will be set,
@@ -156,7 +156,9 @@ public void commitChanges() {
156156
String color = current.getString("color");
157157
String path = current.getString("keypath");
158158
SimpleColorFilter colorFilter = new SimpleColorFilter(Color.parseColor(color));
159-
KeyPath keyPath = new KeyPath(path, "**");
159+
String pathWithGlobstar = path +".**";
160+
String[] keys = pathWithGlobstar.split(Pattern.quote("."));
161+
KeyPath keyPath = new KeyPath(keys);
160162
LottieValueCallback<ColorFilter> callback = new LottieValueCallback<>(colorFilter);
161163
view.addValueCallback(keyPath, LottieProperty.COLOR_FILTER, callback);
162164
}

0 commit comments

Comments
 (0)