gallery view: added method for modifying the content offset of the collection view
This commit is contained in:
parent
1c74b2cf53
commit
03fac3591a
|
@ -568,6 +568,16 @@ RCT_EXPORT_METHOD(refreshGalleryView:(NSArray*)selectedImages
|
|||
resolve(@YES);
|
||||
}
|
||||
|
||||
RCT_EXPORT_METHOD(modifyGalleryViewContentOffset:(NSDictionary*)params) {
|
||||
CGPoint newOffset = self.galleryView.collectionView.contentOffset;
|
||||
if(params[@"x"] != nil) {
|
||||
newOffset.x += [params[@"x"] floatValue];
|
||||
}
|
||||
if(params[@"y"] != nil) {
|
||||
newOffset.y += [params[@"y"] floatValue];
|
||||
}
|
||||
[self.galleryView.collectionView setContentOffset:newOffset];
|
||||
}
|
||||
|
||||
#pragma mark - Static functions
|
||||
|
||||
|
|
|
@ -27,6 +27,10 @@ export default class CameraKitGalleryView extends Component {
|
|||
return true;
|
||||
}
|
||||
|
||||
modifyGalleryViewContentOffset (offset) {
|
||||
//do nothing. compatability with ios
|
||||
}
|
||||
|
||||
render() {
|
||||
const transformedProps = {...this.props};
|
||||
transformedProps.albumName = this.props.albumName ? this.props.albumName : ALL_PHOTOS;
|
||||
|
|
|
@ -55,4 +55,8 @@ export default class CameraKitGalleryView extends Component {
|
|||
const isSuccess = await GalleryViewManager.refreshGalleryView(selectedImages);
|
||||
return isSuccess;
|
||||
}
|
||||
|
||||
modifyGalleryViewContentOffset (offset) {
|
||||
GalleryViewManager.modifyGalleryViewContentOffset(offset);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue