From 2016fa315b07a2c88f577e632abf65325bd57a58 Mon Sep 17 00:00:00 2001 From: Moxie Marlinspike Date: Mon, 22 Jun 2015 08:46:43 -0700 Subject: [PATCH] Support for quick reply from notifications. Fixes #483 Closes #3455 // FREEBIE --- AndroidManifest.xml | 9 ++ res/anim/slide_from_top.xml | 7 ++ res/anim/slide_to_top.xml | 7 ++ res/drawable-hdpi/ic_launch_white_24dp.png | Bin 0 -> 357 bytes res/drawable-hdpi/ic_reply_white_36dp.png | Bin 0 -> 467 bytes res/drawable-mdpi/ic_launch_white_24dp.png | Bin 0 -> 268 bytes res/drawable-mdpi/ic_reply_white_36dp.png | Bin 0 -> 350 bytes res/drawable-xhdpi/ic_launch_white_24dp.png | Bin 0 -> 368 bytes res/drawable-xhdpi/ic_reply_white_36dp.png | Bin 0 -> 567 bytes res/drawable-xxhdpi/ic_launch_white_24dp.png | Bin 0 -> 533 bytes res/drawable-xxhdpi/ic_reply_white_36dp.png | Bin 0 -> 814 bytes res/drawable-xxxhdpi/ic_launch_white_24dp.png | Bin 0 -> 666 bytes res/drawable-xxxhdpi/ic_reply_white_36dp.png | Bin 0 -> 1057 bytes res/menu/conversation_popup.xml | 9 ++ res/values/attrs.xml | 1 + res/values/strings.xml | 8 +- res/values/themes.xml | 19 +++ .../securesms/ConversationActivity.java | 58 ++++++--- .../securesms/ConversationListActivity.java | 1 + .../securesms/ConversationPopupActivity.java | 117 ++++++++++++++++++ .../notifications/MessageNotifier.java | 2 +- .../notifications/NotificationItem.java | 16 ++- .../util/concurrent/ListenableFuture.java | 12 ++ .../util/concurrent/SettableFuture.java | 112 +++++++++++++++++ 24 files changed, 354 insertions(+), 24 deletions(-) create mode 100644 res/anim/slide_from_top.xml create mode 100644 res/anim/slide_to_top.xml create mode 100644 res/drawable-hdpi/ic_launch_white_24dp.png create mode 100644 res/drawable-hdpi/ic_reply_white_36dp.png create mode 100644 res/drawable-mdpi/ic_launch_white_24dp.png create mode 100644 res/drawable-mdpi/ic_reply_white_36dp.png create mode 100644 res/drawable-xhdpi/ic_launch_white_24dp.png create mode 100644 res/drawable-xhdpi/ic_reply_white_36dp.png create mode 100644 res/drawable-xxhdpi/ic_launch_white_24dp.png create mode 100644 res/drawable-xxhdpi/ic_reply_white_36dp.png create mode 100644 res/drawable-xxxhdpi/ic_launch_white_24dp.png create mode 100644 res/drawable-xxxhdpi/ic_reply_white_36dp.png create mode 100644 res/menu/conversation_popup.xml create mode 100644 src/org/thoughtcrime/securesms/ConversationPopupActivity.java create mode 100644 src/org/thoughtcrime/securesms/util/concurrent/ListenableFuture.java create mode 100644 src/org/thoughtcrime/securesms/util/concurrent/SettableFuture.java diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 6003be36e9..538f960447 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -112,6 +112,15 @@ + + + + + \ No newline at end of file diff --git a/res/anim/slide_to_top.xml b/res/anim/slide_to_top.xml new file mode 100644 index 0000000000..cc204acb23 --- /dev/null +++ b/res/anim/slide_to_top.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/res/drawable-hdpi/ic_launch_white_24dp.png b/res/drawable-hdpi/ic_launch_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..9bdb87244f9133deb5fe7333e77aadee9383b16d GIT binary patch literal 357 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k0wldT1B8K;Lb6AYF9SoB8UsT^3j@P1pisjL z28L1t28LG&3=CE?7#PG0=Ijcz0ZK3>dAqwX{BQ3+vmeOgEbxddW?004R> z004l5008;`004mK004C`008P>0026e000+ooVrmw00002VoOIv0RM-N%)bBt010qN zS#tmY3ljhU3ljkVnw%H_00B!$L_t(o!|m6|%qcZk{+|jieoHIMvB3MKb@z{zjR!IAl6L7KJi-XPdD&SaizdlG&(OT*@4pMLi4} zEbIJ6lO}oT0}@P~tlZJ>&jV?Rrv52ayVuokS+{W!->^%OGF9$)9D==&vi-zNvBVDN zGzM_{Qjg~ZtDN!?YJwTbv0$DO%|Pv*^uUwh_`CLvN%>K3h3Bv84UHjnj#~h(bjEL= zGvG7)tV%5wO=~G=WkL+ z;_2cTVsSe8$9V^-lm)Zf4*b{uznE!)#xjl==3PZiQV*CU0^a-&4Ki_<60a1-?6Z@j zP)gyHKGRfVfyIoGmV#0NQ|t7R2={S literal 0 HcmV?d00001 diff --git a/res/drawable-mdpi/ic_reply_white_36dp.png b/res/drawable-mdpi/ic_reply_white_36dp.png new file mode 100644 index 0000000000000000000000000000000000000000..fcf2096dd8eaae60dc1febc820079c4112ac8fcb GIT binary patch literal 350 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k0wldT1B8K;Lb6AYF9SoB8UsT^3j@P1pisjL z28L1t28LG&3=CE?7#PG0=Ijcz0ZK3>dAqwX{BQ3+vmeOgEbxddW?y2nj|ESCVgiR`p6>GyrkH?`REfx zoh4Zx@x?PbAG=!fVnkBc?BtS;^*_kK8-*knaxL8Yir7_ej6ERU>U=Oa^V!(Ye)!q2i zr$2=|gS@{h?*1ZaeE8`Hx7^LsJ*F~B|2ZD#9=647we_~i+b6PBGranAEbJibGpV)L tQceag|2ccd4Xej1e2nF9?&rD75c2nN&!dBd6M#Ns@O1TaS?83{1OON_fv5lg literal 0 HcmV?d00001 diff --git a/res/drawable-xhdpi/ic_launch_white_24dp.png b/res/drawable-xhdpi/ic_launch_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..9dbbc3f08f3087426ba98b1b0b21e25ab76ea11f GIT binary patch literal 368 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA0wn)(8}a}tg=CK)Uj~LMH3o);76yi2K%s^g z3=E|}g|8AA7_4S6Fo+k-*%fF5lweBoc6VX;-`;;_Kaj^+;1OBOz`!jG!i)^F=12eq zUwFDWhD02Gd)=4skb*#4qL5AZOTm~5p3=u(cjbRgIJV`T%FjD1{<5|urd?!7^S*aH z!1w5Z7k!!s+8SdMm>gQgWSw4bpS&rZF{DCi+olGw3#?YT38~DP>k4Kau+it?sa($3 z^I5zyVV3zN5MSr>q5~7^|9@^eP!-4X;VJK(@=Xl&^FG*hFn9h8Ntk0_d@m!hVWK~y z#?PL7!MB$;GroFg&{+6S#HLWp;r!-?WT$zo5m%nreD2W6N}Bg~f-c{Y`BQJ*pT?BK zQQ?^MweEo)lS!rcgd0@}^81|bUPzbmGd?@Lx`guT literal 0 HcmV?d00001 diff --git a/res/drawable-xhdpi/ic_reply_white_36dp.png b/res/drawable-xhdpi/ic_reply_white_36dp.png new file mode 100644 index 0000000000000000000000000000000000000000..0f11be49564fa35f2bc1d42959ca9e8347023099 GIT binary patch literal 567 zcmV-70?7S|P)004R> z004l5008;`004mK004C`008P>0026e000+ooVrmw00002VoOIv0RM-N%)bBt010qN zS#tmY3ljhU3ljkVnw%H_00FN_L_t(&-tF0~OG9B4$MMa9&Nm#0CgXxA27_WU4Y6u4 z_%8?sF&J-C#2_YFSy1d+#(WEc4zsXem_b1igGum(eGPY4_j2#p+`W4aa(*`-_;BBz z^PDF{NY)inkb)GXAO$H%K??G`ELk86B!MiD1hP3|Kn_O;=$9h`RLT(mD(4snRdNi2 zsyRkMZXAOkcaAZT7YClmu*o7rtps^f<rh zPBM)64Qhr1@WB?n{(+k1*vT{H56B-5z$a^jn+5sDv9nLRED)U2C*_ejxujddOI?~X zqGmt)>KvH-F}i2f#L`hKUre`lajoZ9+0&Z#qyFp$*`OVf=9Fu0d1;^A;BK+E_FBF_bB*{;vg2URh4sQx6(1zEAG^V z`C&txld{@T^W&H>OT7Km?#LKejdNG5eI_Dfq}NZjSUn?U=-EXYfTWzUa0kc0y`;f; zCs*!Ynz=)S0rD)%I_nrCCGGGfp~q7SQjmfaq@e!?`UXwqj!ba}_3Quu002ovPDHLk FV1fW`>>L09 literal 0 HcmV?d00001 diff --git a/res/drawable-xxhdpi/ic_launch_white_24dp.png b/res/drawable-xxhdpi/ic_launch_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..cbb8dba76c4d26c99e70879c2bd7136137f2dac1 GIT binary patch literal 533 zcmV+w0_y#VP)004R> z004l5008;`004mK004C`008P>0026e000+ooVrmw00002VoOIv0RM-N%)bBt010qN zS#tmY3ljhU3ljkVnw%H_00E6jL_t(&-tE~tP6IIzfZ;z)c6nTZ3lM0KfFtmd=xA~R zL;+G-T3Qei6*VOiiICtB1SAU1zzL9eG)s|!i0p2h@z~yCrrO5Vw`+T5M{X4~D_RCJ zkbw-;P*BDpU6xsNpK0v55RIw4g9jJ_Rz;`N8Ip?Q-{&1j-K075G(txTtNkDa+ z1fY6ObkHZfc(lGm&Nd8kc~3vmfe)Jhx3Kn6099P~v-ocLtk1@yvNB+!rz7f_G$NT6e` zTtGR`bRuwG*_^D0RacyktOV!m@$S~Sj(XA~x^$QevX$Ss;kx{9!S3x1WFP|>=wJK- Xv#JRYx;U6c00000NkvXXu0mjfAS~6^ literal 0 HcmV?d00001 diff --git a/res/drawable-xxhdpi/ic_reply_white_36dp.png b/res/drawable-xxhdpi/ic_reply_white_36dp.png new file mode 100644 index 0000000000000000000000000000000000000000..24e00b240899c14bfeaaf118c35242b54037fa07 GIT binary patch literal 814 zcmeAS@N?(olHy`uVBq!ia0vp^IUvlz0wh)Q=eq$Zg=CK)Uj~LMH3o);76yi2K%s^g z3=E|P3=FRl7#OT(FffQ0%-I!a1C(G&@^*J&_}|`tWO>_%)r1c48n{Iv*t(u zRV?##aSW-r_4c-PhDe~uv5y}GLz0AQ9xOB1#Nw-*lqe`7vL#Ymdg2$mgQ6lX9)j7y ztCn~vYcx$2(_EvZF|A38wOJyvM!_+#S%IyyzPs@5*|hSsvd!hs<{kdIZ2yPm$~)EP zW;QrH7nL}Zz-Bz-AWxb>vm^?Wv2yMP8`WMQzQE2M`6?lGno&gSQm(MGK`hZ{f|ysQ zYBuVou57rPtl4liy|djkiL>1_t+UN_Bg^4Mkx7Y#Itw>cO!J5k5)-j>@e|UKTs_C% zr(kCDny<3gWL8g#_bHml7@xRylUC(Pj=%d3PCL)_x!tqv#Rt}FdSRCDce<2++fcUo zP)%yfI-SJ4h{QC@!>e)<^db}I8PBjgW6Pb;_?UG4Uy8Re&M2mbo@DMR|~`s=m1X)mV!Z(KJ&eeFAy+M7Y9 z=UB9t<~2Poa(%Q>_2$Me9c!A?jF)d)Yvjdz_Bo?=jsCMOvlc~1lx>mE`Mf&e*1kKR zmmax$R;}t~a)TomPhnqR-scJZx|g~3nX6XaIPH0CX3|2<8{JP_=dZc#5i9dd>vCu2 z@ujB!eo3ZjF|L`irS47m>N54~GrAYfopviG{(NMbQbPVD+w{6V=QYn*@})2Jos>&> z`GD#E>vg|9{+$TylP=BNZOYRr`eQ@NQ$yM0TIn6Zn?G&;(YI}iu$J&-*Qv$hdq)x7C3Yt*m#Fru#*x|1LSi hH1|A~G;;d2{)!r=)PGEw(}2mC!PC{xWt~$(696s-XAJ-V literal 0 HcmV?d00001 diff --git a/res/drawable-xxxhdpi/ic_launch_white_24dp.png b/res/drawable-xxxhdpi/ic_launch_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..092346dd7cd9d7096476e544df490c524e688d3c GIT binary patch literal 666 zcmV;L0%iS)P)004R> z004l5008;`004mK004C`008P>0026e000+ooVrmw00002VoOIv0RM-N%)bBt010qN zS#tmY3ljhU3ljkVnw%H_00I(8L_t(|+U?svN&`U@$MIhvXhIN=AQoEKgp?K{1QHOu zg^*Zi=|afv_p_OuCCR3e zpxmQk00S7n00uCC0sa-B8u+@8P(TZPv@wH;&_guxI3e1O7od(^tQCEa;{oazV5#^d zjR!a>eDtFNTDYfKCSn1O&@VUO1#{&F41*U=C4j_l1B7D{15A|{ke;s|kd?0-ke#m@ z;FGTyFh2hs)8zoT^1HY$1Hhes2p4j|8BbJW&9Yb3X!r_S6*zP_I0~0Q!Yf6yVD5 z;4XN97X)zR3j%oZ#QO>_%)r1c48n{Iv*t)J zFfh;bba4!+xb^nV-R%BEnd2YlpE*2X>4ZsY!O5=LUB{MbEbq85$)Ye}tBk_iglJC7 z3C*5-Dn$;(4l7k>+C0fnT`gR_oBrtzFF#apOp)s^cX;{f0J~g4 zUscu&x%vfPDuX^x*3;Y2-df0ds!!c?y~X*o?dvqASGawiYxXTjh=0MI&wtW(ofGR? z#5=`)-o-BkJ(pH6J)N&UQ*qrUqbi5iN0PqQ*^5|0GUlb^iU0HJ65>B#Fnz{*s|mLA zQuY-sDahac;-kvtlUnADcOH2DTQDbKQntgp4=SH$EY)M&d5rmj`&w-Wy-zB|X7jg4 zeW_%4XLMR`!fhLdyExwM|!UuolfJ>Ftms~ns z5VtHPc}r(8S9ip5y;+${yX7sFZb@CwJ>WVe*qd9HCx!Kk&E={6FLG4$m(5ySl2XHc z?RSw#BH!*EZuM-NT`t#HoiUnx_fC?5?xN;@vhB0nm2DR`RvG_H>G{{V%k#~HK#xUM z;SF5%D#f<^&J24~7HK<}@qNwXC{)cYWcxArs^L8kc;`Vu7@!|UXs^VF3HCAEv+exR7{kvkYzyq~+*7n~6pCpqIDV#y!dHWxEx1wnb9!PC{xWt~$(696df%BBDS literal 0 HcmV?d00001 diff --git a/res/menu/conversation_popup.xml b/res/menu/conversation_popup.xml new file mode 100644 index 0000000000..f35e1f1ae3 --- /dev/null +++ b/res/menu/conversation_popup.xml @@ -0,0 +1,9 @@ + + + + + + diff --git a/res/values/attrs.xml b/res/values/attrs.xml index 48cc16ea4c..9ca060e1fc 100644 --- a/res/values/attrs.xml +++ b/res/values/attrs.xml @@ -95,6 +95,7 @@ + diff --git a/res/values/strings.xml b/res/values/strings.xml index 64e3af7dd9..8aa13a829b 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -436,6 +436,9 @@ Bad encrypted MMS message... MMS message encrypted for non-existing session... + + Mute notifications + Import in progress Importing text messages @@ -458,6 +461,7 @@ Mark all as read Mark as read Media message + Reply Quick response unavailable when TextSecure is locked! @@ -901,6 +905,9 @@ Delete thread All images + + Expand popup + Add to contacts @@ -950,7 +957,6 @@ Transport icon - Mute notifications diff --git a/res/values/themes.xml b/res/values/themes.xml index 11a3b90752..62171cc14c 100644 --- a/res/values/themes.xml +++ b/res/values/themes.xml @@ -39,6 +39,23 @@ @color/black + + + +