Skip to content

Replace outdated react-native-photo-view library. #4217

Open
@chrisbobbe

Description

In d873e22, we pointed to a commit on this project's master branch that hadn't been released at the time, which was September 21, 2018. It still hasn't been released—in fact, there haven't been any commits after that date.

Right now, if I do yarn upgrade && yarn yarn-deduplicate && yarn, Android fails to build (looks like it's something to do with the Android Support Library; it reminds me of 01cf598 and 48ef40d). edit: I've seen this kind of build failure a few times; clearing node_modules and running yarn—and making sure the jetify step of tools/postinstall gets run—has cleared it up so far.

Unfortunately, I haven't found an obvious choice for a replacement lightbox library. Here are some candidates:

  • react-native-lightbox (GitHub, npm). I recognize the author's name, at least—they run react-native-vector-icons. Looks like pinch-to-zoom isn't supported (though there's Pinch to zoom oblador/react-native-lightbox#5 from 2015 for it), and it's not super frequently maintained.
  • Brent Vatne (who's quite active in the React Native ecosystem) says, on an Expo feature request page, that react-native-reanimated (GitHub, npm) can be used for a lightbox with pinch-and-zoom. react-native-reanimated v2 is a reimplementation of the RN Animated library entirely in JavaScript (blog post: "Therefore, we wanted for the next Reanimated to allow for building animations and interactions using just JavaScript."). I tried out the lightbox example on the iOS simulator, following the instructions, and pinch-and-zoom didn't work. It animated from a small thumbnail into a size that covered the screen, but once it was there, I couldn't zoom in at all (you can use the option key to do a pinch gesture in the simulator).

There is a major concern about both of these options, though. From the GIFs showing react-native-lightbox in action, and from seeing the demo with react-native-reanimated, both of them have the lightbox opening from a smooth animation from a React Native-land thumbnail to fill the screen. It really like this animation (and we'd get to solve #4039 for free). But the thumbnails we're showing aren't in React Native-land, they're in the WebView. I don't see how we can somehow overlay a React Native-land thumbnail on the message list and have it scroll with everything else...

I wonder if it's time to take another look at #3426? That seems pretty dramatic; maybe let's try something else before it comes to that.

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions