{"action":"created","issue":{"url":"https://api.github.com/repos/lwansbrough/react-native-camera/issues/306","repository_url":"https://api.github.com/repos/lwansbrough/react-native-camera","labels_url":"https://api.github.com/repos/lwansbrough/react-native-camera/issues/306/labels{/name}","comments_url":"https://api.github.com/repos/lwansbrough/react-native-camera/issues/306/comments","events_url":"https://api.github.com/repos/lwansbrough/react-native-camera/issues/306/events","html_url":"https://github.com/lwansbrough/react-native-camera/issues/306","id":157920456,"number":306,"title":"Collaborators","user":{"login":"charpeni","id":7189823,"avatar_url":"https://avatars.githubusercontent.com/u/7189823?v=3","gravatar_id":"","url":"https://api.github.com/users/charpeni","html_url":"https://github.com/charpeni","followers_url":"https://api.github.com/users/charpeni/followers","following_url":"https://api.github.com/users/charpeni/following{/other_user}","gists_url":"https://api.github.com/users/charpeni/gists{/gist_id}","starred_url":"https://api.github.com/users/charpeni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charpeni/subscriptions","organizations_url":"https://api.github.com/users/charpeni/orgs","repos_url":"https://api.github.com/users/charpeni/repos","events_url":"https://api.github.com/users/charpeni/events{/privacy}","received_events_url":"https://api.github.com/users/charpeni/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-06-01T14:26:01Z","updated_at":"2016-06-03T09:41:26Z","closed_at":null,"body":"I noticed the lack of collaborators on this project, many pull requests that are really profitable to the package and issues are still open.\r\n\r\nI know you have other things to do, that's why I could help you if you want. I'm currently working with this package and I have time to handle some issues and PRs. It's up to you!\r\n\r\ncc @lwansbrough @rt2zz "},"comment":{"url":"https://api.github.com/repos/lwansbrough/react-native-camera/issues/comments/223536222","html_url":"https://github.com/lwansbrough/react-native-camera/issues/306#issuecomment-223536222","issue_url":"https://api.github.com/repos/lwansbrough/react-native-camera/issues/306","id":223536222,"user":{"login":"wangzhanji","id":9349836,"avatar_url":"https://avatars.githubusercontent.com/u/9349836?v=3","gravatar_id":"","url":"https://api.github.com/users/wangzhanji","html_url":"https://github.com/wangzhanji","followers_url":"https://api.github.com/users/wangzhanji/followers","following_url":"https://api.github.com/users/wangzhanji/following{/other_user}","gists_url":"https://api.github.com/users/wangzhanji/gists{/gist_id}","starred_url":"https://api.github.com/users/wangzhanji/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wangzhanji/subscriptions","organizations_url":"https://api.github.com/users/wangzhanji/orgs","repos_url":"https://api.github.com/users/wangzhanji/repos","events_url":"https://api.github.com/users/wangzhanji/events{/privacy}","received_events_url":"https://api.github.com/users/wangzhanji/received_events","type":"User","site_admin":false},"created_at":"2016-06-03T09:41:26Z","updated_at":"2016-06-03T09:41:26Z","body":"@charpeni I found a piece of code, and is already in use.\r\n\r\nimport React from 'react';\r\n\r\nimport {\r\n  StyleSheet,\r\n  View,\r\n  Text,\r\n  Dimensions,\r\n  TouchableOpacity,\r\n  Vibration\r\n} from 'react-native'\r\n\r\nimport Camera from 'react-native-camera';\r\n\r\nvar QRCodeScreen = React.createClass({\r\n\r\n  propTypes: {\r\n    cancelButtonVisible: React.PropTypes.bool,\r\n    cancelButtonTitle: React.PropTypes.string,\r\n    // onSucess: React.PropTypes.func,\r\n    onCancel: React.PropTypes.func,\r\n  },\r\n\r\n  getDefaultProps: function() {\r\n    return {\r\n      cancelButtonVisible: false,\r\n      cancelButtonTitle: 'Cancel',\r\n    };\r\n  },\r\n\r\n  _onPressCancel: function() {\r\n    var $this = this;\r\n    requestAnimationFrame(function() {\r\n      $this.props.navigator.pop();\r\n      if ($this.props.onCancel) {\r\n        $this.props.onCancel();\r\n      }\r\n    });\r\n  },\r\n\r\n  _onBarCodeRead: function(result) {\r\n    var $this = this;\r\n\r\n    if (this.barCodeFlag) {\r\n      this.barCodeFlag = false;\r\n\r\n      setTimeout(function() {\r\n        Vibration.vibrate();\r\n\r\n        alert(result.data);\r\n        // $this.props.onSucess(result.data);\r\n      }, 1000);\r\n    }\r\n  },\r\n\r\n  render: function() {\r\n    var cancelButton = null;\r\n    this.barCodeFlag = true;\r\n    \r\n    if (this.props.cancelButtonVisible) {\r\n      cancelButton = <CancelButton onPress={this._onPressCancel} title={this.props.cancelButtonTitle} />;\r\n    }\r\n\r\n    return (\r\n      <Camera\r\n        onBarCodeRead={this._onBarCodeRead}\r\n        style={styles.camera}>\r\n        <View style={styles.rectangleContainer}>\r\n          <View style={styles.rectangle}/>\r\n        </View>\r\n        {cancelButton}\r\n      </Camera>\r\n    );\r\n  },\r\n});\r\n\r\nvar CancelButton = React.createClass({\r\n  render: function() {\r\n    return (\r\n      <View style={styles.cancelButton}>\r\n        <TouchableOpacity onPress={this.props.onPress}>\r\n          <Text style={styles.cancelButtonText}>{this.props.title}</Text>\r\n        </TouchableOpacity>\r\n      </View>\r\n    );\r\n  }\r\n});\r\n\r\nvar styles = StyleSheet.create({\r\n\r\n  camera: {\r\n    height: Dimensions.get('window').height,\r\n    alignItems: 'center',\r\n  },\r\n\r\n  rectangleContainer: {\r\n    flex: 1,\r\n    alignItems: 'center',\r\n    justifyContent: 'center',\r\n    backgroundColor: 'transparent',\r\n  },\r\n\r\n  rectangle: {\r\n    height: 250,\r\n    width: 250,\r\n    borderWidth: 2,\r\n    borderColor: '#00FF00',\r\n    backgroundColor: 'transparent',\r\n  },\r\n\r\n  cancelButton: {\r\n    flexDirection: 'row',\r\n    justifyContent: 'center',\r\n    backgroundColor: 'white',\r\n    borderRadius: 3,\r\n    padding: 15,\r\n    width: 100,\r\n    bottom: 10,\r\n  },\r\n  cancelButtonText: {\r\n    fontSize: 17,\r\n    fontWeight: '500',\r\n    color: '#0097CE',\r\n  },\r\n});\r\n\r\nmodule.exports = QRCodeScreen;\r\n"}}
{"actor":{"display_login":"wangzhanji"}}