For anybody using krell on Ubuntu with Android Studio and the Android Studio emulator, in addition to the steps described on github and the react native page, I had to run npm start
in the project directory to get it to serve the files to the emulator.
@mac that's a bit odd - was pretty sure npx react-native run-foo
would do that for you?
Anyone here who have used the react-native-gesture-handler? I am trying to get this example working.
This is what I have done:
The (.-state nativeEvent) thing is just nil (it seems so). When using the .equals function that if does return true, and the alert does popup, but it does so on any kind of press not just longpress ๐ฎ
Yeah the problem is that (.-state nativeEvent) is nil no matter what. Am I accessing it wrong? nvm! When in doubt, use (js-keys javascriptObject) ๐ I got a list of all the attributes, and obviously I wasn't accessing the correct one from start. Need to do (.-state (.-nativeEvent events)).
@dnolen Apparently not.
@mac so a known react native issue?
@dnolen If I read this https://reactnative.dev/docs/environment-setup#native correctly it is not an issue but necessary to run the app. You need both npx react-native start (or npm start) and npx react-native run-android. So you might want to add it to the krell reagent tutorial.
huh ok, locally I've always seen the bundler auto start with run-android
@shakof91 just to get a long press handling, why donโt you try this:
...
(:require [reagent.core :as r])
(def react-native (js/require "react-native"))
(def touchable-opacity (r/adapt-react-class (.-TouchableOpacity react-native)))
[touchable-opacity {:on-long-press #(js/alert "long press")}
[text {} "long press"]]
Oh! I didn't know you could do that with the regular react native. ๐ฎ What I want to achieve with this gesture handler thing is to translate a view up and down or side to side, or even just moving a view around on the screen. So tap -> move -> release. What would you recommend for this kind of itneraction?
You can create a view and within this view you can add a modal that pops in, from left/right/up or down, which is by default not visible. Then depending on some pre-defined value, the modal is either visible or not. By default it can be not visible and by the long press this boolean value becomes true, thus making it visible. Does that make sense?
Really? You can make modals pop in from all sides and not just bottom? ๐ฎ
How do you set the direction of the modal?
Something like this: https://github.com/react-native-community/react-native-modal/blob/master/example/src/modals/SlideModal.tsx#L14
Ah, using the community version. Alright. I will check it out! Thanks for your guidance as always ๐
Ok will update the docs
updated the docs