Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- async getCameraRoll() {
- let allPhotos = [];
- let has_next_page = true;
- let end_cursor = undefined;
- let photos;
- do {
- photos = await CameraRoll.getPhotos({
- first: 20,
- after: end_cursor === undefined ? null : end_cursor
- });
- if (photos.page_info.has_next_page !== true) has_next_page = false;
- end_cursor = photos.page_info.end_cursor;
- allPhotos = allPhotos.concat(photos.edges);
- } while (has_next_page === true);
- this.setState({ photos: allPhotos });
- }
- <ScrollView contentContainerStyle={styles.scrollContainer}>
- {this.state.photos.map((image, i) => {
- let uri = image.node.image.uri;
- return (
- <TouchableOpacity
- activeOpacity={1}
- style={styles.imageWrapper}
- key={i}
- onPress={() =>
- this.props.navigator.push({
- screen: "watiz.ImageSelection",
- navigatorStyle: {
- navBarHidden: true
- },
- passProps: { uri, previousScreen: "watiz.Gallery" }
- })
- }
- underlayColor="transparent"
- >
- <Image style={styles.image} source={{ uri: uri }} />
- </TouchableOpacity>
- );
- })}
- </ScrollView>
Add Comment
Please, Sign In to add comment