mirror of
https://github.com/status-im/react-native-cameraroll.git
synced 2025-01-12 10:54:18 +00:00
Merge pull request #24 from scarlac/bugfix-18-default-to-all
Default groupTypes to "All"
This commit is contained in:
commit
ae52098925
@ -118,16 +118,16 @@ Returns a Promise with photo identifier objects from the local camera roll of th
|
||||
| ------ | ------ | -------- | ------------------------------------------------ |
|
||||
| params | object | Yes | Expects a params with the shape described below. |
|
||||
|
||||
* `first` : {number} : The number of photos wanted in reverse order of the photo application (i.e. most recent first for SavedPhotos).
|
||||
* `first` : {number} : The number of photos wanted in reverse order of the photo application (i.e. most recent first for SavedPhotos). Required.
|
||||
* `after` : {string} : A cursor that matches `page_info { end_cursor }` returned from a previous call to `getPhotos`.
|
||||
* `groupTypes` : {string} : Specifies which group types to filter the results to. Valid values are:
|
||||
* `Album`
|
||||
* `All`
|
||||
* `All` // default
|
||||
* `Event`
|
||||
* `Faces`
|
||||
* `Library`
|
||||
* `PhotoStream`
|
||||
* `SavedPhotos` // default
|
||||
* `SavedPhotos`
|
||||
* `groupName` : {string} : Specifies filter on group names, like 'Recent Photos' or custom album titles.
|
||||
* `assetType` : {string} : Specifies filter on asset type. Valid values are:
|
||||
* `All`
|
||||
|
@ -48,7 +48,7 @@ type State = {|
|
||||
|
||||
export default class CameraRollExample extends React.Component<Props, State> {
|
||||
state = {
|
||||
groupTypes: 'SavedPhotos',
|
||||
groupTypes: 'All',
|
||||
sliderValue: 1,
|
||||
bigImages: true,
|
||||
};
|
||||
|
@ -90,7 +90,7 @@ type Row = {
|
||||
|
||||
class CameraRollView extends React.Component<Props, State> {
|
||||
static defaultProps = {
|
||||
groupTypes: 'SavedPhotos',
|
||||
groupTypes: 'All',
|
||||
batchSize: 5,
|
||||
imagesPerRow: 1,
|
||||
assetType: 'Photos',
|
||||
|
@ -15,12 +15,12 @@ const invariant = require('fbjs/lib/invariant');
|
||||
|
||||
const GROUP_TYPES_OPTIONS = {
|
||||
Album: 'Album',
|
||||
All: 'All',
|
||||
All: 'All', // default
|
||||
Event: 'Event',
|
||||
Faces: 'Faces',
|
||||
Library: 'Library',
|
||||
PhotoStream: 'PhotoStream',
|
||||
SavedPhotos: 'SavedPhotos', // default
|
||||
SavedPhotos: 'SavedPhotos',
|
||||
};
|
||||
|
||||
const ASSET_TYPE_OPTIONS = {
|
||||
@ -37,7 +37,7 @@ export type GroupTypes = $Keys<typeof GROUP_TYPES_OPTIONS>;
|
||||
export type GetPhotosParams = {
|
||||
/**
|
||||
* The number of photos wanted in reverse order of the photo application
|
||||
* (i.e. most recent first for SavedPhotos).
|
||||
* (i.e. most recent first).
|
||||
*/
|
||||
first: number,
|
||||
|
||||
@ -163,6 +163,9 @@ class CameraRoll {
|
||||
if (!params.assetType) {
|
||||
params.assetType = ASSET_TYPE_OPTIONS.All;
|
||||
}
|
||||
if (!params.groupTypes) {
|
||||
params.groupTypes = GROUP_TYPES_OPTIONS.All;
|
||||
}
|
||||
if (arguments.length > 1) {
|
||||
console.warn(
|
||||
'CameraRoll.getPhotos(tag, success, error) is deprecated. Use the returned Promise instead',
|
||||
|
@ -16,6 +16,7 @@ Array [
|
||||
Object {
|
||||
"assetType": "All",
|
||||
"first": 0,
|
||||
"groupTypes": "All",
|
||||
},
|
||||
],
|
||||
]
|
||||
|
Loading…
x
Reference in New Issue
Block a user