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

[iOS, Android] - Image flickers when dragging on zoomed image #16

Closed
crank-chips opened this issue Jun 11, 2023 · 1 comment
Closed

Comments

@crank-chips
Copy link

After fixing this issue #14 the new issue was discovered.

When dragging/paning on zoomed image there is a noticeable image flickering going on (see the screen recording)
It's more noticeable on Android than on iOS but still happens on both platforms.

android-video.mov
ios-video.mov

Here is a code from the implementation:


import {Dimensions, Image, View} from "react-native";
import * as React from "react";
import {ImageViewer, ImageWrapper} from "react-native-reanimated-viewer";
import {useRef} from "react";
import {FlatList} from "react-native-gesture-handler";

const images = Array.from({length: 50}, (_, index) => {
    return {
        uri: `https://picsum.photos/id/${index + 10}/1280/720`,
        thumbNailUri: `https://picsum.photos/id/${index + 10}/980/551`
    };
});

export const TestRNViewer = () => {
    const imageRef = useRef(null);

    return (
        <>
            <ImageViewer
                ref={imageRef}
                dragUpToCloseEnabled={true}
                data={images.map((el) => ({key: `key-${el.thumbNailUri}`, source: {uri: el.uri}}))}
            />
            <View style={{backgroundColor: "rgb(15, 15, 15)"}}>
                <FlatList
                    data={images}
                    keyExtractor={(item) => item.thumbNailUri}
                    initialNumToRender={5}
                    renderItem={({item, index}) => (
                        <ImageWrapper
                            key={item.thumbNailUri}
                            viewerRef={imageRef}
                            index={index}
                            source={{
                                uri: item.thumbNailUri,
                            }}
                        >
                            <Image source={{uri: item.thumbNailUri,}}
                                   style={{width: Dimensions.get("screen").width, height: 250, marginBottom: 10}}/>
                        </ImageWrapper>
                    )}
                    showsVerticalScrollIndicator={false}
                />
            </View>

        </>
    );
}
@llr101 llr101 closed this as completed in 7cfce65 Jun 12, 2023
@llr101
Copy link
Collaborator

llr101 commented Jun 12, 2023

I fixed it in v1.2.4. If there is still a problem, you can reopen this issue any time

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

No branches or pull requests

2 participants