From 0f6c7660cb3a90944c14efc52251413c4765e49d Mon Sep 17 00:00:00 2001 From: Benjamin Albrecht Date: Sat, 1 Mar 2014 01:32:00 +0100 Subject: [PATCH] Use modern icons in info and alert dialogs for ICS+ --- .../whispersystems/textsecure/util/Util.java | 9 ----- .../ic_dialog_alert_holo_dark.png | Bin 0 -> 928 bytes .../ic_dialog_alert_holo_light.png | Bin 0 -> 928 bytes .../ic_dialog_info_holo_dark.png | Bin 0 -> 646 bytes .../ic_dialog_info_holo_light.png | Bin 0 -> 683 bytes .../ic_dialog_alert_holo_dark.png | Bin 0 -> 794 bytes .../ic_dialog_alert_holo_light.png | Bin 0 -> 794 bytes .../ic_dialog_info_holo_dark.png | Bin 0 -> 433 bytes .../ic_dialog_info_holo_light.png | Bin 0 -> 465 bytes .../ic_dialog_alert_holo_dark.png | Bin 0 -> 1416 bytes .../ic_dialog_alert_holo_light.png | Bin 0 -> 1416 bytes .../ic_dialog_info_holo_dark.png | Bin 0 -> 787 bytes .../ic_dialog_info_holo_light.png | Bin 0 -> 860 bytes .../ic_dialog_alert_holo_dark.png | Bin 0 -> 940 bytes .../ic_dialog_alert_holo_light.png | Bin 0 -> 996 bytes .../ic_dialog_info_holo_dark.png | Bin 0 -> 1231 bytes .../ic_dialog_info_holo_light.png | Bin 0 -> 1354 bytes res/values-v11/resources.xml | 7 ++++ res/values/attrs.xml | 2 ++ res/values/resources.xml | 7 ++++ res/values/themes.xml | 4 +++ .../ApplicationPreferencesActivity.java | 3 +- .../securesms/ConversationActivity.java | 11 ++++--- .../securesms/ConversationFragment.java | 5 +-- .../securesms/ConversationItem.java | 7 ++-- .../securesms/ConversationListFragment.java | 3 +- .../securesms/ExportFragment.java | 5 +-- .../securesms/ImportFragment.java | 7 ++-- .../securesms/KeyScanningActivity.java | 4 +-- .../securesms/RegistrationActivity.java | 5 +-- .../RegistrationProgressActivity.java | 17 +++++----- .../securesms/ViewLocalIdentityActivity.java | 3 +- .../crypto/KeyExchangeInitiator.java | 3 +- .../LedBlinkPatternListPreference.java | 3 +- .../thoughtcrime/securesms/util/Dialogs.java | 31 ++++++++++++++---- 35 files changed, 88 insertions(+), 48 deletions(-) create mode 100644 res/drawable-hdpi/ic_dialog_alert_holo_dark.png create mode 100644 res/drawable-hdpi/ic_dialog_alert_holo_light.png create mode 100644 res/drawable-hdpi/ic_dialog_info_holo_dark.png create mode 100644 res/drawable-hdpi/ic_dialog_info_holo_light.png create mode 100644 res/drawable-mdpi/ic_dialog_alert_holo_dark.png create mode 100644 res/drawable-mdpi/ic_dialog_alert_holo_light.png create mode 100644 res/drawable-mdpi/ic_dialog_info_holo_dark.png create mode 100644 res/drawable-mdpi/ic_dialog_info_holo_light.png create mode 100644 res/drawable-xhdpi/ic_dialog_alert_holo_dark.png create mode 100644 res/drawable-xhdpi/ic_dialog_alert_holo_light.png create mode 100644 res/drawable-xhdpi/ic_dialog_info_holo_dark.png create mode 100644 res/drawable-xhdpi/ic_dialog_info_holo_light.png create mode 100644 res/drawable-xxhdpi/ic_dialog_alert_holo_dark.png create mode 100644 res/drawable-xxhdpi/ic_dialog_alert_holo_light.png create mode 100644 res/drawable-xxhdpi/ic_dialog_info_holo_dark.png create mode 100644 res/drawable-xxhdpi/ic_dialog_info_holo_light.png create mode 100644 res/values-v11/resources.xml create mode 100644 res/values/resources.xml diff --git a/library/src/org/whispersystems/textsecure/util/Util.java b/library/src/org/whispersystems/textsecure/util/Util.java index 229f8a7ac6..ef71cb1b39 100644 --- a/library/src/org/whispersystems/textsecure/util/Util.java +++ b/library/src/org/whispersystems/textsecure/util/Util.java @@ -1,6 +1,5 @@ package org.whispersystems.textsecure.util; -import android.app.AlertDialog; import android.content.Context; import android.telephony.TelephonyManager; import android.widget.EditText; @@ -88,14 +87,6 @@ public class Util { return value == null || value.length() == 0; } - public static void showAlertDialog(Context context, String title, String message) { - AlertDialog.Builder dialog = new AlertDialog.Builder(context); - dialog.setTitle(title); - dialog.setMessage(message); - dialog.setIcon(android.R.drawable.ic_dialog_alert); - dialog.setPositiveButton(android.R.string.ok, null); - dialog.show(); - } public static int generateRegistrationId() { try { diff --git a/res/drawable-hdpi/ic_dialog_alert_holo_dark.png b/res/drawable-hdpi/ic_dialog_alert_holo_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..7e7750639a58ca0b26dc8555a0d0f60b4cc2752d GIT binary patch literal 928 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA3?vioaBgK_U}OsL32_B-|Bq}?DfB%U7z$w} zL4H7*nTgRm{(qdzi|12+TmAjF{m-^go~zuI6{>F+Hu)~F_j5Q9%o3X!BXp}QqwQB? zsn)07RWm)79^JSsYmda^GyI1hiT9a23F0_!#$L31MWOV!?+MO1U5qDo1H=2fr;B5V z$MLtJnc=eoM9!p0=N|bkwf)K#)2zo*p0U|kk1y?dANBWt{nGDF0!^L=>dN@oEBdX^ zoO!y}S?zP*f98gqFu(j2=PTKRu0IddIH9TP{AYm&-$~Y&uRcrsbC}i^s=V|7hitp@ zOBIv1D;91wSuABUb#cE=aNkCgc~>r2@Upf&KDq46U*XA&iA7q0&a7IGj&VKtr0MA- z>>r-_^57<`xf7x}=f9i~&lRsdW%kU2ET$ogx0Q&^2n-~pZoTqQ?Sja>XZIrBU)EI3sbq4x!DeR5I`hUW-vDRpx&F^Suy1%PoRYPCx~A`( z+h4^e?%B%v=ZyeQd9iKL>I3ugJvjF_gjw9G)?LW-_HTlqq@0YOEGx_D`}J|2D-IL} zEYw^T`aCt@Sz(Nmb;%<(roxC_>Kpx5E)LU3*m*x^URzDB({y!HliM#R_**pRTnV^v z;#2P|p!>HF~zBZebQWY0UTz$`ac)z0K_Gg!ilM5N7&ihYX%O%hGpQprl(^r-~ fPsP9Wov~k|VlvHn(Z&gTe~DWM4f=>ae( literal 0 HcmV?d00001 diff --git a/res/drawable-hdpi/ic_dialog_alert_holo_light.png b/res/drawable-hdpi/ic_dialog_alert_holo_light.png new file mode 100644 index 0000000000000000000000000000000000000000..c96047f27c5b8dd3b74f0eb39527a35a65b183e6 GIT binary patch literal 928 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA3?vioaBgK_U}OsL32_B-i$^w)@6?n6hC*0L zkY6wZ12Yq&cl`f2nHSHe{;{JScTX3` z5Rc<;Lo>r?2Z)?Wkh%ud~|czW>Y(IbnYJE6!K42VH+2sBuD5)%ni?55AMEFJFC@_~$UKEmV2w0S?)A z<(DcZZ&xhbYO+|$X6oX8o#4KWCiAXbu;68Fdwg=)m%qZ3854`N0-ag49v$O)@=4Rv zN!UL;^X0)!R&ysrbIyM`A)YHx{xJw1HOnTJ{zF04=AvFXnCt+Nt*SHIZAS#$k^QOxV< zPS#uYJ=}Wbq1pwJdC%@eyuYlenp4T-bc4;zmUZThSH1zx)^q)zePG}4RyZYV`E*U+ zIk&%xPu#PW_0Jmtp7LVbqSXiH<$G}MZwRxvRjs>_>FwVHK}k6oKUr3m)A#G+JXahj z3|OeSD)f13z_Y>_C+m_&Y)pj_yVN)Oty~lx_WHbGX20(UdcA`@E{S<9epa(o}0h@mg^EEch6Pz(+>TkLiRRCil)Dt zSRc6J^s#y!_lHrh%Y1D%DWxhdl(_ny_3(a0$L-H97bh1oNS*hexRy(v^FL3C@usgV gd!CAa>pNq=M#W^B^P-I>fQgL3)78&qol`;+05zGTy8r+H literal 0 HcmV?d00001 diff --git a/res/drawable-hdpi/ic_dialog_info_holo_dark.png b/res/drawable-hdpi/ic_dialog_info_holo_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..b1f140623976979e6b284f462d7e2646e99db549 GIT binary patch literal 646 zcmV;10(t$3P)|oTDhJUWNb|E#X6ftU;#C*DfFjkOIhDMJ7A6@wf=zEKY7)y|v#!F}ElH}(m|-Ig&(Fds!>?03TbvR2(lQPQ z1&+U`R}L~9FYsV=Qy!2|NQ7rJI*7iRixr?JXl`jpief{Yp30wXgFhG(&a^n?Vs0oO z+V;X32>;RDX9Z~99}1PG+sQ$89gqN9*F^ktyea|dl0fyOp7#azzT*(6Now>?Leo*Z zAaEkjY5?ymgYIqwATQT=_4}=fZ0q$7m!?(`KpSYsOco<9*sH zJ{ntPQxZQpq|~U5Eq!APb8E38Ri!kP#^baWAFPHF_RZZruGVU!wOqmH58$nGh6*b*sHl3ZDeC(0Cgbw#+c9KAHyKisz zZf_mO!otGB;+oOYIoNPG9Kgi|>46NSzhjUDWWU{R)IS@ovAR8ca zY>WUH@4+R^F?=sQyE#M_Kq9J@0D4^*?vtN|CpYNTxFE!QlrH&egG7$T383*)65~SY zT7(4G030I#84)6a^h}jRtD^Bj>HOTJ#2J}L<0+A7E9wk0l%2hz;I}gz%fYcjBQt;r z`^@zeS)BxSjCbkGzHt+~t(dfF%+DFqEJEW6Wl}N|r!jHt(@djIZ6V~7rE<*-n{Lj1 zQ8=yfu}5Z43xR-mf5rUf1K&U5JqIf?3u7%gfGfpossKE-Fj?DxzK}TV1@t9F@82@U zbfpbP#gM-hOM!Sq2zX^P&IzHO6sKIIg`JyG*cIi%K1+8M0(9N43$dhI%SQHHBLTLq zw)4+%sRTMY3B(2UyeY8rjzb_JOQUfTl8!_N0a{dfHF)34(S05P+zC@p_}n6^!bvYZ zmu2miS_ot$Wm$VY;_R>%78Vv3799KvFaWL8_z2(t Rzvln|002ovPDHLkV1hDADi#0$ literal 0 HcmV?d00001 diff --git a/res/drawable-mdpi/ic_dialog_alert_holo_dark.png b/res/drawable-mdpi/ic_dialog_alert_holo_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..98132d580e4bfccb7f57cc084425b832c0ebb068 GIT binary patch literal 794 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabRA=0V3Z2*32_B-|BnJ}A+Xu4UWT(MK#Alo%^m_=Q>=G{Q0edY2&<(l{Q-6KJE8>%x&i7=I*Vy z^u!ivpbdeZE{-7?j?J<>eRI{@ zHm9q+z7}l~r1f>b>k=8IRTtHd`YSozD*ftpm0`(B#@;6?3LVzI4r-@eJ~FuOOxv=+ zw6SSL@2!QrR#uT+Nu0ZOCH8dJ=s3uHIl!85QCeAv^Ow$rcnJo!_Eoi~?+3O%xba?k z$|rTX=?7m*-d^EyCaoph>UqgQC%L1kM_K#B|1C1qc)pI=s9Czmrp@H;J<01;sbBVf zOyAbg{-DI_%L`7IQ;%NG3@MlvA9w#=Gncyj{JMAr&T@qb4-R&&Em>>*W%^gv(uv9? UJQWT(MK#Alo%^m_=Q>=G{Q0edY2&<(l{Q-6KJE8>%x&i7=I*Vy z^u!ivpbdeZE{-7?j?J<>eRI{@ zHm9q+z7}l~r1f>b>k=8IRTtHd`YSozD*ftpm0`(B#@;6?3LVzI4r-@eJ~FuOOxv=+ zw6SSL@2!QrR#uT+Nu0ZOCH8dJ=s3uHIl!85QCeAv^Ow$rcnJo!_Eoi~?+3O%xba?k z$|rTX=?7m*-d^EyCaoph>UqgQC%L1kM_K#B|1C1qc)pI=s9Czmrp@H;J<01;sbBVf zOyAbg{-DI_%L`7IQ;%NG3@MlvA9w#=Gncyj{JMAr&T@qb4-R&&Em>>*W%^gv(uv9? UJQX=Sk2J7ceR?I2iXm4zi7 zJE5v7g+@c;)=&xk3&ZgC6aoN_&=_a}Rf3rXFQ8`-xz0ua;9E3%0@olpzXSHC4RW^s z1QI{qF#@=OUZ{p45W~~9_XXe5(Jxewn5Q}C!rhw$9yOe3VYL}m2_$Or(G&uiYa7uY zH?}(N312qq5OPJ|{Qc@mE!rITdvw@5{9ydE3u_|~(>%?EBd_iFmD+hQIoD>4l6FZV zP#fotD1ERl7=BBVw|ovF&@3#z;`Ffz7M4B&Y6c87g+R$Roq<5w^4U)Sr?+J65?ARR zcyrqO;YOdMLQrt~b{?zW)#?0t0AF00000NkvXXu0mjf42rnJ literal 0 HcmV?d00001 diff --git a/res/drawable-mdpi/ic_dialog_info_holo_light.png b/res/drawable-mdpi/ic_dialog_info_holo_light.png new file mode 100644 index 0000000000000000000000000000000000000000..624e745b69712286c6ff964d236ca635d7fdefa4 GIT binary patch literal 465 zcmV;?0WSWDP)u3TnuDp&p%pezAn3}f?J)?PNG(KICSheK*NF^uJ zIK4e^cs8R#5=W9h+4jWR;YdQ`nZR5{h zqm6)^z=j+`;KnwXfIwjAY$t%-`^DV(EXhI8%b7ZRrJ!W^q7mLlbvX~&11X~r^H?=e z@ubVxZ@Ld+>PY|JWi*THcoq+mSv<+QK1yw+wqU`m@hiXpx%Qux(P3C700000NkvXX Hu0mjf+t|H% zxk)8Ke!;+)WMNY83Q)ZH|8LBWA0Jeh|I8P-@XxOND5uQ3gjx5jzIPmauNS%emV4tV zUe(W;dD&&pvX(@1UwEaj?arkZ6_vkAQ0(T>o9_T1UCO8IublK3Hw6H?1BFJxJcY#>n zq7@q7n)ZHwSO3OOuUu^>gXf<=Z=d}xO5IqjX!m}ug!Jy)2k%;IK0bNFBt&LpaA;rdA%nh8W8UabZCY%WpTT8u^v?AqO8-+41 zoL*cPw$8}XrC>qf)}Rc-HH{ZS7jUiF%CcacbFl97hY}q7_0)73k8H48!g8xVZ8O^~ zmLz9y3vEw_Y&rkX8xnc;uWTcBpWHOzkXKUi43!gybom%n5?`AsZk*4++|RC zVO7I{I2Vk?$^`E~50@F_Kmm7IP@b(zi< zSaC2%8YG!J%ADW8B7HQ*zjrAwGt-0Uq{tRE3vSM`bIUHr%X)iXuuYhEUhz={Bijv& zv`zI>rDjE(@>=yEMeTa4(DDT>zS)an!sB8NaolaO37mfah>$+7M2?#O0+%Tv2$LG$^DFIpgY8IY#5S4LnXXuL1 zQjKL6nlJTF=)|Efb6(3FdNcEx+=S4@|2!u&)al-}dJS8*j<%16O=2Qoo z*@hkXaLJ!3@&nh>^sMH%SEaLOJFYOd-LpWOGhTmc_@CP;N;B))?^#U~lUlgDV8>14 zK>a^)=jXim7UH&&zd4R=RYL2B2d3{HFFzl@Z&CP+Bl!<@s(wlRxA)}rrjTU}>vs#O zf9=v^61MvD;ZWTkp(|64vwIxk4^?GupS1aaEmxX>&z~=QzGUo9EP4`tK;q}!d2LQj r7Xk}rOkv@ly!piX2S+v9^8YZ-Rjb{a%Ae5*%$N+Gu6{1-oD!M_MVb(pX?;Qu<>qRcV<=%LT zSM_sdUUu2DtR>Oh*PnDRr~=?c$!ueIBQ ze@T1qkDq-!$F}f1U**0V;%$>3$cvc0SkUm%f@|aA6AIOd^GxnrpNai;+fzt;)f&NV zTYLIAt?UdL7?|FBx;TbJ9DW=2J^G4+z}-lt2RaIo366muT{bi)Ev%5M2=d$5T_D!C zXobeNroG?a)xYu6D_7ge;Q8mz+h@OvQuo*9-#>HvCU5dljbs0L86K#%{rkhd=dX+E zgAHr8@GQz=FsS%hBqDl5K$nqOYa>^9NU<>&a|36pMnICU31@=D)>1Detw{OSMxl%g zrx(|StuwN8DOgarH7LVyP2+{o1zc;kvMgBV9IX5Np#;Z%JvCj%BOC0Nu-vLo+st;0 zCCS;_Lfg|JTh2f9hD4tIE8B?OCpS$vLFT|P#Y#MfrZ8>Y70zn8W)=JLMe z^y7Nj_V4)g7p61+jiV+N#v_H|@}yw~KRBBDY5K{Mq00h*ox&}ejWQLd`it?C8ys}U8b`I zRvgTc21(|QGUqq2NFR;y?_J8v%=92SDY8Y)f}6AK+_KB@vfkboY!l|4SA0~#$acdb zZBzYJsaX-HyjDF(QM=wMw0uE}Z}y^?@VJ;m9Cur60;k_UBBakNk)!6nz~#-SM?5MI zPTg0VP*Ey&W2;T0+>U(};ji>^-UwGRH5QvU+&we(h*V~*OH--vog&};we7{vJ3?a1 zds*iy{Mp+Rz}NKqDg(a^%dh8$TU7(Z!>rP^=hT1M@wxMJN6jw{S<_bkxnjMtwU{^xdz(#*Q{dsfrLq!#Wj*m2W1 zQ2$Td`8hAXg}ANcZ;oSImC*X(f$6))%g@K}TNFOyNdAMJs$Ww7?LB$DDP$SL`rSh6 zU%T{}gsuL3I8?Vs=*pDi>>h{sLsgmECv84p%avx}^XJQ+FB!WNi=KoZkob9bUYk?X rg}{OtQ&{*XZ$7d9!BLI2{6CCy)oQn<@@I4cGbV$ltDnm{r-UW|PbGc; literal 0 HcmV?d00001 diff --git a/res/drawable-xhdpi/ic_dialog_info_holo_dark.png b/res/drawable-xhdpi/ic_dialog_info_holo_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..4536a8d1513f964c7730fe6dc173e69db7c5cd54 GIT binary patch literal 787 zcmV+u1MK{XP)&KVvOoq%2FL)#28A;^hpQFKO^M!}E*uAr{PZNtc19zC zKp+qZ1OkCzkcdLOYLC)3?u_HBNpr|Dn9{brxN<^L}zqjPPrnI6u}7qdA_2Y*9GdpytHBxbWM1qrrBKwUlKI=%ysfw zL7<|`BlfMX%=lFdOKvy?Sn^(XZL1FIagL%IV~=VAsUA=j@PzVk>-hh3q@I}2EpFl6 zHlO$ifasgdAAMDO$5bd`nf+;`z&CaUEG%oiD^4JLvyhz#;~bF+7OXV@a`z2If7h{x z7RYPDs?w8cm7 z1dyvOGsvrxD*<^=6+rG!TnYHK+_)ZQZ~%OWTYO|y0BQHdfCXxe-`NO&6C3k5Y7RTZ zYej#I4pOoZ%V3I@pXC*!kM9dob^>7gYNo;x&h0}-e}c%*L!Jp9kP6m>)-^}w+Rm;~ z^hw9@UG4=oIRCgVL@szY`DDuX#RxkIy}1~H7bZx$b8s-!B1^@=?PSru* RGokdx?y z?%nsk_wL=DlSCj82m}IwKp^NP(inq`$K!!|j8q%qGsC8%#P!osA zPE;$HT~w;A6%o5vMF39x0=?}6K)^Bt5orLa&!6#lBXM{>kl)TQEJlX#Xs}Z4&Sz+( z9w!g+eQ7ZM5v5!y!}k__71#y_5^s*}D+&Q9`AcFfO#B|a#`PE~YNp!M(D#jxkVrjE z{>l)u3uR#KiC|DwX~-$pt|X)$WdDVD2c*6Tlw3=aUqA`pUBcnSG2wyd-)pZSLEVO0 zvJQvCHqY}@tS12PRQsUbRqD52oIc+;*fS>y4?MrLRS>G^XrQ_(?G@PYDQXB9;vTBD zYfJTf)d+-K@y#Y#sy?nrPGIE&t^zJd9NNZwLDZ8ms>KD4ZL%pG0qA|5`Fmg4-ZB(w zTxJ`L(6-!xQ2o_fQXSfalZyg^?a`Ur}hDF9algCtwhZ06p29b%=l=H#xfykadWFEEWOm z^)@ir^@%M3|13AQhZ!M&He@X}230_k@Nay4q9CR5HW&eTVxw<93fv*Sl=laO0PD>e zXBk|REH+y1pb8Seokc&p*HG3U*-czE%x>*ZC`x{ORhSk2Gkzepe zQ8L8QL3DZD+I<=~EEX;i+yB~Br1|nw`#htCt+!X@?sq*u0It-T2szRv$?8LU^c zw0p*6<0_wBJRY}RzI^_qM|)W;yUN=yZ&+@BYRla2_?B+>%&D@3oDM3-*(lyvv= zrt}5D`yIlvYz?;VR}z~0h3BbC;w#&zDz~B{kEc~0wJw=~r#fD#EYaGYWmZ&kX>y{( zL{av=4>Z2J*RAVU+Vp6_@slUjt9~giRo7RKJ=e2*&OBZ}S*u*zLNO^0-Cbu+sC2CP z>bBGJywmGm_Ps*pPxX%&A831dQ?GdSoR9JRtzX`JdOqd#}!zcm@0+IXgh^{u17 z$*Ge!6E3W75(?cqr^o-z7nuen!^@w0J+h|Ao>aH8U%0AzZB)+bh&{?~RcWf{D-Lb*QHj2`?74>e&Z<4%_!PdcySzyL3nP!cY1CGS zCB6Sl*Ir!~e@Qo+ZLdj&vg{YNh66511HJ6m}U8Yny}KUi$QBjf*8xBKk&FON&! lyHB2XvHv+Z1#tXi&C2&ysEqmd3z$F|JYD@<);T3K0RRIlDKY>6 literal 0 HcmV?d00001 diff --git a/res/drawable-xxhdpi/ic_dialog_alert_holo_light.png b/res/drawable-xxhdpi/ic_dialog_alert_holo_light.png new file mode 100644 index 0000000000000000000000000000000000000000..81a0741da19e5473ae44062f6ecd1f1734798a98 GIT binary patch literal 996 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD3?#3*wSy$C2Ka=y{{R2Kc-VovyeHLw9&|4W z@(X5Q@Z0<6zwWog2fW#CS4e+eYHSe2^Q2wzr<@J*`Ang=CuerGq^V3O+A_a!b?^2$ z$5!NDn)dJmXSjrY>BhMBZ>MED-!c$si#@q< zYsAV0JZnXkEt>0d_lV&g*E=Qu{?9j=#gREX`*z9vPc@HyXDy%NeE#OGO%Xa`-B162 z^6R{uW%(-hDk~q8gI{q|u6Wpv+r6AN2i};det5{cU(&Ix+xo0buMmZUr{=4yA<=*r#_Y1B&H}9MDMNfQD9NY5 zVwrxfm)lo0#dIc#S-7`O(F~1sJg~>^%nfHRD=HplE9e#^8 zRZnFDO-;BsG3M`zKWrB&gE*F`{*tzD_$eQ{ z(u*ZlMfc0|=@xaB)ABsoZ95M%->NV=D8#d23P+wVht0+Xy*?ZP(Hb2w!c68u_KOa* tJXpV`YtGAT-(`JEx`0XMXi{ch{gFp86Plbh-Ug;>22WQ%mvv4FO#p{O#TNho literal 0 HcmV?d00001 diff --git a/res/drawable-xxhdpi/ic_dialog_info_holo_dark.png b/res/drawable-xxhdpi/ic_dialog_info_holo_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..f3db08879b574c797a04d9bff86ac605bcad3f7a GIT binary patch literal 1231 zcmV;=1Tg!FP)v3tW+FVtdrh5?ZePvrE zPw2|%ehzj-ioNd)DK!Y_ruf|4rsm3p|9We#jUi$S0(fh;N?%Zj(L`mgg2<>Zo&cl# znYk?~uKR>l{>qT>evt$i#oM_4$RyKa3Tt9|W64djZ71jK3_|UHJ{ls*iy^=$|JK}Y zJ1WOo=J1{^3M|wU)l77`+!7cT72Ee!??sf`0Ou8&c28 ze?DT3jpEl@3ZOa6PY_|f?#>qpsVC)Ur2Nql%Uk(+fg+Ds9`VGQNGJzS09oCeL;1Z{ zA}1;^JGUEcPe^+VJGP3s@2mP~dFL<3`-gfsx>Ay07jXGk8v?N}&>uKWX!D;**C+xVeKz`LSFxHJFbtJUH8cr=0LSZpG|E3Flf=@;l~72yNCFap zO=J=TxIX8_hPtEd-U)DhZj23;Mk3bwBDRl^02P_85};RT5ipKWS6Qe8s8k05Vx&>+ zNf4k?9SnqkIs^hLU+x-U2&#G~z_Ivs5d=sq{7EI@_F~nDws%AUl4W#4=3WWllF=k0 z>z`;OU`-FOm_vc+E{{8iDn5GHj*(T=Gqr+Y&OD z-bv=!`kNz7U1aT-0CLHSd3l)+*!sD%WR>J;d+D{H!r=wu0b2jqVLXN8IMM`gyVhJA zc0&huc1(QtohSj6jJb`txyIIRMeDb7&6!6l@tuB30;nF)@bK2_?SKZ3DE(jccs-(| z@=njRdf<&^)T<+*B~B&qQQSFUBDk#OQX^H#HohxRw&r^J2!wg_Rx z^dMZi&NDx0j*nIa?p6g}@)eqO@bK0~0qtt|uoG9inwA34u&FNs4is{3%d*|M;Q%em zx+&-}IlpP&zYe(xn)azzBAU4Dwv|k7K;zax$jB44E)K>kM4ESpru0D&aHO1!s(n2G t00000000000000000000@#BvG0|0Jg@;P&pZh-&*002ovPDHLkV1iSKF*X1I literal 0 HcmV?d00001 diff --git a/res/drawable-xxhdpi/ic_dialog_info_holo_light.png b/res/drawable-xxhdpi/ic_dialog_info_holo_light.png new file mode 100644 index 0000000000000000000000000000000000000000..7c7e7647ad92bdf1124302a38f0f91d5c6a78423 GIT binary patch literal 1354 zcmV-Q1-1H#P)`6pHRCwC#TrF%HQ4GFxB|TDb1y$9M zfee&XDoVj7HMFCl#igSQ>}YA}0!l(Rn!*HZl|lw~G?7Yrq~HolW>2mZ-Tac5#qaLj zi$CcpRj$fC`?LN0{v1ULg+ifFC=?2XLZMJ76bgkxp-?D7N25-iJvli^-~(F>tyy?H zg_c9h?(gq2C18DJqmo@H8Yc@{K0|l#hz=CC+0-LwDts$)qOE2ztT)(Nd|^}`|R2i8Wn~ewDy~-vX6pyUK-{f&co4`WBE*J zCJJ^{wek_vhb!t+5wEGTGrVz}YQC>}kh8(V!^6wL!NE`X^9b5*;qg8^Yry}cwebLQ z>vKccx%P2kjQVsvH@Ta~ImslBZHJ+U8`N$jluubqXD+-=DSge>B>{f>#*ndHP^j`d z1W{)3fq8Tb0{#+Geh=C^8aT1N#ThS#5eOB}YlfpI_?;&vMcsw(Gk8ApHUv@D)8+Df z!Bq3qkT%BjOd=eOX>L+Pmt^#I3}`dT`J3xU^}~SrUL?8gGXWjuySqAV5zcu*MoS|$ zGFDFj?PMj4^$&%0Gh!_B^<5+3cMX|$B_ykN9?&*ef9}9CFrz7 zSQy$Cvi>;Y7q&)@!ULwAUrUNcBW6zHod<9y7N&KK{RWSl8bYo&6ETheCo7zDn=7of zIwE}>{kx{sGNh`N5Wr2-Q%6RbMCR?x--e}xb&*=i>`e&DeOT!f9&>UFuP>hf3JFEb zqVO=Yl)ZEhFl}UnhN-3Or4zudjXVcPz_X?7r4zsnMvnm!@aSS7cC{s$1xSDsnYJQD zrEo<+5}>Y{z7oJ?2YUe$5WC3sBnaSEJ9h#kV8>GS(h11Qa#s&SP*ynshQ+VL00}s> zl)aKcxVTsqyE;cx1xS{7iOiJ}zzs&NfULjeVgPpO0f=@$1hg$>_KJX}#A=}j;V0n+ zV5#e_A_UOpHP@lj0IZ*rLF}%vs<@>c%fw@!xPAaczU8=w$vzT97@u^rxX=N0&Tn!&~!YWr& zP=FR}s)~R)g{)e#EL}AmXvs1=1^rLaJ|qGU%4*TR5;75&*zB^E%-EoXTRkB|OBZ|O z6(YsEeN%cZ2w0F#235XZp-?Ck3WY+UP$(1%g+ifFC=?1s`1m8h0Kv}w>EU~z+5i9m M07*qoM6N<$f~#m@YybcN literal 0 HcmV?d00001 diff --git a/res/values-v11/resources.xml b/res/values-v11/resources.xml new file mode 100644 index 0000000000..beaa5425a6 --- /dev/null +++ b/res/values-v11/resources.xml @@ -0,0 +1,7 @@ + + + @drawable/ic_dialog_info_holo_light + @drawable/ic_dialog_info_holo_dark + @drawable/ic_dialog_alert_holo_light + @drawable/ic_dialog_alert_holo_dark + \ No newline at end of file diff --git a/res/values/attrs.xml b/res/values/attrs.xml index 8e49386ffd..34a8043c02 100644 --- a/res/values/attrs.xml +++ b/res/values/attrs.xml @@ -35,6 +35,8 @@ + + diff --git a/res/values/resources.xml b/res/values/resources.xml new file mode 100644 index 0000000000..4c2a27a1b5 --- /dev/null +++ b/res/values/resources.xml @@ -0,0 +1,7 @@ + + + @android:drawable/ic_dialog_info + @android:drawable/ic_dialog_alert + @android:drawable/ic_dialog_info + @android:drawable/ic_dialog_alert + \ No newline at end of file diff --git a/res/values/themes.xml b/res/values/themes.xml index 83028fa9b3..acaf233aaa 100644 --- a/res/values/themes.xml +++ b/res/values/themes.xml @@ -39,6 +39,8 @@ @drawable/conversation_item_sent_triangle_shape @drawable/conversation_item_sent_push_shape @drawable/conversation_item_sent_push_triangle_shape + @drawable/ic_dialog_info_light + @drawable/ic_dialog_alert_light @drawable/ic_action_new_holo_light @drawable/ic_action_add_group_holo_light @@ -93,6 +95,8 @@ @drawable/conversation_item_sent_triangle_shape_dark @drawable/conversation_item_sent_push_shape_dark @drawable/conversation_item_sent_push_triangle_shape_dark + @drawable/ic_dialog_info_dark + @drawable/ic_dialog_alert_dark @drawable/actionbar_icon_holo_dark @drawable/divet_lower_right_light diff --git a/src/org/thoughtcrime/securesms/ApplicationPreferencesActivity.java b/src/org/thoughtcrime/securesms/ApplicationPreferencesActivity.java index 0091adbaa3..7b66b535ac 100644 --- a/src/org/thoughtcrime/securesms/ApplicationPreferencesActivity.java +++ b/src/org/thoughtcrime/securesms/ApplicationPreferencesActivity.java @@ -53,6 +53,7 @@ import org.thoughtcrime.securesms.crypto.MasterSecretUtil; import org.thoughtcrime.securesms.push.PushServiceSocketFactory; import org.thoughtcrime.securesms.service.KeyCachingService; import org.thoughtcrime.securesms.util.ActionBarUtil; +import org.thoughtcrime.securesms.util.Dialogs; import org.thoughtcrime.securesms.util.DirectoryHelper; import org.thoughtcrime.securesms.util.DynamicLanguage; import org.thoughtcrime.securesms.util.DynamicTheme; @@ -440,7 +441,7 @@ public class ApplicationPreferencesActivity extends PassphraseRequiredSherlockPr AlertDialog.Builder builder = new AlertDialog.Builder(ApplicationPreferencesActivity.this); builder.setTitle(R.string.ApplicationPreferencesActivity_disable_storage_encryption); builder.setMessage(R.string.ApplicationPreferencesActivity_warning_this_will_disable_storage_encryption_for_all_messages); - builder.setIcon(android.R.drawable.ic_dialog_alert); + builder.setIcon(Dialogs.resolveIcon(ApplicationPreferencesActivity.this, R.attr.dialog_alert_icon)); builder.setPositiveButton(R.string.ApplicationPreferencesActivity_disable, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { diff --git a/src/org/thoughtcrime/securesms/ConversationActivity.java b/src/org/thoughtcrime/securesms/ConversationActivity.java index ea497c2222..938879e6ea 100644 --- a/src/org/thoughtcrime/securesms/ConversationActivity.java +++ b/src/org/thoughtcrime/securesms/ConversationActivity.java @@ -92,6 +92,7 @@ import org.thoughtcrime.securesms.util.ActionBarUtil; import org.thoughtcrime.securesms.util.BitmapDecodingException; import org.thoughtcrime.securesms.util.BitmapUtil; import org.thoughtcrime.securesms.util.CharacterCalculator; +import org.thoughtcrime.securesms.util.Dialogs; import org.thoughtcrime.securesms.util.DynamicLanguage; import org.thoughtcrime.securesms.util.DynamicTheme; import org.thoughtcrime.securesms.util.EncryptedCharacterCalculator; @@ -377,7 +378,7 @@ public class ConversationActivity extends PassphraseRequiredSherlockFragmentActi String recipientName = (recipient.getName() == null ? recipient.getNumber() : recipient.getName()); AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(R.string.ConversationActivity_initiate_secure_session_question); - builder.setIcon(android.R.drawable.ic_dialog_info); + builder.setIcon(Dialogs.resolveIcon(this, R.attr.dialog_info_icon)); builder.setCancelable(true); builder.setMessage(String.format(getString(R.string.ConversationActivity_initiate_secure_session_with_s_question), recipientName)); @@ -396,7 +397,7 @@ public class ConversationActivity extends PassphraseRequiredSherlockFragmentActi private void handleAbortSecureSession() { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(R.string.ConversationActivity_abort_secure_session_confirmation); - builder.setIcon(android.R.drawable.ic_dialog_alert); + builder.setIcon(Dialogs.resolveIcon(this, R.attr.dialog_alert_icon)); builder.setCancelable(true); builder.setMessage(R.string.ConversationActivity_are_you_sure_that_you_want_to_abort_this_secure_session_question); builder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() { @@ -438,7 +439,7 @@ public class ConversationActivity extends PassphraseRequiredSherlockFragmentActi AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(getString(R.string.ConversationActivity_leave_group)); - builder.setIcon(android.R.drawable.ic_dialog_info); + builder.setIcon(Dialogs.resolveIcon(this, R.attr.dialog_info_icon)); builder.setCancelable(true); builder.setMessage(getString(R.string.ConversationActivity_are_you_sure_you_want_to_leave_this_group)); builder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() { @@ -520,7 +521,7 @@ public class ConversationActivity extends PassphraseRequiredSherlockFragmentActi startActivity(dialIntent); } catch (ActivityNotFoundException anfe) { Log.w(TAG, anfe); - Util.showAlertDialog(this, + Dialogs.showAlertDialog(this, getString(R.string.ConversationActivity_calls_not_supported), getString(R.string.ConversationActivity_this_device_does_not_appear_to_support_dial_actions)); } @@ -533,7 +534,7 @@ public class ConversationActivity extends PassphraseRequiredSherlockFragmentActi private void handleDeleteThread() { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(R.string.ConversationActivity_delete_thread_confirmation); - builder.setIcon(android.R.drawable.ic_dialog_alert); + builder.setIcon(Dialogs.resolveIcon(this, R.attr.dialog_alert_icon)); builder.setCancelable(true); builder.setMessage(R.string.ConversationActivity_are_you_sure_that_you_want_to_permanently_delete_this_conversation_question); builder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() { diff --git a/src/org/thoughtcrime/securesms/ConversationFragment.java b/src/org/thoughtcrime/securesms/ConversationFragment.java index 6ff0e2973e..770bccf997 100644 --- a/src/org/thoughtcrime/securesms/ConversationFragment.java +++ b/src/org/thoughtcrime/securesms/ConversationFragment.java @@ -27,6 +27,7 @@ import org.thoughtcrime.securesms.database.loaders.ConversationLoader; import org.thoughtcrime.securesms.database.model.MessageRecord; import org.thoughtcrime.securesms.recipients.Recipients; import org.thoughtcrime.securesms.sms.MessageSender; +import org.thoughtcrime.securesms.util.Dialogs; import java.sql.Date; import java.text.SimpleDateFormat; @@ -116,7 +117,7 @@ public class ConversationFragment extends SherlockListFragment AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setTitle(R.string.ConversationFragment_confirm_message_delete); - builder.setIcon(android.R.drawable.ic_dialog_alert); + builder.setIcon(Dialogs.resolveIcon(getActivity(), R.attr.dialog_alert_icon)); builder.setCancelable(true); builder.setMessage(R.string.ConversationFragment_are_you_sure_you_want_to_permanently_delete_this_message); @@ -149,7 +150,7 @@ public class ConversationFragment extends SherlockListFragment SimpleDateFormat dateFormatter = new SimpleDateFormat("EEE MMM d, yyyy 'at' hh:mm:ss a zzz"); AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setTitle(R.string.ConversationFragment_message_details); - builder.setIcon(android.R.drawable.ic_dialog_info); + builder.setIcon(Dialogs.resolveIcon(getActivity(), R.attr.dialog_info_icon)); builder.setCancelable(false); if (dateReceived == dateSent || message.isOutgoing()) { diff --git a/src/org/thoughtcrime/securesms/ConversationItem.java b/src/org/thoughtcrime/securesms/ConversationItem.java index 24090fe0ef..50992e0b0d 100644 --- a/src/org/thoughtcrime/securesms/ConversationItem.java +++ b/src/org/thoughtcrime/securesms/ConversationItem.java @@ -53,6 +53,7 @@ import org.thoughtcrime.securesms.service.SendReceiveService; import org.thoughtcrime.securesms.util.BitmapUtil; import org.thoughtcrime.securesms.util.DateUtils; import org.thoughtcrime.securesms.util.Emoji; +import org.thoughtcrime.securesms.util.Dialogs; import org.whispersystems.textsecure.crypto.MasterSecret; import org.whispersystems.textsecure.storage.Session; import org.whispersystems.textsecure.util.FutureTaskListener; @@ -462,7 +463,7 @@ public class ConversationItem extends LinearLayout { public boolean onLongClick(View v) { AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setTitle(R.string.ConversationItem_save_to_sd_card); - builder.setIcon(android.R.drawable.ic_dialog_alert); + builder.setIcon(Dialogs.resolveIcon(context, R.attr.dialog_alert_icon)); builder.setCancelable(true); builder.setMessage(R.string.ConversationItem_this_media_has_been_stored_in_an_encrypted_database_warning); builder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() { @@ -524,7 +525,7 @@ public class ConversationItem extends LinearLayout { public void onClick(View v) { AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setTitle(R.string.ConversationItem_view_secure_media_question); - builder.setIcon(android.R.drawable.ic_dialog_alert); + builder.setIcon(Dialogs.resolveIcon(context, R.attr.dialog_alert_icon)); builder.setCancelable(true); builder.setMessage(R.string.ConversationItem_this_media_has_been_stored_in_an_encrypted_database_external_viewer_warning); builder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() { @@ -589,7 +590,7 @@ public class ConversationItem extends LinearLayout { AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setTitle(R.string.ConversationActivity_abort_secure_session_confirmation); - builder.setIcon(android.R.drawable.ic_dialog_alert); + builder.setIcon(Dialogs.resolveIcon(context, R.attr.dialog_alert_icon)); builder.setCancelable(true); builder.setMessage(R.string.ConversationActivity_are_you_sure_that_you_want_to_abort_this_secure_session_question); builder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() { diff --git a/src/org/thoughtcrime/securesms/ConversationListFragment.java b/src/org/thoughtcrime/securesms/ConversationListFragment.java index a602857c7c..29b9cabae2 100644 --- a/src/org/thoughtcrime/securesms/ConversationListFragment.java +++ b/src/org/thoughtcrime/securesms/ConversationListFragment.java @@ -38,6 +38,7 @@ import org.thoughtcrime.securesms.database.DatabaseFactory; import org.thoughtcrime.securesms.database.loaders.ConversationListLoader; import org.thoughtcrime.securesms.notifications.MessageNotifier; import org.thoughtcrime.securesms.recipients.Recipients; +import org.thoughtcrime.securesms.util.Dialogs; import com.actionbarsherlock.app.SherlockListFragment; import com.actionbarsherlock.view.ActionMode; @@ -162,7 +163,7 @@ public class ConversationListFragment extends SherlockListFragment private void handleDeleteAllSelected() { AlertDialog.Builder alert = new AlertDialog.Builder(getActivity()); - alert.setIcon(android.R.drawable.ic_dialog_alert); + alert.setIcon(Dialogs.resolveIcon(getActivity(), R.attr.dialog_alert_icon)); alert.setTitle(R.string.ConversationListFragment_delete_threads_question); alert.setMessage(R.string.ConversationListFragment_are_you_sure_you_wish_to_delete_all_selected_conversation_threads); alert.setCancelable(true); diff --git a/src/org/thoughtcrime/securesms/ExportFragment.java b/src/org/thoughtcrime/securesms/ExportFragment.java index 2f4a38193f..c980c987a5 100644 --- a/src/org/thoughtcrime/securesms/ExportFragment.java +++ b/src/org/thoughtcrime/securesms/ExportFragment.java @@ -15,6 +15,7 @@ import android.widget.Toast; import com.actionbarsherlock.app.SherlockFragment; import org.whispersystems.textsecure.crypto.MasterSecret; +import org.thoughtcrime.securesms.util.Dialogs; import org.thoughtcrime.securesms.database.EncryptedBackupExporter; import org.thoughtcrime.securesms.database.NoExternalStorageException; import org.thoughtcrime.securesms.database.PlaintextBackupExporter; @@ -59,7 +60,7 @@ public class ExportFragment extends SherlockFragment { private void handleExportEncryptedBackup() { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); - builder.setIcon(android.R.drawable.ic_dialog_info); + builder.setIcon(Dialogs.resolveIcon(getActivity(), R.attr.dialog_info_icon)); builder.setTitle(getActivity().getString(R.string.ExportFragment_export_to_sd_card)); builder.setMessage(getActivity().getString(R.string.ExportFragment_this_will_export_your_encrypted_keys_settings_and_messages)); builder.setPositiveButton(getActivity().getString(R.string.ExportFragment_export), new Dialog.OnClickListener() { @@ -74,7 +75,7 @@ public class ExportFragment extends SherlockFragment { private void handleExportPlaintextBackup() { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); - builder.setIcon(android.R.drawable.ic_dialog_alert); + builder.setIcon(Dialogs.resolveIcon(getActivity(), R.attr.dialog_alert_icon)); builder.setTitle(getActivity().getString(R.string.ExportFragment_export_plaintext_to_sd_card)); builder.setMessage(getActivity().getString(R.string.ExportFragment_warning_this_will_export_the_plaintext_contents)); builder.setPositiveButton(getActivity().getString(R.string.ExportFragment_export), new Dialog.OnClickListener() { diff --git a/src/org/thoughtcrime/securesms/ImportFragment.java b/src/org/thoughtcrime/securesms/ImportFragment.java index 0d94061a18..0140d2f475 100644 --- a/src/org/thoughtcrime/securesms/ImportFragment.java +++ b/src/org/thoughtcrime/securesms/ImportFragment.java @@ -15,6 +15,7 @@ import android.widget.Toast; import com.actionbarsherlock.app.SherlockFragment; import org.whispersystems.textsecure.crypto.MasterSecret; +import org.thoughtcrime.securesms.util.Dialogs; import org.thoughtcrime.securesms.database.EncryptedBackupExporter; import org.thoughtcrime.securesms.database.DatabaseFactory; import org.thoughtcrime.securesms.database.NoExternalStorageException; @@ -81,7 +82,7 @@ public class ImportFragment extends SherlockFragment { private void handleImportSms() { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); - builder.setIcon(android.R.drawable.ic_dialog_info); + builder.setIcon(Dialogs.resolveIcon(getActivity(), R.attr.dialog_info_icon)); builder.setTitle(getActivity().getString(R.string.ImportFragment_import_system_sms_database)); builder.setMessage(getActivity().getString(R.string.ImportFragment_this_will_import_messages_from_the_system)); builder.setPositiveButton(getActivity().getString(R.string.ImportFragment_import), new AlertDialog.OnClickListener() { @@ -107,7 +108,7 @@ public class ImportFragment extends SherlockFragment { private void handleImportEncryptedBackup() { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); - builder.setIcon(android.R.drawable.ic_dialog_alert); + builder.setIcon(Dialogs.resolveIcon(getActivity(), R.attr.dialog_alert_icon)); builder.setTitle(getActivity().getString(R.string.ImportFragment_restore_encrypted_backup)); builder.setMessage(getActivity().getString(R.string.ImportFragment_restoring_an_encrypted_backup_will_completely_replace_your_existing_keys)); builder.setPositiveButton(getActivity().getString(R.string.ImportFragment_restore), new AlertDialog.OnClickListener() { @@ -122,7 +123,7 @@ public class ImportFragment extends SherlockFragment { private void handleImportPlaintextBackup() { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); - builder.setIcon(android.R.drawable.ic_dialog_alert); + builder.setIcon(Dialogs.resolveIcon(getActivity(), R.attr.dialog_alert_icon)); builder.setTitle(getActivity().getString(R.string.ImportFragment_import_plaintext_backup)); builder.setMessage(getActivity().getString(R.string.ImportFragment_this_will_import_messages_from_a_plaintext_backup)); builder.setPositiveButton(getActivity().getString(R.string.ImportFragment_import), new AlertDialog.OnClickListener() { diff --git a/src/org/thoughtcrime/securesms/KeyScanningActivity.java b/src/org/thoughtcrime/securesms/KeyScanningActivity.java index 415ea39716..020a62f298 100644 --- a/src/org/thoughtcrime/securesms/KeyScanningActivity.java +++ b/src/org/thoughtcrime/securesms/KeyScanningActivity.java @@ -88,9 +88,9 @@ public abstract class KeyScanningActivity extends PassphraseRequiredSherlockActi String data = scanResult.getContents(); if (data.equals(Base64.encodeBytes(getIdentityKeyToCompare().serialize()))) { - Dialogs.displayAlert(this, getVerifiedTitle(), getVerifiedMessage(), android.R.drawable.ic_dialog_info); + Dialogs.showInfoDialog(this, getVerifiedTitle(), getVerifiedMessage()); } else { - Dialogs.displayAlert(this, getNotVerifiedTitle(), getNotVerifiedMessage(), android.R.drawable.ic_dialog_alert); + Dialogs.showAlertDialog(this, getNotVerifiedTitle(), getNotVerifiedMessage()); } } else { Toast.makeText(this, R.string.KeyScanningActivity_no_scanned_key_found_exclamation, diff --git a/src/org/thoughtcrime/securesms/RegistrationActivity.java b/src/org/thoughtcrime/securesms/RegistrationActivity.java index c2ee16748b..55cd3564a0 100644 --- a/src/org/thoughtcrime/securesms/RegistrationActivity.java +++ b/src/org/thoughtcrime/securesms/RegistrationActivity.java @@ -28,6 +28,7 @@ import com.google.i18n.phonenumbers.Phonenumber; import org.thoughtcrime.securesms.util.ActionBarUtil; import org.whispersystems.textsecure.crypto.MasterSecret; import org.thoughtcrime.securesms.util.TextSecurePreferences; +import org.thoughtcrime.securesms.util.Dialogs; import org.whispersystems.textsecure.util.PhoneNumberFormatter; import org.whispersystems.textsecure.util.Util; @@ -166,7 +167,7 @@ public class RegistrationActivity extends SherlockActivity { final String e164number = getConfiguredE164Number(); if (!PhoneNumberFormatter.isValidNumber(e164number)) { - Util.showAlertDialog(self, + Dialogs.showAlertDialog(self, getString(R.string.RegistrationActivity_invalid_number), String.format(getString(R.string.RegistrationActivity_the_number_you_specified_s_is_invalid), e164number)); @@ -176,7 +177,7 @@ public class RegistrationActivity extends SherlockActivity { try { GCMRegistrar.checkDevice(self); } catch (UnsupportedOperationException uoe) { - Util.showAlertDialog(self, getString(R.string.RegistrationActivity_unsupported), + Dialogs.showAlertDialog(self, getString(R.string.RegistrationActivity_unsupported), getString(R.string.RegistrationActivity_sorry_this_device_is_not_supported_for_data_messaging)); return; } diff --git a/src/org/thoughtcrime/securesms/RegistrationProgressActivity.java b/src/org/thoughtcrime/securesms/RegistrationProgressActivity.java index 4a18d669ee..67cea2798d 100644 --- a/src/org/thoughtcrime/securesms/RegistrationProgressActivity.java +++ b/src/org/thoughtcrime/securesms/RegistrationProgressActivity.java @@ -33,6 +33,7 @@ import com.actionbarsherlock.app.SherlockActivity; import org.thoughtcrime.securesms.push.PushServiceSocketFactory; import org.thoughtcrime.securesms.service.RegistrationService; import org.thoughtcrime.securesms.util.ActionBarUtil; +import org.thoughtcrime.securesms.util.Dialogs; import org.thoughtcrime.securesms.util.TextSecurePreferences; import org.whispersystems.textsecure.crypto.MasterSecret; import org.whispersystems.textsecure.push.ExpectationFailedException; @@ -317,7 +318,7 @@ public class RegistrationProgressActivity extends SherlockActivity { private void handleMultiRegistrationError(RegistrationState state) { handleVerificationTimeout(state); - Util.showAlertDialog(this, getString(R.string.RegistrationProgressActivity_registration_conflict), + Dialogs.showAlertDialog(this, getString(R.string.RegistrationProgressActivity_registration_conflict), getString(R.string.RegistrationProgressActivity_this_number_is_already_registered_on_a_different)); } @@ -493,19 +494,19 @@ public class RegistrationProgressActivity extends SherlockActivity { startService(intent); break; case NETWORK_ERROR: - Util.showAlertDialog(context, getString(R.string.RegistrationProgressActivity_network_error), + Dialogs.showAlertDialog(context, getString(R.string.RegistrationProgressActivity_network_error), getString(R.string.RegistrationProgressActivity_unable_to_connect)); break; case VERIFICATION_ERROR: - Util.showAlertDialog(context, getString(R.string.RegistrationProgressActivity_verification_failed), + Dialogs.showAlertDialog(context, getString(R.string.RegistrationProgressActivity_verification_failed), getString(R.string.RegistrationProgressActivity_the_verification_code_you_submitted_is_incorrect)); break; case RATE_LIMIT_ERROR: - Util.showAlertDialog(context, getString(R.string.RegistrationProgressActivity_too_many_attempts), + Dialogs.showAlertDialog(context, getString(R.string.RegistrationProgressActivity_too_many_attempts), getString(R.string.RegistrationProgressActivity_youve_submitted_an_incorrect_verification_code_too_many_times)); break; case MULTI_REGISTRATION_ERROR: - Util.showAlertDialog(context, getString(R.string.RegistrationProgressActivity_registration_conflict), + Dialogs.showAlertDialog(context, getString(R.string.RegistrationProgressActivity_registration_conflict), getString(R.string.RegistrationProgressActivity_this_number_is_already_registered_on_a_different)); break; } @@ -585,17 +586,17 @@ public class RegistrationProgressActivity extends SherlockActivity { }, 15000); break; case NETWORK_ERROR: - Util.showAlertDialog(context, + Dialogs.showAlertDialog(context, getString(R.string.RegistrationProgressActivity_network_error), getString(R.string.RegistrationProgressActivity_unable_to_connect)); break; case CREATE_ERROR: - Util.showAlertDialog(context, + Dialogs.showAlertDialog(context, getString(R.string.RegistrationProgressActivity_server_error), getString(R.string.RegistrationProgressActivity_the_server_encountered_an_error)); break; case RATE_LIMIT_EXCEEDED: - Util.showAlertDialog(context, + Dialogs.showAlertDialog(context, getString(R.string.RegistrationProgressActivity_too_many_requests), getString(R.string.RegistrationProgressActivity_youve_already_requested_a_voice_call)); break; diff --git a/src/org/thoughtcrime/securesms/ViewLocalIdentityActivity.java b/src/org/thoughtcrime/securesms/ViewLocalIdentityActivity.java index 3573c7f47b..9983c76498 100644 --- a/src/org/thoughtcrime/securesms/ViewLocalIdentityActivity.java +++ b/src/org/thoughtcrime/securesms/ViewLocalIdentityActivity.java @@ -28,6 +28,7 @@ import com.actionbarsherlock.view.Menu; import com.actionbarsherlock.view.MenuInflater; import com.actionbarsherlock.view.MenuItem; import org.thoughtcrime.securesms.crypto.IdentityKeyUtil; +import org.thoughtcrime.securesms.util.Dialogs; import org.whispersystems.textsecure.crypto.MasterSecret; import org.whispersystems.textsecure.crypto.ecc.Curve; import org.whispersystems.textsecure.crypto.ecc.ECPublicKey; @@ -74,7 +75,7 @@ public class ViewLocalIdentityActivity extends ViewIdentityActivity { private void promptToRegenerateIdentityKey() { AlertDialog.Builder dialog = new AlertDialog.Builder(this); - dialog.setIcon(android.R.drawable.ic_dialog_alert); + dialog.setIcon(Dialogs.resolveIcon(this, R.attr.dialog_alert_icon)); dialog.setTitle(getString(R.string.ViewLocalIdentityActivity_reset_identity_key)); dialog.setMessage(getString(R.string.ViewLocalIdentityActivity_by_regenerating_your_identity_key_your_existing_contacts_will_receive_warnings)); dialog.setNegativeButton(getString(R.string.ViewLocalIdentityActivity_cancel), null); diff --git a/src/org/thoughtcrime/securesms/crypto/KeyExchangeInitiator.java b/src/org/thoughtcrime/securesms/crypto/KeyExchangeInitiator.java index 616221bf15..a7075fa589 100644 --- a/src/org/thoughtcrime/securesms/crypto/KeyExchangeInitiator.java +++ b/src/org/thoughtcrime/securesms/crypto/KeyExchangeInitiator.java @@ -26,6 +26,7 @@ import org.thoughtcrime.securesms.crypto.protocol.KeyExchangeMessageV2; import org.thoughtcrime.securesms.recipients.Recipient; import org.thoughtcrime.securesms.sms.MessageSender; import org.thoughtcrime.securesms.sms.OutgoingKeyExchangeMessage; +import org.thoughtcrime.securesms.util.Dialogs; import org.whispersystems.textsecure.crypto.IdentityKeyPair; import org.whispersystems.textsecure.crypto.MasterSecret; import org.whispersystems.textsecure.crypto.ecc.Curve; @@ -44,7 +45,7 @@ public class KeyExchangeInitiator { AlertDialog.Builder dialog = new AlertDialog.Builder(context); dialog.setTitle(R.string.KeyExchangeInitiator_initiate_despite_existing_request_question); dialog.setMessage(R.string.KeyExchangeInitiator_youve_already_sent_a_session_initiation_request_to_this_recipient_are_you_sure); - dialog.setIcon(android.R.drawable.ic_dialog_alert); + dialog.setIcon(Dialogs.resolveIcon(context, R.attr.dialog_alert_icon)); dialog.setCancelable(true); dialog.setPositiveButton(R.string.KeyExchangeInitiator_send, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { diff --git a/src/org/thoughtcrime/securesms/preferences/LedBlinkPatternListPreference.java b/src/org/thoughtcrime/securesms/preferences/LedBlinkPatternListPreference.java index 327b3b3fbd..6f6c2ca816 100644 --- a/src/org/thoughtcrime/securesms/preferences/LedBlinkPatternListPreference.java +++ b/src/org/thoughtcrime/securesms/preferences/LedBlinkPatternListPreference.java @@ -34,6 +34,7 @@ import android.widget.Toast; import org.thoughtcrime.securesms.ApplicationPreferencesActivity; import org.thoughtcrime.securesms.R; import org.thoughtcrime.securesms.util.TextSecurePreferences; +import org.thoughtcrime.securesms.util.Dialogs; /** * List preference for LED blink pattern notification. @@ -81,7 +82,7 @@ public class LedBlinkPatternListPreference extends ListPreference implements OnS private void initializeDialog(View view) { AlertDialog.Builder builder = new AlertDialog.Builder(context); - builder.setIcon(android.R.drawable.ic_dialog_info); + builder.setIcon(Dialogs.resolveIcon(context, R.attr.dialog_info_icon)); builder.setTitle(R.string.preferences__pref_led_blink_custom_pattern_title); builder.setView(view); builder.setOnCancelListener(new CustomDialogCancelListener()); diff --git a/src/org/thoughtcrime/securesms/util/Dialogs.java b/src/org/thoughtcrime/securesms/util/Dialogs.java index f4300aa9af..44d40ce594 100644 --- a/src/org/thoughtcrime/securesms/util/Dialogs.java +++ b/src/org/thoughtcrime/securesms/util/Dialogs.java @@ -18,15 +18,32 @@ package org.thoughtcrime.securesms.util; import android.app.AlertDialog; import android.content.Context; +import android.graphics.drawable.Drawable; +import android.util.TypedValue; + +import org.thoughtcrime.securesms.R; public class Dialogs { + public static void showAlertDialog(Context context, String title, String message) { + AlertDialog.Builder dialog = new AlertDialog.Builder(context); + dialog.setTitle(title); + dialog.setMessage(message); + dialog.setIcon(resolveIcon(context, R.attr.dialog_alert_icon)); + dialog.setPositiveButton(android.R.string.ok, null); + dialog.show(); + } + public static void showInfoDialog(Context context, String title, String message) { + AlertDialog.Builder dialog = new AlertDialog.Builder(context); + dialog.setTitle(title); + dialog.setMessage(message); + dialog.setIcon(resolveIcon(context, R.attr.dialog_info_icon)); + dialog.setPositiveButton(android.R.string.ok, null); + dialog.show(); + } - public static void displayAlert(Context context, String title, String message, int icon) { - AlertDialog.Builder alertDialog = new AlertDialog.Builder(context); - alertDialog.setTitle(title); - alertDialog.setMessage(message); - alertDialog.setIcon(icon); - alertDialog.setPositiveButton(android.R.string.ok, null); - alertDialog.show(); + public static Drawable resolveIcon(Context c, int iconAttr) { + TypedValue out = new TypedValue(); + c.getTheme().resolveAttribute(iconAttr, out, true); + return c.getResources().getDrawable(out.resourceId); } }