mirror of
https://github.com/status-im/status-react.git
synced 2025-02-20 06:39:22 +00:00
46 lines
1.0 KiB
Clojure
46 lines
1.0 KiB
Clojure
(ns status-im.components.animation
|
|
(:require [status-im.components.react :refer [animated]]))
|
|
|
|
(defn start
|
|
([anim] (.start anim))
|
|
([anim callback] (.start anim callback)))
|
|
|
|
(defn timing [anim-value config]
|
|
(.timing animated anim-value (clj->js config)))
|
|
|
|
(defn spring [anim-value config]
|
|
(.spring animated anim-value (clj->js config)))
|
|
|
|
(defn event [config]
|
|
(.event animated (clj->js [nil, config])))
|
|
|
|
(defn add-listener [anim-value listener]
|
|
(.addListener anim-value listener))
|
|
|
|
(defn remove-all-listeners [anim-value]
|
|
(.removeAllListeners anim-value))
|
|
|
|
(defn stop-animation [anim-value]
|
|
(.stopAnimation anim-value))
|
|
|
|
(defn value [anim-value]
|
|
(.-value anim-value))
|
|
|
|
(defn set-value [anim-value value]
|
|
(.setValue anim-value value))
|
|
|
|
(defn create-value [value]
|
|
(js/React.Animated.Value. value))
|
|
|
|
(defn x [value-xy]
|
|
(.-x value-xy))
|
|
|
|
(defn y [value-xy]
|
|
(.-y value-xy))
|
|
|
|
(defn get-layout [value-xy]
|
|
(js->clj (.getLayout value-xy)))
|
|
|
|
(defn create-value-xy [x y]
|
|
(js/React.Animated.ValueXY. (clj->js {:x x, :y y})))
|