hiding of param's suggestions

Former-commit-id: ecd7ae26b8
This commit is contained in:
Roman Volosovskyi 2016-06-21 10:27:07 +03:00
parent 23b90af064
commit 3931c0a1c7
5 changed files with 9 additions and 22 deletions

View File

@ -269,8 +269,7 @@
[messages-container [messages-container
[messages-view group-chat]] [messages-view group-chat]]
(when group-chat [typing-all]) (when group-chat [typing-all])
(cond [response-view]
command? [response-view] (when-not command? [suggestions-view])
:else [suggestions-view])
[chat-message-new] [chat-message-new]
(when show-actions-atom [actions-view])]) (when show-actions-atom [actions-view])])

View File

@ -1,20 +1,16 @@
(ns status-im.chat.views.message-input (ns status-im.chat.views.message-input
(:require-macros [status-im.utils.views :refer [defview]]) (:require-macros [status-im.utils.views :refer [defview]])
(:require [re-frame.core :refer [subscribe dispatch]] (:require [re-frame.core :refer [subscribe]]
[reagent.core :as r]
[status-im.components.react :refer [view [status-im.components.react :refer [view
animated-view animated-view
icon icon
touchable-highlight touchable-highlight
text-input text-input]]
dismiss-keyboard!]]
[status-im.components.animation :as anim]
[status-im.chat.views.plain-message :as plain-message] [status-im.chat.views.plain-message :as plain-message]
[status-im.chat.views.command :as command] [status-im.chat.views.command :as command]
[status-im.chat.styles.message-input :as st] [status-im.chat.styles.message-input :as st]
[status-im.chat.styles.plain-message :as st-message] [status-im.chat.styles.plain-message :as st-message]
[status-im.chat.styles.response :as st-response] [status-im.chat.styles.response :as st-response]))
[status-im.constants :refer [response-input-hiding-duration]]))
(defn send-button [{:keys [on-press accessibility-label]}] (defn send-button [{:keys [on-press accessibility-label]}]
[touchable-highlight {:on-press on-press [touchable-highlight {:on-press on-press
@ -22,15 +18,6 @@
[view st/send-container [view st/send-container
[icon :send st/send-icon]]]) [icon :send st/send-icon]]])
(defn animation-logic [{:keys [to-value val]}]
(fn [_]
(let [to-value @to-value]
(anim/start (anim/timing val {:toValue to-value
:duration response-input-hiding-duration})
(fn [arg]
(when (.-finished arg)
(dispatch [:set-animation ::message-input-offset-current to-value])))))))
(defn message-input-container [input] (defn message-input-container [input]
[view st/message-input-container input]) [view st/message-input-container input])

View File

@ -64,8 +64,8 @@
(let [to-scale (if @command? 0 1)] (let [to-scale (if @command? 0 1)]
(when-not @command? (anim/set-value width 56)) (when-not @command? (anim/set-value width 56))
(anim/start (anim/spring val {:toValue to-scale}) (anim/start (anim/spring val {:toValue to-scale})
(fn [] (fn [e]
(when @command? (when (and @command? (.-finished e))
(anim/set-value width 0.1))))))) (anim/set-value width 0.1)))))))
(defn smile-button [] (defn smile-button []

View File

@ -65,6 +65,7 @@
(defn container-animation-logic [{:keys [to-value val]}] (defn container-animation-logic [{:keys [to-value val]}]
(fn [_] (fn [_]
(println :to @to-value)
(let [to-value @to-value] (let [to-value @to-value]
(anim/start (anim/spring val {:toValue to-value}))))) (anim/start (anim/spring val {:toValue to-value})))))

View File

@ -37,7 +37,7 @@
:whisper-identity "" :whisper-identity ""
:phone-number ""} :phone-number ""}
:disable-group-creation false :disable-group-creation false
:animations {:to-response-height nil :animations {:to-response-height 0.1
:response-height-current nil :response-height-current nil
:command? false :command? false
:messages-offset 0 :messages-offset 0