From 0878de59362e1a0e0a87d7a36b38da92b1f9dc2b Mon Sep 17 00:00:00 2001 From: cketti Date: Fri, 14 Sep 2012 00:34:25 +0200 Subject: [PATCH] Go back to the old behavior for batch mark as (un)read, (un)flag If there is at least one unread message among the selected messages the action is "mark as read". Otherwise, "mark as unread". If there is at least one unstarred message among the selected messages the action is "add star". Otherwise, "remove star". --- res/drawable-hdpi/ic_action_flag_light.png | Bin 0 -> 1164 bytes .../ic_action_mark_as_read_light.png | Bin 0 -> 982 bytes ....png => ic_action_mark_as_unread_dark.png} | Bin ...png => ic_action_mark_as_unread_light.png} | Bin res/drawable-hdpi/ic_action_unflag_light.png | Bin 0 -> 1502 bytes res/drawable-ldpi/ic_action_flag_light.png | Bin 0 -> 582 bytes .../ic_action_mark_as_read_light.png | Bin 0 -> 500 bytes ....png => ic_action_mark_as_unread_dark.png} | Bin ...png => ic_action_mark_as_unread_light.png} | Bin res/drawable-ldpi/ic_action_unflag_light.png | Bin 0 -> 646 bytes res/drawable-mdpi/ic_action_flag_light.png | Bin 0 -> 753 bytes .../ic_action_mark_as_read_light.png | Bin 0 -> 672 bytes ....png => ic_action_mark_as_unread_dark.png} | Bin ...png => ic_action_mark_as_unread_light.png} | Bin res/drawable-mdpi/ic_action_unflag_light.png | Bin 0 -> 929 bytes res/drawable-xhdpi/ic_action_flag_light.png | Bin 0 -> 1513 bytes .../ic_action_mark_as_read_light.png | Bin 0 -> 1246 bytes ....png => ic_action_mark_as_unread_dark.png} | Bin ...png => ic_action_mark_as_unread_light.png} | Bin res/drawable-xhdpi/ic_action_unflag_light.png | Bin 0 -> 2161 bytes res/menu/message_list_context.xml | 30 +++++-- res/menu/message_view_option.xml | 19 ++-- res/values/attrs.xml | 7 +- res/values/themes.xml | 16 ++-- src/com/fsck/k9/activity/MessageList.java | 83 ++++++++++++++++-- 25 files changed, 117 insertions(+), 38 deletions(-) create mode 100644 res/drawable-hdpi/ic_action_flag_light.png create mode 100644 res/drawable-hdpi/ic_action_mark_as_read_light.png rename res/drawable-hdpi/{ic_action_read_dark.png => ic_action_mark_as_unread_dark.png} (100%) rename res/drawable-hdpi/{ic_action_read_light.png => ic_action_mark_as_unread_light.png} (100%) create mode 100644 res/drawable-hdpi/ic_action_unflag_light.png create mode 100644 res/drawable-ldpi/ic_action_flag_light.png create mode 100644 res/drawable-ldpi/ic_action_mark_as_read_light.png rename res/drawable-ldpi/{ic_action_read_dark.png => ic_action_mark_as_unread_dark.png} (100%) rename res/drawable-ldpi/{ic_action_read_light.png => ic_action_mark_as_unread_light.png} (100%) create mode 100644 res/drawable-ldpi/ic_action_unflag_light.png create mode 100644 res/drawable-mdpi/ic_action_flag_light.png create mode 100644 res/drawable-mdpi/ic_action_mark_as_read_light.png rename res/drawable-mdpi/{ic_action_read_dark.png => ic_action_mark_as_unread_dark.png} (100%) rename res/drawable-mdpi/{ic_action_read_light.png => ic_action_mark_as_unread_light.png} (100%) create mode 100644 res/drawable-mdpi/ic_action_unflag_light.png create mode 100644 res/drawable-xhdpi/ic_action_flag_light.png create mode 100644 res/drawable-xhdpi/ic_action_mark_as_read_light.png rename res/drawable-xhdpi/{ic_action_read_dark.png => ic_action_mark_as_unread_dark.png} (100%) rename res/drawable-xhdpi/{ic_action_read_light.png => ic_action_mark_as_unread_light.png} (100%) create mode 100644 res/drawable-xhdpi/ic_action_unflag_light.png diff --git a/res/drawable-hdpi/ic_action_flag_light.png b/res/drawable-hdpi/ic_action_flag_light.png new file mode 100644 index 0000000000000000000000000000000000000000..eb0a3f7b8ef3fd7008b2deedefb167c852a8cebd GIT binary patch literal 1164 zcmV;71atd|P)5C#FmKBZg5#XhO!!R|G{^K~IQYWPe0P{ZU9k6cG`WMi4=dKZ@$F!03;R zUIbzUl}J&fP8^9;5>aHMKg2d))4BCIvVpF-d++hy<-iN$I?p-Z-}n1_-E;0tDM@~r zlAM3ajDY_g!I=oei-6PVoF&HHZg;;?kuo#_#l^)NAZ~KGT+fqHfE58Xf;a-saSIqB z!mtRGl#~>QLZQQg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K-n^s z?T53+(KLu>w@R1F_=O(++q$~CVP6*H=jS^(Tf9V+o|LYWNJ&2xLmm|K`+dOQHiN)4 z0KES=3W^!RWjV-SbEk_@e;(8l0qI5!U#0<|a5u{SBw@dqi!Mg35L)5=mxYSt!G5FP$vV>jh`_^m z>AD#uM%SvyHVwe2G4r)<5x{(T+HY0pejBXUAM_OZ7b5bwPqA&SIsgCw07*qoM6N<$ Eg2AT9NdN!< literal 0 HcmV?d00001 diff --git a/res/drawable-ldpi/ic_action_flag_light.png b/res/drawable-ldpi/ic_action_flag_light.png new file mode 100644 index 0000000000000000000000000000000000000000..8ab54155abaf668f599ec750b90e7bcddd98737a GIT binary patch literal 582 zcmV-M0=fN(P)~UjTtXU<<+|nM@x4J0KJajmfgSON9v`2Y?h;O$-5^XEpt$p}Wl<}JY@#Uk4Ku*&^>TK*eYDYNI3YGn zABZSph>T-w*NS1jhW7&I-!QJwZ~9oR)=I5bd&%W;CB@F~P4IXG<4r8$xvaq#dxSiqHs{*fbksl;MO(RCUO^;NW+2G?-tBf@Ns?4=u~J8b`2Bub z)Hz1TZ7P+DVr{d1yaeGyi?l+5An-PuZLh8Om6MC8UE2A2y}qB#W{bZCqMHHypN0R+N)&|1 z5S2=$(lveOIBo%RBIcC;2h<^gI!I;#YqV7%@`Owx@p$}MD?o2oM81SI6SPH9hYM2x z_`i)~A4?<>cY6NP}7 z^ctl4z7@EH7Z4nBL_ciXF2rK7vtqIM<_Gcw2w}^zmLy49bP0E8vGz_(K~>cYuZq3^ z5{bkJEy$rH94kTEKun!+)o3)%4a0bG=X3y4snj~I<_S;(3U`OqX0f4$2Vz~$C+Mx6$W4jZ)T0000t^SQ?5os}c}N$Q5x>N~MAbT@=(!MX2rsF&lq}n-;;H7Njmj!G$1# zMJZi~WKv?8na)7-!SGEc?>Wyo@A+nwp#d*t!1;&V0#u`* zj?=504!XkH^obsyZi$JDtvYu~^)40+)!%Hj zTJI&P*XzAV7f+835Q#)aG)-ITStC~Iy1rVeRDK=>anu3!T&C*pz2VBR>1G_8-Z};4F-bww6!y5kD6<)OlF8%^g17Ve{5vNQ^q0_0qF-Zg_s3WcIgv;#(5{B}&k5*S zfMgceu~jb=3a`vGwx`HA`=4m}i&-$1p2gDhcJG8OfY$HS>-E)It@g_d5DJA(1cSjP zta)T*r5!*4aF1X)p1tKYZsd6WTWB(9R;+Ba1Q0k$&@92vBoTIJ{wyPPCaE3&`SzrBr|25u?UF>=-Nw8&}Ge6dBHedLBzA3;yfE#WBw+Q&db&BLK z4_7E10=dfnKe&bgJaGl!dvl+}n*@He@|Widon8Pm&3Ed7D?m6L)~eO2ZWeU-nVr_r g*VGBbN;7c4UpFZMC=hjLs{jB107*qoM6N<$g5riPGynhq literal 0 HcmV?d00001 diff --git a/res/drawable-mdpi/ic_action_flag_light.png b/res/drawable-mdpi/ic_action_flag_light.png new file mode 100644 index 0000000000000000000000000000000000000000..2cbff776c99e36c027df18802772168e93eb557b GIT binary patch literal 753 zcmVjwZ67pE_(1IsHP$~!>yy!uC5LAi>u~2#_J(Lzosp6#+ zN-rJ?LW>2#lc0jQd9WdfwDcfBnjCDJ3X(^Y{=c$;?Ka8G?n;6K%kIv8kKcTcnH74v zJcKU$@Ah zodM<@YGI=j0CoV(0KlySC<5RG=Bh>@3`Zao3SG6^?GKwdsaC7YilThA1mO4kdp#bH z+v#+krBx!gZo1<-en+S;zyZ}jv#}4E9mo`M9nf7AMS3ol%jJVYp-{|bvwyXUCn69I zhi}_#wwp#)U{tnNt8JoK*Bg4LQh@wk!z%7Uz-H7qL%xPcyg{9OY#D*Z2lRLd&(!Cx ze*{s2oh9rQir!w!B1EsB2l10O`Q~M#x_F5L>t{2Cwp|bi1O{9#*Hb8-bX;(6(k6+*Sml@Ca|hk&*$@FEaxQ4 zWl(qWaRmbHHivfGVhQsC+<>7wEMvOwZ&CH{SvtG`k70;f)5uT&@QS6t3os8uXHFH6 zAnei{3UsiEqdx$6W*GpjIEYr9(ix(SWfKlQ&^&77I&QRupV+w2f|F>$W5`y683Ala z!&u>cjRCn*sjQ{b={>E{U@+M4a5(N_PHN1f6<4tVeX9 jX)#s=OdIA^>^i^^>zM*Db%7>}00000NkvXXu0mjfWo}S? literal 0 HcmV?d00001 diff --git a/res/drawable-mdpi/ic_action_mark_as_read_light.png b/res/drawable-mdpi/ic_action_mark_as_read_light.png new file mode 100644 index 0000000000000000000000000000000000000000..07f0119751a59165b0de5bd07203d1168420f3ee GIT binary patch literal 672 zcmV;R0$=@!P)KC( z76GXk62`8Y!2Ae?QLzW=yP%ekKrR4s*bD-vhV**<6vd&keN=Y&5d!mlST~6=jQid7 zIkf=wb!Aj>fpG|-8?V>P8;!grm6P%4#HlF4MwlQf^Y^$>OZ^PzJ~w3wTTk`Cyxt{r| z18=$E!fv@-zQ%5uq-)rJfPNUnm{Dq2O#mPw0^$k|Bv3JjBioOA0VQ#o*9w3|t7S|F z;O9GlqqE_Iq3wq)u@EQfdc*mlwSd}uieJTQ6RM5x0K5XQgBdWiE6n%+0000*=)YB-~h$N#p}}3)Ax(OQ&Uqn zhlYkeBmkKDFtZ0x?nJ5H)tAhMQh^xDWucii(Ps@$vCio6R;R0%|mxyquhzCIEyY z{zM=WR)B2vWV@MQ?U8|iYM>WhqKYXc0JU1JP%4$V1j+UL{Yu76JcsTCP~u!o*LPSf z7F%Q>old7=Dh~0V9eWoga$+C4%VaVa&rX-i<+R)Fp2&57C_r|#1lq|p#=>u6F_#O6 zA!l;AT)aEU{?lw(qQV*h>ht+R(AWy#T=5^*3f}X$?x9lm^!mR_px5gS7}epRy|=gb zb0Ts^v#qSGTulNEKs+#+Ovb1ROn*R$O&Hfxg6o5WgVt0aN=iz!l;9vqb&~n3nZBYn zAq!Wb!ZAR)+3S0ffnZ##2wY3{S4iZ`Y(D0kg3{8`r2rfU#6sQgCjvn~>>#iXfXf2| z13#m!jX8#5DpV@f5uE)(!p=D6Tt*4&fnMTpIIhj?`nXFFX{gm|Gcq$X+fd;|JOE^W z$?bMGTCG-ZEY)HvARI8`g&7$cy8vj5;YJ`nY1 zFPNb59?uH^4v*4|Jpnkhp&C#COmLB#9<_JXa9R3T2x1lh|te&oFic^#3CDU*tC;#{y6 zxZ9!^xxWMQc}f6ecYwe}IGG^8EjE?6b2$WfJrMh_$p&B;fEy_Rkl9HBo5FGjV%0SK zT?+U%K=deeF(m+T{!8YpCxXVaHf9gRnQ_u){{emja<`N)k$+5P00000NkvXXu0mjf D=%cH) literal 0 HcmV?d00001 diff --git a/res/drawable-xhdpi/ic_action_flag_light.png b/res/drawable-xhdpi/ic_action_flag_light.png new file mode 100644 index 0000000000000000000000000000000000000000..d0bdfd64d96f4f498e2de66e66709248755b7dfc GIT binary patch literal 1513 zcmVSfcx*p{X=VwB@DuZ!I6ue zfR>h)y0WseUJUlHH5NkRu~@8ca&mIcBnienK$Jd=z17M{NcqNeNi<48b8~Ykvwsld zt8&cpB3`g}YHDi5louE!faDh<`R&eU9Lewq$uN8|65#3V?A(W&Uz5)`!sGYh;o$>f zd0>JBV;*2t`f?d)vLqTKfZ5-}?03k_Dqb*x7aWoqt2)LA0ijSRz^op~E`7Pci;_sL z*cT3m=T!}~d)^2EEPL++$X#||vi|=i%j2&cKI3@!h7%x4UwL_XAG5#32|B#s-172r z??#tIodkG$dU~p&(P#i;tG!-tz~}Q-ClZNkvzNWHM2O`va(-J~U5z4V9y!tK>gxIa z{{BT|BxL2}tvWVBJj`Gf%4&0JSA0!L{UVna*t#nu+yn^^Bj6HcG-d@{!1$vW|AR^nNIl!t)ztzC zk8_rrwPD@bVubJEp`oEkI|;TPkP*<`-F+3wWe@kYc0yhLe}rUxXmD`wPZ=E21PEbN zgiG1ZKF#G7GQwRLbC&J&+hqQKWpz6uKnNA>?7F(TU4%nWR*8vm#QWIX+}wLk+v|=A zNE_p)v-8+`7dW~JN%s>!KyKWr?DZ0m(!*L|2g&9EE|ugs1-)i`k{bUBHU8W6%1{Q* zM(1XfKg4OeOkP0eF*Z!6*K53ZPMH89gtfwTxZzV=iY2m%BTD$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;tb&4~-&&IZa zKwx1_P0jC!w~c3utcVx11}F^vF12dRT0Wbanzmxu17__x?Y+uL&Yg6OSexpCEJ#(*H<}pje6Z+bzI90Q6;<@#^a84v251pI=l78{>*9KpG4) zcR>y+S)UI=Xp0#cVnf89gElKOEv5{XRV zmP5pC{wV~2#3WWcBVrgm)m z`DzolSDqnAoT7P;=hyf(PK<17_NkIIi*t+sfc(mR2|yzPm>mC=)cF2N4f5ku{z>_n zG+ED5`3C~{e>MS9Tod>B;VyqzeaR$9YSgCI_>E!;9pt4CCpjRKQxvlDiu(gIjS;-H ze6G|r>zM;NRRCQRY}t=1fbL^)OUWG;;5xu{faaH@4s*CA95)5r6mU}@?|+bxBdC(S zr~$Xlz-!xcm#RXp0Hr!}x^TM=(4}Ol_TxIBRA){X?y`5lHzF%QUpZrl(EtDd07*qo IM6N<$f|BV-)Bpeg literal 0 HcmV?d00001 diff --git a/res/drawable-xhdpi/ic_action_read_dark.png b/res/drawable-xhdpi/ic_action_mark_as_unread_dark.png similarity index 100% rename from res/drawable-xhdpi/ic_action_read_dark.png rename to res/drawable-xhdpi/ic_action_mark_as_unread_dark.png diff --git a/res/drawable-xhdpi/ic_action_read_light.png b/res/drawable-xhdpi/ic_action_mark_as_unread_light.png similarity index 100% rename from res/drawable-xhdpi/ic_action_read_light.png rename to res/drawable-xhdpi/ic_action_mark_as_unread_light.png diff --git a/res/drawable-xhdpi/ic_action_unflag_light.png b/res/drawable-xhdpi/ic_action_unflag_light.png new file mode 100644 index 0000000000000000000000000000000000000000..5b3f34471c930f631eca55ef9ffcc5c67f4984af GIT binary patch literal 2161 zcmV-%2#)uOP)kKbF&_+1#8t zt@)=kw`{KFpRo9k7%7YCn-L(az{ivLPoKl?a}RuQ@8ezWW5C;fyZ7CD?(dxQJ?D4M z`JH=BgZlZ;)X()FGyuSW2lR6U29`iScL2`@!NkPGp<;lXoSf^PGK5E$Kzw}sG*LV+ zFYj2t17Pgfv4j2m{5FW?D7a!Y2p(Aixc_{V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$P?Cmp6{RIG6#Jowwfvvng zE7ZuNOETR6KsafiO_O*2RA(pEgo8ecygnN`YMa(WfL5&bOl)lI;}k&8Kz9uK<7)I; z?&}G_8!)_&Dsa<<3l}bT#+=>caCVb3u+#ihqMM0$&iHY;M)r#P1u`VEfX(ql;H z{FY?_4!j9?O|+WlnT&enAf7lp2gWpbvnvht`s zkVyay2??3OrfLEJctcl8COP1&&j1Lkpc&0b)1w)q3jhSbRFqnP;6LG--`KT}j*bqb zPd5``ALN>uVNq%Xi!;k8Z-wS^FOty$SijPLJW^CtBpv6rAF<Gr%t4!^Pj*=~=<6RRaTQGhm=6tOcMQ3zwdw`@RnV9nQ zfZDr%cLa5O)}Ac@y_F@l(VcnS1;9iAOduHL>geuT_0fg5y8vhvw%5`P0MKhqV~}72 n9$*mAy_U^@2lQIg7$n&LFqHdl8$hh%00000NkvXXu0mjfFNq3p literal 0 HcmV?d00001 diff --git a/res/menu/message_list_context.xml b/res/menu/message_list_context.xml index 9d1cb9a7a..44ff9c361 100644 --- a/res/menu/message_list_context.xml +++ b/res/menu/message_list_context.xml @@ -7,10 +7,16 @@ android:icon="?attr/iconActionDelete" /> + - - + - + - - + diff --git a/res/values/attrs.xml b/res/values/attrs.xml index 2c50a744a..662cc1d02 100644 --- a/res/values/attrs.xml +++ b/res/values/attrs.xml @@ -14,7 +14,6 @@ - @@ -22,8 +21,10 @@ - - + + + + diff --git a/res/values/themes.xml b/res/values/themes.xml index e052da581..20c0d60dd 100644 --- a/res/values/themes.xml +++ b/res/values/themes.xml @@ -15,7 +15,6 @@ @drawable/ic_action_move_or_copy_light @drawable/ic_action_next_message_light @drawable/ic_action_previous_message_light - @drawable/ic_action_read_light @drawable/ic_action_refresh_light @drawable/ic_action_search_light @drawable/ic_action_send_light @@ -23,8 +22,10 @@ @drawable/ic_action_single_message_options_light @drawable/ic_action_sort_light @drawable/ic_action_spam_light - @drawable/ic_action_toggle_flag_light - @drawable/ic_action_toggle_read_light + @drawable/ic_action_flag_light + @drawable/ic_action_unflag_light + @drawable/ic_action_mark_as_read_light + @drawable/ic_action_mark_as_unread_light @drawable/ic_menu_add @drawable/ic_menu_attachment @drawable/ic_menu_clear @@ -55,7 +56,6 @@ @drawable/ic_action_move_or_copy_dark @drawable/ic_action_next_message_dark @drawable/ic_action_previous_message_dark - @drawable/ic_action_read_dark @drawable/ic_action_refresh_dark @drawable/ic_action_search_dark @drawable/ic_action_send_dark @@ -63,8 +63,10 @@ @drawable/ic_action_single_message_options_dark @drawable/ic_action_sort_dark @drawable/ic_action_spam_dark - @drawable/ic_action_toggle_flag_dark - @drawable/ic_action_toggle_read_dark + @drawable/ic_action_flag_light + @drawable/ic_action_unflag_light + @drawable/ic_action_mark_as_read_light + @drawable/ic_action_mark_as_unread_light @drawable/ic_menu_add @drawable/ic_menu_attachment @drawable/ic_menu_clear @@ -81,4 +83,4 @@ @drawable/ic_show_folders - \ No newline at end of file + diff --git a/src/com/fsck/k9/activity/MessageList.java b/src/com/fsck/k9/activity/MessageList.java index 10dae5347..e078a23c4 100644 --- a/src/com/fsck/k9/activity/MessageList.java +++ b/src/com/fsck/k9/activity/MessageList.java @@ -26,10 +26,8 @@ import android.text.style.ForegroundColorSpan; import android.text.style.StyleSpan; import android.util.Log; import android.util.TypedValue; -import android.view.GestureDetector; import android.view.KeyEvent; import android.view.LayoutInflater; -import android.view.MotionEvent; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; @@ -1402,6 +1400,8 @@ public class MessageList extends K9ListActivity implements OnItemClickListener { messageInfo.flagged = !messageInfo.flagged; mAdapter.sortMessages(); } + + computeBatchDirection(); } private void checkMail(Account account, String folderName) { @@ -2368,6 +2368,7 @@ public class MessageList extends K9ListActivity implements OnItemClickListener { mSelectedCount += (isSelected ? 1 : 0); } + computeBatchDirection(); mAdapter.notifyDataSetChanged(); if (isSelected) { @@ -2395,6 +2396,7 @@ public class MessageList extends K9ListActivity implements OnItemClickListener { mActionMode = MessageList.this.startActionMode(mActionModeCallback); updateActionModeTitle(); computeSelectAllVisibility(); + computeBatchDirection(); } else { mSelectedCount = 0; mActionMode.finish(); @@ -2408,8 +2410,8 @@ public class MessageList extends K9ListActivity implements OnItemClickListener { return; } } else { - mActionMode = MessageList.this.startActionMode(mActionModeCallback); - } + mActionMode = startActionMode(mActionModeCallback); + } if (holder.selected) { holder.selected = false; @@ -2419,6 +2421,8 @@ public class MessageList extends K9ListActivity implements OnItemClickListener { mSelectedCount += 1; } mAdapter.notifyDataSetChanged(); + + computeBatchDirection(); updateActionModeTitle(); // make sure the onPrepareActionMode is called @@ -2435,6 +2439,29 @@ public class MessageList extends K9ListActivity implements OnItemClickListener { mActionModeCallback.showSelectAll(mSelectedCount != mAdapter.getCount()); } + private void computeBatchDirection() { + boolean isBatchFlag = false; + boolean isBatchRead = false; + + for (MessageInfoHolder holder : mAdapter.getMessages()) { + if (holder.selected) { + if (!holder.flagged) { + isBatchFlag = true; + } + if (!holder.read) { + isBatchRead = true; + } + + if (isBatchFlag && isBatchRead) { + break; + } + } + } + + mActionModeCallback.showMarkAsRead(isBatchRead); + mActionModeCallback.showFlag(isBatchFlag); + } + /** * @param holders * Messages to update. Never {@code null}. @@ -2744,10 +2771,18 @@ public class MessageList extends K9ListActivity implements OnItemClickListener { class ActionModeCallback implements ActionMode.Callback { private MenuItem mSelectAll; + private MenuItem mMarkAsRead; + private MenuItem mMarkAsUnread; + private MenuItem mFlag; + private MenuItem mUnflag; @Override public boolean onPrepareActionMode(ActionMode mode, Menu menu) { mSelectAll = menu.findItem(R.id.select_all); + mMarkAsRead = menu.findItem(R.id.mark_as_read); + mMarkAsUnread = menu.findItem(R.id.mark_as_unread); + mFlag = menu.findItem(R.id.flag); + mUnflag = menu.findItem(R.id.unflag); if (mQueryString != null) { // show all @@ -2777,6 +2812,10 @@ public class MessageList extends K9ListActivity implements OnItemClickListener { public void onDestroyActionMode(ActionMode mode) { mActionMode = null; mSelectAll = null; + mMarkAsRead = null; + mMarkAsUnread = null; + mFlag = null; + mUnflag = null; setAllSelected(false); } @@ -2842,6 +2881,20 @@ public class MessageList extends K9ListActivity implements OnItemClickListener { } } + public void showMarkAsRead(boolean show) { + if (mActionMode != null) { + mMarkAsRead.setVisible(show); + mMarkAsUnread.setVisible(!show); + } + } + + public void showFlag(boolean show) { + if (mActionMode != null) { + mFlag.setVisible(show); + mUnflag.setVisible(!show); + } + } + @Override public boolean onActionItemClicked(ActionMode mode, MenuItem item) { final List selection = getSelectionFromCheckboxes(); @@ -2859,12 +2912,24 @@ public class MessageList extends K9ListActivity implements OnItemClickListener { mSelectedCount = 0; break; } - case R.id.read_toggle: { - onToggleRead(selection); + case R.id.mark_as_read: { + setFlag(selection, Flag.SEEN, true); + computeBatchDirection(); break; } - case R.id.flag_toggle: { - onToggleFlag(selection); + case R.id.mark_as_unread: { + setFlag(selection, Flag.SEEN, false); + computeBatchDirection(); + break; + } + case R.id.flag: { + setFlag(selection, Flag.FLAGGED, true); + computeBatchDirection(); + break; + } + case R.id.unflag: { + setFlag(selection, Flag.FLAGGED, false); + computeBatchDirection(); break; } case R.id.select_all: { @@ -2900,6 +2965,6 @@ public class MessageList extends K9ListActivity implements OnItemClickListener { return true; } - }; + } }