From 0bb3ae37f0762ad264a4b98b3ebc4753017441af Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 8 Jan 2016 14:41:55 +0100 Subject: [PATCH] show icon in conversations overview when notifications are disabled --- .../ui/adapter/ConversationAdapter.java | 12 ++ .../ic_notifications_grey600_24dp.png | Bin 0 -> 364 bytes .../ic_notifications_off_grey600_24dp.png | Bin 0 -> 462 bytes .../ic_notifications_paused_grey600_24dp.png | Bin 0 -> 440 bytes .../ic_notifications_grey600_24dp.png | Bin 0 -> 276 bytes .../ic_notifications_off_grey600_24dp.png | Bin 0 -> 336 bytes .../ic_notifications_paused_grey600_24dp.png | Bin 0 -> 323 bytes .../ic_notifications_grey600_24dp.png | Bin 0 -> 469 bytes .../ic_notifications_off_grey600_24dp.png | Bin 0 -> 485 bytes .../ic_notifications_paused_grey600_24dp.png | Bin 0 -> 482 bytes .../ic_notifications_grey600_24dp.png | Bin 0 -> 630 bytes .../ic_notifications_off_grey600_24dp.png | Bin 0 -> 697 bytes .../ic_notifications_paused_grey600_24dp.png | Bin 0 -> 790 bytes .../ic_notifications_grey600_24dp.png | Bin 0 -> 777 bytes .../ic_notifications_off_grey600_24dp.png | Bin 0 -> 990 bytes .../ic_notifications_paused_grey600_24dp.png | Bin 0 -> 972 bytes src/main/res/layout/conversation_list_row.xml | 173 ++++++++++-------- 17 files changed, 109 insertions(+), 76 deletions(-) create mode 100644 src/main/res/drawable-hdpi/ic_notifications_grey600_24dp.png create mode 100644 src/main/res/drawable-hdpi/ic_notifications_off_grey600_24dp.png create mode 100644 src/main/res/drawable-hdpi/ic_notifications_paused_grey600_24dp.png create mode 100644 src/main/res/drawable-mdpi/ic_notifications_grey600_24dp.png create mode 100644 src/main/res/drawable-mdpi/ic_notifications_off_grey600_24dp.png create mode 100644 src/main/res/drawable-mdpi/ic_notifications_paused_grey600_24dp.png create mode 100644 src/main/res/drawable-xhdpi/ic_notifications_grey600_24dp.png create mode 100644 src/main/res/drawable-xhdpi/ic_notifications_off_grey600_24dp.png create mode 100644 src/main/res/drawable-xhdpi/ic_notifications_paused_grey600_24dp.png create mode 100644 src/main/res/drawable-xxhdpi/ic_notifications_grey600_24dp.png create mode 100644 src/main/res/drawable-xxhdpi/ic_notifications_off_grey600_24dp.png create mode 100644 src/main/res/drawable-xxhdpi/ic_notifications_paused_grey600_24dp.png create mode 100644 src/main/res/drawable-xxxhdpi/ic_notifications_grey600_24dp.png create mode 100644 src/main/res/drawable-xxxhdpi/ic_notifications_off_grey600_24dp.png create mode 100644 src/main/res/drawable-xxxhdpi/ic_notifications_paused_grey600_24dp.png diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java index a4a80dc4b..302faaf10 100644 --- a/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java +++ b/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java @@ -59,6 +59,7 @@ public class ConversationAdapter extends ArrayAdapter { TextView mLastMessage = (TextView) view.findViewById(R.id.conversation_lastmsg); TextView mTimestamp = (TextView) view.findViewById(R.id.conversation_lastupdate); ImageView imagePreview = (ImageView) view.findViewById(R.id.conversation_lastimage); + ImageView notificationStatus = (ImageView) view.findViewById(R.id.notification_status); Message message = conversation.getLatestMessage(); @@ -94,6 +95,17 @@ public class ConversationAdapter extends ArrayAdapter { } } + long muted_till = conversation.getLongAttribute(Conversation.ATTRIBUTE_MUTED_TILL,0); + if (muted_till == Long.MAX_VALUE) { + notificationStatus.setVisibility(View.VISIBLE); + notificationStatus.setImageResource(R.drawable.ic_notifications_off_grey600_24dp); + } else if (muted_till >= System.currentTimeMillis()) { + notificationStatus.setVisibility(View.VISIBLE); + notificationStatus.setImageResource(R.drawable.ic_notifications_paused_grey600_24dp); + } else { + notificationStatus.setVisibility(View.GONE); + } + mTimestamp.setText(UIHelper.readableTimeDifference(activity,conversation.getLatestMessage().getTimeSent())); ImageView profilePicture = (ImageView) view.findViewById(R.id.conversation_image); loadAvatar(conversation,profilePicture); diff --git a/src/main/res/drawable-hdpi/ic_notifications_grey600_24dp.png b/src/main/res/drawable-hdpi/ic_notifications_grey600_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..96b329c4ab41dc9d334d24a07584b430fddee214 GIT binary patch literal 364 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k0wldT1B8K;Lb6AYF9SoB8UsT^3j@P1pisjL z28L1t28LG&3=CE?7#PG0=Ijcz0ZK3>dAqwX{BQ3+vmeOgEbxddW?5JdX^_ONY^_e17viXa>gj+z?g?f!O%a16m zzT{cZyl&dFsa%tiCuF^p+o5RiW91f!@`yz7Z!B5A`bG0JpQ_wbn0@KJMNgx|QI|Q6 zHB0$FN-#IM9+AA_aA3y&rScnDt#>gLztnDG`>TIeHD`jP;ITjYcRg<`5Lv`i<#=O( z)*_x?&NmjY0V(^e3o9Hec!D%)9hNxq{@_u%C!ymuF`K6?a7jB~-vlQE*#@_XTrcCl z=evArvr}bbJ=AOIy+YIR#L3J9R!^-jqy{yws&$EPW>8+r5gXOo0rD?{r>mdKI;Vst E0JSxQ>;M1& literal 0 HcmV?d00001 diff --git a/src/main/res/drawable-hdpi/ic_notifications_off_grey600_24dp.png b/src/main/res/drawable-hdpi/ic_notifications_off_grey600_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..09ebc5d25347333125525a611993664e45141000 GIT binary patch literal 462 zcmV;<0WtoGP)004R> z004l5008;`004mK004C`008P>0026e000+ooVrmw00002VoOIv0RM-N%)bBt010qN zS#tmY3ljhU3ljkVnw%H_00BlxL_t(Y$IaF;O9L?!2k^U6gzDt# zEN6b>0~hvLsjqE?+R!M%4H|x@mMPS_k*fI}{}~7bhLlrNjXL*(u6VhfdN+-|n5g3| zUm&Ra0(Ihs_LK!S>edY%7xos^os@lbLmh3je^f)FzTHq)gUnPVh``Y1)FcejsmhQ{ zjl&?73W8)R5E4`{L}19=&^Df(kcBGGSg0zDkt#Etg_L;QN7p-g{DYi@|NDWh29VyKlf4~DBmBIjH!q004R> z004l5008;`004mK004C`008P>0026e000+ooVrmw00002VoOIv0RM-N%)bBt010qN zS#tmY3ljhU3ljkVnw%H_00A&bL_t(Y$73jEpbli9r$LO=Fvzm>PU)}GnWapW8g#St zKNv<(YS4cutf#~vtI|nugRYk5l?sw$kZS23xFIn3sk9h(SYa3T1Zw(^6>cfzB;FvK z((gEoff&U^oI!l05AhfSfRbhn4i&7bI#$AOZ_J^=R=t2Dxm~BDgb!g%w8LHmG-fuWSGbWQ0QFeKX`+|fT!1|0zMkRe5}h6@rfNTKur zkp?y3Gl+O&uoy+IF&IXX9y&Ne3c++hiz8wn{pWfYY+e<6VE~y7CYDg0000prW|| literal 0 HcmV?d00001 diff --git a/src/main/res/drawable-mdpi/ic_notifications_grey600_24dp.png b/src/main/res/drawable-mdpi/ic_notifications_grey600_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..d6c20c203e092cb9db79188a3ee25ac2f509d591 GIT binary patch literal 276 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM0wlfaz7_*1g=CK)Uj~LMH3o);76yi2K%s^g z3=E|P3=FRl7#OT(FffQ0%-I!a1C(G&@^*J&_}|`tWO=~G=WkL+ zN4A;q&{S1 z9JtcpZ`mbw=$vD*7_;f746!R`c#=#DrsZkO=~G=WkKx z!qdeu#NzbSD;xQm32I>c9;oN_|` zPlx%BNrDU1<|eFXSXgqhpsM@J^vjMl`=0g)DPBK#?%u9ak8@t^Z9VEQ|G(zpZM+!l b+{^#$&Mxs?iS8SLeq!)+^>bP0l+XkKS1f*j literal 0 HcmV?d00001 diff --git a/src/main/res/drawable-mdpi/ic_notifications_paused_grey600_24dp.png b/src/main/res/drawable-mdpi/ic_notifications_paused_grey600_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..9d6308d2c13bb82f4a06cbdf98b3d4c0bb1c75c0 GIT binary patch literal 323 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM0wlfaz7_*1g=CK)Uj~LMH3o);76yi2K%s^g z3=E|P3=FRl7#OT(FffQ0%-I!a1C(G&@^*J&_}|`tWO=~G=WkLc z+tbA{#Nu?aMydkuqe%%WzK54wvR_)eB;!Z)FZmU%9=v`_vl~x27UZsER^-)LTD-6; zu|O<f8CTp6t96B6+tS-!~U=2-RYFU*a@AyN%AoB-%`H}NM z(F*laQ@-<0XKPtKxp9w}Rbd!e8DWi_72O@WI&ak+~oGHY`ILVuLjsU~ysT;eQZTx_t!NB0@ L>gTe~DWM4fOZRDV literal 0 HcmV?d00001 diff --git a/src/main/res/drawable-xhdpi/ic_notifications_grey600_24dp.png b/src/main/res/drawable-xhdpi/ic_notifications_grey600_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..d441dc7c950b8bcb5b976a0cb4bad4e0de4c1e21 GIT binary patch literal 469 zcmV;`0V@89P)004R> z004l5008;`004mK004C`008P>0026e000+ooVrmw00002VoOIv0RM-N%)bBt010qN zS#tmY3ljhU3ljkVnw%H_00B)&L_t(o!|m5SPQx%1!0~@VY0FSS1$QVD2nj(W(gJ7b z5fC3@2R53e2S5xJoB}bF1wr{Z0AfNM0STc(n9G8yMxu^i;xK@n#fg&li|uE}arVfz zxLCj#P~?P9LfRB1z}SlJoyTl5PM$@|bo2p7JB!{aeb;(SWzj{YL2c4}7tOQF>TtVx z<;7GB>fH0dVdPqqM{e=c0~4Hb!_SSZaYvg%8lX&?i(0Y=a;i6r_%q_ zL<{K;9Uta_tH{}004R> z004l5008;`004mK004C`008P>0026e000+ooVrmw00002VoOIv0RM-N%)bBt010qN zS#tmY3ljhU3ljkVnw%H_00CV|L_t(o!|m9?O2a@92H*%nbL>&kbDDz+-o+Q`bNqLu zAU=Q)`V>VUAc9pdeSw1Kq$j1AdhoPfYRsmyyPeG}cqnrV+5aOuyN5}HC~QSLKn{p8 z#urw|5QhOWsCC_S0gmv9gnae02A2N7G2Wn1kc4WKH!xiXw22dpG~f!Sen5%^LELKL zzx9L*pB_*|A2X6r$k5}Tq5(<<@rpkGm~x4je-9ECG4{D=!+QBP#3dhiX)G_D#FPu1 zw*uV684tMG2yhYCJm8s#uoF2Ccqg~PMid-i&u~_3#5V`nHv%?72v8_7APF(RL2B6w5mP!!X5loHA3~qe6uVCw})U b;XeRBeaPs`AejNz00000NkvXXu0mjfzzehS literal 0 HcmV?d00001 diff --git a/src/main/res/drawable-xhdpi/ic_notifications_paused_grey600_24dp.png b/src/main/res/drawable-xhdpi/ic_notifications_paused_grey600_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..c68bedd383837e956c04d6691ff2aceb2442f5ab GIT binary patch literal 482 zcmV<80UiE{P)004R> z004l5008;`004mK004C`008P>0026e000+ooVrmw00002VoOIv0RM-N%)bBt010qN zS#tmY3ljhU3ljkVnw%H_00CM_L_t(o!|m8VOT$1M#_>~eNp5+ZfEg2D zfrlUKC6X@lxY8yiPzJP)004R> z004l5008;`004mK004C`008P>0026e000+ooVrmw00002VoOIv0RM-N%)bBt010qN zS#tmY3ljhU3ljkVnw%H_00HhvL_t(&-tF4CF9cB>!13?cC3Z<%QMf}P8pIK?HbTM% z(U7PpbP`8_gb)QKiKCDx{R0w5sMt7)wG=A;1R`__1rc;23_CmXo1H1%o9expdGnc> zch6{3xGN-~KnmmrkmepxI!oN~&Mk|iiQL4WU!#3bo~ z?B&ED>3yF1NJ#zGRKsX4cx|2>s=mxcpcy`Nw`r$9H*u!h4m#pNC-t7NQ=k_nbyCN9 zwFdH7Sk=7diO{!OdSil3tA*NQX_@tcJ<`d=&jY&*vM004R> z004l5008;`004mK004C`008P>0026e000+ooVrmw00002VoOIv0RM-N%)bBt010qN zS#tmY3ljhU3ljkVnw%H_00J>dL_t(&-tF4EO2j}E2H+K3FSxK+3fg%Gu~ciV#Kv_| z@FB$JUo0&IwG_n%Q1F7F_y!iDjf!s|3%jfKHhW>mLeNbznK?;LW>yHN%w*CtHQncH5TQ~v&JMn?ixWuyd_M!{) z78fXuYY5b|q^1khj0g0?5d@O(L@c1omI3@pS*%Gwd1U!PIn*?y8C;+$;Rpy+agBNI zIg~?PK^nlP59Ti(G0U4}YSJWu)WjirIoBZ_=|f8rc)<|o!pK1?VU%;FUQv=JNTf0b zIZFoz=@mVkwJgs-I^r#^1xM#K>CFd1@zVOi4Q60Nrb5hL=?FZF|Q7Dr>WcPAYPM zs)TizO8Vje2~xO8qf%1S9EeIX2$GS?c0mGlEy*xQPcjbjl13aP3m_S(WEZ3&SpxZ! ztbx3wVU+BG)bx|A(=gMCXh@YgF8uQoS-eA*-;>quF%N| zTJixc65o=P69v>Q-NUb-i}c~n<(z19Xg%!4W_;)Nn`k()X2brk7SlLI1r1bif~n;1 fm;{u7{sZV6UPp>Dk_rPF00000NkvXXu0mjfJ((G; literal 0 HcmV?d00001 diff --git a/src/main/res/drawable-xxhdpi/ic_notifications_paused_grey600_24dp.png b/src/main/res/drawable-xxhdpi/ic_notifications_paused_grey600_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..e38f52179eaff583470afb779a02b7d3573061aa GIT binary patch literal 790 zcmV+x1L^#UP)004R> z004l5008;`004mK004C`008P>0026e000+ooVrmw00002VoOIv0RM-N%)bBt010qN zS#tmY3ljhU3ljkVnw%H_00NFlL_t(&-tF4WOB7)o!13?6DY**0u?KsTI#idGGDO>= zpcacDG`y6D4pET>WndXWc@hP!Lm&jvp$T3E8)ml| zXLg?7?6bx5%w?Wu=9&G>Jns){byHfQ3gHFW#XWv>`8Es~cp=x3=)0m9)F0wzEP9D8(4_jJRAGVV+SA z6cePq~HoCDFLbz z1l0$*$*({*d!*mXiT&mV89TPsBhMxY&}xtLQ+cb8jAJJG)FaOti6RR!3O%CFK9BL( zb9|3Wfc*RD4>@0Jh?LrbTXiWtM=L)Z1$j~LGH8J|X6@J>hIOyYPBZP8;EqzE7c|I2 z`@D*A5_-2|o^#bvT^|JN_M!uQ<~WOXte0a_-Feud^C;i!^BNM|&AED3VJ_#hVU-Ql zr-aKT(hrFT1N!GcVOv?&6j^D4dWC;2!1H3srLx}?2JOeX#=tpET3 literal 0 HcmV?d00001 diff --git a/src/main/res/drawable-xxxhdpi/ic_notifications_grey600_24dp.png b/src/main/res/drawable-xxxhdpi/ic_notifications_grey600_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..98dff2f3c6ae87b101991567b67d0d7c78d91485 GIT binary patch literal 777 zcmV+k1NQuhP)004R> z004l5008;`004mK004C`008P>0026e000+ooVrmw00002VoOIv0RM-N%)bBt010qN zS#tmY3ljhU3ljkVnw%H_00MzYL_t(|+U?xWZ;U}0!13>HOMlQq!&R(wg|>c_+R&~d z4pJQS?8L!EB$YH9!hsuU9ZPU>6%HkpE{PwNI8@_M4i4Rj_$zFx)>YZ}?K|(j&%84{ zbK9BS_kBL^%)Il==H1Pd@VjJDfC3bt00lS)Xy+0iSz?I=O0-D=G6DG&P9?ts%IBihtB%r%)ZLdFomb$eb%>mEXfqY;~m+OFD zCaAC&*j}N+I6ZDIWGA@HP{jAna+9)4Jtx4~(-m zZ9o_EjKw@cmJ)O1(gYl0j-3siyN`K_X#tK=W<$f5ZzC@_ng-w?PZP@W+nJ6rhZ+QI zWhx+Hh?jmpX=ITz2ek4yfx)wKAU%qILCgUY>`FWz*uxE5fc-*SlTrHZ049a<*DRAZ z03+-Z%Zm?iQXX(cG_}7f4cJRT6fnSUS-=_b?bTUXz=$~Dlq6sWo5TS*^Br4sz#ult zfE=J;1yGO!rP3Q&Lo z6rcbFC_n)UP(XOOZY?6iGc^^X9rT(tz!5UMNfux;d}G4u0Nddk5>^AG5xx;29FSJ{ z281v`n&C$#1Ow6zKO!Ocsl}QjD^*5UVg-nn=D1@|dq4sI{2Yi=s-e$AS0#SOk!%lq z4Q>76{t$W<+WOLcz}=7pq{e;s0Sh5P-r;*%?+kPAkAYO004R> z004l5008;`004mK004C`008P>0026e000+ooVrmw00002VoOIv0RM-N%)bBt010qN zS#tmY3ljhU3ljkVnw%H_00UM@L_t(|+U?s=?aZ?C`|xIWW_D+sZql8c43GgbKnBPF_5sT1}2DP4d)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L(R{spbUxQ$NH$aT{|igJ}*Ov?Z=>s7b-n?8D&qksZt uncyxhbTcbfZR`Ilp#d780UGdM1O5O#TZy9}bNz1s0000 + xmlns:app="http://schemas.android.com/apk/res-auto" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:descendantFocusability="blocksDescendants"> - + - + - + - + - + - + - + - + + - - + + + + - - - - + + + + \ No newline at end of file