This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Sample React Native App | |
* https://github.com/facebook/react-native | |
* @flow | |
*/ | |
import React, { Component } from 'react'; | |
import { | |
AppRegistry, | |
StyleSheet, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"key":1, | |
"name":"Suits", | |
"image":"https://static.tvmaze.com/uploads/images/medium_portrait/0/2432.jpg" | |
}, | |
{ | |
"key":2, | |
"name":"Modern Family", | |
"image":"https://static.tvmaze.com/uploads/images/medium_portrait/0/628.jpg" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import Video from 'react-native-video'; | |
import { | |
TouchableWithoutFeedback, | |
TouchableHighlight, | |
PanResponder, | |
StyleSheet, | |
Touchable, | |
Animated, | |
Easing, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"superhero":"Batman", | |
"publisher":"DC Comics", | |
"alter_ego":"Bruce Wayne", | |
"first_appearance":"Detective Comics #27", | |
"characters":"Bruce Wayne" | |
}, | |
{ | |
"superhero":"Superman", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<TextInput | |
style={styles.textInput} | |
onChangeText={(text) => this.filterSearch(text)} | |
value={this.state.text} | |
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
filterSearch(text){ | |
this.setState({text}) | |
let newData = this.dataFilter(text, this.state.rawData); | |
this.setState({ | |
dataSource: this.state.dataSource.cloneWithRows(newData), | |
isLoaded: true, | |
empty: false | |
}) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
renderRow(rowData){ | |
return ( | |
<TouchableHighlight style={styles.containerCell}> | |
<View> | |
<View style={styles.footerContainer}> | |
<View style={styles.footerTextContainer}> | |
<Text style={styles.text}>{rowData.name}</Text> | |
<Text style={[styles.text, styles.textTitle]}>{rowData.number}</Text> | |
<Text style={[styles.text, styles.textBy]}>By {rowData.airdate}</Text> | |
</View> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ListView | |
enableEmptySections={true} | |
renderRow={this.renderRow.bind(this)} | |
dataSource={this.state.dataSource} | |
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default class App extends Component { | |
constructor(){ | |
super() | |
const ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2}) | |
this.state = { | |
dataSource: ds.cloneWithRows([]), | |
rawData: '' | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {Component} from 'react' | |
import { Text, InputText, View, StyleSheet, Dimensions } from 'react-native' | |
const {width, height} = Dimensions.get('window') | |
export default class App extends Component { | |
render(){ | |
<View style={styles.container}> | |
<InputText | |
style={styles.inputText} |