From e728c155a12139daf977397fb0ea7a6de5339b57 Mon Sep 17 00:00:00 2001 From: Roman Volosovskyi Date: Thu, 30 Jun 2016 11:48:56 +0300 Subject: [PATCH] commands button --- .../res/drawable-hdpi/icon_input_list.png | Bin 0 -> 469 bytes .../res/drawable-mdpi/icon_input_list.png | Bin 0 -> 247 bytes .../res/drawable-xhdpi/icon_input_list.png | Bin 0 -> 333 bytes .../res/drawable-xxhdpi/icon_input_list.png | Bin 0 -> 651 bytes .../res/drawable-xxxhdpi/icon_input_list.png | Bin 0 -> 823 bytes src/status_im/chat/styles/plain_message.cljs | 19 +++++++-- src/status_im/chat/views/plain_message.cljs | 40 +++++++++++------- 7 files changed, 40 insertions(+), 19 deletions(-) create mode 100644 android/app/src/main/res/drawable-hdpi/icon_input_list.png create mode 100644 android/app/src/main/res/drawable-mdpi/icon_input_list.png create mode 100644 android/app/src/main/res/drawable-xhdpi/icon_input_list.png create mode 100644 android/app/src/main/res/drawable-xxhdpi/icon_input_list.png create mode 100644 android/app/src/main/res/drawable-xxxhdpi/icon_input_list.png diff --git a/android/app/src/main/res/drawable-hdpi/icon_input_list.png b/android/app/src/main/res/drawable-hdpi/icon_input_list.png new file mode 100644 index 0000000000000000000000000000000000000000..033344a21f021a20db58e5af74c97984f30c8fec GIT binary patch literal 469 zcmV;`0V@89P)Px$k4Z#9R5%gs6g^8qQS_X9uR=p04J{2i*qTH%H}nVcCkR0#MJNs>H5p2vMkqRo zKf&5v+6`)Mv3`M5p}y5-gUs~0ze!LbZ-jhdBWXO zxo;;(o^Tlf5Cv*@l{+2sQ!LdQuVgr7^(4r2v5U6I&YcRKpoF#t)+3jz`F zopt#w@>Q<3jyQ4|iS{lpPCl8pIyM8LrwB{cMxDI5MUJRw%GTko(^;R6zUv0ewvEUO zDZ()zwyyJMPhJ_*iprd!PFfrTF+H86iFjZJ8P8D59WR9bH>;w7eF7VPFL(|R@v%nCe-x6Ni!OhiJXp4ZE3NCJ+NTbnOl{)!Hq z0SseZvv*sYP}a5m9(6@Olyz+#(1h%TvaZ86w4sQ&Ybov;*ef~9ZRs?1{39t zjVF#A`0`&~_;O;v0Y&SXFC6|H|G+O%@c$rVdmh6zhm>F6&x@_-6kI0pj7g&Y!vz<1 vr7(5oVC9RA9ak9=vQ+F{uACuL|d!n>e8f=y(QCS3j3^P6Px$2T4RhR7eeDT(xQy+s((Xniv`W$1woGe+I@y>at>WVPRpvKzv#Q7Ler(|Noc& zhuieO94H3jRltRSjMn~Xp8x*-odsmdAd8d1e!|Sim|j(!vkjz|3FdQTgRqHF$#Rf2 zGJpU7p9!;%3C0*Gnh6x==$2y>0|gsU-4k@RWbmIbF*B#Z^f3-}B7`|)lpeVuFyM)h zq>}Lezkf6T|Nk#bWPE|MTXkX9c6{ndDhWxj9Au{qwDiPhKf}-|38AGI(Ip`xBjaP_ z5)W4}40s~M<*-rlkrM&~o(PF93EO(7ctM*|l(q?B(F<-H5?vBf*>aF0z-_~!Qxa0K fO^6Z&1D*&0^;fc{?`V4|00000NkvXXu0mjf5;uyo literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/drawable-xxhdpi/icon_input_list.png b/android/app/src/main/res/drawable-xxhdpi/icon_input_list.png new file mode 100644 index 0000000000000000000000000000000000000000..9e4fd528b3052cec72c432a4092e9f297d4b997f GIT binary patch literal 651 zcmV;60(AX}P)Px%MM*?KR9Fe^SiLVqK@gwWcS1))f<#G0N3D=(XzyPTL2^ezg3?DwxJwZ6FI-DQ z6k19uO2rYHQ#$YMnmsld&pFH9yWC6OHoH4JyYsPcXMS%Gs1*tY@9zG2L4isG!T>0^ zMZiLTU*}Fboenflvo`!t{^^{Q9}O!>MqKpwb&b_BVm)`%4Z+)_MAZ}CU(dNvSWLC5 zlcl-2B0o3v>G@GkG-GX)UZ?rCq49og_i#kY@+r|e=++`_k_5cH;>$*Ue|$MJdufD; z%4cI{Rr;FiD#+2f9aXkPLLyz-10Qnya8dc@IVC*SZ{mkWP9OSVDLOL3AU|B_2g?cH z#2W9{&|58WDxS zYdK!YPCa}vKu_YF2e>iGIPpN@fy4ui_W&ifc!yEvM5f`il>P*O?ER1b1qdYpibAAL z!b!^JJSRB4nLilzgYuaRB9%buQzKYjB6vQ&IzN47qqyO5g402u@-E67B`Up!E ztH`U<+yGvwc7oGN2K9r}TtkbosZ=|`X##RzD#aFZ>&rs&n+i_<)jAEoo#1rCtJB;< l4dcN_Fh>z&pIia(Xk^e@_4a002ovPDHLkV1h)hEa3nE literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/drawable-xxxhdpi/icon_input_list.png b/android/app/src/main/res/drawable-xxxhdpi/icon_input_list.png new file mode 100644 index 0000000000000000000000000000000000000000..d136f96ef87a84076a4bf075d92ad4491c369a98 GIT binary patch literal 823 zcmV-71IYY|P)Px%@kvBMRA>e5TFq+{Q4pV5n{5s%=s{?!7q2SqMXwe`6!hfTLqY4ofP$s*QctD_ zD~%vT(Y7Zg)w58cSgoEsh)}`5K&`!4!Bb33o-<35w&P1TOE=x!zPAvv^TEEE-@cF8 zAA?Z8lv0?>KfD4;T?T|Bo?5{dK%5!7d2JdIRl|2D{Uawce*bZgs#Ts62&Z+)QSu9J z8ZTutnH8Nq$+|9n^W*tK%j7vZ2ButsXY_xjotbd=!PLQW`OiI?G$)mUo@fEW6^i2> zfHOKalKCoQ+10i8z%XTaLmD*l;rAatet$bZ_eo=Gs=VYYr6p1vr{A8YA-bF0H1tuL z>O-f_o-e+cpZmQ&6vtch>ouF*^Zwv-RVt+kP_W;}ZQIQX)IOTQ6LMgux#3BRPHt?D zI@_9VaP2l;cf2HJM2=LLCesq2qpsbn4PV+*X~T)_wJ0N_C4e(h*-~!9mrjW+0{&|G zjHnC0QJ+#(W`+i-$nFhy zLE$oUeEemn`?v`@R!2C&YPI~Cl0QMgbb=G)XCAB8{tlhHaIyIM)yoYWUr+#&%Lx+i z$jo!lgr$F?IYAxAClmCOEhm_8PH@rh4g1+c=LB81dz7g5Rlk9^YA4?Dr;g(b`rObt zK|Y$8e&(=!o^DYttdjAPLFLdf`1*nh@Z4~u|Bz#?D~un1TLb}9nK z7edCD!kys+CkuzTBZ~=(==%ia;@#Lch<7Fn)F)VbBHgqyI#+LxWTv#Xx-v(}Q?tPm zx20|77q!i66O3D*;D347`vwu50gl!9Ldf`1_#gZjvG^HO7#siq002ovPDHLkV1fbj Bg_r;U literal 0 HcmV?d00001 diff --git a/src/status_im/chat/styles/plain_message.cljs b/src/status_im/chat/styles/plain_message.cljs index b85dea9a97..fa639b39fa 100644 --- a/src/status_im/chat/styles/plain_message.cljs +++ b/src/status_im/chat/styles/plain_message.cljs @@ -9,11 +9,24 @@ :justifyContent :center}) (defn message-input-button [scale] - {:transform [{:scale scale}]}) + {:transform [{:scale scale}] + :width 24 + :height 24 + :alignItems :center + :justifyContent :center}) (def list-icon - {:width 13 - :height 12}) + {:width 16 + :height 16}) + +(def requests-icon + {:background-color :#7099e6 + :width 8 + :height 8 + :border-radius 8 + :left 0 + :top 0 + :position :absolute}) (def close-icon {:width 12 diff --git a/src/status_im/chat/views/plain_message.cljs b/src/status_im/chat/views/plain_message.cljs index 86f06a7e6a..f1dc3a0cde 100644 --- a/src/status_im/chat/views/plain_message.cljs +++ b/src/status_im/chat/views/plain_message.cljs @@ -5,6 +5,7 @@ [status-im.components.react :refer [view animated-view icon + text touchable-highlight]] [status-im.components.animation :as anim] [status-im.chat.styles.plain-message :as st] @@ -30,22 +31,24 @@ (defn list-container [min] (fn [{:keys [command? width]}] (let [n-width (if @command? min 56) - delay (if @command? 100 0)] + delay (if @command? 100 0)] (anim/start (anim/timing width {:toValue n-width :duration response-input-hiding-duration :delay delay}) #(dispatch [:set :disable-input false]))))) (defn commands-button [] - (let [command? (subscribe [:command?]) - buttons-scale (anim/create-value (if @command? 1 0)) + (let [command? (subscribe [:command?]) + requests (subscribe [:get-requests]) + suggestions (subscribe [:get-suggestions]) + buttons-scale (anim/create-value (if @command? 1 0)) container-width (anim/create-value (if @command? 20 56)) - context {:command? command? - :val buttons-scale - :width container-width} - on-update (fn [_] - ((button-animation-logic context)) - ((list-container 20) context))] + context {:command? command? + :val buttons-scale + :width container-width} + on-update (fn [_] + ((button-animation-logic context)) + ((list-container 20) context))] (r/create-class {:component-did-mount on-update @@ -58,7 +61,12 @@ [animated-view {:style (st/message-input-button-touchable container-width)} [animated-view {:style (st/message-input-button buttons-scale)} - [icon :list st/list-icon]]]])}))) + (if (seq @suggestions) + [icon :close_gray st/close-icon] + [icon :input_list st/list-icon]) + (when (and (seq @requests) + (not (seq @suggestions))) + [view st/requests-icon])]]])}))) (defn smile-animation-logic [{:keys [command? val width]}] (fn [_] @@ -71,13 +79,13 @@ (anim/set-value width 0.1))))))) (defn smile-button [] - (let [command? (subscribe [:command?]) - buttons-scale (anim/create-value (if @command? 1 0)) + (let [command? (subscribe [:command?]) + buttons-scale (anim/create-value (if @command? 1 0)) container-width (anim/create-value (if @command? 0.1 56)) - context {:command? command? - :val buttons-scale - :width container-width} - on-update (smile-animation-logic context)] + context {:command? command? + :val buttons-scale + :width container-width} + on-update (smile-animation-logic context)] (r/create-class {:component-did-mount on-update