This repository was archived by the owner on Nov 9, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "layout", | ||
"private": true, | ||
"main": "view.js" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import React, { | ||
Component, | ||
Text, | ||
Image, | ||
View, | ||
StyleSheet, | ||
} from 'react-native'; | ||
import NavBar, { NavButton, NavTitle, NavGroup } from 'react-native-nav'; | ||
import NavBarStyle from '../navbarstyle'; | ||
import TouchableFeedback from '../TouchableFeedback'; | ||
import Realm from '../models'; | ||
|
||
var styles = StyleSheet.create({ | ||
row: { | ||
flexDirection: 'row', | ||
flex: 1, | ||
}, | ||
item: { | ||
flex: 1, | ||
padding: 10, | ||
height: 50, | ||
}, | ||
}); | ||
|
||
export default class ImagePicker extends Component { | ||
render(){ | ||
let current = this.props.route.slide.layout; | ||
return ( | ||
<View style={{flexDirection: 'column'}}> | ||
<NavBar style={NavBarStyle}> | ||
<NavButton onPress={this._onPreviousButton}><Image style={NavBarStyle.navIcon} source={require('../ic_navigate_before_white.png')} /></NavButton> | ||
<NavTitle style={NavBarStyle.title}>Layout</NavTitle> | ||
<NavGroup /> | ||
</NavBar> | ||
<View style={styles.row}> | ||
<TouchableFeedback onPress={this.onChoose(0)}><View style={styles.item}><Text>Top left</Text></View></TouchableFeedback> | ||
<TouchableFeedback onPress={this.onChoose(1)}><View style={styles.item}><Text style={{textAlign: 'center'}}>Top center</Text></View></TouchableFeedback> | ||
<TouchableFeedback onPress={this.onChoose(2)}><View style={styles.item}><Text style={{textAlign: 'right'}}>Top right</Text></View></TouchableFeedback> | ||
</View> | ||
<View style={styles.row}> | ||
<TouchableFeedback onPress={this.onChoose(3)}><View style={styles.item}><Text>Middle left</Text></View></TouchableFeedback> | ||
<TouchableFeedback onPress={this.onChoose(4)}><View style={styles.item}><Text style={{textAlign: 'center'}}>Middle center</Text></View></TouchableFeedback> | ||
<TouchableFeedback onPress={this.onChoose(5)}><View style={styles.item}><Text style={{textAlign: 'right'}}>Middle right</Text></View></TouchableFeedback> | ||
</View> | ||
<View style={styles.row}> | ||
<TouchableFeedback onPress={this.onChoose(6)}><View style={styles.item}><Text>Bottom left</Text></View></TouchableFeedback> | ||
<TouchableFeedback onPress={this.onChoose(7)}><View style={styles.item}><Text style={{textAlign: 'center'}}>Bottom center</Text></View></TouchableFeedback> | ||
<TouchableFeedback onPress={this.onChoose(8)}><View style={styles.item}><Text style={{textAlign: 'right'}}>Bottom right</Text></View></TouchableFeedback> | ||
</View> | ||
</View> | ||
) | ||
} | ||
|
||
onChoose(layout){ | ||
return () => { | ||
Realm.write(() => { | ||
this.props.route.slide.layout = layout; | ||
}); | ||
this.props.navigator.pop(); | ||
}; | ||
} | ||
|
||
_onPreviousButton = () => { | ||
this.props.navigator.pop(); | ||
}; | ||
} |