From daa98107c37e64df3eac53843e9ffd3dc2b54c7d Mon Sep 17 00:00:00 2001 From: Jake McGinty Date: Tue, 30 Jun 2015 17:45:39 -0700 Subject: [PATCH] new composition styling Closes #3506 // FREEBIE --- res/anim/animation_toggle_in.xml | 15 +++ res/anim/animation_toggle_out.xml | 15 +++ res/drawable-hdpi/ic_send_push_white_24dp.png | Bin 0 -> 757 bytes res/drawable-hdpi/ic_send_sms_white_24dp.png | Bin 0 -> 757 bytes res/drawable-mdpi/ic_send_push_white_24dp.png | Bin 0 -> 485 bytes res/drawable-mdpi/ic_send_sms_white_24dp.png | Bin 0 -> 485 bytes .../circle_touch_highlight_background.xml | 9 ++ .../ic_send_push_white_24dp.png | Bin 0 -> 973 bytes res/drawable-xhdpi/ic_send_sms_white_24dp.png | Bin 0 -> 956 bytes .../ic_send_push_white_24dp.png | Bin 0 -> 1742 bytes .../ic_send_sms_white_24dp.png | Bin 0 -> 1558 bytes res/drawable-xxhdpi/ic_send_white_24dp.png | Bin 0 -> 562 bytes .../ic_send_push_white_24dp.png | Bin 0 -> 1367 bytes .../ic_send_sms_white_24dp.png | Bin 0 -> 1455 bytes res/drawable/circle_tintable.xml | 5 + .../circle_touch_highlight_background.xml | 8 ++ res/drawable/compose_background.xml | 6 +- res/layout/conversation_activity.xml | 93 ++++++++---------- res/layout/transport_selection.xml | 3 +- res/layout/transport_selection_list_item.xml | 12 ++- res/values-v19/colors.xml | 2 +- res/values/dimens.xml | 4 +- res/values/styles.xml | 14 +++ .../securesms/ConversationActivity.java | 15 +++ .../securesms/TransportOption.java | 17 ++-- .../securesms/TransportOptions.java | 18 ++-- .../securesms/TransportOptionsAdapter.java | 2 + .../securesms/TransportOptionsPopup.java | 72 ++++++++++++-- .../securesms/components/AnimatingToggle.java | 37 ++----- 29 files changed, 234 insertions(+), 113 deletions(-) create mode 100644 res/anim/animation_toggle_in.xml create mode 100644 res/anim/animation_toggle_out.xml create mode 100644 res/drawable-hdpi/ic_send_push_white_24dp.png create mode 100644 res/drawable-hdpi/ic_send_sms_white_24dp.png create mode 100644 res/drawable-mdpi/ic_send_push_white_24dp.png create mode 100644 res/drawable-mdpi/ic_send_sms_white_24dp.png create mode 100644 res/drawable-v21/circle_touch_highlight_background.xml create mode 100644 res/drawable-xhdpi/ic_send_push_white_24dp.png create mode 100644 res/drawable-xhdpi/ic_send_sms_white_24dp.png create mode 100644 res/drawable-xxhdpi/ic_send_push_white_24dp.png create mode 100644 res/drawable-xxhdpi/ic_send_sms_white_24dp.png create mode 100644 res/drawable-xxhdpi/ic_send_white_24dp.png create mode 100644 res/drawable-xxxhdpi/ic_send_push_white_24dp.png create mode 100644 res/drawable-xxxhdpi/ic_send_sms_white_24dp.png create mode 100644 res/drawable/circle_tintable.xml create mode 100644 res/drawable/circle_touch_highlight_background.xml diff --git a/res/anim/animation_toggle_in.xml b/res/anim/animation_toggle_in.xml new file mode 100644 index 0000000000..ffffd02d1e --- /dev/null +++ b/res/anim/animation_toggle_in.xml @@ -0,0 +1,15 @@ + + + + + \ No newline at end of file diff --git a/res/anim/animation_toggle_out.xml b/res/anim/animation_toggle_out.xml new file mode 100644 index 0000000000..1e6f7ed638 --- /dev/null +++ b/res/anim/animation_toggle_out.xml @@ -0,0 +1,15 @@ + + + + + \ No newline at end of file diff --git a/res/drawable-hdpi/ic_send_push_white_24dp.png b/res/drawable-hdpi/ic_send_push_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..64f6ceb372109faa636308ba3d6c5506f6cff648 GIT binary patch literal 757 zcmVHeM)!Eun?CcS zzw|TQShZkjhr7xO?XIh7&0__dJJ15{Z`r2Wqn%7m5g1{Bfoa8nH*FK{_T^%eM54;H$~paPFLVAsV=KAUyS6X> zT`E7@ND`ij2p^gweKVtVZEU%Ug{n-iA7X(r_;+Sc-yEwy;023k+ZXP&)$vY%cPt#4m1lPg-|+664%w(*~5|vS4umc|*RjdZ*u^gsUMzKYgo? z?va>OIN7uuLe|>jvg6F|J+BCny8dRUOwCu49I{mbDPhOte#7hQXZk5Y3rRA_W>rWr z>|?_nLrkNit$b{g0MZ4}Y+6G|5G`ppS_32m9V;?PT~w)>$iJndP+_!VG#5in+tP7a nz{6hmidQT3vez6u? zJ+<`d?U{(I?>DEKXTmTu`xW0i!+aBjc}5O?aH@GH0CR!LzcTQXGbR~kH{?oHbasaM zCjn*!RkMh&ADuRCXQuNN%7`l)*w4-!#{j5b@j!GUadxH!#st$>Z)d4wFbr(C)<{6x zqEP8pJLWIWN(Uf~wxle41cr6?ld~*1GHh}m5G6bfZnB3=Q0c8-O*V6oh*`@!GFrYiQ?+2%{)nbV?HvWBhf<}jzaSjQb6 z^`f_Z>PtWQqdR=8**TW0t&A*FnbUGMw7a8R;XYp|5K;aGcbPGMVp{9l(Y}s%o{l>` z;SHbo!Jo1u7?nZ^9N7PhrV7xnYy73iB5XW;!XVJ zAuod?nuK;n-UcO3)@|Gm*4s&V!_xIxzXRp|v2XynNF^IK&VAPJE~|d8Ds2+4@4?=| zs^?YFQ3FwcN1K}T8PL}(Q~OY5xp1dnue0Tjs$VjjpHL=o9=7o?9se#C4*33he+f>g zZ(9XrQrO@m1ewn1I<9hcSgz9XtJ1BuXezv--7QfjKpjBy^ZSzt7Ow5L=BzB6Up zXh-Fr=%iKH06J9eZ@IWMv(^`;Y1*M*Z~dxQV#jXW1&L=4ibK(M^o6Or{miGrLpJz7 zBsw}6xwcAtsdf})6VF>OflLBuW_>AS5~8J$)KQ#b;v!S{JUSX#(b0j1)=#GD8IR2E nIuE+f{o>+Y4>>GMAC3M4gRiyv(_Gks00000NkvXXu0mjfPrYpx literal 0 HcmV?d00001 diff --git a/res/drawable-mdpi/ic_send_push_white_24dp.png b/res/drawable-mdpi/ic_send_push_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..7d1e725b40dbb6827710c51ff256152b6b46bce3 GIT binary patch literal 485 zcmVjnmq^M`{{|u5(11E2uew#(8wI(?ZmC2TLS7CL8tAPmkUK+~rn&+mlT?Kw@RymE+3J9^uDB(t zSm}Ck5!K`guldYhy6I(tt*%QYZpuNkU~xxCU+H0x3FcXCoBd8W=d!Ar<0lUlTNfZ-s}(*EqhFwNoIglK{7W*hz(Yn_Umjm;LRDajTvC|L^=;^Tz-*hm?6r_Knd_lw zzt4WDv@n-H%SxHV4L3tdWLCPj0A6>iZ2qRW4G%kw43OiTM+%??W<_%;$b$~c6&I1o z9rJJj{Nwk^<}z@k8gN_zM01pfoREuK%AJl|x+9tkxz{%2qPDxQRG&QMV;}fX2tM$! br;3r=l!1>UM4DEA00000NkvXXu0mjf2hQH{ literal 0 HcmV?d00001 diff --git a/res/drawable-mdpi/ic_send_sms_white_24dp.png b/res/drawable-mdpi/ic_send_sms_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..74ac8833e70a85183b8e13e5afa45a1e8ec902be GIT binary patch literal 485 zcmVnpE!>FO%8-I|%1nVDl|W)SSpGDxF2e&YXpZ}rUv z-+D6?xX}%vGiZ?M;e}31UKeprZ!dOAa+m!waK4k0X`-}}`gADiCQ1-%(o5|~{zN8< zHR*!BZAzY#RPpB0%dJRmu~jCO%f;#_rGCvM#lv{biK1LuNw0(wH-_LZlP$2$F2|gc z0MzT18_^68dfq4g(x`{AHc1dABKWtg^o1t!dEpWU8I2R-Wdo5d5l17q?y$9(MsbGz(AlO(-x0docG}sqc}A&BD{K zhi}k;FGBD>8jF#xq6GEu*P+5dYp!q33e$^$aiX-=`P)$7Vb6KWGoCQUCJ(rwIELsS z+-8SNTB}jueWzS3j!P~`L@V4@OmB8`@Vtb2jba%5iX0Ge%spkp|1hOm`Nr#Qe-Ndj z;*g8>ySo(r_InjBXhS$q3AJ$T-7iQ1QFK^U>4ti^`okwOb+)=aw2zm( + + + + + + + \ No newline at end of file diff --git a/res/drawable-xhdpi/ic_send_push_white_24dp.png b/res/drawable-xhdpi/ic_send_push_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..2a0f54fb53300cab712b18e40cb2d30b980155ac GIT binary patch literal 973 zcmV;;12X)HP)&8a}nw@@=f>>vnIsRRsk zL9;?EZX$v}gbZp{h|dHG0#%TOn+(yq^m&J1j)0JXT-X#yGsMH&z3W(3lR$cyCSMnk+UNC2{tGzp@#)U|@y0u6#(k{ysmfFs2;HwZGM zR><1sM45&|x;Gf2gMLDcpf<>24T5+sHe2nG9$82>3%$#LH1>0CkfFJd*lhb?PQ??6 zR4Qbg2p4~kke(LLhb(8dd@JD!;0YL(3(?x{PIjK_-R3E;`P?6dnW8u^sv;Rufz)r> z>S#erS=YvPaj;{ZsfTOb>j^LW%FjlbDjrk@a+OtT86_QbwY;_M;ZUdP?ru-{!RRQR zP5aNb`!BoE%x_s6+QI>jbFS`gbFWu?=ns8OGDFrvB`ZOQ*DieGuaFHnoW2#L6f|4nnDY7++@!CGCGYDdD-@19OPh=| zH-b>X_bIR5&QQ@X)DA@#&fXM6kfN{7T3gLHFxrbH9|gu+y;3(hfQ#$RK&brp#`5~7 z!7G+6|F*1Gz%#jk%0oGT_)0lja9U~Qilzwu)^)C+lBBNw7EG~RzI=OsAvY3JFvAl1e|E*lpxdQICv2AQw@@;JFZUh%uBQFQ93liC# ze<+HVci+csX&lS30OACjrT4t#yBZ=$tHj^4f8F-i-Vo}2Ib(!QS-{3p1X0|(_Rh{0 z9rTTBLY1p*aj-5~zzIlV4nE9^#|Zi&skhe$>zoDLDlr?pW8Ww~@3+6ABN`$bfsZQU zd*zEa0bohfeUvZWbim3EE*5VBpg=sE)fCgwL5_B$qh$R^M>|Nz>Sz81Q#W$=J?!9*00000NkvXXu0mjf7!K25 literal 0 HcmV?d00001 diff --git a/res/drawable-xhdpi/ic_send_sms_white_24dp.png b/res/drawable-xhdpi/ic_send_sms_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..c8680adb2ad0c11cb96a940ba359761ccc0b0a99 GIT binary patch literal 956 zcmV;t14I0YP)u^SArgd{1I3h;S@A;$MBk|YU; zy&DMew4^{nKz!B^h~|Eub0swiNdhS{*=K0x$)E>qgF*>Nk;%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!|NJ)GO+L*`h)tNzxI zZ>~Zr2B(OYx-sd0k>vgbJ80HGM%z=RP96uecx~M^Nn2M+wp{m~J=0z(tp~ z#xk<|7gNwvImooQ14(9txZ3ROJ+8hM^i|IbN|guldI*}JU5J_acXraNm!S2)H6~?8 zh`I^V;tV&Mlf_hDL9Kq8^E9F!$g-H~FDTpe>My8zt9_@g%>(2?9uNu&3ew)sP^;UJ z2!%Yw<63+7WtKTo#f{AydfWWXuC}+m9rC=q#qMS|{Qua00oPQBpC!}jMgRZ+07*qo IM6N<$g6}K)_y7O^ literal 0 HcmV?d00001 diff --git a/res/drawable-xxhdpi/ic_send_white_24dp.png b/res/drawable-xxhdpi/ic_send_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..cbb64e09f4a1bb550620c9cc7a78acac6f5d60b8 GIT binary patch literal 562 zcmV-20?qx2P)004R> z004l5008;`004mK004C`008P>0026e000+ooVrmw00002VoOIv0RM-N%)bBt010qN zS#tmY3ljhU3ljkVnw%H_00F8=L_t(&-tF04PQpMGK;cuv0%QSVqC0LAXx)L7b%?@3 zq+5WXK9EM5*mi#Iy)mUj?)31xufBQ6`#`q z0i4)Su$>O*a_uSX0}g=z8Y)W5fMcLGV9xt3Kwo6N-!uy74l)Yp2Qmog4^j>o3Q`N$ z1^F**;sIkp;sIqqZNL?W>3}W)Yl^slvY^YgqhK8xPy-YdPzw|sP!kjsP#@$O&<4~7 z%=z#G&3U@|EST8`9NGrWSag7Mi-11+GRgV%1`OXQO3d$%fO0$6(D@yxD1QTLZKeI@ zcVyEB)B`>toZBH4kC)D+`SKsF$cNEX{5uSlApph#Mv;7A&v zsJ*K6ag5Vm!sfv0Kt-i{VC4=Hj1&tJj}!xHDCHxCg7)M(k%mBhuNG7z`GE`~xr2-% zxqt)?FXceyZ^(u~Z!GO2Nu7QqPy!`T0{v6a4>u+r5RAI_ZU6uP07*qoM6N<$f>Nj9 A-2eap literal 0 HcmV?d00001 diff --git a/res/drawable-xxxhdpi/ic_send_push_white_24dp.png b/res/drawable-xxxhdpi/ic_send_push_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..79211258f55af6001857fd80803ced4f6cfc39c9 GIT binary patch literal 1367 zcmV-d1*rOoP)10x0 zC{DZkQ#ld_Dqcow>PEupB1MnHQXxHTqWiLXq-HvqM~65%Jdlc!FrIhB*UJ*2+T5=c z?H;P~$j&kM(bLMI+ze4(y)6^U$py--qpTxg7nRY+vY{L-qEa$?St%sV z_&xw?b|ef|Ss8t;8j|B|)zHUsAsIGM9a(*?mPCNr{ib^QS-$jT{H|)s=vU&J@PO*; zXN3@#1EoR6Kx>3JtR_ABTQPK(nfxq0vIbf+bdM9n5jHkWiN5A`1R%K)jvPMXbX49F;ELOLr9qnXaH@Me*9`cG$ec?-O zk~g3dhoVLkn9zh4vYJ(G?qp{>$9eh~;yKTH&v(A}gTKU)^_Yz{hRQRMMXhQr+q+1A zgMBU|o;S=HlBdqpW;ch~ZD4nM*vE|?(yG;W;|W6yGt$@o(xy#Td3@;5qKY@MX-#cGo7&3e_Hm7y-QpQH#mbb!x+wxYjlPkQb ztJm$QDa4_#@_5er8Vj#H>vTrXqN%T#H*WV$ItOlg?08Eu+S8iz~H&*sdX-#o4uPihIJaIfUt8Y0fp z)d*+X)1J;UTvz9WQWz;Y8%Dh@=r=hZ*{JL5c^}I8-NL0jfc;HUel~s7?=^B>GfVg% zX7z@gYeQVtlbn||=GobP%m0SLVt&`@Gn0pSoFF+*<$VQnRVcufa@Gv-ct~=djCwsz z&Z?mRtH?Pf#G%Fel5=~WORHba6bdl4A9cDq#9=X6$rxn|jZwen>GZX!Ljk7rZK(ma zlZ4l8slH3U=jQ^Ls;B^0g*cqARHN+~ouu*yn7W(+9#@KyHq#Iy6%Sw%AB$^*&D0lh z^ZZreDP#)Ylonv&5{hpqxGn5%Tm5wU$-#E9d!Dw7gZ!e?W45!q#X@)3Gubb%!4*n% zxw=p+SL>eFZJ|CCFsEwlqo5ld@yrPiTZ5|b$+5ofrRX#&(7wtBw4zNMq z;x~-GeCh+7tg9h5h!$*31n4d2xv2PB382aAfFah8rcDh6m|HtuwRwotR)FoiXbUYN z)M|jqqhnw#21wqx0OJCT3y}PQCWdhV?v#W(L$#RGM@sdPIYRZA$wgW{5VN(q$V}ny Z?;m0VIE+miTc!X2002ovPDHLkV1h93w1NNt literal 0 HcmV?d00001 diff --git a/res/drawable-xxxhdpi/ic_send_sms_white_24dp.png b/res/drawable-xxxhdpi/ic_send_sms_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..0976f95f75462b68faaeaf24299682c6ac8b9716 GIT binary patch literal 1455 zcmV;g1yK5lP)jUg2u&f>vq%o2llv=nah{1`7YM5tDfbsMqCI@B2 zSrMTQak==)a>I!o$di+D7Fh{kElN~vnVw)KE=34VDlE|xL~<78I%t8wrW7@D@+FU& z3-AHzRm}qP020wcPAYla9Duv|1FckJLZX0By3kH86MBMuXsud9r&u@wn7389Ur()-gpzW{09H~1%jF{EvWG^x>EZ$oOF&d9Sh2BTBZ67PGLION zd5>J)WfzAzLK8nSfE~NSe4Y|DDvSvUyl^Hnm1#V~3uLgKS1F*71C-ItMJ{qlm%eLY zss4weFd~U$9CKMpJZbD;Cp*Zao@S16gdY0&i+-*tglJ+dx0sQ4x{ZY-l1L_>@HLJ6 zskk40=0QCS+PIHsqKRe=8`;1n3Mi+Ha(<$ZK7Q9^5OtEnSfvI-31tj-v4BOyv7B7C zvyDA8(?SdF^mC1?T-7bGf8`y*#VTg^Fp(HiNM$vf*-Jk8v~rGfoYCk_%2fy1j1zm) zV`*oIzZtU3Qr1B>Vd6t&hD8>y|IKF+DsQa6Xc_aT$x;xovg?)lsFO^YZ{7`1ZMymM zY$a0pa&yU4^WT%9aGw7UV6lnjTUm`w?RuJJlKEq-;$|N=w-QAZQA}fkD8O!$%-ei+ zyJ?ir!xik<8KRe3HVI(RX0Z9={)P={67{-EYzep%Wul=We1i49QzhXPjBv1-YK0JP zA=zJ*fCy?wytj+#QUGroV!oM`QnQWV2M;G1@Bj8hZos|K^hBQrfaKtkVmsnk>`a+6z}I#0=;>{Nn#^8Y;gZ_{QlC}?|$YL zwvx>+B^Gpfw$1NhY%G<>|@Kc!&?-m(0RH&R5J{Jd& zbChgnqe$L{hgIjPy96f&Cebf!evN4AgE^`v<}-o|qTpx8ZLEMXIL05x72 zGY!le2tXK}Zu2X(GH)cnLpZLVq%^PH8w8NS52UG?ZOjIkpoe*bSK?8CQGii^Q2>7c zbAuh=PLCv%G93;vSEQ@5ZznOtY>~izN+^>3E2Y4a|NVp3`WNwYXQN0`bV>jK002ov JPDHLkV1mf}uD1XH literal 0 HcmV?d00001 diff --git a/res/drawable/circle_tintable.xml b/res/drawable/circle_tintable.xml new file mode 100644 index 0000000000..6c5c360635 --- /dev/null +++ b/res/drawable/circle_tintable.xml @@ -0,0 +1,5 @@ + + + + diff --git a/res/drawable/circle_touch_highlight_background.xml b/res/drawable/circle_touch_highlight_background.xml new file mode 100644 index 0000000000..96f6b341a6 --- /dev/null +++ b/res/drawable/circle_touch_highlight_background.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/res/drawable/compose_background.xml b/res/drawable/compose_background.xml index c3369ec70f..6e74c4b6fa 100644 --- a/res/drawable/compose_background.xml +++ b/res/drawable/compose_background.xml @@ -1,9 +1,5 @@ - - + \ No newline at end of file diff --git a/res/layout/conversation_activity.xml b/res/layout/conversation_activity.xml index 5c7bdf651c..99be48928d 100644 --- a/res/layout/conversation_activity.xml +++ b/res/layout/conversation_activity.xml @@ -4,6 +4,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="fill_parent" android:layout_height="fill_parent" + xmlns:tools="http://schemas.android.com/tools" android:background="?conversation_background" android:orientation="vertical"> @@ -60,73 +61,65 @@ - + - + - + android:contentDescription="@string/conversation_activity__emoji_toggle_description" /> - + tools:hint="Send TextSecure message" /> + + android:id="@+id/button_toggle" + android:layout_width="50dp" + android:layout_height="50dp" + android:background="@drawable/circle_tintable" + android:layout_gravity="bottom"> + android:id="@+id/attach_button" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_gravity="center" + android:background="@drawable/circle_touch_highlight_background" + android:src="@drawable/ic_attach_white_24dp" + android:contentDescription="@string/ConversationActivity_add_attachment" + android:nextFocusLeft="@+id/embedded_text_editor" /> + android:id="@+id/send_button" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:contentDescription="@string/conversation_activity__send" + android:nextFocusLeft="@+id/embedded_text_editor" + android:src="?conversation_transport_sms_indicator" + android:background="@drawable/circle_touch_highlight_background" /> diff --git a/res/layout/transport_selection.xml b/res/layout/transport_selection.xml index 39951ca18d..d532f27d91 100644 --- a/res/layout/transport_selection.xml +++ b/res/layout/transport_selection.xml @@ -4,7 +4,8 @@ android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:background="?conversation_transport_popup_background"> + android:background="?conversation_transport_popup_background" + android:elevation="2dp"> diff --git a/res/layout/transport_selection_list_item.xml b/res/layout/transport_selection_list_item.xml index ba3ce5b8d7..8a6033e815 100644 --- a/res/layout/transport_selection_list_item.xml +++ b/res/layout/transport_selection_list_item.xml @@ -1,6 +1,7 @@ + android:padding="7dp" + android:background="@drawable/circle_tintable" + android:contentDescription="@string/transport_selection_list_item__transport_icon" + tools:src="@drawable/ic_send_push_white_24dp" + tools:backgroundTint="@color/textsecure_primary" /> - \ No newline at end of file + android:layout_height="wrap_content" + tools:text="TextSecure" /> + diff --git a/res/values-v19/colors.xml b/res/values-v19/colors.xml index 4d2b6f2d81..8eee1017ab 100644 --- a/res/values-v19/colors.xml +++ b/res/values-v19/colors.xml @@ -1,4 +1,4 @@ - #10000000 + #22000000 \ No newline at end of file diff --git a/res/values/dimens.xml b/res/values/dimens.xml index ca2e62ef97..d4b87973bd 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -7,8 +7,8 @@ 5dp 12sp 200sp - 0dp - 1dp + 2dp + 2dp 64dp 50dp 230dp diff --git a/res/values/styles.xml b/res/values/styles.xml index 72e11def65..94f39187a4 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -176,4 +176,18 @@ @drawable/error_round + + diff --git a/src/org/thoughtcrime/securesms/ConversationActivity.java b/src/org/thoughtcrime/securesms/ConversationActivity.java index 2354713293..f76a2f57dc 100644 --- a/src/org/thoughtcrime/securesms/ConversationActivity.java +++ b/src/org/thoughtcrime/securesms/ConversationActivity.java @@ -23,6 +23,11 @@ import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.IntentFilter; +import android.content.res.ColorStateList; +import android.content.res.TypedArray; +import android.graphics.Color; +import android.graphics.PorterDuff; +import android.graphics.PorterDuff.Mode; import android.graphics.drawable.ColorDrawable; import android.net.Uri; import android.os.AsyncTask; @@ -30,6 +35,7 @@ import android.os.Build; import android.os.Bundle; import android.provider.ContactsContract; import android.support.annotation.NonNull; +import android.support.v4.graphics.drawable.DrawableCompat; import android.text.Editable; import android.text.InputType; import android.text.TextWatcher; @@ -154,6 +160,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity private ConversationFragment fragment; private Button unblockButton; private View composePanel; + private View composeBubble; private AttachmentTypeSelectorAdapter attachmentAdapter; private AttachmentManager attachmentManager; @@ -732,6 +739,13 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity titleView = (ConversationTitleView) getSupportActionBar().getCustomView(); unblockButton = (Button) findViewById(R.id.unblock_button); composePanel = findViewById(R.id.bottom_panel); + composeBubble = findViewById(R.id.compose_bubble); + + int[] attributes = new int[]{R.attr.conversation_item_bubble_background}; + TypedArray colors = obtainStyledAttributes(attributes); + int defaultColor = colors.getColor(0, Color.WHITE); + composeBubble.getBackground().setColorFilter(defaultColor, PorterDuff.Mode.MULTIPLY); + colors.recycle(); attachmentAdapter = new AttachmentTypeSelectorAdapter(this); attachmentManager = new AttachmentManager(this, this); @@ -747,6 +761,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity public void onChange(TransportOption newTransport) { calculateCharactersRemaining(); composeText.setHint(newTransport.getComposeHint()); + buttonToggle.getBackground().setColorFilter(newTransport.getBackgroundColor(), Mode.MULTIPLY); } }); diff --git a/src/org/thoughtcrime/securesms/TransportOption.java b/src/org/thoughtcrime/securesms/TransportOption.java index 15b117ef55..875f1114ad 100644 --- a/src/org/thoughtcrime/securesms/TransportOption.java +++ b/src/org/thoughtcrime/securesms/TransportOption.java @@ -1,5 +1,7 @@ package org.thoughtcrime.securesms; +import android.support.annotation.DrawableRes; + import org.thoughtcrime.securesms.util.CharacterCalculator; import org.thoughtcrime.securesms.util.CharacterCalculator.CharacterState; @@ -11,19 +13,22 @@ public class TransportOption { } private int drawable; + private int backgroundColor; private String text; private Type type; private String composeHint; private CharacterCalculator characterCalculator; public TransportOption(Type type, - int drawable, + @DrawableRes int drawable, + int backgroundColor, String text, String composeHint, CharacterCalculator characterCalculator) { this.type = type; this.drawable = drawable; + this.backgroundColor = backgroundColor; this.text = text; this.composeHint = composeHint; this.characterCalculator = characterCalculator; @@ -37,10 +42,6 @@ public class TransportOption { return this.type == type; } - public boolean isPlaintext() { - return type == Type.SMS; - } - public boolean isSms() { return type == Type.SMS; } @@ -49,10 +50,14 @@ public class TransportOption { return characterCalculator.calculateCharacters(charactersSpent); } - public int getDrawable() { + public @DrawableRes int getDrawable() { return drawable; } + public int getBackgroundColor() { + return backgroundColor; + } + public String getComposeHint() { return composeHint; } diff --git a/src/org/thoughtcrime/securesms/TransportOptions.java b/src/org/thoughtcrime/securesms/TransportOptions.java index fd9b6ab950..81854a0443 100644 --- a/src/org/thoughtcrime/securesms/TransportOptions.java +++ b/src/org/thoughtcrime/securesms/TransportOptions.java @@ -82,32 +82,28 @@ public class TransportOptions { } private List initializeAvailableTransports(boolean isMediaMessage) { - List results = new LinkedList<>(); - int[] attributes = new int[]{R.attr.conversation_transport_sms_indicator, - R.attr.conversation_transport_push_indicator}; - TypedArray iconArray = context.obtainStyledAttributes(attributes); - int smsIconResource = iconArray.getResourceId(0, -1); - int pushIconResource = iconArray.getResourceId(1, -1); + List results = new LinkedList<>(); if (isMediaMessage) { - results.add(new TransportOption(Type.SMS, smsIconResource, + results.add(new TransportOption(Type.SMS, R.drawable.ic_send_sms_white_24dp, + context.getResources().getColor(R.color.grey_600), context.getString(R.string.ConversationActivity_transport_insecure_mms), context.getString(R.string.conversation_activity__type_message_mms_insecure), new MmsCharacterCalculator())); } else { - results.add(new TransportOption(Type.SMS, smsIconResource, + results.add(new TransportOption(Type.SMS, R.drawable.ic_send_sms_white_24dp, + context.getResources().getColor(R.color.grey_600), context.getString(R.string.ConversationActivity_transport_insecure_sms), context.getString(R.string.conversation_activity__type_message_sms_insecure), new SmsCharacterCalculator())); } - results.add(new TransportOption(Type.TEXTSECURE, pushIconResource, + results.add(new TransportOption(Type.TEXTSECURE, R.drawable.ic_send_push_white_24dp, + context.getResources().getColor(R.color.textsecure_primary), context.getString(R.string.ConversationActivity_transport_textsecure), context.getString(R.string.conversation_activity__type_message_push), new PushCharacterCalculator())); - iconArray.recycle(); - return results; } diff --git a/src/org/thoughtcrime/securesms/TransportOptionsAdapter.java b/src/org/thoughtcrime/securesms/TransportOptionsAdapter.java index 33b718d09a..72d10a1f28 100644 --- a/src/org/thoughtcrime/securesms/TransportOptionsAdapter.java +++ b/src/org/thoughtcrime/securesms/TransportOptionsAdapter.java @@ -1,6 +1,7 @@ package org.thoughtcrime.securesms; import android.content.Context; +import android.graphics.PorterDuff.Mode; import android.support.annotation.NonNull; import android.view.LayoutInflater; import android.view.View; @@ -54,6 +55,7 @@ public class TransportOptionsAdapter extends BaseAdapter { ImageView imageView = (ImageView) convertView.findViewById(R.id.icon); TextView textView = (TextView) convertView.findViewById(R.id.text); + imageView.getBackground().setColorFilter(transport.getBackgroundColor(), Mode.MULTIPLY); imageView.setImageResource(transport.getDrawable()); textView.setText(transport.getDescription()); diff --git a/src/org/thoughtcrime/securesms/TransportOptionsPopup.java b/src/org/thoughtcrime/securesms/TransportOptionsPopup.java index 3cbaf99f99..f813d778ae 100644 --- a/src/org/thoughtcrime/securesms/TransportOptionsPopup.java +++ b/src/org/thoughtcrime/securesms/TransportOptionsPopup.java @@ -1,11 +1,17 @@ package org.thoughtcrime.securesms; +import android.animation.Animator; +import android.animation.Animator.AnimatorListener; +import android.annotation.TargetApi; import android.content.Context; import android.graphics.drawable.BitmapDrawable; +import android.os.Build.VERSION; +import android.os.Build.VERSION_CODES; import android.support.annotation.NonNull; import android.view.LayoutInflater; import android.view.View; -import android.view.ViewTreeObserver; +import android.view.ViewAnimationUtils; +import android.view.ViewTreeObserver.OnGlobalLayoutListener; import android.view.WindowManager; import android.widget.AdapterView; import android.widget.ListView; @@ -20,6 +26,9 @@ public class TransportOptionsPopup implements ListView.OnItemClickListener { private final PopupWindow popupWindow; private final SelectedListener listener; + private OnGlobalLayoutListener observer; + private View parent; + public TransportOptionsPopup(@NonNull Context context, @NonNull SelectedListener listener) { this.listener = listener; this.adapter = new TransportOptionsAdapter(context, new LinkedList()); @@ -27,7 +36,6 @@ public class TransportOptionsPopup implements ListView.OnItemClickListener { View selectionMenu = LayoutInflater.from(context).inflate(R.layout.transport_selection, null); ListView listView = (ListView) selectionMenu.findViewById(R.id.transport_selection_list); - listView.setAdapter(adapter); this.popupWindow = new PopupWindow(selectionMenu); @@ -36,6 +44,10 @@ public class TransportOptionsPopup implements ListView.OnItemClickListener { this.popupWindow.setOutsideTouchable(true); this.popupWindow.setWindowLayoutMode(0, WindowManager.LayoutParams.WRAP_CONTENT); this.popupWindow.setWidth(context.getResources().getDimensionPixelSize(R.dimen.transport_selection_popup_width)); + if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { + this.popupWindow.setAnimationStyle(0); + this.popupWindow.setElevation(context.getResources().getDimensionPixelSize(R.dimen.transport_selection_popup_yoff)); + } listView.setOnItemClickListener(this); } @@ -48,17 +60,65 @@ public class TransportOptionsPopup implements ListView.OnItemClickListener { final int yoff = context.getResources().getDimensionPixelOffset(R.dimen.transport_selection_popup_yoff); popupWindow.showAsDropDown(parent, xoff, yoff); + animateInIfAvailable(); - parent.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { + this.parent = parent; + this.observer = new OnGlobalLayoutListener() { @Override public void onGlobalLayout() { popupWindow.update(parent, xoff, yoff, -1, -1); } - }); + }; + parent.getViewTreeObserver().addOnGlobalLayoutListener(observer); + } + + @TargetApi(VERSION_CODES.LOLLIPOP) private Animator getCircularReveal(View v, boolean in) { + int outBound = Math.max(v.getWidth(), v.getHeight()); + return ViewAnimationUtils.createCircularReveal(v, + v.getMeasuredWidth(), + v.getMeasuredHeight(), + in ? 0 : outBound, + in ? outBound : 0) + .setDuration(200); + } + + private void animateInIfAvailable() { + if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { + popupWindow.getContentView().getViewTreeObserver().addOnGlobalLayoutListener(new OnGlobalLayoutListener() { + @Override @TargetApi(VERSION_CODES.LOLLIPOP) public void onGlobalLayout() { + parent.getViewTreeObserver().removeGlobalOnLayoutListener(this); + if (popupWindow.getContentView().isAttachedToWindow()) { + getCircularReveal(popupWindow.getContentView(), true).start(); + } + } + }); + } + } + + private void animateOutIfAvailable() { + if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { + Animator animator = getCircularReveal(popupWindow.getContentView(), false); + animator.addListener(new AnimatorListener() { + @Override public void onAnimationStart(Animator animation) {} + @Override public void onAnimationCancel(Animator animation) {} + @Override public void onAnimationRepeat(Animator animation) {} + @Override public void onAnimationEnd(Animator animation) { + popupWindow.dismiss(); + } + }); + animator.start(); + } else { + popupWindow.dismiss(); + } } public void dismiss() { - this.popupWindow.dismiss(); + animateOutIfAvailable(); + if (this.observer != null && this.parent != null) { + parent.getViewTreeObserver().removeGlobalOnLayoutListener(observer); + } + this.observer = null; + this.parent = null; } @Override @@ -67,7 +127,7 @@ public class TransportOptionsPopup implements ListView.OnItemClickListener { } public interface SelectedListener { - public void onSelected(TransportOption option); + void onSelected(TransportOption option); } } diff --git a/src/org/thoughtcrime/securesms/components/AnimatingToggle.java b/src/org/thoughtcrime/securesms/components/AnimatingToggle.java index ea43faa971..01f45faebe 100644 --- a/src/org/thoughtcrime/securesms/components/AnimatingToggle.java +++ b/src/org/thoughtcrime/securesms/components/AnimatingToggle.java @@ -7,9 +7,13 @@ import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; import android.view.animation.Animation; +import android.view.animation.AnimationSet; +import android.view.animation.AnimationUtils; import android.view.animation.TranslateAnimation; import android.widget.FrameLayout; +import org.thoughtcrime.securesms.R; + public class AnimatingToggle extends FrameLayout { private static final int SPEED_MILLIS = 200; @@ -38,29 +42,19 @@ public class AnimatingToggle extends FrameLayout { } else { child.setVisibility(View.GONE); } + child.setClickable(false); } public void display(View view) { if (view == current) return; - int oldViewIndex = getViewIndex(current); - int newViewIndex = getViewIndex(view); - - int sign; - - if (oldViewIndex < newViewIndex) sign = -1; - else sign = 1; - - TranslateAnimation oldViewAnimation = createTranslation(0.0f, sign * 1.0f); - TranslateAnimation newViewAnimation = createTranslation(sign * -1.0f, 0.0f); - - animateOut(current, oldViewAnimation); - animateIn(view, newViewAnimation); + animateOut(current, AnimationUtils.loadAnimation(getContext(), R.anim.animation_toggle_out)); + animateIn(view, AnimationUtils.loadAnimation(getContext(), R.anim.animation_toggle_in)); current = view; } - private void animateOut(final View view, TranslateAnimation animation) { + private void animateOut(final View view, Animation animation) { animation.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { @@ -79,7 +73,7 @@ public class AnimatingToggle extends FrameLayout { view.startAnimation(animation); } - private void animateIn(View view, TranslateAnimation animation) { + private void animateIn(View view, Animation animation) { animation.setInterpolator(new FastOutSlowInInterpolator()); view.setVisibility(View.VISIBLE); view.startAnimation(animation); @@ -92,17 +86,4 @@ public class AnimatingToggle extends FrameLayout { throw new IllegalArgumentException("Not a parent of this view."); } - - private TranslateAnimation createTranslation(float startY, float endY) { - TranslateAnimation translateAnimation = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0.0f, - Animation.RELATIVE_TO_SELF, 0.0f, - Animation.RELATIVE_TO_SELF, startY, - Animation.RELATIVE_TO_SELF, endY); - - translateAnimation.setDuration(SPEED_MILLIS); - translateAnimation.setInterpolator(new FastOutSlowInInterpolator()); - - return translateAnimation; - } - }