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

Going back by swiping. Make the area to start swiping bigger. #50

Closed
jvlobo opened this issue Feb 14, 2016 · 16 comments
Closed

Going back by swiping. Make the area to start swiping bigger. #50

jvlobo opened this issue Feb 14, 2016 · 16 comments

Comments

@jvlobo
Copy link

jvlobo commented Feb 14, 2016

Hi there!

untitled-1

I'm gonna try to explain it with an image.

Now, when I want to go back in my app with react-native-simple-router by swiping, the area where I have to start swiping is really small (light blue in the image). What I'd like to do is to make this area bigger (light blue + dark blue in the image) to be able to start swiping easily.

I don't know if it is possible.

Thanks!

@davidLeonardi
Copy link
Contributor

I'm pretty sure this is an iOS specific property, and defined by the
gesture itself, rather than JS logic.

On Sun, Feb 14, 2016 at 9:06 PM JV Lobo notifications@github.com wrote:

Hi there!

[image: untitled-1]
https://cloud.githubusercontent.com/assets/5671420/13036089/7704ae58-d35e-11e5-9390-f3fb36264773.png

I'm gonna try to explain it with an image.

Now, when I want to go back in my app with react-native-simple-router
by swiping, the area where I have to start swiping is really small (light
blue in the image). What I'd like to do is to make this area bigger (light
blue + dark blue in the image) to be able to start swiping easily.

I don't know if it is possible.

Thanks!


Reply to this email directly or view it on GitHub
#50
.

@jvlobo
Copy link
Author

jvlobo commented Feb 14, 2016

So do you think it is not possible to change it?

In Twitter, for example, you can swipe from a bigger area.

Thanks.

@davidLeonardi
Copy link
Contributor

@jvlobo seems that sceneconfig can be used to configure gestures, wanna take a look into this?

@jvlobo
Copy link
Author

jvlobo commented Feb 15, 2016

Thanks for your answer @SEthX

I've been looking for some info in React Native doc but it seems like it doesn't provide so much information about SceneConfigs

Do you know how to set properties on that?

Thanks!

@ericraio
Copy link
Contributor

You should be able to configure the SceneConfigs directly onto the Navigator, we may need to set some defaults

@liamzebedee
Copy link

Yeah, if you change the edgeHitWidth variable to something larger that should fix it.

@jvlobo
Copy link
Author

jvlobo commented Feb 16, 2016

Thanks for your help guys.

Should I change the variable directly in NavigatorSceneConfigs.js or could I set it in my code?

Thanks.

@davidLeonardi
Copy link
Contributor

Set it in your code as a scene config...

On Tue, Feb 16, 2016 at 9:59 PM JV Lobo notifications@github.com wrote:

Thanks for your help guys.

Should I change the variable directly in NavigatorSceneConfigs.js or
could I set it in my code?

Thanks.


Reply to this email directly or view it on GitHub
#50 (comment)
.

@jvlobo
Copy link
Author

jvlobo commented Feb 20, 2016

Thank for your help guys.

I've configured a Scene config as it sets here: https://rnplay.org/apps/HPy6UA

The thing is that in the example, they use a component. Because I'm using React Native Simple Router I set the configureScene in my component:

<Router firstRoute={dashboard} hideNavigationBar={true} noStatusBar={true} configureScene={this._configureScene}/>

I don't know if I'm doing something wrong, but it seems like it doesn't work.

Thanks for the help.

@jvlobo jvlobo reopened this Feb 20, 2016
@lucaboieru
Copy link

I have the same issue with the swipe area. I was wondering how can I have my router configured such that it'll have the default iOS start swipe area width. I'm really new to to RN and mobile development and I would really appreciate if you could guide me step-by-step or show me some code.

@lucaboieru
Copy link

After some troubleshooting i found out how to configure the swipe area width.
I made this function

_configureScene() {
    var newConfig = Navigator.SceneConfigs.PushFromRight;
    newConfig.gestures.pop.edgeHitWidth = 50;
    return newConfig;
}

and passed it as a prop to the router
configureScene={this._configureScene()}

@jvlobo
Copy link
Author

jvlobo commented Feb 20, 2016

Hey @lucaboieru

Have you passed it like this:

<Router firstRoute={dashboard} hideNavigationBar={true} noStatusBar={true} configureScene={this._configureScene()}/>

I set the _configureScene() function above my render function and passed it as a prop but it seems like it doesn't work

@lucaboieru
Copy link

@jvlobo that's how i passed the new config. You can try setting the edgeHitWidth to something like 200 to see clearly if it works or not, because setting it to 50 like i did might seem like it does not work. If that still does not work we'll have to find another solution.

@jvlobo
Copy link
Author

jvlobo commented Feb 20, 2016

Yes, I set something like 200 or 300 to test it, but it seems like it doesn't work! :/

This is my code: http://puu.sh/neY0J/16af6f15f2.png

@lucaboieru
Copy link

You have to call the function _configureScene such that it will return to the prop the new configuration to be passed to the Navigator. Notice my () at the end.
screenshot 2016-02-20 19 18 12

@jvlobo
Copy link
Author

jvlobo commented Feb 20, 2016

Ok, It was wrong!!

Solved.

Thank you so much :)

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

5 participants