cljsrn

https://github.com/drapanjanas/re-natal | https://github.com/drapanjanas/re-natal/wiki/FAQ | https://github.com/condense/mercury-app/wiki | https://github.com/seantempesta/expo-cljs-template/ https://www.npmjs.com/package/create-expo-cljs-app
2020-04-26T08:26:36.335700Z

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.

dnolen 2020-04-26T11:56:11.336200Z

@mac that's a bit odd - was pretty sure npx react-native run-foo would do that for you?

Shako Farhad 2020-04-26T12:01:16.337Z

Anyone here who have used the react-native-gesture-handler? I am trying to get this example working.

Shako Farhad 2020-04-26T12:01:49.337400Z

This is what I have done:

Shako Farhad 2020-04-26T12:03:20.339100Z

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 ๐Ÿ˜ฎ

Shako Farhad 2020-04-26T12:10:05.339700Z

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)).

2020-04-26T12:33:01.340500Z

@dnolen Apparently not.

dnolen 2020-04-26T12:33:54.340900Z

@mac so a known react native issue?

2020-04-26T12:49:13.342800Z

@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.

dnolen 2020-04-26T12:50:39.343400Z

huh ok, locally I've always seen the bundler auto start with run-android

dotemacs 2020-04-26T13:03:22.344200Z

@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"]]

Shako Farhad 2020-04-26T13:06:05.344400Z

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?

dotemacs 2020-04-26T13:16:55.344600Z

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?

Shako Farhad 2020-04-26T13:17:45.344800Z

Really? You can make modals pop in from all sides and not just bottom? ๐Ÿ˜ฎ

Shako Farhad 2020-04-26T13:17:59.345Z

How do you set the direction of the modal?

Shako Farhad 2020-04-26T13:29:38.345500Z

Ah, using the community version. Alright. I will check it out! Thanks for your guidance as always ๐Ÿ˜„

๐Ÿ‘ 1
2020-04-26T13:37:53.348500Z

@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

dnolen 2020-04-26T14:09:28.348800Z

Ok will update the docs

dnolen 2020-04-26T15:42:27.349Z

updated the docs

๐Ÿ‘ 2