graalvm-mobile

phronmophobic 2021-07-11T19:53:47.254300Z

Just added an example that let's you script UIs using a sci repl, https://github.com/phronmophobic/mobiletest#membrane-example. Feedback welcome! Here's an example of a simple counter:

(require '[membrane.ui :as ui])
(require '[com.phronemophobic.mobiletest.membrane :refer
           [main-view]])


(def my-count (atom 0))

(defn counter-view []
  (ui/translate 50 100
                (ui/on
                 :mouse-down
                 (fn [pos]
                   (swap! my-count inc)
                   nil)
                 (ui/label (str "the count "
                                @my-count)
                           (ui/font nil 42)))))


(add-watch my-count ::update-view (fn [k ref old updated]
                                    (reset! main-view (counter-view))))

(reset! my-count 0)

👍 1
borkdude 2021-07-11T19:54:12.254600Z

wwwwaaat, wow

😄 1
phronmophobic 2021-07-11T19:56:29.255400Z

I've done a little bit more research into what objc interop would look like, but it's still a work in progress.

phronmophobic 2021-07-11T19:58:39.256200Z

I wish the Apple ecosystem wasn't so closed down. Not sure what the best way to make it easy for other people to try things out.

borkdude 2021-07-11T19:59:39.256900Z

Perhaps publish a thing that people can try via this thing, what was it, TestFlight?

phronmophobic 2021-07-11T20:00:09.257200Z

yea, I can look into that if people are interested

borkdude 2021-07-11T20:00:55.257500Z

I would be interested in that.

borkdude 2021-07-11T20:01:13.257900Z

Are you also able to change the UI via the SCI REPL in the published app?

phronmophobic 2021-07-11T20:01:51.258600Z

yea, there's a main-view atom. just reset its value and it will get redrawn

borkdude 2021-07-11T20:01:58.258800Z

that's wicked

phronmophobic 2021-07-11T20:06:04.259800Z

in addition to test-flight, I guess there's probably some CI system that could build everything for you if given the right provisioning profile

borkdude 2021-07-11T20:06:38.260100Z

Maybe try to get something in the app store? ;)

phronmophobic 2021-07-11T20:07:54.261200Z

I know Apple has frowned upon apps with scripting capabilities before, but maybe it's less restrictive now?

borkdude 2021-07-11T20:08:09.261400Z

Maybe don't tell em? ;)

borkdude 2021-07-11T20:08:23.261700Z

it's just "a config file to set the UI layout"

borkdude 2021-07-11T20:09:21.263Z

I think you could let users point to their gist to import a certain UI configuration (using scripting). Don't know what the app itself would do, perhaps a 4clojure app (now that the site is closing down) or a SCI REPL?

borkdude 2021-07-11T20:10:25.263700Z

(typing code on a phone is a bit awkward though)

borkdude 2021-07-11T20:10:45.264300Z

perhaps "docstring of the day", an app which shows you info about a particular clojure function

phronmophobic 2021-07-11T20:11:20.264800Z

yea, it's more fun if you can script against the Apple platform apis

phronmophobic 2021-07-11T20:11:32.265100Z

otherwise, you might as well make a web app

borkdude 2021-07-11T20:15:06.265300Z

yes, agreed

borkdude 2021-07-11T21:25:18.265800Z

@smith.adriane I wonder, have you ever had the stalling problem again since we made the initialize-at-build-time fix? > If it gets stuck directly after setup and doesn't reach the clinit phase within 3-4 minutes, try stopping the script and restarting ./scripts/compile-shared.

phronmophobic 2021-07-11T21:25:33.266Z

I haven't

borkdude 2021-07-11T21:25:38.266200Z

cool

phronmophobic 2021-07-11T21:26:20.266800Z

good find! maybe it's time to remove the warning from the docs

borkdude 2021-07-11T21:27:25.267400Z

Perhaps it's possible to record your screen on the phone as post this as an animated gif in the repo

phronmophobic 2021-07-11T21:29:21.267700Z

yea, shouldn't be too hard

borkdude 2021-07-11T21:30:29.268200Z

also perhaps make a link or mention of this channel to get more interested people in here

👍 1
➕ 1