Commit Graph

31 Commits

Author SHA1 Message Date
Mikael Sand
e98b0fe1d1 Merge branch 'master' into NativeAnimation
# Conflicts:
#	android/src/main/java/com/horcrux/svg/RenderableShadowNode.java
#	android/src/main/java/com/horcrux/svg/SvgViewShadowNode.java
#	elements/Image.js
#	elements/Rect.js
#	elements/Use.js
#	lib/attributes.js
2018-08-19 15:48:40 +03:00
Mikael Sand
4e6ba9a786 Remove internal imports. Run prettier. 2018-03-19 04:02:14 +02:00
Mikael Sand
fbd6591251 Experiment to allow animating fillOpacity of Rect using native driver.
import React, { Component } from 'react';
import { StyleSheet, View, Dimensions, Animated } from 'react-native';
import { Svg, Rect } from 'react-native-svg';

const { width, height } = Dimensions.get('window');
const AnimatedRect = Animated.createAnimatedComponent(Rect);

export default class App extends Component {
  state = {
    anim: new Animated.Value(0),
  };

  componentDidMount() {
    Animated.timing(this.state.anim, {
      toValue: 1,
      duration: 3000,
      useNativeDriver: true,
    }).start();
  }

  render() {
    const { anim } = this.state;
    return (
      <View style={styles.container}>
        <Svg width={width} height={height} viewBox="0 0 100 100">
          <AnimatedRect
            x="5"
            y="5"
            width="90"
            height="90"
            fill="green"
            fillOpacity={anim}
          />
        </Svg>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    backgroundColor: '#ecf0f1',
  },
});
2018-02-24 23:45:42 +02:00
Bruno Lemos
4a71c7f932 Make createReactNativeComponentClass backward compatible with react native < 0.50 2017-10-27 20:44:55 -02:00
Christoph Oberhofer
3db9489652 Fixed exports due to changed API signature of createReactNativeComponentClass 2017-10-18 22:39:28 +02:00
michal jarnot
30f968c546 Fix createReactNativeComponentClass import statements 2017-07-21 14:23:25 +02:00
Igor Borges
2e5ea29e68 move createReactNativeComponentClass import 2017-06-26 18:11:32 -03:00
Horcrux
5bd9b40c17 refactor Components props extracting 2017-02-03 19:43:25 +08:00
Pablo Carrillo
3e261b6c0a Fixes #188 in the master repo by replacing the path in the import with the new path 2016-11-24 15:05:02 +00:00
Horcrux
7d09dcde29 fix lint warnings 2016-07-27 12:10:12 +08:00
Horcrux
ff2395bcc2 finish gradients refactor 2016-07-20 22:38:45 +08:00
Horcrux
18e1b60823 complete ClipPath refactor 2016-07-20 14:44:19 +08:00
Horcrux
dd6cb80e84 refactor Use and Defs element with native code support(iOS) 2016-07-19 23:09:51 +08:00
Horcrux
efa7363b6f Add setNativeProps method for most of elements 2016-07-18 18:34:54 +08:00
Horcrux
2516a778ba use createReactNativeComponentClass inside from react
due to the peerDependency of react-native is >=0.29.0.
so there is no need to consider compatibility with react-native@0.27.0
and below.
2016-07-18 17:35:42 +08:00
Horcrux
7307715712 add touchable support for shape elements 2016-06-09 23:30:10 +08:00
Horcrux
233ea81a4a fix create native component issue
fix create native component issue
2016-05-15 10:50:53 +08:00
Horcrux
8d01e8eccb refactor shape elements add responder system.
refactor shape elements add responder system.
Just iOS.
2016-05-15 00:40:43 +08:00
chunghe
4af7dc664b React API must be now required from react package 2016-05-12 13:04:04 +08:00
Horcrux
cbce096b5c Use eslint, add travis-ci 2016-05-04 17:54:30 +08:00
Horcrux
be8c273adf Add eslint 2016-05-04 11:24:13 +08:00
Horcrux
1baf00c034 fix ellipse draw bug and fix shape props context 2016-04-26 21:04:54 +08:00
Horcrux
24dcc83a80 complete basic shapes(ios) 2016-04-26 19:10:57 +08:00
Horcrux
7d3ef84163 add ClipPath element support 2016-04-21 17:55:18 +08:00
Horcrux
d700ca5493 refactor all components and isolated from ART dependency 2016-04-20 00:52:59 +08:00
Horcrux
060cf7746b Add gradient elements and examples
Add gradient elements and examples
2016-01-25 15:50:06 +08:00
Horcrux
e001285cbe Refactor reuse elements
Refactor reuse elements
2016-01-25 11:39:31 +08:00
Horcrux
11c211a9a9 add Use element and add example for it
add Use element and add example for it
2016-01-23 19:25:12 +08:00
Horcrux
af0995022d apply common stroke processor to elements
apply common stroke processor to elements
2016-01-23 16:50:11 +08:00
Horcrux
b871e0087e Add G element
Add G element
2016-01-22 18:41:52 +08:00
Horcrux
a482948b83 Add examples and refactor code
Add examples and refactor code
2016-01-21 23:44:38 +08:00