Enable layout animations by default (#16832)

Co-authored-by: Jamie Caprani <jamiecaprani@gmail.com>
This commit is contained in:
Parvesh Monu 2023-08-03 18:53:15 +05:30 committed by GitHub
parent 98085cd9c9
commit 109061a112
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View File

@ -17,12 +17,15 @@
SlideInUp
SlideOutUp
LinearTransition
enableLayoutAnimations
runOnJS)]
[reagent.core :as reagent]
["react-native-redash" :refer (withPause)]
[react-native.flat-list :as rn-flat-list]
[utils.worklets.core :as worklets.core]))
(def enable-layout-animations enableLayoutAnimations)
(def ^:const default-duration 300)
;; Animations

View File

@ -7,6 +7,7 @@
[react-native.core :as rn]
[react-native.platform :as platform]
[react-native.shake :as react-native-shake]
[react-native.reanimated :as reanimated]
[reagent.impl.batching :as batching]
[status-im2.contexts.shell.jump-to.utils :as shell.utils]
[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 :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)
(re-frame/dispatch-sync [:app-started]))