zehfernandes / react-native-3dcube-navigation

MIT License
283 stars 48 forks source link

Some Improvement Ideas & Rotating Bug #14

Closed zek closed 1 year ago

zek commented 5 years ago

This doesn't give the same feeling as instagram's stories.

For example I want it to go to next cube when I touch/slide softly however master version forcing me to keep touching on screen until my finger pass half of the screen. I think we can detect acceleration in order to give this functionality.

https://github.com/zek/react-native-3dcube-navigation/commit/aef5049e2c1bc5a09db68ee14d0a898ad9956186

I did something like this. (You can inspect forked repo.) But really don't get anything about react native animation library so this is really hard for me. I hope you can understand the problem and find a better solution.

And here is the rotating bug. It doesn't happen all the time but when I touch multiple times or touching softly (I mean not keeping my finger on screen for long time)

https://rhodeus.org/bug.mp4

Sorry If I am not clear. I may try explaining it better if you cannot understand.

billouboq commented 5 years ago

@zek

I think you just need to edit :

let mod = gestureState.dx > 0 ? 100 : -100;

on line 56 in horizontal.js -> give it an higher value (or lower can't remember what I did to fix this)

zek commented 5 years ago

@billouboq Thanks for answers. I tried different values but it doesn't give the same feeling of instagram's stories.

My other biggest problem is optimization. I am rendering video and assume there are 40-50 videos. Rendering time is so long, videos failing to load due to lack of ram and network resources. I need something like windowSize as in FlatList. I also tried to implement same animation on react-native-carousel but I failed.

https://snack.expo.io/@drtzack/paranoid-soda

billouboq commented 5 years ago

You can implement lazy loading, but for this you will need to change how this package work. Don't have time now, but when I do I will try to show you how you can achieve this

mqtik commented 4 years ago

@billouboq I'm also looking for this. Can you share you thoughts of how can we achieve this?

mqtik commented 4 years ago

Instead of a .map(), we could, perhaps, add a FlatList component there? image

I'm willig to make a PR for this. I'd like to know your thoughts first.