fix: activity center closing animation (#15222)

fix: activity center closing animation
This commit is contained in:
Omar Basem 2023-03-01 15:12:16 +04:00 committed by GitHub
parent 2ce4a820d7
commit 4a6e42c6f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 10 deletions

View File

@ -25,24 +25,26 @@
[bottom-anim-value alpha-value window-height]
(anim/start
(anim/parallel
[(anim/spring bottom-anim-value
[(anim/timing bottom-anim-value
{:toValue (- window-height)
:duration 300
:useNativeDriver true})
(anim/timing alpha-value
{:toValue 0
:duration 500
:duration 300
:useNativeDriver true})])))
(defn show-panel-anim
[bottom-anim-value alpha-value]
(anim/start
(anim/parallel
[(anim/spring bottom-anim-value
[(anim/timing bottom-anim-value
{:toValue 0
:duration 300
:useNativeDriver true})
(anim/timing alpha-value
{:toValue 0.4
:duration 500
:duration 300
:useNativeDriver true})])))
(defn popover-view
@ -58,7 +60,7 @@
(js/setTimeout
#(do (reset! current-popover nil)
(re-frame/dispatch [:hide-popover]))
200))
300))
(hide-panel-anim
bottom-anim-value
alpha-value
@ -184,7 +186,7 @@
[signing-sheets/fees-warning]
(= :activity-center view)
[activity-center/view]
[activity-center/view request-close]
:else
[view])]]]])))})))

View File

@ -134,7 +134,7 @@
(contains? types-with-unread types/system))}]}]))
(defn header
[]
[request-close]
[rn/view
[rn/view {:style style/header-container}
[quo/button
@ -143,7 +143,7 @@
:size 32
:accessibility-label :close-activity-center
:override-theme :dark
:on-press #(rf/dispatch [:hide-popover])}
:on-press request-close}
:i/close]
[quo/button
{:icon true
@ -202,7 +202,7 @@
nil)]))))
(defn view
[]
[request-close]
(let [active-swipeable (atom nil)]
[:f>
(fn []
@ -212,7 +212,7 @@
(let [notifications (rf/sub [:activity-center/filtered-notifications])
window-width (rf/sub [:dimensions/window-width])]
[rn/view {:style (style/screen-container window-width top bottom)}
[header]
[header request-close]
[rn/flat-list
{:data notifications
:render-data active-swipeable