reset() { this.setState( { focusedLocation: { latitude: 37.78825, longitude: -122.4324, latitudeDelta: 0.015, longitudeDelta: Dimensions.get('window').width / Dimensions.get('window').height * 0.015, }, locationChosen: false }) }
render() { return ( <TabView navigationState={this.state} renderScene={this.state.sceneMap} onIndexChange={index => this.setState({ index })} initialLayout={{ width: Dimensions.get('window').width, height: Dimensions.get('window').height, }} /> ); }
render() { return ( <View style={styles.container}> <ProgressiveImage thumbnailSource={{ uri: `https://images.pexels.com/photos/671557/pexels-photo-671557.jpeg?w=50&buster=${Math.random()}` }} source={{ uri: `https://images.pexels.com/photos/671557/pexels-photo-671557.jpeg?w=${w.width * 2}&buster=${Math.random()}` }} style={{ width: w.width, height: w.width }} resizeMode="cover" /> </View> ); }
constructor(props){ super(props); this.state = { xValue : Dimensions.get('window').width / 2, yValue : Dimensions.get('window').height / 2 } // required for android devices if(Platform.OS === 'android'){ UIManager.setLayoutAnimationEnabledExperimental(true); } }
componentDidMount(){ let data = this.props.navigation.getParam("data", {}) if(data.images){ const imageObjects = data.images.map((image,index) => ( <View key={index} style={{height:'100%',justifyContent:'center'}}> <Image source={{uri:image}} style={{width:Dimensions.get("window").width,aspectRatio:1}}/> </View> )) data.price=data.types[0].price this.setState({imageObjects:imageObjects,data:data}) } }
constructor(props) { super(props); this.dayWidth = (windowSize.width - 40) / 7; this.state = { currentMonth: props.current ? parseDate(props.current) : XDate(), }; }
setTimeout(() => { this.setState({ xValue : Math.floor(Math.random() * Dimensions.get('window').width), yValue : Math.floor(Math.random() * Dimensions.get('window').height) }) }, 1000);
_renderImage(image) { let contentHeight = scaleModerate(400, 1); let height = Dimensions.get('window').height - contentHeight; let width = Dimensions.get('window').width; image = (<Image style={[styles.image, {height, width}]} source={require('../../images/vecihi.jpg')}/>); return image; }
componentDidMount() { if (this.props.currentUser.avatar != null) { Image.getSize(this.props.currentUser.avatar, (width, height) => { const screenWidth = Dimensions.get('window').width; const scaleFactor = width / screenWidth; const imageHeight = height / scaleFactor; this.setState({imageHeight: imageHeight}); }); } }
constructor(props) { super(props); var bounds = Dimensions.get("window"); this.state = { toc: [], show: false, width : bounds.width, height : bounds.height, orientation: "PORTRAIT" } }
constructor(){ super(); this.state = { liked: false, screenWidth: Dimensions.get("window").width } }
constructor(props) { super(props); this.state = { id: 0, hero: null, loading: false, width: Dimensions.get("window").width.toFixed() }; }
_renderImage(image) { let contentHeight = scaleModerate(375, 1); let height = Dimensions.get('window').height - contentHeight; let width = Dimensions.get('window').width; image = (<Image style={[styles.image, {height, width}]} source={require('../../images/vecihi.jpg')}/>); return image; }
/** * Calculate the width of the grid, based on screen dimensions. * * @returns {number} The width of the grid */ export function calculateContainerSize() { return Dimensions.get('window').width - 20; }