import React, { Component } from 'react'; import { StyleSheet, Text, View, TouchableOpacity, Image, FlatList } from 'react-native'; import {CameraKitGallery} from '../../src'; import GalleryScreen from './GalleryScreen'; export default class AlbumsScreen extends Component { constructor(props) { super(props); this.state = { albums:{}, albumsDS: [], albumName: undefined } } componentDidMount() { this.onGetAlbumsPressed(); } render() { if (this.state.albumName) { const albumName = this.state.albumName; return ; } return ( ); } _renderRow(rowData) { const item = rowData.item; const image = 'file://' + item.thumbUri; return ( this.setState({albumName: item.albumName})}> {item.albumName} {item.imagesCount} ) } async onGetAlbumsPressed() { let albums = await CameraKitGallery.getAlbumsWithThumbnails(); albums = albums.albums; this.setState({albumsDS: albums, albums:{albums}, shouldShowListView: true}); } } const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: '#F5FCFF', marginTop: 20 }, listView: { margin: 8, backgroundColor: '#D6DAC2' } });