react-native-lightbox icon indicating copy to clipboard operation
react-native-lightbox copied to clipboard

Pinch to zoom

Open JonathanWi opened this issue 9 years ago • 52 comments

Very nice update using the animated library! It really is smoother and lighter!

Do you think it would be possible - just like facebook lightbox - to enable a pinch to zoom?

Have a great day

JonathanWi avatar Oct 17 '15 11:10 JonathanWi

Hi, yeah it's on my todo. Thinking of maybe writing a carousel to go with it too. Just need some time to do it ;-)

oblador avatar Oct 18 '15 19:10 oblador

Awesome news then! Could you ping me when it's up?

Cheers

JonathanWi avatar Oct 19 '15 09:10 JonathanWi

Would be great to have this too

ashleydw avatar Nov 02 '15 12:11 ashleydw

+1

machard avatar Nov 20 '15 16:11 machard

:+1:

btoueg avatar Nov 20 '15 16:11 btoueg

+1

dannytce avatar Nov 23 '15 18:11 dannytce

+1

iwater avatar Nov 24 '15 02:11 iwater

+1

NoBaR avatar Nov 25 '15 09:11 NoBaR

I'm feeling the pressure haha. I've implemented this in the navigator-refactor branch.

See https://github.com/oblador/react-native-lightbox/issues/8#issuecomment-160352712 for more info.

lightbox

oblador avatar Nov 29 '15 00:11 oblador

Hi @oblador, I'm getting this to work fine on iOS but not on Android. When I click to zoom, it zooms in but doesn't pinch to zoom. It also scrolls but doesn't drag left to right to see details cut off from initial zoom. I'm using your navigator example and also cloned the navigator-refactor branch during npm install. Any help is appreciated. Thanks!

kwokster10 avatar Feb 01 '16 16:02 kwokster10

@kwokster10: I'm aware of that issue, that's because ScrollView on android doesn't support zooming. I'm not sure if I should implement zooming for android completely custom or just wait for support to land in React Native core.

oblador avatar Feb 01 '16 19:02 oblador

Oh, interesting. Is there a workaround for this? Would using ViewPagerAndroid make a difference? Thanks!

kwokster10 avatar Feb 02 '16 15:02 kwokster10

@kwokster10: ViewPagerAndroid might help with paging the images but I don't think it'll help with zooming. Should be able to do zooming with scale transforms, but it wouldn't be as fluid as native zooming nor give you higher detail when zooming.

oblador avatar Feb 02 '16 15:02 oblador

Hello, i couldn't get to work the version from the navigator refactor branch.. I get the following error:

Element type is invalid: expected a string but got:object. Check the render method of image.ios.js

The main branch works without problems for me. I'm on react-native 0.25.1

apvlv avatar May 05 '16 23:05 apvlv

For those who can't get the navigator-refactor working for some reason but would like pinch-to-zoom, Wrapping an image in a ScrollView and setting swipeToDismiss to false does the trick (assuming you prioritize zooming above swipeToDismiss)

<LightBox
        key={i}
        swipeToDismiss={false}
      >
        <ScrollView
          minimumZoomScale={1}
          maximumZoomScale={2}
          centerContent={true}
        >
          <Image
            style={styles.image}
            source={{'uri' : source}}
          >

          </Image>
        </ScrollView>
      </LightBox>

I realize this is not ideal, but it's a quick and easy fix for a small feature

kobePer avatar May 31 '16 13:05 kobePer

+1 .. waiting eagerly :)

iit2008047 avatar Jun 14 '16 14:06 iit2008047

+1 mee too... On the navigator refactor branch I am getting the same error as @pvlvsk

HendrikZero72 avatar Jun 30 '16 11:06 HendrikZero72

@oblador: just curious about timing, are you still working on this?

braco avatar Jul 01 '16 18:07 braco

@braco: Not actively currently but I will soon need this functionality for a project I'm working on, but with NavigationExperimental so consider the navigator branch dead. Hopefully I'll be able to release something more generic for NavigationExperimental but I can't promise it right nor do I have a timeplan.

oblador avatar Jul 03 '16 14:07 oblador

@oblador: thanks for the clarification. Sounds like there's a bunch of hungry puppies waiting for you here, myself included!

braco avatar Jul 06 '16 22:07 braco

@oblador any update on this feature?

alexgv14 avatar Aug 11 '16 16:08 alexgv14

Thanks @oblador! Awesome Work :)

waleedarshad-vf avatar Oct 05 '16 06:10 waleedarshad-vf

Would someone using the pinch to zoom feature on the navigator-refactor branch be willing to help me with this? http://stackoverflow.com/questions/40264486/including-a-library-from-a-github-branch-in-react-native?noredirect=1#comment67789465_40264486

Not sure what I'm doing wrong. Thanks in advance.

update: @kobePer 's suggestion worked for me. gracias.

toddmetheny avatar Oct 26 '16 14:10 toddmetheny

@oblador for zoom, consider looking at this library https://github.com/alwx/react-native-photo-view.

Sam1301 avatar Jun 10 '17 04:06 Sam1301

Is there a stable version of the pinch to zoom now?

jamesbaker1 avatar Jul 31 '17 18:07 jamesbaker1

+1 ... really need / love to have this feature :)

ptgamr avatar Oct 24 '17 12:10 ptgamr

+1 !

artsx avatar Nov 13 '17 12:11 artsx

+1

muaaz-vf avatar Nov 13 '17 12:11 muaaz-vf

+1

zhaonian avatar Dec 30 '17 08:12 zhaonian

+1

SamiChab avatar Jan 22 '18 22:01 SamiChab