oblador / react-native-lightbox

Images etc in Full Screen Lightbox Popovers for React Native
MIT License
2.82k stars 501 forks source link

Pinch to zoom #5

Open JonathanWi opened 9 years ago

JonathanWi commented 9 years ago

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

oblador commented 9 years ago

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 ;-)

JonathanWi commented 9 years ago

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

Cheers

ashleydw commented 9 years ago

Would be great to have this too

machard commented 8 years ago

+1

btoueg commented 8 years ago

:+1:

dannytce commented 8 years ago

+1

iwater commented 8 years ago

+1

NoBaR commented 8 years ago

+1

oblador commented 8 years ago

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

kwokster10 commented 8 years ago

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!

oblador commented 8 years ago

@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.

kwokster10 commented 8 years ago

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

oblador commented 8 years ago

@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.

apvlv commented 8 years ago

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

kobePer commented 8 years ago

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

iit2008047 commented 8 years ago

+1 .. waiting eagerly :)

HendrikZero72 commented 8 years ago

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

braco commented 8 years ago

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

oblador commented 8 years ago

@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.

braco commented 8 years ago

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

alexgv14 commented 8 years ago

@oblador any update on this feature?

waleedarshad-vf commented 8 years ago

Thanks @oblador! Awesome Work :)

toddmetheny commented 8 years ago

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.

Sam1301 commented 7 years ago

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

jamesbaker1 commented 7 years ago

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

ptgamr commented 7 years ago

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

artsx commented 7 years ago

+1 !

muaaz-vf commented 7 years ago

+1

zhaonian commented 6 years ago

+1

SamiChab commented 6 years ago

+1

sandywk commented 6 years ago

+1

marcoizzo commented 6 years ago

+1

ahmadw commented 6 years ago

+1

davidjack7 commented 6 years ago

+1

vcebotari commented 6 years ago

+1

drewdulz commented 6 years ago

+1

MaheshNandam commented 6 years ago

@kobePer ,

Hey Kobeper, the above-mentioned code was working completely in ios but in android zooming is not working, can you suggest any update on top of it?

Thank you!.

wassgha commented 6 years ago

+1

ng-david commented 6 years ago

+1

mengpeilee commented 6 years ago

+1

MaheshNandam commented 6 years ago

@kobePer,

the above-mentioned code is working fine on IOS devices but not on Android devices!

anaibol commented 6 years ago

+1

AnisDerbel commented 6 years ago

+1

somarjun commented 6 years ago

+1

eblaauw commented 6 years ago

+1, would be great to have this

mo-hummus commented 5 years ago

+1

MR-Neto commented 4 years ago

Any updates?

waheedakhtar694 commented 4 years ago

@kobePer Your solution will only work for IOS any work around for android ?

anaibol commented 4 years ago

+1

huyhai commented 4 years ago

any update ?