Merge pull request #420 from react-native-community/5.3.2

5.3.2
This commit is contained in:
Horcrux
2017-08-03 14:46:46 +08:00
committed by GitHub
2 changed files with 24 additions and 19 deletions
+19 -19
View File
@@ -75,7 +75,7 @@
Here's a simple example. To render output like this:
![SVG example](./screenShoots/svg.png)
![SVG example](https://raw.githubusercontent.com/react-native-community/react-native-svg/master/screenShoots/svg.png)
Use the following code:
@@ -191,7 +191,7 @@ The <Rect> element is used to create a rectangle and variations of a rectangle s
</Svg>
```
![Rect](./screenShoots/rect.png)
![Rect](https://raw.githubusercontent.com/react-native-community/react-native-svg/master/screenShoots/rect.png)
Code explanation:
@@ -217,7 +217,7 @@ The <Circle> element is used to create a circle:
</Svg>
```
![Rect](./screenShoots/circle.png)
![Rect](https://raw.githubusercontent.com/react-native-community/react-native-svg/master/screenShoots/circle.png)
Code explanation:
@@ -246,7 +246,7 @@ An ellipse is closely related to a circle. The difference is that an ellipse has
/>
</Svg>
```
![Rect](./screenShoots/ellipse.png)
![Rect](https://raw.githubusercontent.com/react-native-community/react-native-svg/master/screenShoots/ellipse.png)
Code explanation:
@@ -275,7 +275,7 @@ The <Line> element is an SVG basic shape, used to create a line connecting two p
</Svg>
```
![Rect](./screenShoots/line.png)
![Rect](https://raw.githubusercontent.com/react-native-community/react-native-svg/master/screenShoots/line.png)
Code explanation:
@@ -302,7 +302,7 @@ The <Polygon> element is used to create a graphic that contains at least three s
</Svg>
```
![Rect](./screenShoots/polygon.png)
![Rect](https://raw.githubusercontent.com/react-native-community/react-native-svg/master/screenShoots/polygon.png)
Code explanation:
@@ -326,7 +326,7 @@ The <Polyline> element is used to create any shape that consists of only straigh
</Svg>
```
![Rect](./screenShoots/polyline.png)
![Rect](https://raw.githubusercontent.com/react-native-community/react-native-svg/master/screenShoots/polyline.png)
Code explanation:
@@ -364,7 +364,7 @@ The following commands are available for path data:
</Svg>
```
![Rect](./screenShoots/path.png)
![Rect](https://raw.githubusercontent.com/react-native-community/react-native-svg/master/screenShoots/path.png)
#### Text
@@ -388,7 +388,7 @@ The <Text> element is used to define text.
</Svg>
```
![Text](./screenShoots/text.png)
![Text](https://raw.githubusercontent.com/react-native-community/react-native-svg/master/screenShoots/text.png)
#### TSpan
@@ -416,7 +416,7 @@ The <TSpan> element is used to draw multiple lines of text in SVG. Rather than h
</Svg>
```
![TSpan](./screenShoots/tspan.png)
![TSpan](https://raw.githubusercontent.com/react-native-community/react-native-svg/master/screenShoots/tspan.png)
#### TextPath
@@ -453,7 +453,7 @@ In addition to text drawn in a straight line, SVG also includes the ability to p
</Svg>
```
![TextPath](./screenShoots/text-path.png)
![TextPath](https://raw.githubusercontent.com/react-native-community/react-native-svg/master/screenShoots/text-path.png)
#### G
@@ -496,7 +496,7 @@ The <G> element is a container used to group other SVG elements. Transformations
</G>
</Svg>
```
![G](./screenShoots/g.png)
![G](https://raw.githubusercontent.com/react-native-community/react-native-svg/master/screenShoots/g.png)
#### Use
@@ -527,7 +527,7 @@ Before the <G> element can be referenced, it must have an ID set on it via its i
The <Use> element specifies where to show the reused shapes via its x and y props. Notice that the shapes inside the <G> element are located at 0,0. That is done because their position is added to the position specified in the <Use> element.
![use](./screenShoots/use.png)
![use](https://raw.githubusercontent.com/react-native-community/react-native-svg/master/screenShoots/use.png)
#### Symbol
@@ -566,7 +566,7 @@ The SVG <Symbol> element is used to define reusable symbols. The shapes nested i
</Svg>
```
![Symbol](./screenShoots/symbol.png)
![Symbol](https://raw.githubusercontent.com/react-native-community/react-native-svg/master/screenShoots/symbol.png)
#### Defs
@@ -621,7 +621,7 @@ The <Image> element allows a raster image to be included in an Svg componenet.
</Svg>
```
![Image](./screenShoots/image.png)
![Image](https://raw.githubusercontent.com/react-native-community/react-native-svg/master/screenShoots/image.png)
#### ClipPath
@@ -673,7 +673,7 @@ The <ClipPath> SVG element defines a clipping path. A clipping path is used/refe
</Svg>
```
![ClipPath](./screenShoots/clip-path.png)
![ClipPath](https://raw.githubusercontent.com/react-native-community/react-native-svg/master/screenShoots/clip-path.png)
#### LinearGradient
@@ -708,7 +708,7 @@ Code explanation:
* The color range for a gradient can be composed of two or more colors. Each color is specified with a <Stop> tag. The offset prop is used to define where the gradient color begin and end
* The fill prop links the ellipse element to the gradient
![LinearGradient](./screenShoots/lineargradient.png)
![LinearGradient](https://raw.githubusercontent.com/react-native-community/react-native-svg/master/screenShoots/lineargradient.png)
*NOTICE:*
LinearGradient also supports percentage as prop:
@@ -754,7 +754,7 @@ Code explanation:
* The color range for a gradient can be composed of two or more colors. Each color is specified with a <stop> tag. The offset prop is used to define where the gradient color begin and end
* The fill prop links the ellipse element to the gradient
![RadialGradient](./screenShoots/radialgradient.png)
![RadialGradient](https://raw.githubusercontent.com/react-native-community/react-native-svg/master/screenShoots/radialgradient.png)
#### Touch Events
@@ -781,7 +781,7 @@ You can use these events to provide interactivity to your react-native-svg compo
/>
```
![TouchEvents](./screenShoots/touchevents.gif)
![TouchEvents](https://raw.githubusercontent.com/react-native-community/react-native-svg/master/screenShoots/touchevents.gif)
For more examples of touch in action, checkout the [TouchEvents.js examples](https://github.com/magicismight/react-native-svg-example/blob/master/examples/TouchEvents.js).
@@ -44,6 +44,11 @@ public class SvgPackage implements ReactPackage {
new SvgViewManager());
}
@Override
public List<Class<? extends JavaScriptModule>> createJSModules() {
return Collections.emptyList();
}
@Override
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
return Collections.<NativeModule>singletonList(new SvgViewModule(reactContext));