react-native-image-fit icon indicating copy to clipboard operation
react-native-image-fit copied to clipboard

[Suggestion] Zoom

Open jonathanroze opened this issue 8 years ago • 3 comments

Hey, thanks for your component it works great!

But can you add a Zoom feature ? Because doubleTap is good but zoom with your finger it's greater i think !

Thanks :)

jonathanroze avatar Jun 26 '17 08:06 jonathanroze

Hi @Clowning !. Thanks for the suggestion, i'm totally agree. We have component for such (zoom, punch, drag, etc.) functionalities https://github.com/react-armenia/react-native-view-editable. So we have to use some calculations from there, or you can use this component and wrap ImageViewer with ViewEditable

<ViewEditable>
  <ImageViewer />
</ViewEditable>

shahen94 avatar Jun 26 '17 09:06 shahen94

@shahen94 - would you mind elaborating on this? I just tried it with the following code:

<ViewEditor
          scaleBounds={{min: 1, max: 10}}
          onMove={() => console.log('move')}
          onMoveEnd={() => console.log('move end')}
        >
          <ImageViewer
            mainImageProps={{
              resizeMode: 'contain'
            }}
            zoomedImageProps={{
              resizeMode: 'contain'
            }}
            mainImageStyle={{width: 300, height: 200, borderRadius: 5}}
            source={{uri: uri}}
          />
        </ViewEditor>

but didn't have any success.

compojoom avatar Sep 11 '17 09:09 compojoom

Hi @compojoom - yea that's what i meant. Well - this will take 5min of work, i don't know when i can work on this, if someone want to handle this suggestion - i'll merge the PR right away.

shahen94 avatar Sep 11 '17 10:09 shahen94