mirror of
https://github.com/status-im/status-react.git
synced 2025-01-11 11:34:45 +00:00
Fix slow scrolling on chat screen
This commit is contained in:
parent
6f920afcf7
commit
65e3b209f2
@ -166,6 +166,13 @@
|
|||||||
[props]
|
[props]
|
||||||
[:f> f-list-footer-avatar props])
|
[:f> f-list-footer-avatar props])
|
||||||
|
|
||||||
|
;;TODO(rasom) https://github.com/facebook/react-native/issues/30034
|
||||||
|
(defn- add-inverted-y-android
|
||||||
|
[style]
|
||||||
|
(cond-> style
|
||||||
|
platform/android?
|
||||||
|
(assoc :scale-y -1)))
|
||||||
|
|
||||||
(defn f-list-footer
|
(defn f-list-footer
|
||||||
[{:keys [chat scroll-y cover-bg-color on-layout]}]
|
[{:keys [chat scroll-y cover-bg-color on-layout]}]
|
||||||
(let [{:keys [chat-id chat-name emoji chat-type
|
(let [{:keys [chat-id chat-name emoji chat-type
|
||||||
@ -184,7 +191,7 @@
|
|||||||
[30 125]
|
[30 125]
|
||||||
[14 0]
|
[14 0]
|
||||||
header-extrapolation-option)]
|
header-extrapolation-option)]
|
||||||
[rn/view {:flex 1}
|
[rn/view (add-inverted-y-android {:flex 1})
|
||||||
[rn/view
|
[rn/view
|
||||||
{:style (style/header-container all-loaded?)
|
{:style (style/header-container all-loaded?)
|
||||||
:on-layout on-layout}
|
:on-layout on-layout}
|
||||||
@ -230,7 +237,8 @@
|
|||||||
(defn render-fn
|
(defn render-fn
|
||||||
[{:keys [type value deleted? deleted-for-me? content-type] :as message-data} _ _
|
[{:keys [type value deleted? deleted-for-me? content-type] :as message-data} _ _
|
||||||
{:keys [context keyboard-shown?]}]
|
{:keys [context keyboard-shown?]}]
|
||||||
[rn/view {:background-color (colors/theme-colors colors/white colors/neutral-95)}
|
[rn/view
|
||||||
|
(add-inverted-y-android {:background-color (colors/theme-colors colors/white colors/neutral-95)})
|
||||||
(if (= type :datemark)
|
(if (= type :datemark)
|
||||||
[quo/divider-date value]
|
[quo/divider-date value]
|
||||||
(if (= content-type constants/content-type-gap)
|
(if (= content-type constants/content-type-gap)
|
||||||
@ -285,11 +293,14 @@
|
|||||||
(scroll-handler event scroll-y)
|
(scroll-handler event scroll-y)
|
||||||
(when on-scroll
|
(when on-scroll
|
||||||
(on-scroll event)))
|
(on-scroll event)))
|
||||||
:style {:background-color (if all-loaded?
|
:style (add-inverted-y-android
|
||||||
cover-bg-color
|
{:background-color (if all-loaded?
|
||||||
(colors/theme-colors colors/white
|
cover-bg-color
|
||||||
colors/neutral-95))}
|
(colors/theme-colors
|
||||||
:inverted true
|
colors/white
|
||||||
|
colors/neutral-95))})
|
||||||
|
;;TODO(rasom) https://github.com/facebook/react-native/issues/30034
|
||||||
|
:inverted (when platform/ios? true)
|
||||||
:on-layout (fn [e]
|
:on-layout (fn [e]
|
||||||
;; FIXME: this is due to Android not triggering the initial
|
;; FIXME: this is due to Android not triggering the initial
|
||||||
;; scrollTo event
|
;; scrollTo event
|
||||||
|
Loading…
x
Reference in New Issue
Block a user