Skip to content

Commit 551f017

Browse files
committed
nada
1 parent 3930689 commit 551f017

File tree

5 files changed

+54
-39
lines changed

5 files changed

+54
-39
lines changed

ios/Runner/Info.plist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,7 @@
4343
</array>
4444
<key>UIViewControllerBasedStatusBarAppearance</key>
4545
<false/>
46+
<key>CADisableMinimumFrameDurationOnPhone</key>
47+
<true/>
4648
</dict>
4749
</plist>

src/tiltontec/example/fab.cljd

Lines changed: 28 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
(defn make-app []
2525
(material-app
2626
{:title "Expandable Fab/MX"
27+
:theme (.dark m/ThemeData) ;;(m/ThemeData. :primarySwatch m.Colors/pink)
2728
:debugShowCheckedModeBanner false}
2829
{:name :mat-app}
2930

@@ -47,17 +48,20 @@
4748
(defn expandable-fab [& {:keys [initial-open? distance actions] :or [initial-open? false]}]
4849
(fx/sized-box+expand
4950
{:initState (fn [this me]
51+
(dp :all-new-fab!)
5052
(let [c (util/rmap-meta-setf [:controller me]
5153
(m/AnimationController
5254
:value (if initial-open? 1.0 0.0)
5355
:duration ^:const (dart:core/Duration :milliseconds 250)
5456
:vsync this))]
55-
;; todo can we just make a Ticker instead of using the state mixin
5657
(util/rmap-meta-setf [:expand-animation me]
5758
(m/CurvedAnimation
5859
:curve m.Curves/fastOutSlowIn
5960
:reverseCurve m.Curves/easeOutQuad
60-
:parent c))))}
61+
:parent c))))
62+
:dispose (fn [this me]
63+
(when-let [controller (:controller (meta me))]
64+
(.dispose controller)))}
6165
{:name :fab
6266
:step (cF (/ 90.0 (dec (count actions))))
6367
:open? (cI initial-open?
@@ -71,27 +75,27 @@
7175
:clipBehavior m.Clip/none}
7276
(tap-to-close-fab me)
7377
;; Matrix always flattens children, and discards nils, so we can offer a collection mid-children
74-
(doall (map-indexed
75-
(fn [i action]
76-
(expanding-action-button me
77-
:direction-degrees (* i (fmuv :step :fab))
78-
:max-distance distance
79-
:progress-key :expand-animation
80-
:action action))
81-
actions))
78+
(doall (do (dp :rebuilding-actions!!)
79+
(map-indexed
80+
(fn [i action]
81+
(expanding-action-button me
82+
:direction-degrees (* i (fmuv :step :fab))
83+
:max-distance distance
84+
:progress-key :expand-animation
85+
:action action))
86+
actions)))
8287
(tap-to-open-fab me))))
8388

8489
(defn expanding-action-button [me & {:keys [action direction-degrees max-distance progress-key]}]
85-
(dp :eab-entry
86-
;;:fab (md/fm* :fab)
87-
:ani-key progress-key ;; :ani (progress-key (meta (md/fm* :fab)) :notfound)
88-
:ctx! (when-let [^State state (:state-ref (meta me))]
89-
(.context state)))
90+
#_(dp :eab-entry
91+
;;:fab (md/fm* :fab)
92+
:ani-key progress-key ;; :ani (progress-key (meta (md/fm* :fab)) :notfound)
93+
:ctx! (when-let [^State state (:state-ref (meta me))]
94+
(.context state)))
9095

9196
(fx/animated-builder
92-
{:animation ;;(cF (progress-key (meta (md/fm* :fab))))
93-
(fn [me ctx]
94-
(progress-key (meta (md/fm* :fab))))
97+
{:animation (fn [me ctx]
98+
(progress-key (meta (md/fm* :fab))))
9599
;; todo lose "beefer"
96100
:ani-beefer (fn [me ctx child]
97101
(let [fab (md/fm* :fab)
@@ -124,9 +128,10 @@
124128
(show-action ctx action)
125129
nil))))
126130

127-
(action-button
131+
(action-button ctx
128132
:icon (:icon action)
129133
:onPressed (fn ^void []
134+
;; todo roll up into (with-context (ctx) ....)
130135
(let [^State state (:state-ref (meta me))]
131136
(assert state)
132137
(assert (.context state))
@@ -161,28 +166,15 @@
161166
:onPressed #(-> ctx m.Navigator/of .pop)
162167
:child ^:const (m/Text "CLOSE"))]))))
163168

