This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-04-26
Channels
- # announcements (10)
- # aws (5)
- # babashka (27)
- # beginners (175)
- # boot (1)
- # braveandtrue (2)
- # calva (11)
- # cider (13)
- # clj-kondo (91)
- # cljs-dev (54)
- # cljsrn (20)
- # clojure (164)
- # clojure-gamedev (3)
- # clojure-uk (43)
- # clojurescript (185)
- # core-async (6)
- # core-typed (1)
- # cursive (1)
- # docker (2)
- # emacs (2)
- # figwheel-main (78)
- # fulcro (69)
- # off-topic (20)
- # pathom (30)
- # planck (3)
- # re-frame (6)
- # reagent (70)
- # reitit (26)
- # ring (1)
- # shadow-cljs (120)
- # tools-deps (6)
- # vim (9)
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 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.
@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 😄
@dnolen @mac Yeah, same behavior for me on one of my setup (Ubuntu/Android Studio).
I must always open one terminal to run npx react-native start
and another for npx react-native run-android
.
Dunno why it's not always the case...depend on "something" in the setup