Skip to content

Commit

Permalink
fix: re-animated v3 animations (Easing, FadeIn)
Browse files Browse the repository at this point in the history
  • Loading branch information
siddarthkay committed Sep 8, 2023
1 parent 33074f6 commit 1981eea
Show file tree
Hide file tree
Showing 12 changed files with 75 additions and 187 deletions.
2 changes: 1 addition & 1 deletion ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ SPEC CHECKSUMS:
FBLazyVector: 5d4a3b7f411219a45a6d952f77d2c0a6c9989da5
FBReactNativeSpec: 3fc2d478e1c4b08276f9dd9128f80ec6d5d85c1f
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b
glog: 39f165f95d368bf68eb4fdab79c1799b09c283d5
HMSegmentedControl: 34c1f54d822d8308e7b24f5d901ec674dfa31352
Keycard: ac6df4d91525c3c82635ac24d4ddd9a80aca5fc8
libwebp: f62cb61d0a484ba548448a4bd52aabf150ff6eef
Expand Down
22 changes: 10 additions & 12 deletions src/quo/animated.cljs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
(ns quo.animated
(:refer-clojure :exclude [abs set delay divide])
(:require ["react-native-reanimated" :default animated :refer
(clockRunning
; EasingNode
)]
(clockRunning Easing)]
["react-native-redash" :as redash]
[oops.core :refer [ocall oget]]
[quo.gesture-handler :as gh]
Expand Down Expand Up @@ -91,22 +89,22 @@
;;;;; TODO: replace this with an updated implementation
;;;TypeError: undefined is not an object (evaluating
;;;'shadow.js.shim.module$react_native_reanimated.EasingNode.bezier')
;(def bezier (.-bezier ^js EasingNode))
(def bezier (.-bezier ^js Easing))

;;;ERROR TypeError: undefined is not an object (evaluating
;;;'shadow.js.shim.module$react_native_reanimated.EasingNode.linear')
;(def linear (.-linear ^js EasingNode))


;;; They depend on bezier and linear
;(def easings
; {:linear linear
; :ease-in (bezier 0.42 0 1 1)
; :ease-out (bezier 0 0 0.58 1)
; :ease-in-out (bezier 0.42 0 0.58 1)
; :cubic (bezier 0.55 0.055 0.675 0.19)
; :keyboard (bezier 0.17 0.59 0.4 0.77)})
;
(def easings
{; :linear linear
:ease-in (bezier 0.42 0 1 1)
:ease-out (bezier 0 0 0.58 1)
:ease-in-out (bezier 0.42 0 0.58 1)
:cubic (bezier 0.55 0.055 0.675 0.19)
:keyboard (bezier 0.17 0.59 0.4 0.77)})

(def springs
{:lazy {:damping 50
:mass 0.3
Expand Down
18 changes: 9 additions & 9 deletions src/quo2/components/drawers/drawer_buttons/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -129,56 +129,56 @@
(reanimated/animate-shared-value-with-delay bottom-view-top
(:height (rn/get-screen))
animations-duration
; :easing4
:easing4
animations-delay)
(reanimated/animate-shared-value-with-delay
height
max-height
animations-duration
; :easing4
:easing4
animations-delay)
(reanimated/animate-shared-value-with-delay
top-padding
(+ 68 (safe-area/get-top))
animations-duration
; :easing4
:easing4
animations-delay)
(reanimated/animate-shared-value-with-delay
top-children-opacity
0
animations-duration
; :easing4
:easing4
animations-delay)
(reanimated/animate-shared-value-with-delay
top-title-opacity
0
0
; :linear
:linear
(+ animations-delay animations-duration 500)))
reset-top-animation (fn []
(reanimated/set-shared-value top-title-opacity 1)
(reanimated/animate-shared-value-with-delay bottom-view-top
80
animations-duration
; :easing4
:easing4
50)
(reanimated/animate-shared-value-with-timing
height
default-height
animations-duration
; :easing4
:easing4
)
(reanimated/animate-shared-value-with-timing
top-padding
12
animations-duration
; :easing4
:easing4
)
(reanimated/animate-shared-value-with-timing
top-children-opacity
1
animations-duration
; :easing4
:easing4
))]
(rn/use-effect (fn []
(when on-init
Expand Down
2 changes: 1 addition & 1 deletion src/quo2/components/loaders/skeleton.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
(reanimated/animate-shared-value-with-repeat translate-x
window-width
1000
; :linear
:linear
(- 1)
false)
[masked-view/masked-view
Expand Down
10 changes: 5 additions & 5 deletions src/quo2/components/record_audio/record_audio/helpers.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
shared-value
value
duration
; :linear
:linear
))

(defn animate-linear-with-delay
Expand All @@ -16,7 +16,7 @@
shared-value
value
duration
; :linear
:linear
delay))

(defn animate-linear-with-delay-loop
Expand All @@ -25,7 +25,7 @@
shared-value
value
duration
; :linear
:linear
delay
-1))

Expand All @@ -35,7 +35,7 @@
shared-value
value
duration
; :easing1
:easing1
))

(defn animate-easing-with-delay
Expand All @@ -44,7 +44,7 @@
shared-value
value
duration
; :easing1
:easing1
delay))

(defn set-value
Expand Down
Loading

0 comments on commit 1981eea

Please sign in to comment.