Skip to content

Commit

Permalink
chore: update fill types
Browse files Browse the repository at this point in the history
  • Loading branch information
jakex7 committed Oct 2, 2024
1 parent 9384cc5 commit f28f1da
Show file tree
Hide file tree
Showing 34 changed files with 68 additions and 100 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import com.facebook.react.bridge.ColorPropConverter;
import com.facebook.react.bridge.DynamicFromObject;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.uimanager.BaseViewManagerDelegate;
import com.facebook.react.uimanager.BaseViewManagerInterface;

Expand Down Expand Up @@ -65,7 +64,7 @@ public void setProperty(T view, String propName, @Nullable Object value) {
mViewManager.setColor(view, ColorPropConverter.getColor(value, view.getContext()));
break;
case "fill":
mViewManager.setFill(view, (ReadableMap) value);
mViewManager.setFill(view, new DynamicFromObject(value));
break;
case "fillOpacity":
mViewManager.setFillOpacity(view, value == null ? 1f : ((Double) value).floatValue());
Expand All @@ -74,7 +73,7 @@ public void setProperty(T view, String propName, @Nullable Object value) {
mViewManager.setFillRule(view, value == null ? 1 : ((Double) value).intValue());
break;
case "stroke":
mViewManager.setStroke(view, (ReadableMap) value);
mViewManager.setStroke(view, new DynamicFromObject(value));
break;
case "strokeOpacity":
mViewManager.setStrokeOpacity(view, value == null ? 1f : ((Double) value).floatValue());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import androidx.annotation.Nullable;
import com.facebook.react.bridge.Dynamic;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;

public interface RNSVGCircleManagerInterface<T extends View> {
void setName(T view, @Nullable String value);
Expand All @@ -29,10 +28,10 @@ public interface RNSVGCircleManagerInterface<T extends View> {
void setDisplay(T view, @Nullable String value);
void setPointerEvents(T view, @Nullable String value);
void setColor(T view, @Nullable Integer value);
void setFill(T view, @Nullable ReadableMap value);
void setFill(T view, Dynamic value);
void setFillOpacity(T view, float value);
void setFillRule(T view, int value);
void setStroke(T view, @Nullable ReadableMap value);
void setStroke(T view, Dynamic value);
void setStrokeOpacity(T view, float value);
void setStrokeWidth(T view, Dynamic value);
void setStrokeLinecap(T view, int value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import com.facebook.react.bridge.ColorPropConverter;
import com.facebook.react.bridge.DynamicFromObject;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.uimanager.BaseViewManagerDelegate;
import com.facebook.react.uimanager.BaseViewManagerInterface;

Expand Down Expand Up @@ -65,7 +64,7 @@ public void setProperty(T view, String propName, @Nullable Object value) {
mViewManager.setColor(view, ColorPropConverter.getColor(value, view.getContext()));
break;
case "fill":
mViewManager.setFill(view, (ReadableMap) value);
mViewManager.setFill(view, new DynamicFromObject(value));
break;
case "fillOpacity":
mViewManager.setFillOpacity(view, value == null ? 1f : ((Double) value).floatValue());
Expand All @@ -74,7 +73,7 @@ public void setProperty(T view, String propName, @Nullable Object value) {
mViewManager.setFillRule(view, value == null ? 1 : ((Double) value).intValue());
break;
case "stroke":
mViewManager.setStroke(view, (ReadableMap) value);
mViewManager.setStroke(view, new DynamicFromObject(value));
break;
case "strokeOpacity":
mViewManager.setStrokeOpacity(view, value == null ? 1f : ((Double) value).floatValue());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import androidx.annotation.Nullable;
import com.facebook.react.bridge.Dynamic;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;

public interface RNSVGClipPathManagerInterface<T extends View> {
void setName(T view, @Nullable String value);
Expand All @@ -29,10 +28,10 @@ public interface RNSVGClipPathManagerInterface<T extends View> {
void setDisplay(T view, @Nullable String value);
void setPointerEvents(T view, @Nullable String value);
void setColor(T view, @Nullable Integer value);
void setFill(T view, @Nullable ReadableMap value);
void setFill(T view, Dynamic value);
void setFillOpacity(T view, float value);
void setFillRule(T view, int value);
void setStroke(T view, @Nullable ReadableMap value);
void setStroke(T view, Dynamic value);
void setStrokeOpacity(T view, float value);
void setStrokeWidth(T view, Dynamic value);
void setStrokeLinecap(T view, int value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import com.facebook.react.bridge.ColorPropConverter;
import com.facebook.react.bridge.DynamicFromObject;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.uimanager.BaseViewManagerDelegate;
import com.facebook.react.uimanager.BaseViewManagerInterface;

Expand Down Expand Up @@ -65,7 +64,7 @@ public void setProperty(T view, String propName, @Nullable Object value) {
mViewManager.setColor(view, ColorPropConverter.getColor(value, view.getContext()));
break;
case "fill":
mViewManager.setFill(view, (ReadableMap) value);
mViewManager.setFill(view, new DynamicFromObject(value));
break;
case "fillOpacity":
mViewManager.setFillOpacity(view, value == null ? 1f : ((Double) value).floatValue());
Expand All @@ -74,7 +73,7 @@ public void setProperty(T view, String propName, @Nullable Object value) {
mViewManager.setFillRule(view, value == null ? 1 : ((Double) value).intValue());
break;
case "stroke":
mViewManager.setStroke(view, (ReadableMap) value);
mViewManager.setStroke(view, new DynamicFromObject(value));
break;
case "strokeOpacity":
mViewManager.setStrokeOpacity(view, value == null ? 1f : ((Double) value).floatValue());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import androidx.annotation.Nullable;
import com.facebook.react.bridge.Dynamic;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;

public interface RNSVGEllipseManagerInterface<T extends View> {
void setName(T view, @Nullable String value);
Expand All @@ -29,10 +28,10 @@ public interface RNSVGEllipseManagerInterface<T extends View> {
void setDisplay(T view, @Nullable String value);
void setPointerEvents(T view, @Nullable String value);
void setColor(T view, @Nullable Integer value);
void setFill(T view, @Nullable ReadableMap value);
void setFill(T view, Dynamic value);
void setFillOpacity(T view, float value);
void setFillRule(T view, int value);
void setStroke(T view, @Nullable ReadableMap value);
void setStroke(T view, Dynamic value);
void setStrokeOpacity(T view, float value);
void setStrokeWidth(T view, Dynamic value);
void setStrokeLinecap(T view, int value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import com.facebook.react.bridge.ColorPropConverter;
import com.facebook.react.bridge.DynamicFromObject;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.uimanager.BaseViewManagerDelegate;
import com.facebook.react.uimanager.BaseViewManagerInterface;

Expand Down Expand Up @@ -65,7 +64,7 @@ public void setProperty(T view, String propName, @Nullable Object value) {
mViewManager.setColor(view, ColorPropConverter.getColor(value, view.getContext()));
break;
case "fill":
mViewManager.setFill(view, (ReadableMap) value);
mViewManager.setFill(view, new DynamicFromObject(value));
break;
case "fillOpacity":
mViewManager.setFillOpacity(view, value == null ? 1f : ((Double) value).floatValue());
Expand All @@ -74,7 +73,7 @@ public void setProperty(T view, String propName, @Nullable Object value) {
mViewManager.setFillRule(view, value == null ? 1 : ((Double) value).intValue());
break;
case "stroke":
mViewManager.setStroke(view, (ReadableMap) value);
mViewManager.setStroke(view, new DynamicFromObject(value));
break;
case "strokeOpacity":
mViewManager.setStrokeOpacity(view, value == null ? 1f : ((Double) value).floatValue());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import androidx.annotation.Nullable;
import com.facebook.react.bridge.Dynamic;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;

public interface RNSVGForeignObjectManagerInterface<T extends View> {
void setName(T view, @Nullable String value);
Expand All @@ -29,10 +28,10 @@ public interface RNSVGForeignObjectManagerInterface<T extends View> {
void setDisplay(T view, @Nullable String value);
void setPointerEvents(T view, @Nullable String value);
void setColor(T view, @Nullable Integer value);
void setFill(T view, @Nullable ReadableMap value);
void setFill(T view, Dynamic value);
void setFillOpacity(T view, float value);
void setFillRule(T view, int value);
void setStroke(T view, @Nullable ReadableMap value);
void setStroke(T view, Dynamic value);
void setStrokeOpacity(T view, float value);
void setStrokeWidth(T view, Dynamic value);
void setStrokeLinecap(T view, int value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import com.facebook.react.bridge.ColorPropConverter;
import com.facebook.react.bridge.DynamicFromObject;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.uimanager.BaseViewManagerDelegate;
import com.facebook.react.uimanager.BaseViewManagerInterface;

Expand Down Expand Up @@ -65,7 +64,7 @@ public void setProperty(T view, String propName, @Nullable Object value) {
mViewManager.setColor(view, ColorPropConverter.getColor(value, view.getContext()));
break;
case "fill":
mViewManager.setFill(view, (ReadableMap) value);
mViewManager.setFill(view, new DynamicFromObject(value));
break;
case "fillOpacity":
mViewManager.setFillOpacity(view, value == null ? 1f : ((Double) value).floatValue());
Expand All @@ -74,7 +73,7 @@ public void setProperty(T view, String propName, @Nullable Object value) {
mViewManager.setFillRule(view, value == null ? 1 : ((Double) value).intValue());
break;
case "stroke":
mViewManager.setStroke(view, (ReadableMap) value);
mViewManager.setStroke(view, new DynamicFromObject(value));
break;
case "strokeOpacity":
mViewManager.setStrokeOpacity(view, value == null ? 1f : ((Double) value).floatValue());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import androidx.annotation.Nullable;
import com.facebook.react.bridge.Dynamic;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;

public interface RNSVGGroupManagerInterface<T extends View> {
void setName(T view, @Nullable String value);
Expand All @@ -29,10 +28,10 @@ public interface RNSVGGroupManagerInterface<T extends View> {
void setDisplay(T view, @Nullable String value);
void setPointerEvents(T view, @Nullable String value);
void setColor(T view, @Nullable Integer value);
void setFill(T view, @Nullable ReadableMap value);
void setFill(T view, Dynamic value);
void setFillOpacity(T view, float value);
void setFillRule(T view, int value);
void setStroke(T view, @Nullable ReadableMap value);
void setStroke(T view, Dynamic value);
void setStrokeOpacity(T view, float value);
void setStrokeWidth(T view, Dynamic value);
void setStrokeLinecap(T view, int value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void setProperty(T view, String propName, @Nullable Object value) {
mViewManager.setColor(view, ColorPropConverter.getColor(value, view.getContext()));
break;
case "fill":
mViewManager.setFill(view, (ReadableMap) value);
mViewManager.setFill(view, new DynamicFromObject(value));
break;
case "fillOpacity":
mViewManager.setFillOpacity(view, value == null ? 1f : ((Double) value).floatValue());
Expand All @@ -74,7 +74,7 @@ public void setProperty(T view, String propName, @Nullable Object value) {
mViewManager.setFillRule(view, value == null ? 1 : ((Double) value).intValue());
break;
case "stroke":
mViewManager.setStroke(view, (ReadableMap) value);
mViewManager.setStroke(view, new DynamicFromObject(value));
break;
case "strokeOpacity":
mViewManager.setStrokeOpacity(view, value == null ? 1f : ((Double) value).floatValue());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ public interface RNSVGImageManagerInterface<T extends View> {
void setDisplay(T view, @Nullable String value);
void setPointerEvents(T view, @Nullable String value);
void setColor(T view, @Nullable Integer value);
void setFill(T view, @Nullable ReadableMap value);
void setFill(T view, Dynamic value);
void setFillOpacity(T view, float value);
void setFillRule(T view, int value);
void setStroke(T view, @Nullable ReadableMap value);
void setStroke(T view, Dynamic value);
void setStrokeOpacity(T view, float value);
void setStrokeWidth(T view, Dynamic value);
void setStrokeLinecap(T view, int value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import com.facebook.react.bridge.ColorPropConverter;
import com.facebook.react.bridge.DynamicFromObject;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.uimanager.BaseViewManagerDelegate;
import com.facebook.react.uimanager.BaseViewManagerInterface;

Expand Down Expand Up @@ -65,7 +64,7 @@ public void setProperty(T view, String propName, @Nullable Object value) {
mViewManager.setColor(view, ColorPropConverter.getColor(value, view.getContext()));
break;
case "fill":
mViewManager.setFill(view, (ReadableMap) value);
mViewManager.setFill(view, new DynamicFromObject(value));
break;
case "fillOpacity":
mViewManager.setFillOpacity(view, value == null ? 1f : ((Double) value).floatValue());
Expand All @@ -74,7 +73,7 @@ public void setProperty(T view, String propName, @Nullable Object value) {
mViewManager.setFillRule(view, value == null ? 1 : ((Double) value).intValue());
break;
case "stroke":
mViewManager.setStroke(view, (ReadableMap) value);
mViewManager.setStroke(view, new DynamicFromObject(value));
break;
case "strokeOpacity":
mViewManager.setStrokeOpacity(view, value == null ? 1f : ((Double) value).floatValue());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import androidx.annotation.Nullable;
import com.facebook.react.bridge.Dynamic;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;

public interface RNSVGLineManagerInterface<T extends View> {
void setName(T view, @Nullable String value);
Expand All @@ -29,10 +28,10 @@ public interface RNSVGLineManagerInterface<T extends View> {
void setDisplay(T view, @Nullable String value);
void setPointerEvents(T view, @Nullable String value);
void setColor(T view, @Nullable Integer value);
void setFill(T view, @Nullable ReadableMap value);
void setFill(T view, Dynamic value);
void setFillOpacity(T view, float value);
void setFillRule(T view, int value);
void setStroke(T view, @Nullable ReadableMap value);
void setStroke(T view, Dynamic value);
void setStrokeOpacity(T view, float value);
void setStrokeWidth(T view, Dynamic value);
void setStrokeLinecap(T view, int value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import com.facebook.react.bridge.ColorPropConverter;
import com.facebook.react.bridge.DynamicFromObject;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.uimanager.BaseViewManagerDelegate;
import com.facebook.react.uimanager.BaseViewManagerInterface;

Expand Down Expand Up @@ -65,7 +64,7 @@ public void setProperty(T view, String propName, @Nullable Object value) {
mViewManager.setColor(view, ColorPropConverter.getColor(value, view.getContext()));
break;
case "fill":
mViewManager.setFill(view, (ReadableMap) value);
mViewManager.setFill(view, new DynamicFromObject(value));
break;
case "fillOpacity":
mViewManager.setFillOpacity(view, value == null ? 1f : ((Double) value).floatValue());
Expand All @@ -74,7 +73,7 @@ public void setProperty(T view, String propName, @Nullable Object value) {
mViewManager.setFillRule(view, value == null ? 1 : ((Double) value).intValue());
break;
case "stroke":
mViewManager.setStroke(view, (ReadableMap) value);
mViewManager.setStroke(view, new DynamicFromObject(value));
break;
case "strokeOpacity":
mViewManager.setStrokeOpacity(view, value == null ? 1f : ((Double) value).floatValue());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import androidx.annotation.Nullable;
import com.facebook.react.bridge.Dynamic;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;

public interface RNSVGMarkerManagerInterface<T extends View> {
void setName(T view, @Nullable String value);
Expand All @@ -29,10 +28,10 @@ public interface RNSVGMarkerManagerInterface<T extends View> {
void setDisplay(T view, @Nullable String value);
void setPointerEvents(T view, @Nullable String value);
void setColor(T view, @Nullable Integer value);
void setFill(T view, @Nullable ReadableMap value);
void setFill(T view, Dynamic value);
void setFillOpacity(T view, float value);
void setFillRule(T view, int value);
void setStroke(T view, @Nullable ReadableMap value);
void setStroke(T view, Dynamic value);
void setStrokeOpacity(T view, float value);
void setStrokeWidth(T view, Dynamic value);
void setStrokeLinecap(T view, int value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import com.facebook.react.bridge.ColorPropConverter;
import com.facebook.react.bridge.DynamicFromObject;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.uimanager.BaseViewManagerDelegate;
import com.facebook.react.uimanager.BaseViewManagerInterface;

Expand Down Expand Up @@ -65,7 +64,7 @@ public void setProperty(T view, String propName, @Nullable Object value) {
mViewManager.setColor(view, ColorPropConverter.getColor(value, view.getContext()));
break;
case "fill":
mViewManager.setFill(view, (ReadableMap) value);
mViewManager.setFill(view, new DynamicFromObject(value));
break;
case "fillOpacity":
mViewManager.setFillOpacity(view, value == null ? 1f : ((Double) value).floatValue());
Expand All @@ -74,7 +73,7 @@ public void setProperty(T view, String propName, @Nullable Object value) {
mViewManager.setFillRule(view, value == null ? 1 : ((Double) value).intValue());
break;
case "stroke":
mViewManager.setStroke(view, (ReadableMap) value);
mViewManager.setStroke(view, new DynamicFromObject(value));
break;
case "strokeOpacity":
mViewManager.setStrokeOpacity(view, value == null ? 1f : ((Double) value).floatValue());
Expand Down
Loading

0 comments on commit f28f1da

Please sign in to comment.