Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: transfer specs to ts and remove unnecessary props #1865

Merged
merged 12 commits into from
Sep 14, 2022
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
4 changes: 0 additions & 4 deletions android/src/main/java/com/horcrux/svg/CircleView.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import android.graphics.Path;
import com.facebook.react.bridge.Dynamic;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.uimanager.annotations.ReactProp;

@SuppressLint("ViewConstructor")
class CircleView extends RenderableView {
Expand All @@ -26,7 +25,6 @@ public CircleView(ReactContext reactContext) {
super(reactContext);
}

@ReactProp(name = "cx")
public void setCx(Dynamic cx) {
mCx = SVGLength.from(cx);
invalidate();
Expand All @@ -37,7 +35,6 @@ public void setCx(String cx) {
invalidate();
}

@ReactProp(name = "cy")
public void setCy(Dynamic cy) {
mCy = SVGLength.from(cy);
invalidate();
Expand All @@ -48,7 +45,6 @@ public void setCy(String cy) {
invalidate();
}

@ReactProp(name = "r")
public void setR(Dynamic r) {
mR = SVGLength.from(r);
invalidate();
Expand Down
5 changes: 0 additions & 5 deletions android/src/main/java/com/horcrux/svg/EllipseView.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import android.graphics.RectF;
import com.facebook.react.bridge.Dynamic;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.uimanager.annotations.ReactProp;

@SuppressLint("ViewConstructor")
class EllipseView extends RenderableView {
Expand All @@ -28,7 +27,6 @@ public EllipseView(ReactContext reactContext) {
super(reactContext);
}

@ReactProp(name = "cx")
public void setCx(Dynamic cx) {
mCx = SVGLength.from(cx);
invalidate();
Expand All @@ -39,7 +37,6 @@ public void setCx(String cx) {
invalidate();
}

@ReactProp(name = "cy")
public void setCy(Dynamic cy) {
mCy = SVGLength.from(cy);
invalidate();
Expand All @@ -50,7 +47,6 @@ public void setCy(String cy) {
invalidate();
}

@ReactProp(name = "rx")
public void setRx(Dynamic rx) {
mRx = SVGLength.from(rx);
invalidate();
Expand All @@ -61,7 +57,6 @@ public void setRx(String rx) {
invalidate();
}

@ReactProp(name = "ry")
public void setRy(Dynamic ry) {
mRy = SVGLength.from(ry);
invalidate();
Expand Down
5 changes: 0 additions & 5 deletions android/src/main/java/com/horcrux/svg/ForeignObjectView.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import androidx.annotation.NonNull;
import com.facebook.react.bridge.Dynamic;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.uimanager.annotations.ReactProp;

@SuppressLint("ViewConstructor")
class ForeignObjectView extends GroupView {
Expand Down Expand Up @@ -48,7 +47,6 @@ public void onDescendantInvalidated(@NonNull View child, @NonNull View target) {
invalidate();
}

@ReactProp(name = "x")
public void setX(Dynamic x) {
mX = SVGLength.from(x);
invalidate();
Expand All @@ -59,7 +57,6 @@ public void setX(String x) {
invalidate();
}

@ReactProp(name = "y")
public void setY(Dynamic y) {
mY = SVGLength.from(y);
invalidate();
Expand All @@ -70,7 +67,6 @@ public void setY(String y) {
invalidate();
}

@ReactProp(name = "width")
public void setWidth(Dynamic width) {
mW = SVGLength.from(width);
invalidate();
Expand All @@ -81,7 +77,6 @@ public void setWidth(String width) {
invalidate();
}

@ReactProp(name = "height")
public void setHeight(Dynamic height) {
mH = SVGLength.from(height);
invalidate();
Expand Down
2 changes: 0 additions & 2 deletions android/src/main/java/com/horcrux/svg/GroupView.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import android.view.View;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.uimanager.annotations.ReactProp;
import javax.annotation.Nullable;

@SuppressLint("ViewConstructor")
Expand All @@ -32,7 +31,6 @@ public GroupView(ReactContext reactContext) {
super(reactContext);
}

@ReactProp(name = "font")
public void setFont(@Nullable ReadableMap font) {
mFont = font;
invalidate();
Expand Down
8 changes: 0 additions & 8 deletions android/src/main/java/com/horcrux/svg/ImageView.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.common.ReactConstants;
import com.facebook.react.uimanager.annotations.ReactProp;
import com.facebook.react.views.imagehelper.ImageSource;
import com.facebook.react.views.imagehelper.ResourceDrawableIdHelper;
import java.util.concurrent.atomic.AtomicBoolean;
Expand All @@ -54,7 +53,6 @@ public ImageView(ReactContext reactContext) {
super(reactContext);
}

@ReactProp(name = "x")
public void setX(Dynamic x) {
mX = SVGLength.from(x);
invalidate();
Expand All @@ -65,7 +63,6 @@ public void setX(String x) {
invalidate();
}

@ReactProp(name = "y")
public void setY(Dynamic y) {
mY = SVGLength.from(y);
invalidate();
Expand All @@ -76,7 +73,6 @@ public void setY(String y) {
invalidate();
}

@ReactProp(name = "width")
public void setWidth(Dynamic width) {
mW = SVGLength.from(width);
invalidate();
Expand All @@ -87,7 +83,6 @@ public void setWidth(String width) {
invalidate();
}

@ReactProp(name = "height")
public void setHeight(Dynamic height) {
mH = SVGLength.from(height);
invalidate();
Expand All @@ -98,7 +93,6 @@ public void setHeight(String height) {
invalidate();
}

@ReactProp(name = "src")
public void setSrc(@Nullable ReadableMap src) {
if (src != null) {
uriString = src.getString("uri");
Expand All @@ -122,13 +116,11 @@ public void setSrc(@Nullable ReadableMap src) {
}
}

@ReactProp(name = "align")
public void setAlign(String align) {
mAlign = align;
invalidate();
}

@ReactProp(name = "meetOrSlice")
public void setMeetOrSlice(int meetOrSlice) {
mMeetOrSlice = meetOrSlice;
invalidate();
Expand Down
5 changes: 0 additions & 5 deletions android/src/main/java/com/horcrux/svg/LineView.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import android.graphics.Path;
import com.facebook.react.bridge.Dynamic;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.uimanager.annotations.ReactProp;

@SuppressLint("ViewConstructor")
class LineView extends RenderableView {
Expand All @@ -27,7 +26,6 @@ public LineView(ReactContext reactContext) {
super(reactContext);
}

@ReactProp(name = "x1")
public void setX1(Dynamic x1) {
mX1 = SVGLength.from(x1);
invalidate();
Expand All @@ -38,7 +36,6 @@ public void setX1(String x1) {
invalidate();
}

@ReactProp(name = "y1")
public void setY1(Dynamic y1) {
mY1 = SVGLength.from(y1);
invalidate();
Expand All @@ -49,7 +46,6 @@ public void setY1(String y1) {
invalidate();
}

@ReactProp(name = "x2")
public void setX2(Dynamic x2) {
mX2 = SVGLength.from(x2);
invalidate();
Expand All @@ -60,7 +56,6 @@ public void setX2(String x2) {
invalidate();
}

@ReactProp(name = "y2")
public void setY2(Dynamic y2) {
mY2 = SVGLength.from(y2);
invalidate();
Expand Down
8 changes: 0 additions & 8 deletions android/src/main/java/com/horcrux/svg/LinearGradientView.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.common.ReactConstants;
import com.facebook.react.uimanager.annotations.ReactProp;
import javax.annotation.Nullable;

@SuppressLint("ViewConstructor")
Expand All @@ -40,7 +39,6 @@ public LinearGradientView(ReactContext reactContext) {
super(reactContext);
}

@ReactProp(name = "x1")
public void setX1(Dynamic x1) {
mX1 = SVGLength.from(x1);
invalidate();
Expand All @@ -51,7 +49,6 @@ public void setX1(String x1) {
invalidate();
}

@ReactProp(name = "y1")
public void setY1(Dynamic y1) {
mY1 = SVGLength.from(y1);
invalidate();
Expand All @@ -62,7 +59,6 @@ public void setY1(String y1) {
invalidate();
}

@ReactProp(name = "x2")
public void setX2(Dynamic x2) {
mX2 = SVGLength.from(x2);
invalidate();
Expand All @@ -73,7 +69,6 @@ public void setX2(String x2) {
invalidate();
}

@ReactProp(name = "y2")
public void setY2(Dynamic y2) {
mY2 = SVGLength.from(y2);
invalidate();
Expand All @@ -84,13 +79,11 @@ public void setY2(String y2) {
invalidate();
}

@ReactProp(name = "gradient")
public void setGradient(ReadableArray gradient) {
mGradient = gradient;
invalidate();
}

@ReactProp(name = "gradientUnits")
public void setGradientUnits(int gradientUnits) {
switch (gradientUnits) {
case 0:
Expand All @@ -103,7 +96,6 @@ public void setGradientUnits(int gradientUnits) {
invalidate();
}

@ReactProp(name = "gradientTransform")
public void setGradientTransform(@Nullable ReadableArray matrixArray) {
if (matrixArray != null) {
int matrixSize = PropHelper.toMatrixData(matrixArray, sRawMatrix, mScale);
Expand Down
13 changes: 0 additions & 13 deletions android/src/main/java/com/horcrux/svg/MarkerView.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import android.view.View;
import com.facebook.react.bridge.Dynamic;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.uimanager.annotations.ReactProp;

@SuppressLint("ViewConstructor")
class MarkerView extends GroupView {
Expand All @@ -41,7 +40,6 @@ public MarkerView(ReactContext reactContext) {
super(reactContext);
}

@ReactProp(name = "refX")
public void setRefX(Dynamic refX) {
mRefX = SVGLength.from(refX);
invalidate();
Expand All @@ -52,7 +50,6 @@ public void setRefX(String refX) {
invalidate();
}

@ReactProp(name = "refY")
public void setRefY(Dynamic refY) {
mRefY = SVGLength.from(refY);
invalidate();
Expand All @@ -63,7 +60,6 @@ public void setRefY(String refY) {
invalidate();
}

@ReactProp(name = "markerWidth")
public void setMarkerWidth(Dynamic markerWidth) {
mMarkerWidth = SVGLength.from(markerWidth);
invalidate();
Expand All @@ -74,7 +70,6 @@ public void setMarkerWidth(String markerWidth) {
invalidate();
}

@ReactProp(name = "markerHeight")
public void setMarkerHeight(Dynamic markerHeight) {
mMarkerHeight = SVGLength.from(markerHeight);
invalidate();
Expand All @@ -85,49 +80,41 @@ public void setMarkerHeight(String markerHeight) {
invalidate();
}

@ReactProp(name = "markerUnits")
public void setMarkerUnits(String markerUnits) {
mMarkerUnits = markerUnits;
invalidate();
}

@ReactProp(name = "orient")
public void setOrient(String orient) {
mOrient = orient;
invalidate();
}

@ReactProp(name = "minX")
public void setMinX(float minX) {
mMinX = minX;
invalidate();
}

@ReactProp(name = "minY")
public void setMinY(float minY) {
mMinY = minY;
invalidate();
}

@ReactProp(name = "vbWidth")
public void setVbWidth(float vbWidth) {
mVbWidth = vbWidth;
invalidate();
}

@ReactProp(name = "vbHeight")
public void setVbHeight(float vbHeight) {
mVbHeight = vbHeight;
invalidate();
}

@ReactProp(name = "align")
public void setAlign(String align) {
mAlign = align;
invalidate();
}

@ReactProp(name = "meetOrSlice")
public void setMeetOrSlice(int meetOrSlice) {
mMeetOrSlice = meetOrSlice;
invalidate();
Expand Down
Loading