Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ado/templates/apple-droid-node-patching.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ steps:
- task: CmdLine@2
displayName: Apply Android specific patches for Office consumption
inputs:
script: node $(System.DefaultWorkingDirectory)/android-patches/bundle/bundle.js patch $(System.DefaultWorkingDirectory) Build OfficeRNHost V8 Focus --patch-store $(System.DefaultWorkingDirectory)/android-patches/patches --log-folder $(System.DefaultWorkingDirectory)/android-patches/logs --confirm ${{ parameters.apply_office_patches }}
script: node $(System.DefaultWorkingDirectory)/android-patches/bundle/bundle.js patch $(System.DefaultWorkingDirectory) Build OfficeRNHost V8 Focus ImageColor --patch-store $(System.DefaultWorkingDirectory)/android-patches/patches --log-folder $(System.DefaultWorkingDirectory)/android-patches/logs --confirm ${{ parameters.apply_office_patches }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
--- "E:\\github\\rnm-63-fresh\\ReactAndroid\\src\\main\\java\\com\\facebook\\react\\uimanager\\ViewManagersPropertyCache.java" 2020-10-27 20:26:16.901168200 -0700
+++ "E:\\github\\rnm-63\\ReactAndroid\\src\\main\\java\\com\\facebook\\react\\uimanager\\ViewManagersPropertyCache.java" 2021-03-09 18:12:54.215475900 -0800
@@ -214,6 +214,29 @@
}
}

+ private static class NullableColorPropSetter extends PropSetter {
+
+ private final int mDefaultValue;
+
+ public NullableColorPropSetter(ReactProp prop, Method setter) {
+ this(prop, setter, 0);
+ }
+
+ public NullableColorPropSetter(ReactProp prop, Method setter, int defaultValue) {
+ super(prop, "mixed", setter);
+ mDefaultValue = defaultValue;
+ }
+
+ @Override
+ protected Object getValueOrDefault(Object value, Context context) {
+ if (value == null) {
+ return null;
+ }
+
+ return ColorPropConverter.getColor(value, context);
+ }
+ }
+
private static class BooleanPropSetter extends PropSetter {

private final boolean mDefaultValue;
@@ -407,6 +430,9 @@
if ("Color".equals(annotation.customType())) {
return new ColorPropSetter(annotation, method, annotation.defaultInt());
}
+ if ("NullableColor".equals(annotation.customType())) {
+ return new NullableColorPropSetter(annotation, method, annotation.defaultInt());
+ }
return new IntPropSetter(annotation, method, annotation.defaultInt());
} else if (propTypeClass == float.class) {
return new FloatPropSetter(annotation, method, annotation.defaultFloat());
@@ -420,6 +446,9 @@
if ("Color".equals(annotation.customType())) {
return new ColorPropSetter(annotation, method);
}
+ if ("NullableColor".equals(annotation.customType())) {
+ return new NullableColorPropSetter(annotation, method, annotation.defaultInt());
+ }
return new BoxedIntPropSetter(annotation, method);
} else if (propTypeClass == ReadableArray.class) {
return new ArrayPropSetter(annotation, method);
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
--- "E:\\github\\rnm-63-fresh\\ReactAndroid\\src\\main\\java\\com\\facebook\\react\\views\\image\\ReactImageManager.java" 2020-10-27 20:26:16.952166400 -0700
+++ "E:\\github\\rnm-63\\ReactAndroid\\src\\main\\java\\com\\facebook\\react\\views\\image\\ReactImageManager.java" 2021-03-09 18:13:37.555129800 -0800
@@ -145,7 +145,7 @@
view.setLoadingIndicatorSource(source);
}

- @ReactProp(name = "borderColor", customType = "Color")
+ @ReactProp(name = "borderColor", customType = "NullableColor")
public void setBorderColor(ReactImageView view, @Nullable Integer borderColor) {
if (borderColor == null) {
view.setBorderColor(Color.TRANSPARENT);
@@ -154,7 +154,7 @@
}
}

- @ReactProp(name = "overlayColor", customType = "Color")
+ @ReactProp(name = "overlayColor", customType = "NullableColor")
public void setOverlayColor(ReactImageView view, @Nullable Integer overlayColor) {
if (overlayColor == null) {
view.setOverlayColor(Color.TRANSPARENT);
@@ -209,7 +209,7 @@
}
}

- @ReactProp(name = "tintColor", customType = "Color")
+ @ReactProp(name = "tintColor", customType = "NullableColor")
public void setTintColor(ReactImageView view, @Nullable Integer tintColor) {
if (tintColor == null) {
view.clearColorFilter();