Basic example ios reverse toggle logic

This commit is contained in:
Brad Adams 2016-11-09 01:19:32 +01:00
parent 70799eca9b
commit f3ba2ee5d2

View File

@ -20,7 +20,7 @@ class Basic extends Component {
constructor() { constructor() {
super() super()
this.state = { this.state = {
hideBlurs: false, showBlurs: true,
blurBlurType: 'light', blurBlurType: 'light',
blurActiveSegment: 1, blurActiveSegment: 1,
vibrancyBlurType: 'dark', vibrancyBlurType: 'dark',
@ -54,11 +54,9 @@ class Basic extends Component {
resizeMode='cover' resizeMode='cover'
style={styles.img}/> style={styles.img}/>
{(this.state.hideBlurs {(this.state.showBlurs
? null ? <View style={styles.container}>
: <View style={styles.container}>
<BlurView <BlurView
blurType={this.state.blurBlurType} blurType={this.state.blurBlurType}
@ -87,13 +85,15 @@ class Basic extends Component {
</VibrancyView> </VibrancyView>
</View> </View>
: null
)} )}
<View <View
style={styles.blurToggle}> style={styles.blurToggle}>
<Switch <Switch
onValueChange={(value) => this.setState({hideBlurs: value})} onValueChange={(value) => this.setState({showBlurs: value})}
value={this.state.hideBlurs} /> value={this.state.showBlurs} />
</View> </View>
</View> </View>