Enable layout animations by default (#16832)
Co-authored-by: Jamie Caprani <jamiecaprani@gmail.com>
This commit is contained in:
parent
98085cd9c9
commit
109061a112
|
@ -17,12 +17,15 @@
|
||||||
SlideInUp
|
SlideInUp
|
||||||
SlideOutUp
|
SlideOutUp
|
||||||
LinearTransition
|
LinearTransition
|
||||||
|
enableLayoutAnimations
|
||||||
runOnJS)]
|
runOnJS)]
|
||||||
[reagent.core :as reagent]
|
[reagent.core :as reagent]
|
||||||
["react-native-redash" :refer (withPause)]
|
["react-native-redash" :refer (withPause)]
|
||||||
[react-native.flat-list :as rn-flat-list]
|
[react-native.flat-list :as rn-flat-list]
|
||||||
[utils.worklets.core :as worklets.core]))
|
[utils.worklets.core :as worklets.core]))
|
||||||
|
|
||||||
|
(def enable-layout-animations enableLayoutAnimations)
|
||||||
|
|
||||||
(def ^:const default-duration 300)
|
(def ^:const default-duration 300)
|
||||||
|
|
||||||
;; Animations
|
;; Animations
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
[react-native.core :as rn]
|
[react-native.core :as rn]
|
||||||
[react-native.platform :as platform]
|
[react-native.platform :as platform]
|
||||||
[react-native.shake :as react-native-shake]
|
[react-native.shake :as react-native-shake]
|
||||||
|
[react-native.reanimated :as reanimated]
|
||||||
[reagent.impl.batching :as batching]
|
[reagent.impl.batching :as batching]
|
||||||
[status-im2.contexts.shell.jump-to.utils :as shell.utils]
|
[status-im2.contexts.shell.jump-to.utils :as shell.utils]
|
||||||
[status-im2.contexts.shell.jump-to.state :as shell.state]
|
[status-im2.contexts.shell.jump-to.state :as shell.state]
|
||||||
|
@ -47,6 +48,14 @@
|
||||||
(async-storage/get-item :selected-stack-id #(shell.utils/change-selected-stack-id % nil nil))
|
(async-storage/get-item :selected-stack-id #(shell.utils/change-selected-stack-id % nil nil))
|
||||||
(async-storage/get-item :screen-height #(reset! shell.state/screen-height %))
|
(async-storage/get-item :screen-height #(reset! shell.state/screen-height %))
|
||||||
|
|
||||||
|
;; Note - We have to enable layout animations manually at app startup,
|
||||||
|
;; otherwise, they will be enabled at runtime when they are used and will cause few bugs.
|
||||||
|
;; https://github.com/status-im/status-mobile/issues/16693
|
||||||
|
;; We can remove this call, once reanimated library is upgraded to v3.
|
||||||
|
;; Also, we can't move this call to reanimated.cljs file,
|
||||||
|
;; because that causes component tests to fail. (as function is not mocked in library jestUtils)
|
||||||
|
(reanimated/enable-layout-animations true)
|
||||||
|
|
||||||
(dev/setup)
|
(dev/setup)
|
||||||
|
|
||||||
(re-frame/dispatch-sync [:app-started]))
|
(re-frame/dispatch-sync [:app-started]))
|
||||||
|
|
Loading…
Reference in New Issue