164-
(defn action-button [& {:keys [onPressed icon]}]
169+
(defn action-button [ctx & {:keys [onPressed icon]}]
165170
(fx/material {:shape ^:const (m/CircleBorder)
166171
:clipBehavior m.Clip/antiAlias
167-
:color (fn [me ctx]
168-
(dp :color-callback!!!!!)
169-
(-> (Theme/of ctx) .-colorScheme .-secondary))
170-
;; todo avoid callback
171-
#_(cF (dp :mtlcolor-meta (meta me))
172-
173-
Colors/red) #_(cF
174-
(dp :mtlcolor-sees (my-state))
175-
176-
;;(-> (Theme/of (my-ctx)) .-colorScheme .-secondary)
177-
)
172+
:color (-> (Theme/of ctx) .-colorScheme .-secondary)
178173
:elevation 4.0}
179174
(fx/icon-button
180175
{:onPressed onPressed
181176
:icon icon
182-
:color Colors/white ;; todo use theme
183-
#_(cF (assert (my-ctx))
184-
(-> (Theme/of (my-ctx)) .-colorScheme .-onSecondary))})))
185-
177+
:color (-> (Theme/of ctx) .-colorScheme .-onSecondary)})))
186178

187179
(defn- tap-to-close-fab [par]
188180
(f/nest
@@ -200,6 +192,7 @@
200192
(m/Icon m.Icons/close :color m.Colors/blue #_(.primaryColor theme)))) ;; todo use theme
201193

202194
(defn- tap-to-open-fab [par]
195+
(dp :tap-to-open-entry)
203196
(f/nest
204197
(m/IgnorePointer :ignoring (boolean (mget (md/fasc :fab par) :open?)))
205198
(m/AnimatedContainer

src/tiltontec/mx_flutter/core.cljd

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,21 @@
1919
(defmacro my-state []
2020
`^State (:state-ref (meta ~'me)))
2121

22+
#_
2223
(defmacro my-ctx []
2324
`(.context ^State (:state-ref (meta ~'me))))
2425

26+
(defmacro my-ctx [& [me]]
27+
(let [me-ref (or me 'me)]
28+
`(do (assert (:state-ref (meta ~me-ref)) (str "state ref not bound for " (minfo ~me-ref)))
29+
(.context ^State (:state-ref (meta ~me-ref))))))
30+
31+
#_ (defmacro fmu [name & [me]]
32+
(let [me-ref (or me 'me)]
33+
`(let [name# ~name]
34+
(fm-navig #(= name# (md-get % :name))
35+
~me-ref :me? false :up? true :inside? false))))
36+
2537
(defn ctx-page-push [ctx fx-page-def]
2638
;; fx-page-def will be a def (NOT defn) like (def (fx/scaffold....
2739
(.push (-> ctx m.Navigator/of)
@@ -70,12 +82,11 @@
7082
nil)
7183

7284
(dart/is? fab m/Widget)
73-
(do (dp :fab-is-widget fab)
85+
(do ;; (dp :fab-is-widget fab)
7486
fab)
7587

7688
(fn? fab)
7789
(do (dp :ew-sees-fn dbg-key fab)
78-
;; render-fx?
7990
(recur [dbg-key :fn] me ctx (fab me ctx)))
8091

8192
(and (cty/md-ref? fab)
@@ -124,7 +135,6 @@
124135
:clipBehavior (mget me :clipBehavior)
125136
;; todo write call-or-get-property or sth
126137
:color (let [color (mget me :color)]
127-
(dp :MTL-sees-color!! color)
128138
(if (fn? color)
129139
(color me ctx)
130140
color))
@@ -145,7 +155,6 @@
145155
:icon (mget me :icon)
146156
:onPressed (mget me :onPressed)
147157
:color (let [color (mget me :color)]
148-
(dp :icon-button-sees-color!! color)
149158
(if (fn? color)
150159
(color me ctx)
151160
color))))))
@@ -163,6 +172,7 @@
163172
(fn [me ctx]
164173
(m/Scaffold
165174
:appBar (let [abar (mget me :appBar)]
175+
;; todo convert to, and create, universal extract-widget
166176
(if (dart/is? abar m/AppBar)
167177
abar
168178
(tag/render-fx abar)))
@@ -208,6 +218,7 @@
208218
(type-beefer me ctx))))
209219
(^void initState [this]
210220
(.initState ^super this)
221+
(rmap-meta-setf [:context me] (.context this))
211222
(when-let [init (mget me :initState)]
212223
(init this me)))
213224
(^void dispose [this]

src/tiltontec/mx_flutter/tag.cljd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
(beefer me ctx))
4545
(^void initState [this]
4646
(.initState ^super this)
47+
(rmap-meta-setf [:context me] (.context this))
4748
(when-let [init (mget me :initState)]
4849
(init this me)))
4950
(^void dispose [this]

windows/flutter/generated_plugins.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
list(APPEND FLUTTER_PLUGIN_LIST
66
)
77

8+
list(APPEND FLUTTER_FFI_PLUGIN_LIST
9+
)
10+
811
set(PLUGIN_BUNDLED_LIBRARIES)
912

1013
foreach(plugin ${FLUTTER_PLUGIN_LIST})
@@ -13,3 +16,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST})
1316
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
1417
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
1518
endforeach(plugin)
19+
20+
foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
21+
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin})
22+
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
23+
endforeach(ffi_plugin)

0 commit comments

Comments
 (0)