Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image open animation #5287

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft

Image open animation #5287

wants to merge 10 commits into from

Conversation

gaearon
Copy link
Contributor

@gaearon gaearon commented Sep 12, 2024

This is not perfect (in particular, there is no corresponding exit) but it kinda works.
Putting this out for initial testing. Needs testing on device!

The animation is disabled if you enable the Reduced Motion system setting.

iOS

ios.mov

Android

android.mov

return (
<Animated.View ref={containerRef} style={styles.container}>
{isLoading && (
<ActivityIndicator size="small" color="#FFF" style={styles.loading} />
Copy link
Contributor Author

@gaearon gaearon Sep 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't figure out how to make this guy work well, but it seems less important now anyway. Figured I'd just remove it. Maybe we can readd with a bit more thinking.

Or we can add some placeholder.

@@ -143,14 +141,13 @@ const ImageItem = ({
maximumZoomScale={maxZoomScale}
contentContainerStyle={styles.imageScrollContainer}
onScroll={scrollHandler}>
{(!loaded || !imageDimensions) && <ImageLoading />}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

<ImageViewing
key={props.initialImageIndex}
{...props}
onLoad={() => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be too conservative since it'll just get stuck if the network is slow. Maybe worth adding a safeguard timeout. Or it would require a bigger rework to integrate with the slider and dismiss gesture inside.

Copy link

Old size New size Diff
7.13 MB 7.13 MB 0 B (0.00%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants