Request icon in message is overlapped by the next message fix (#400)
Former-commit-id: f1b687872b0f171cfaa9b692aedd0573631809f6
This commit is contained in:
parent
83d32e79e7
commit
82b3587fb0
|
@ -140,9 +140,9 @@
|
||||||
(def command-request-from-text
|
(def command-request-from-text
|
||||||
(merge style-sub-text {:marginBottom 2}))
|
(merge style-sub-text {:marginBottom 2}))
|
||||||
|
|
||||||
(def command-request-image-touchable
|
(defn command-request-image-touchable [top-offset?]
|
||||||
{:position :absolute
|
{:position :absolute
|
||||||
:top 4
|
:top (if top-offset? 4 -1)
|
||||||
:right -8
|
:right -8
|
||||||
:alignItems :center
|
:alignItems :center
|
||||||
:justifyContent :center
|
:justifyContent :center
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
(anim/start
|
(anim/start
|
||||||
(button-animation val min-scale loop? answered?)))))
|
(button-animation val min-scale loop? answered?)))))
|
||||||
|
|
||||||
(defn request-button [message-id command status-initialized?]
|
(defn request-button [message-id command status-initialized? top-offset?]
|
||||||
(let [scale-anim-val (anim/create-value min-scale)
|
(let [scale-anim-val (anim/create-value min-scale)
|
||||||
answered? (subscribe [:is-request-answered? message-id])
|
answered? (subscribe [:is-request-answered? message-id])
|
||||||
loop? (r/atom true)
|
loop? (r/atom true)
|
||||||
|
@ -62,7 +62,7 @@
|
||||||
[touchable-highlight
|
[touchable-highlight
|
||||||
{:on-press (when (and (not @answered?) status-initialized?)
|
{:on-press (when (and (not @answered?) status-initialized?)
|
||||||
#(set-chat-command message-id command))
|
#(set-chat-command message-id command))
|
||||||
:style st/command-request-image-touchable
|
:style (st/command-request-image-touchable top-offset?)
|
||||||
:accessibility-label (label command)}
|
:accessibility-label (label command)}
|
||||||
[animated-view {:style (st/command-request-image-view command scale-anim-val)}
|
[animated-view {:style (st/command-request-image-view command scale-anim-val)}
|
||||||
(when command-icon
|
(when command-icon
|
||||||
|
@ -70,7 +70,8 @@
|
||||||
|
|
||||||
(defn message-content-command-request
|
(defn message-content-command-request
|
||||||
[{:keys [message-id content from incoming-group]}]
|
[{:keys [message-id content from incoming-group]}]
|
||||||
(let [commands-atom (subscribe [:get-responses])
|
(let [top-offset (r/atom {:specified? false})
|
||||||
|
commands-atom (subscribe [:get-responses])
|
||||||
answered? (subscribe [:is-request-answered? message-id])
|
answered? (subscribe [:is-request-answered? message-id])
|
||||||
status-initialized? (subscribe [:get :status-module-initialized?])]
|
status-initialized? (subscribe [:get :status-module-initialized?])]
|
||||||
(fn [{:keys [message-id content from incoming-group]}]
|
(fn [{:keys [message-id content from incoming-group]}]
|
||||||
|
@ -86,6 +87,11 @@
|
||||||
:font :default}
|
:font :default}
|
||||||
from])
|
from])
|
||||||
[text {:style st/style-message-text
|
[text {:style st/style-message-text
|
||||||
|
:on-layout #(reset! top-offset {:specified? true
|
||||||
|
:value (-> (.-nativeEvent %)
|
||||||
|
(.-layout)
|
||||||
|
(.-height)
|
||||||
|
(> 25))})
|
||||||
:font :default}
|
:font :default}
|
||||||
content]]]
|
content]]]
|
||||||
(when (:request-text command)
|
(when (:request-text command)
|
||||||
|
@ -93,4 +99,5 @@
|
||||||
[text {:style st/style-sub-text
|
[text {:style st/style-sub-text
|
||||||
:font :default}
|
:font :default}
|
||||||
(:request-text command)]])
|
(:request-text command)]])
|
||||||
[request-button message-id command @status-initialized?]]))))
|
(when (:specified? @top-offset)
|
||||||
|
[request-button message-id command @status-initialized? (:value @top-offset)])]))))
|
||||||
|
|
Loading…
Reference in New Issue