From 8f9712c64e712108ac3e25b28de4646b7454f52d Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sat, 15 Mar 2014 00:19:42 +0100 Subject: [PATCH] added security indicator on every single message --- res/drawable-hdpi/ic_indicator.png | Bin 0 -> 684 bytes res/drawable-mdpi/ic_indicator.png | Bin 0 -> 490 bytes res/drawable-xhdpi/ic_indicator.png | Bin 0 -> 915 bytes res/drawable-xxhdpi/ic_indicator.png | Bin 0 -> 1298 bytes res/layout/message_recieved.xml | 23 ++++- res/layout/message_sent.xml | 85 +++++++++++------- .../ui/ConversationFragment.java | 12 +++ 7 files changed, 84 insertions(+), 36 deletions(-) create mode 100644 res/drawable-hdpi/ic_indicator.png create mode 100644 res/drawable-mdpi/ic_indicator.png create mode 100644 res/drawable-xhdpi/ic_indicator.png create mode 100644 res/drawable-xxhdpi/ic_indicator.png diff --git a/res/drawable-hdpi/ic_indicator.png b/res/drawable-hdpi/ic_indicator.png new file mode 100644 index 0000000000000000000000000000000000000000..6de8969faadad5329d3ae2f4af404c5ba02d725e GIT binary patch literal 684 zcmV;d0#p5oP)XV#k2A_-4vm4mBu*(I>~0b$E;{<+i)@rn z^AbW3Jw(<^(BHDqpAfy58R8%+BCCi9hA1j1h{!Z5n`0y1+mnON+^qu_=AQ34pYvn5 z7K|~FEFO=43I>C(T`reR(=GUt3&&S=Q8_!?va|=BU S!sQPD0000K~yM_bx<*D!cY+YB88U5P@0lj2o46Z6k;AKc6e*CgP?RN zICt<5bnB0Bv~#BxM_pXHbTFj|P7Z>DQK1S6ja~X$qOViJ6WW6tzWctr`|c#pIm9TJ z%cEkknDIPsGaiqhyWQ@k$j3xbsZ`$5>9o;qw^N-?=f*V6i(D>u{cnS=>(+ce9}NbB ziQ_mA)9KVtrBZjIMhYzvLXJzN(!1~bKd$Re0U()78mrani!pZCYPHq?umb?5X`WZB z)mKf^Bwg3{0Az%rO0U=RBuP>^=bIP+7>4nvX_^!&`u+aIw(XA)Q%VmgrT5VdilQ8e zJ{OCH!x;M%Yw>veEV2Y(Et0CLp31VUU^_O^hS_ZPA~KZH6GDg_;vfjHTrQhiU&`n6 zPlS*w%d&O>!1Fxr`~I3S77T~Orfu7|007Q;l!-(_ZZsOaUax;=vspvr!rTUcRIAn8 gLZPt#mzZ;oU-yr>(}!;civR!s07*qoM6N<$f`0eXzW@LL literal 0 HcmV?d00001 diff --git a/res/drawable-xhdpi/ic_indicator.png b/res/drawable-xhdpi/ic_indicator.png new file mode 100644 index 0000000000000000000000000000000000000000..3e5141c2836125cfccec88317beb6f34b4b64a73 GIT binary patch literal 915 zcmV;E18n?>P)K~zYIrIpP~8$lSxpP5b4Xh?{}+RZ^4#hCgL35`Ny>On%G z$3oB+p|nMMwa|m~P_*{eLQnk*+CvXk&?D85Bp720QW~)FVv5uiHF4dTonET= zvAcfsg@K)U-g$mA!@RSEF$S%uudlyeTU#5csi~>9SS(yVpJ##~>@F@Yeu~HAPc

