index.ios.js 1.3 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
const React = require("react-native");
const {
  AppRegistry,
  StyleSheet,
  Text,
  View,
  ScrollView,
} = React;

const HelloGL = require("./HelloGL");
const Sepia = require("./Sepia");

const Simple = React.createClass({
  render: function() {
    return <ScrollView style={styles.container}>
      <Text style={styles.title}>
        Welcome to GL React Native!
      </Text>
      <View style={styles.demos}>
        <Text style={styles.demoTitle}>1. Hello GL</Text>
        <View style={styles.demo}>
          <HelloGL width={256} height={144} />
        </View>

        <Text style={styles.demoTitle}>2. Sepia on an Image</Text>
        <View style={styles.demo}>
          <Sepia
            width={256}
            height={144}
            factor={0.6}
            image={{ uri: "http://i.imgur.com/qVxHrkY.jpg" }} />
        </View>
      </View>
    </ScrollView>;
  }
});

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: "#fff",
  },
  title: {
    fontSize: 20,
    textAlign: "center",
    margin: 5,
    marginBottom: 20,
    fontWeight: "bold"
  },
  demos: {
    flex: 1,
    justifyContent: "center",
    alignItems: "center",
  },
  demoTitle: {
    fontSize: 20,
    margin: 5,
    fontStyle: "italic"
  },
});

AppRegistry.registerComponent("Simple", () => Simple);