From 52c10562dc94f234e641858b2ceda678c450a83f Mon Sep 17 00:00:00 2001 From: Andrey Shovkoplyas Date: Thu, 4 May 2017 13:57:40 +0300 Subject: [PATCH] fixes https://github.com/status-im/status-react/issues/1096 --- .../views/input/animations/responder.cljs | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/status_im/chat/views/input/animations/responder.cljs b/src/status_im/chat/views/input/animations/responder.cljs index b3fbd8fab2..a1e14f0cb0 100644 --- a/src/status_im/chat/views/input/animations/responder.cljs +++ b/src/status_im/chat/views/input/animations/responder.cljs @@ -3,20 +3,24 @@ [status-im.components.animation :as anim] [status-im.chat.views.input.utils :as input-utils] [re-frame.core :refer [dispatch]] - [taoensso.timbre :as log])) + [taoensso.timbre :as log] + [status-im.utils.platform :as p] + [status-im.components.toolbar-new.styles :as toolbar-st])) ;; todo bad name. Ideas? (defn enough-dy [gesture] (> (Math/abs (.-dy gesture)) 10)) (defn on-move [response-height layout-height] - (fn [_ gesture] - (when (enough-dy gesture) - (let [to-value (- @layout-height (.-moveY gesture))] - (when (> to-value input-utils/min-height) - (dispatch [:set :expandable-view-height-to-value to-value]) - (anim/start - (anim/spring response-height {:toValue to-value}))))))) + (let [margin-top (+ (get-in p/platform-specific [:component-styles :status-bar :main :height]) + (/ (:height toolbar-st/toolbar) 2))] + (fn [_ gesture] + (when (enough-dy gesture) + (let [to-value (+ (- @layout-height (.-moveY gesture)) margin-top)] + (when (> to-value input-utils/min-height) + (dispatch [:set :expandable-view-height-to-value to-value]) + (anim/start + (anim/spring response-height {:toValue to-value})))))))) (defn on-release [response-height handler-name key] (fn [_ gesture]