[8452] remove scroll-view hack

Signed-off-by: Andrey Shovkoplyas <motor4ik@gmail.com>
This commit is contained in:
bitsikka 2019-06-21 14:33:04 +05:45 committed by Andrey Shovkoplyas
parent 119c5303a4
commit ed050f30a6
No known key found for this signature in database
GPG Key ID: EAAB7C8622D860A4
2 changed files with 19 additions and 28 deletions

View File

@ -1,9 +1,6 @@
(ns status-im.ui.screens.chat.styles.main (ns status-im.ui.screens.chat.styles.main
(:require [status-im.ui.components.colors :as colors])) (:require [status-im.ui.components.colors :as colors]))
(def scroll-root
{:flex 1})
(def chat-view (def chat-view
{:flex 1 {:flex 1
:background-color colors/white}) :background-color colors/white})

View File

@ -438,32 +438,26 @@
;; components (e.g. chat-toolbar) there can be a brief visual inconsistancy like showing 'add contact' ;; components (e.g. chat-toolbar) there can be a brief visual inconsistancy like showing 'add contact'
;; in public chat ;; in public chat
(when (= chat-id current-chat-id) (when (= chat-id current-chat-id)
;; this scroll-view is a hack that allows us to use on-blur and on-focus on Android [react/view {:style style/chat-view
;; more details here: https://github.com/facebook/react-native/issues/11071 :on-layout (fn [e]
[react/scroll-view {:scroll-enabled false (re-frame/dispatch [:set :layout-height (-> e .-nativeEvent .-layout .-height)]))}
:style style/scroll-root
:content-container-style style/scroll-root
:keyboard-should-persist-taps :handled}
^{:key current-chat-id} ^{:key current-chat-id}
[react/view {:style style/chat-view [chat-toolbar current-chat public? modal?]
:on-layout (fn [e] [connectivity/connectivity-view anim-translate-y]
(re-frame/dispatch [:set :layout-height (-> e .-nativeEvent .-layout .-height)]))} [connectivity/connectivity-animation-wrapper
[chat-toolbar current-chat public? modal?] {}
[connectivity/connectivity-view anim-translate-y] anim-translate-y
[connectivity/connectivity-animation-wrapper [messages-view-animation
{} ;;TODO(kozieiev) : When FlatList in react-native-desktop become viable it should be used instead of optimized ScrollView for chat
anim-translate-y (if platform/desktop?
[messages-view-animation [messages-view-desktop current-chat modal?]
;;TODO(kozieiev) : When FlatList in react-native-desktop become viable it should be used instead of optimized ScrollView for chat [messages-view current-chat modal?])]]
(if platform/desktop? (when show-input?
[messages-view-desktop current-chat modal?] [input/container])
[messages-view current-chat modal?])]] (when show-stickers?
(when show-input? [stickers/stickers-view])
[input/container]) (when show-message-options?
(when show-stickers? [message-options/view])])))
[stickers/stickers-view])
(when show-message-options?
[message-options/view])]])))
(defview chat [] (defview chat []
[chat-root false]) [chat-root false])