add touchable support for shape elements

This commit is contained in:
Horcrux
2016-06-09 23:30:10 +08:00
parent 16b4f741f5
commit 7307715712
12 changed files with 123 additions and 67 deletions
-18
View File
@@ -4,11 +4,9 @@ import createNativeComponent from '../lib/createNativeComponent';
import mergeContext from '../lib/mergeContext';
import {circleProps, pathProps, fillProps, strokeProps, numberProp} from '../lib/props';
class Circle extends Component{
static displayName = 'Circle';
static propTypes = {
...pathProps,
...circleProps
};
static contextTypes = {
@@ -19,28 +17,12 @@ class Circle extends Component{
svgId: numberProp
};
//constructor() {
// super(...arguments);
// _.forEach(SvgTouchableMixin, (method, key) => {
// this[key] = method.bind(this);
// });
//
// this.state = this.touchableGetInitialState();
//};
render() {
let props = mergeContext(this.props, this.context);
return <RNSVGCircle
{...extractProps(props)}
cx={props.cx.toString()}
cy={props.cy.toString()}
r={props.r.toString()}
//onStartShouldSetResponder={this.touchableHandleStartShouldSetResponder}
//onResponderTerminationRequest={this.touchableHandleResponderTerminationRequest}
//onResponderGrant={this.touchableHandleResponderGrant}
//onResponderMove={this.touchableHandleResponderMove}
//onResponderRelease={this.touchableHandleResponderRelease}
//onResponderTerminate={this.touchableHandleResponderTerminate}
/>;
}
}