wC$Hc}`Qkjv#jDTUc=1|bBINaRN-6uO}Wpjx8O=bNzEY-D|XT^<}9 z>=_ssApQOQWOjD;jU-731Ol%1_V(A80yH-_KX$v_B>*rsHuf@+NW4GLhK7b-jE|2; zDW#~atbBecKt)BxBLFBCi|Fg?dwWvf*w}~xfYa$Ly%c~_TK><7b#!zTPwJ8+eFXrM z$wWLJkLkhyj^j!JAeYO@O1i;d$N&H#1eDTSYCej$$m{jqZE0y4b-7%6#u$plQyTyP z=yW;&z{JGFq96!?SS+@o3Fz$X!1?MJYx$o0Y@i@RL+3_3`NVu_F>i zF&PL1E^H0}JkQf$F!;gi_0}i?c%HBD`Fw6QgYE5YjEszY866!>h@z;NV>X*%x7$OC z0H@RWP;2G$^Yh=M(dfOYsi~G^GWka>ud1rbp$L#=`Kqcr0KHysKlrv-EEcsqLI_a= z?C4^ z9jvUZ+&MaStkCxM_HIv4Pydu<#pg#eGMS7#JUsktd3pKQ(Q(DM$nW<*C@CrFDJv^; zw6?a|k7|-6VPRomU6$oyp-_+{NfJa+%%s!l2dk^Ar!I=-FSD_+@mhCxclMyawY7zC zIQ(jEZf@YbJJV^227}@7tk%}n*yQBo{X`=1`Ml<50w|@M0FX|n_h)8iZZ0h?eY=P` p0Dv*3*}A&A1c$?6Ju6SG{RJ+3ZWK(>{80b^002ovPDHLkV1jBCsK5XK literal 0 HcmV?d00001 diff --git a/res/drawable-xxhdpi/ic_indicator.png b/res/drawable-xxhdpi/ic_indicator.png new file mode 100644 index 0000000000000000000000000000000000000000..2c51b8b7650a089ed0bf747ee281bb6c63346a73 GIT binary patch literal 1298 zcmV+t1?~EYP)B4-rG&&Oo}Q79(bAQh2N%~nMWld6Q!7cEJ} zY#*DL>}xM+nzRqSBu$#^)Ao7WKJ>LUF}`e~fvO`Um@XnNliEPtxLQNKF%=0{#c?iu z*p6XAWX8q+(>dRF&dhJVe3$bL;y4b(3L&I*xm>emv)QH9YVT+?8p-MDDVNP=scbfT zL=eOm+uPfZML!q-kXRt6)A_C4Zhv4hnNY2mQmF*1tE=I;xw+9>1?unb|7vP#>Y-Ap z1ONbzU-s0`Oy}fiK5?QYm8w>{DE0szB0MOIZ zBez|w$D^U4p^q#Uiy-)`l+WiO z8jU_H6bc{s{r-&`0bv;C?Cb0MZE$d~8KIh|geVmX1@L;kKZe8MPelQZj*fmjIXU^0 zN~LNDNV#a5hJ}TN6~EvAjv%0kiHSC=)tYQ?Zx_62iWSSUFgrWzSzBB4R`ylR3!0`M zi-AcdlPp0HPXNH^bUM2<8cp3Ci9`YhgW(qdXszn2Y|!iVf;TaeBw>Gl{|y|+T{w=L zW@ctSqiI@DE{0(`yWQSa7pSeRO(_ECWO{n~i1#-)Hy;fkw6vH+LR?BNm!H-J0sv7!&CSitHw99uRP}*qnr6j3 zR4SE9F$^2PFl<2V5u;YCbCqpX8{@&jL9Vm2Q}E2RTCGi1tMyM&Bmj`fWPl{eCzb70 zBXoRx{KHKyk75;%$G2j!7**L`1r!JbzKceqEWyTuB>qgf_Sr7EGAqo zm#$Hz2d|Bdjq~;O^@(^qp1G?3+5*ktaLkX4j7;eDdL)zGxIP1b7q!sx@^WBhWo4Y> zxS9(`(9Kn?R@-}fd++IVI-AGinXDBTi9}8g4-Xds09ck~XqrBvC~Eus{QR#}D)mP) znJm_Om!Qus7K>2;h}vwn9ssBU;y4ccet*pC^$NZaz7h~GmSwAI3yPw^=kv`4gTZ^R z3L_fm?Ck8NWtz|D!RPaR9}b7VZUl^IAcaElFK?41$>BJDKN^kx+9((R5kDIM0AjHi z#V`!)?CdaJulMan!vKgJApn4 + + android:id="@+id/message_time" + android:layout_gravity="center_vertical" + android:gravity="center_vertical"/> + + + + android:padding="8dp" > - + android:background="@drawable/message_border" + android:minHeight="48dp" > - - + + + + + + + + + + + + - - - - + android:scaleType="fitXY" + android:src="@drawable/ic_profile" /> + + \ No newline at end of file diff --git a/src/eu/siacs/conversations/ui/ConversationFragment.java b/src/eu/siacs/conversations/ui/ConversationFragment.java index d8ead9a62..7385d8a96 100644 --- a/src/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/eu/siacs/conversations/ui/ConversationFragment.java @@ -239,6 +239,7 @@ public class ConversationFragment extends Fragment { .findViewById(R.id.message_body); viewHolder.time = (TextView) view .findViewById(R.id.message_time); + viewHolder.indicator = (ImageView) view.findViewById(R.id.security_indicator); view.setTag(viewHolder); } else { viewHolder = (ViewHolder) view.getTag(); @@ -266,12 +267,22 @@ public class ConversationFragment extends Fragment { viewHolder.messageBody.setTextColor(0xff33B5E5); viewHolder.messageBody.setTypeface(null, Typeface.ITALIC); + viewHolder.indicator.setVisibility(View.VISIBLE); + } else if ((item.getEncryption() == Message.ENCRYPTION_OTR)||(item.getEncryption() == Message.ENCRYPTION_DECRYPTED)) { + viewHolder.messageBody.setText(body.trim()); + viewHolder.messageBody.setTextColor(0xff000000); + viewHolder.messageBody.setTypeface(null, + Typeface.NORMAL); + viewHolder.indicator.setVisibility(View.VISIBLE); } else { viewHolder.messageBody.setText(body.trim()); viewHolder.messageBody.setTextColor(0xff000000); viewHolder.messageBody.setTypeface(null, Typeface.NORMAL); + viewHolder.indicator.setVisibility(View.GONE); } + } else { + viewHolder.indicator.setVisibility(View.GONE); } if (item.getStatus() == Message.STATUS_UNSEND) { viewHolder.time.setTypeface(null, Typeface.ITALIC); @@ -554,6 +565,7 @@ public class ConversationFragment extends Fragment { private static class ViewHolder { + protected ImageView indicator; protected TextView time; protected TextView messageBody; protected ImageView imageView;