chore(lib) make the example less glitchy by fixing the width

This commit is contained in:
Bartol Karuza 2019-04-14 12:52:43 +02:00
parent 9e9f290380
commit e19ff9d680
1 changed files with 18 additions and 10 deletions

View File

@ -19,6 +19,7 @@ const {
Text, Text,
View, View,
TouchableOpacity, TouchableOpacity,
Dimensions
} = ReactNative; } = ReactNative;
import CameraRoll from '../../js/CameraRoll'; import CameraRoll from '../../js/CameraRoll';
import type {PhotoIdentifier, GroupTypes} from '../../js/CameraRoll'; import type {PhotoIdentifier, GroupTypes} from '../../js/CameraRoll';
@ -57,16 +58,18 @@ export default class CameraRollExample extends React.Component<Props, State> {
render() { render() {
return ( return (
<View> <View>
<Switch <View style={styles.header}>
onValueChange={this._onSwitchChange} <Switch
value={this.state.bigImages} onValueChange={this._onSwitchChange}
/> value={this.state.bigImages}
<Text>{(this.state.bigImages ? 'Big' : 'Small') + ' Images'}</Text> />
<Slider <Text>{(this.state.bigImages ? 'Big' : 'Small') + ' Images'}</Text>
value={this.state.sliderValue} <Slider
onValueChange={this._onSliderChange} value={this.state.sliderValue}
/> onValueChange={this._onSliderChange}
<Text>{'Group Type: ' + this.state.groupTypes}</Text> />
<Text>{'Group Type: ' + this.state.groupTypes}</Text>
</View>
<CameraRollView <CameraRollView
ref={ref => { ref={ref => {
this._cameraRollView = ref; this._cameraRollView = ref;
@ -131,6 +134,11 @@ export default class CameraRollExample extends React.Component<Props, State> {
} }
const styles = StyleSheet.create({ const styles = StyleSheet.create({
header: {
marginTop: 44,
padding: 20,
width: Dimensions.get('window').width
},
row: { row: {
flexDirection: 'row', flexDirection: 'row',
flex: 1, flex: 1,