From af1b9f83f2945cb85f2c6e4d464d3839a0b26eb7 Mon Sep 17 00:00:00 2001 From: Mark Baker Date: Sat, 24 Dec 2011 18:17:12 +0000 Subject: [PATCH 01/54] Added batch buttons for Archive and Move. Made batch buttons configurable. --- res/drawable/ic_button_archive.png | Bin 0 -> 4113 bytes res/layout/message_list_batch_buttons.xml | 14 ++++ res/values/strings.xml | 9 +++ res/xml/global_preferences.xml | 45 ++++++++++++ src/com/fsck/k9/K9.java | 64 +++++++++++++++++- src/com/fsck/k9/activity/MessageList.java | 30 +++++++- src/com/fsck/k9/activity/setup/Prefs.java | 32 ++++++++- .../fsck/k9/preferences/GlobalSettings.java | 18 +++++ 8 files changed, 207 insertions(+), 5 deletions(-) create mode 100644 res/drawable/ic_button_archive.png diff --git a/res/drawable/ic_button_archive.png b/res/drawable/ic_button_archive.png new file mode 100644 index 0000000000000000000000000000000000000000..f7fbd5f6dbf254b5ac4425a523f55ff73ef7e65b GIT binary patch literal 4113 zcmV+s5bp1ZP)EX>4Tx0C?J+Q+HUC_ZB|i_hk=OLfG)Jmu!ImA|tE_$Pihg5Rw34gb)%y#f69p zRumNxoJdu~g4GI0orvO~D7a@qiilc^Ra`jkAKa(4eR}Wh?fcjJyyu+f{LXpL4}cL8 zCXwc%Y5+M>g*-agACFH+#L2yY0u@N$1RxOR%fe>`#Q*^C19^CUbg)1C0k3ZW0swH; zE+i7i;s1lWP$pLZAdvvzA`<5d0gzGv$SzdK6adH=0I*ZDWC{S3003-xd_p1ssto|_ z^hrJi0NAOM+!p}Yq8zCR0F40vnJ7mj0zkU}U{!%qECRs70HCZuA}$2Lt^t5qwlYTo zfV~9(c8*w(4?ti5fSE!p%m5%b0suoE6U_r4Oaq`W(!b!TUvP!ENC5!A%azTSOVTqG zxRuZvck=My;vwR~Y_URN7by^C3FIQ2mzyIKNaq7g&I|wm8u`(|{y0C7=jP<$=4R(? z@ASo@{%i1WB0eGU-~POe0t5gMPS5Y!U*+Z218~Oyuywy{sapWrRsd+<`C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bC+uVqCv|eJY#Hen&(M5n)A-P*BZ$1MQA-;d)s z=DmCOK3Z8>Y23Yg_Yc>uUCVn`Xsx?e+qTX4`1m}qqOM-O`ulV`{eyD3%=Ycu)8TNq zrIbP`#p~CvWA%F7bX}KxK0msC{d!8J5~Wg!&6_vRZ{4~z-_z5xCY#OfIdbF(mo8mG zYmI4|`I9G49tWOi(=;U>kE6Bb#ful;a~$WL+z$i-ghC;Phleo?gZ}=0wAN%YnJsVL zyosGYefrMYwQCn|+_>?hNF-u5n@t7>2fyre*ScC*SoqoP+qZw!Znvq`YTaT|N_7LK zl)^BKF0tb{G#U+Fy?TY;?{A(sapKO{*x1)kpFW+g*Xx1N(b2hGyLNpFEGiNC{-Z~a zPGvHgkIUsU)oPXZt?)>^J+E3#(?lsnB9Zvx(W6Iy(U}W%;At#uYPCu(mm4h>i)gLs?d>HRjW#DHCa#Q)jr|VzqT}<1H_5uz zi--brr-%0f(atjj_<>cQ0>#cO{-uwj03a`GbZ7hutI%WB|sH1`7O-45(dpuEa-fi=-+ zlvFD9o4tGYeg + + Lock-screen notifications Don\'t display message subject in notification bar when system is locked + Batch buttons + Configure message list batch buttons + Mark read/unread + Delete + Move to archive + Move + Flag + Unselect + Quiet Time Disable ringing, buzzing and flashing at night Quiet Time starts diff --git a/res/xml/global_preferences.xml b/res/xml/global_preferences.xml index 58c41afdf..02fa3c9a7 100644 --- a/res/xml/global_preferences.xml +++ b/res/xml/global_preferences.xml @@ -157,6 +157,7 @@ android:dependency="messagelist_show_contact_name" /> + + + + + + + + + + + + + + + + + + selection = getSelectionFromCheckboxes(); + onArchive(selection); + return; + } + + if (v == mBatchMoveButton) { + final List selection = getSelectionFromCheckboxes(); + onMove(selection); + return; + } + synchronized (mAdapter.messages) { for (MessageInfoHolder holder : mAdapter.messages) { if (holder.selected) { @@ -2546,6 +2568,8 @@ public class MessageList holder.flagged = newState; } else if (v == mBatchReadButton) { holder.read = newState; + } else if (v == mBatchArchiveButton) { + // TODO } messageList.add(holder.message); } diff --git a/src/com/fsck/k9/activity/setup/Prefs.java b/src/com/fsck/k9/activity/setup/Prefs.java index 7a436c65e..540df2f9c 100644 --- a/src/com/fsck/k9/activity/setup/Prefs.java +++ b/src/com/fsck/k9/activity/setup/Prefs.java @@ -74,7 +74,12 @@ public class Prefs extends K9PreferenceActivity { private static final String PREFERENCE_QUIET_TIME_ENABLED = "quiet_time_enabled"; private static final String PREFERENCE_QUIET_TIME_STARTS = "quiet_time_starts"; private static final String PREFERENCE_QUIET_TIME_ENDS = "quiet_time_ends"; - + private static final String PREFERENCE_BATCH_BUTTONS_MARK_READ = "batch_buttons_mark_read"; + private static final String PREFERENCE_BATCH_BUTTONS_DELETE = "batch_buttons_delete"; + private static final String PREFERENCE_BATCH_BUTTONS_ARCHIVE = "batch_buttons_archive"; + private static final String PREFERENCE_BATCH_BUTTONS_MOVE = "batch_buttons_move"; + private static final String PREFERENCE_BATCH_BUTTONS_FLAG = "batch_buttons_flag"; + private static final String PREFERENCE_BATCH_BUTTONS_UNSELECT = "batch_buttons_unselect"; private static final String PREFERENCE_MESSAGEVIEW_MOBILE_LAYOUT = "messageview_mobile_layout"; private static final String PREFERENCE_BACKGROUND_OPS = "background_ops"; @@ -121,6 +126,12 @@ public class Prefs extends K9PreferenceActivity { private com.fsck.k9.preferences.TimePickerPreference mQuietTimeEnds; private Preference mAttachmentPathPreference; + private CheckBoxPreference mBatchButtonsMarkRead; + private CheckBoxPreference mBatchButtonsDelete; + private CheckBoxPreference mBatchButtonsArchive; + private CheckBoxPreference mBatchButtonsMove; + private CheckBoxPreference mBatchButtonsFlag; + private CheckBoxPreference mBatchButtonsUnselect; public static void actionPrefs(Context context) { Intent i = new Intent(context, Prefs.class); @@ -342,6 +353,19 @@ public class Prefs extends K9PreferenceActivity { } }; }); + + mBatchButtonsMarkRead = (CheckBoxPreference)findPreference(PREFERENCE_BATCH_BUTTONS_MARK_READ); + mBatchButtonsDelete = (CheckBoxPreference)findPreference(PREFERENCE_BATCH_BUTTONS_DELETE); + mBatchButtonsArchive = (CheckBoxPreference)findPreference(PREFERENCE_BATCH_BUTTONS_ARCHIVE); + mBatchButtonsMove = (CheckBoxPreference)findPreference(PREFERENCE_BATCH_BUTTONS_MOVE); + mBatchButtonsFlag = (CheckBoxPreference)findPreference(PREFERENCE_BATCH_BUTTONS_FLAG); + mBatchButtonsUnselect = (CheckBoxPreference)findPreference(PREFERENCE_BATCH_BUTTONS_UNSELECT); + mBatchButtonsMarkRead.setChecked(K9.batchButtonsMarkRead()); + mBatchButtonsDelete.setChecked(K9.batchButtonsDelete()); + mBatchButtonsArchive.setChecked(K9.batchButtonsArchive()); + mBatchButtonsMove.setChecked(K9.batchButtonsMove()); + mBatchButtonsFlag.setChecked(K9.batchButtonsFlag()); + mBatchButtonsUnselect.setChecked(K9.batchButtonsUnselect()); } private void saveSettings() { @@ -380,6 +404,12 @@ public class Prefs extends K9PreferenceActivity { K9.setQuietTimeStarts(mQuietTimeStarts.getTime()); K9.setQuietTimeEnds(mQuietTimeEnds.getTime()); + K9.setBatchButtonsMarkRead(mBatchButtonsMarkRead.isChecked()); + K9.setBatchButtonsDelete(mBatchButtonsDelete.isChecked()); + K9.setBatchButtonsArchive(mBatchButtonsArchive.isChecked()); + K9.setBatchButtonsMove(mBatchButtonsMove.isChecked()); + K9.setBatchButtonsFlag(mBatchButtonsFlag.isChecked()); + K9.setBatchButtonsUnselect(mBatchButtonsUnselect.isChecked()); K9.setZoomControlsEnabled(mZoomControlsEnabled.isChecked()); K9.setAttachmentDefaultPath(mAttachmentPathPreference.getSummary().toString()); diff --git a/src/com/fsck/k9/preferences/GlobalSettings.java b/src/com/fsck/k9/preferences/GlobalSettings.java index 5dcae70bb..d09e93417 100644 --- a/src/com/fsck/k9/preferences/GlobalSettings.java +++ b/src/com/fsck/k9/preferences/GlobalSettings.java @@ -191,6 +191,24 @@ public class GlobalSettings { s.put("zoomControlsEnabled", Settings.versions( new V(1, new BooleanSetting(false)) )); + s.put("batchButtonsMarkRead", Settings.versions( + new V(1, new BooleanSetting(true)) + )); + s.put("batchButtonsDelete", Settings.versions( + new V(1, new BooleanSetting(true)) + )); + s.put("batchButtonsArchive", Settings.versions( + new V(1, new BooleanSetting(false)) + )); + s.put("batchButtonsMove", Settings.versions( + new V(1, new BooleanSetting(false)) + )); + s.put("batchButtonsFlag", Settings.versions( + new V(1, new BooleanSetting(true)) + )); + s.put("batchButtonsUnselect", Settings.versions( + new V(1, new BooleanSetting(true)) + )); SETTINGS = Collections.unmodifiableMap(s); From a8c6ec45d2221ac18da004db85c2976d13bb29fc Mon Sep 17 00:00:00 2001 From: Mark Baker Date: Mon, 26 Dec 2011 19:15:35 +0000 Subject: [PATCH 02/54] Replaced archive icon. Still a bit crap, but better than my previous attempt. --- res/drawable/ic_button_archive.png | Bin 4113 -> 4166 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/res/drawable/ic_button_archive.png b/res/drawable/ic_button_archive.png index f7fbd5f6dbf254b5ac4425a523f55ff73ef7e65b..4a410a3c4d60c278f971f869cda0853dfbc94adc 100644 GIT binary patch delta 1463 zcmV;o1xWglAjTlDq6&W+5j7~p8Na;%00o3eL_t(Y$DNi(&+ORo*p5Gl zW4v-g6e_m_}c~mZbR`BFb^zADc>uK;sR))P$&?MM)CXo8v=wvA*QCLK70K5@n=#>q?8+a z8IQ-OPnbPD=SNm3w5{Hl}Gh zKnGv~Yd}f!E^C@bBog_{;Nak`#l=PI&6_u258ywMloEecRaswOZyO&U|FLb`Yn4i6 z<>=9)x0?XAZL@jv=05}OrAwE7Rn&rpx0l%&(?7R_~CDTJU_tFe9i_PGZS9(1{`i_hmnRaL^_Fot1N zg%C!mRKkC8oDUS=y?YmcLx&Ebs%jHVQ4~5lI_6c^b!(<+HmhcKb~dT1DjoxjjEwv~ zoleiSwzguLX7g-*ex6(|M=qCRVPS#qSEJwWulDrxLVCbLWG>ps*}!B9TZKkw^r?Fi=&MckkW-u(Y(4JbU)+ z&rg4yI(4JJzyHR*efy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R<%a(Z~5D2^-7#L{m-o5)i;4CdIt@APqpja#t z3W?x?)rfFgr1}iHo02B&^_}Q~(kL};T|IfKx?(;*34t?YS&&|zsV)A-P*BZ$1MQA-;d)s=DmCO zK3Z8>Y23Yg_Yc>uUCVn`Xsx?e+qTX4`1m}qqOM-O`ulV`{eyD3%=Ycu)8TNqrIbP` z#p~CvWA%F7bX}KxK0msC{d!8J5~Wg!&6|HW&u`tjHQ&?IvnHF(?m2Sg2$wEhLTim_ zn)#C_PaX%JXwx($9*?87=EaK_-*X)2o!k!u0)#>#hKGkS41@muezewPGMO!J-n@yO zK7IPm+O=yJZ``=?qevuTHk(Zb2M53Gbl19CSXlVk?c2A1)o!<`)oR^hQc86Lrj&oe zFpMs-<2W=L4PL!^h2QUQo;Y#h&e+)4*H525ovzpGfzi>?xm~+QRqzI^%e<4h*= zlWMgZsnu$uwj03a`GbZ7hutI%WB|sH1`7O-45(dpuEa-fi=-+ zlvFD9o4tGYeg Date: Thu, 29 Dec 2011 09:56:54 +0000 Subject: [PATCH 03/54] Remove TODO --- src/com/fsck/k9/activity/MessageList.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/com/fsck/k9/activity/MessageList.java b/src/com/fsck/k9/activity/MessageList.java index 73e81cacc..d7bbc4dd3 100644 --- a/src/com/fsck/k9/activity/MessageList.java +++ b/src/com/fsck/k9/activity/MessageList.java @@ -2568,8 +2568,6 @@ public class MessageList holder.flagged = newState; } else if (v == mBatchReadButton) { holder.read = newState; - } else if (v == mBatchArchiveButton) { - // TODO } messageList.add(holder.message); } From 0e86fb2a800a059b2fbe590ccd4e9e26748211ee Mon Sep 17 00:00:00 2001 From: Mark Baker Date: Wed, 4 Jan 2012 19:58:19 +0000 Subject: [PATCH 04/54] Fixed whitespace --- res/values/strings.xml | 16 ++++++++-------- src/com/fsck/k9/activity/setup/Prefs.java | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 354f913fd..fa2d47dd5 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -352,14 +352,14 @@ Welcome to K-9 Mail setup. K-9 is an open source mail client for Android origin Lock-screen notifications Don\'t display message subject in notification bar when system is locked - Batch buttons - Configure message list batch buttons - Mark read/unread - Delete - Move to archive - Move - Flag - Unselect + Batch buttons + Configure message list batch buttons + Mark read/unread + Delete + Move to archive + Move + Flag + Unselect Quiet Time Disable ringing, buzzing and flashing at night diff --git a/src/com/fsck/k9/activity/setup/Prefs.java b/src/com/fsck/k9/activity/setup/Prefs.java index 540df2f9c..5294d1838 100644 --- a/src/com/fsck/k9/activity/setup/Prefs.java +++ b/src/com/fsck/k9/activity/setup/Prefs.java @@ -76,10 +76,10 @@ public class Prefs extends K9PreferenceActivity { private static final String PREFERENCE_QUIET_TIME_ENDS = "quiet_time_ends"; private static final String PREFERENCE_BATCH_BUTTONS_MARK_READ = "batch_buttons_mark_read"; private static final String PREFERENCE_BATCH_BUTTONS_DELETE = "batch_buttons_delete"; - private static final String PREFERENCE_BATCH_BUTTONS_ARCHIVE = "batch_buttons_archive"; - private static final String PREFERENCE_BATCH_BUTTONS_MOVE = "batch_buttons_move"; - private static final String PREFERENCE_BATCH_BUTTONS_FLAG = "batch_buttons_flag"; - private static final String PREFERENCE_BATCH_BUTTONS_UNSELECT = "batch_buttons_unselect"; + private static final String PREFERENCE_BATCH_BUTTONS_ARCHIVE = "batch_buttons_archive"; + private static final String PREFERENCE_BATCH_BUTTONS_MOVE = "batch_buttons_move"; + private static final String PREFERENCE_BATCH_BUTTONS_FLAG = "batch_buttons_flag"; + private static final String PREFERENCE_BATCH_BUTTONS_UNSELECT = "batch_buttons_unselect"; private static final String PREFERENCE_MESSAGEVIEW_MOBILE_LAYOUT = "messageview_mobile_layout"; private static final String PREFERENCE_BACKGROUND_OPS = "background_ops"; From 2261edcfb4e8fb93d848e7cfbabdb70d66f62231 Mon Sep 17 00:00:00 2001 From: Mark Baker Date: Fri, 6 Jan 2012 22:29:33 +0000 Subject: [PATCH 05/54] High DPI version of archive button icon --- res/drawable-hdpi/ic_button_archive.png | Bin 0 -> 4768 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 res/drawable-hdpi/ic_button_archive.png diff --git a/res/drawable-hdpi/ic_button_archive.png b/res/drawable-hdpi/ic_button_archive.png new file mode 100644 index 0000000000000000000000000000000000000000..3850e2d29fb1bb1404487370f8e8392dee391b4a GIT binary patch literal 4768 zcmV;R5?}3!P)EX>4Tx0C?J+Q+HUC_ZB|i_hk=OLfG)Jmu!ImA|tE_$Pihg5Rw34gb)%y#f69p zRumNxoJdu~g4GI0orvO~D7a@qiilc^Ra`jkAKa(4eR}Wh?fcjJyyu+f{LXpL4}cL8 zCXwc%Y5+M>g*-agACFH+#L2yY0u@N$1RxOR%fe>`#Q*^C19^CUbg)1C0k3ZW0swH; zE+i7i;s1lWP$pLZAdvvzA`<5d0gzGv$SzdK6adH=0I*ZDWC{S3003-xd_p1ssto|_ z^hrJi0NAOM+!p}Yq8zCR0F40vnJ7mj0zkU}U{!%qECRs70HCZuA}$2Lt^t5qwlYTo zfV~9(c8*w(4?ti5fSE!p%m5%b0suoE6U_r4Oaq`W(!b!TUvP!ENC5!A%azTSOVTqG zxRuZvck=My;vwR~Y_URN7by^C3FIQ2mzyIKNaq7g&I|wm8u`(|{y0C7=jP<$=4R(? z@ASo@{%i1WB0eGU-~POe0t5gMPS5Y!U*+Z218~Oyuywy{sapWrRsd+<`CT*H37}dE z(0cicc{uz)9-g64$UGe!3JVMEC1RnyFyo6p|1;rl;ER6t{6HT5+j{T-ahgDxt-zy$ z{c&M#cCJ#6=gR~_F>d$gBmT#QfBlXr(c(0*Tr3re@mPttP$EsodAU-NL?OwQ;u7h9 zGVvdl{RxwI4FIf$Pry#L2er#=z<%xl0*ek<(slqqe)BDi8VivC5N9+pdG`PSlfU_o zKq~;2Moa!tiTSO!5zH77Xo1hL_iEAz&sE_ z2IPPo3ZWR5K^auQI@koYumc*P5t`u;w81er4d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z0X=&TK?{GxuSNveaF<)lr5P|<}*f3O%3bT zt>gav`>bET9!=BGG%W2F5TVT z1cO2L@86H6X+1zv*|%@skHX<_i>j&&4i0*%s;a(hZf@?Ys;U|Y1OfviBO}t-*q9oR z#~B|V_xAVqFMs*+r7su^uBoV~z~yq0N~P4UuC9hiBqHtFwd?7!Wy_w$VzIJxI$f5@ zWH1Z^tJTVyHEUSEem#KR-roLu;Du_nTGi6hQgXQ*BO@d33l}c@u-JeU>v^6FvMl3r zxlj~^d?qF)CivouFE$Sk4_6#Ne!Qc#we>H-V6Y_=3T=+Z<0O+wG)+U6WlBp+M}bLT zMs+%!6E>R-Ns?H;d^yEVXTAjI=kpFKFDkMuil4MIH5=fGSrfDxsn>M3dy?WKr)6=tCk|bv)lPPSNHzLJDQIvu-7b|35 z;Z#+{ZnqPSMxC9VoejFKPjB0{?SZCg-Ltc^-|=`nPN&m3yJ5qI-}rpKC%~j6glOvR z?fpS882ouG7PBQ1i3L`xSc;41isy^9!fa|}vsrfR*l}V1{{5ere!vP$14BRrNUFd{ zeSQ5W7K_F5@ZrOs+H5vkEEaoZqbb&g1@1#paJgK#TrO6vT6KHp&Ygb-UYb5o2C~H# zT@pfAO^aO6J;m$w>Kiw1{HUR!;bWlJtoN)W zNed85LI}z9hNVCyP#uXxHVh69ZXX*PYcveQlTN4IdHv30GQ?srlF1~AL}JdJ!Q=6u zY1(K@OUvb@OPAgS!oUQOF1`!Q0Z^1u#jKGF@Bw9JW}N1{1+a$0;jNiW#&PG)okLSo zQw4M3^?IqTt?k~lY13to$MX>Q4-f~8ulw=^w%oij&6tigW_CTBd9Y#*wYIjl57;y{ zHFZb`f!poIr@Kp?Vx`}W@k0)a)<`;7n; u#VjzqWXY1h?cTlnN<~FQ-(u_ib@5+S%hbYR+20QU0000 Date: Sun, 26 Feb 2012 14:56:46 +0530 Subject: [PATCH 06/54] Create default sort setting by preference --- res/values/arrays.xml | 18 +++++++++ res/values/strings.xml | 4 ++ res/xml/account_settings_preferences.xml | 15 ++++++++ src/com/fsck/k9/Account.java | 37 +++++++++++++++++++ src/com/fsck/k9/activity/MessageList.java | 6 ++- .../k9/activity/setup/AccountSettings.java | 24 ++++++++++++ .../k9/controller/MessagingController.java | 2 +- .../fsck/k9/preferences/AccountSettings.java | 7 ++++ 8 files changed, 110 insertions(+), 3 deletions(-) diff --git a/res/values/arrays.xml b/res/values/arrays.xml index 8608cb367..cc96d658c 100644 --- a/res/values/arrays.xml +++ b/res/values/arrays.xml @@ -149,6 +149,24 @@ NOT_SECOND_CLASS + + @string/sort_by_date + @string/sort_by_subject + @string/sort_by_sender + @string/sort_by_unread + @string/sort_by_flag + @string/sort_by_attach + + + + SORT_DATE + SORT_SUBJECT + SORT_SENDER + SORT_UNREAD + SORT_FLAGGED + SORT_ATTACHMENT + + @string/account_settings_show_pictures_never @string/account_settings_show_pictures_only_from_contacts diff --git a/res/values/strings.xml b/res/values/strings.xml index 51ea0c50f..a1e668f7d 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -553,6 +553,10 @@ Welcome to K-9 Mail setup. K-9 is an open source mail client for Android origin Enable refile buttons Show the Archive, Move, and Spam buttons. + Default Sort Type + Sort order + Sort in ascending order + Always show images No From contacts diff --git a/res/xml/account_settings_preferences.xml b/res/xml/account_settings_preferences.xml index 9fa5a11a6..0356280ed 100644 --- a/res/xml/account_settings_preferences.xml +++ b/res/xml/account_settings_preferences.xml @@ -56,6 +56,21 @@ android:title="@string/account_settings_color_label" android:summary="@string/account_settings_color_summary" /> + + + + @@ -121,6 +125,8 @@ public class Account implements BaseAccount { private boolean mSaveAllHeaders; private boolean mPushPollOnConnect; private boolean mNotifySync; + private SORT_TYPE mSortType; + private boolean mSortAscending; private ShowPictures mShowPictures; private boolean mEnableMoveButtons; private boolean mIsSignatureBeforeQuotedText; @@ -210,6 +216,8 @@ public class Account implements BaseAccount { mFolderSyncMode = FolderMode.FIRST_CLASS; mFolderPushMode = FolderMode.FIRST_CLASS; mFolderTargetMode = FolderMode.NOT_SECOND_CLASS; + mSortType = DEFAULT_SORT_TYPE; + mSortAscending = DEFAULT_SORT_ASCENDING; mShowPictures = ShowPictures.NEVER; mEnableMoveButtons = false; mIsSignatureBeforeQuotedText = false; @@ -331,6 +339,15 @@ public class Account implements BaseAccount { (random.nextInt(0x70) * 0xffff) + 0xff000000); + try { + mSortType = SORT_TYPE.valueOf(prefs.getString(mUuid + ".sortTypeEnum", + SORT_TYPE.SORT_DATE.name())); + } catch (Exception e) { + mSortType = SORT_TYPE.SORT_DATE; + } + + mSortAscending = prefs.getBoolean(mUuid + ".sortAscending", false); + try { mShowPictures = ShowPictures.valueOf(prefs.getString(mUuid + ".showPicturesEnum", ShowPictures.NEVER.name())); @@ -463,6 +480,8 @@ public class Account implements BaseAccount { editor.remove(mUuid + ".messageFormatAuto"); editor.remove(mUuid + ".quoteStyle"); editor.remove(mUuid + ".quotePrefix"); + editor.remove(mUuid + ".sortTypeEnum"); + editor.remove(mUuid + ".sortAscending"); editor.remove(mUuid + ".showPicturesEnum"); editor.remove(mUuid + ".replyAfterQuote"); editor.remove(mUuid + ".stripSignature"); @@ -595,6 +614,8 @@ public class Account implements BaseAccount { editor.putString(mUuid + ".spamFolderName", mSpamFolderName); editor.putString(mUuid + ".autoExpandFolderName", mAutoExpandFolderName); editor.putInt(mUuid + ".accountNumber", mAccountNumber); + editor.putString(mUuid + ".sortTypeEnum", mSortType.name()); + editor.putBoolean(mUuid + ".sortAscending", mSortAscending); editor.putString(mUuid + ".showPicturesEnum", mShowPictures.name()); editor.putBoolean(mUuid + ".enableMoveButtons", mEnableMoveButtons); editor.putString(mUuid + ".folderDisplayMode", mFolderDisplayMode.name()); @@ -1000,6 +1021,22 @@ public class Account implements BaseAccount { this.mNotifySync = showOngoing; } + public synchronized SORT_TYPE getSortType() { + return mSortType; + } + + public synchronized void setSortType(SORT_TYPE sortType) { + mSortType = sortType; + } + + public synchronized boolean isSortAscending() { + return mSortAscending; + } + + public synchronized void setSortAscending(boolean sortAscending) { + mSortAscending = sortAscending; + } + public synchronized ShowPictures getShowPictures() { return mShowPictures; } diff --git a/src/com/fsck/k9/activity/MessageList.java b/src/com/fsck/k9/activity/MessageList.java index f874267f9..d2238a27e 100644 --- a/src/com/fsck/k9/activity/MessageList.java +++ b/src/com/fsck/k9/activity/MessageList.java @@ -809,8 +809,10 @@ public class MessageList mStars = K9.messageListStars(); mCheckboxes = K9.messageListCheckboxes(); - sortType = mController.getSortType(); - sortAscending = mController.isSortAscending(sortType); + sortType = mAccount.getSortType(); + mController.setSortType(sortType); + sortAscending = mAccount.isSortAscending(); + mController.setSortAscending(sortType, sortAscending); sortDateAscending = mController.isSortAscending(SORT_TYPE.SORT_DATE); mController.addListener(mAdapter.mListener); diff --git a/src/com/fsck/k9/activity/setup/AccountSettings.java b/src/com/fsck/k9/activity/setup/AccountSettings.java index 9ac8f7058..140fb0f9c 100644 --- a/src/com/fsck/k9/activity/setup/AccountSettings.java +++ b/src/com/fsck/k9/activity/setup/AccountSettings.java @@ -28,6 +28,7 @@ import com.fsck.k9.activity.ChooseIdentity; import com.fsck.k9.activity.ColorPickerDialog; import com.fsck.k9.activity.K9PreferenceActivity; import com.fsck.k9.activity.ManageIdentities; +import com.fsck.k9.controller.MessagingController.SORT_TYPE; import com.fsck.k9.crypto.Apg; import com.fsck.k9.mail.Store; import com.fsck.k9.service.MailService; @@ -53,6 +54,8 @@ public class AccountSettings extends K9PreferenceActivity { private static final String PREFERENCE_FREQUENCY = "account_check_frequency"; private static final String PREFERENCE_DISPLAY_COUNT = "account_display_count"; private static final String PREFERENCE_DEFAULT = "account_default"; + private static final String PREFERENCE_SORT_TYPE = "sort_type_enum"; + private static final String PREFERENCE_SORT_ASCENDING = "sort_ascending"; private static final String PREFERENCE_SHOW_PICTURES = "show_pictures_enum"; private static final String PREFERENCE_ENABLE_MOVE_BUTTONS = "enable_move_buttons"; private static final String PREFERENCE_NOTIFY = "account_notify"; @@ -121,6 +124,8 @@ public class AccountSettings extends K9PreferenceActivity { private CheckBoxPreference mAccountDefault; private CheckBoxPreference mAccountNotify; private CheckBoxPreference mAccountNotifySelf; + private ListPreference mAccountSortType; + private CheckBoxPreference mAccountSortAscending; private ListPreference mAccountShowPictures; private CheckBoxPreference mAccountEnableMoveButtons; private CheckBoxPreference mAccountNotifySync; @@ -427,6 +432,22 @@ public class AccountSettings extends K9PreferenceActivity { mAccountEnableMoveButtons.setEnabled(mIsMoveCapable); mAccountEnableMoveButtons.setChecked(mAccount.getEnableMoveButtons()); + mAccountSortType = (ListPreference) findPreference(PREFERENCE_SORT_TYPE); + mAccountSortType.setValue("" + mAccount.getSortType()); + mAccountSortType.setSummary(mAccountSortType.getEntry()); + mAccountSortType.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { + public boolean onPreferenceChange(Preference preference, Object newValue) { + final String summary = newValue.toString(); + int index = mAccountSortType.findIndexOfValue(summary); + mAccountSortType.setSummary(mAccountSortType.getEntries()[index]); + mAccountSortType.setValue(summary); + return false; + } + }); + + mAccountSortAscending = (CheckBoxPreference) findPreference(PREFERENCE_SORT_ASCENDING); + mAccountSortAscending.setChecked(mAccount.isSortAscending()); + mAccountShowPictures = (ListPreference) findPreference(PREFERENCE_SHOW_PICTURES); mAccountShowPictures.setValue("" + mAccount.getShowPictures()); mAccountShowPictures.setSummary(mAccountShowPictures.getEntry()); @@ -750,6 +771,9 @@ public class AccountSettings extends K9PreferenceActivity { } } + mAccount.setSortType(SORT_TYPE.valueOf(mAccountSortType.getValue())); + mAccount.setSortAscending(mAccountSortAscending.isChecked()); + mAccount.setShowPictures(Account.ShowPictures.valueOf(mAccountShowPictures.getValue())); if (mIsPushCapable) { diff --git a/src/com/fsck/k9/controller/MessagingController.java b/src/com/fsck/k9/controller/MessagingController.java index 1b2b47a6b..c23a02162 100644 --- a/src/com/fsck/k9/controller/MessagingController.java +++ b/src/com/fsck/k9/controller/MessagingController.java @@ -173,7 +173,7 @@ public class MessagingController implements Runnable { } } - private SORT_TYPE sortType = SORT_TYPE.SORT_DATE; + private SORT_TYPE sortType = Account.DEFAULT_SORT_TYPE; private MessagingListener checkMailListener = null; diff --git a/src/com/fsck/k9/preferences/AccountSettings.java b/src/com/fsck/k9/preferences/AccountSettings.java index fdc311820..67c55c0cf 100644 --- a/src/com/fsck/k9/preferences/AccountSettings.java +++ b/src/com/fsck/k9/preferences/AccountSettings.java @@ -12,6 +12,7 @@ import com.fsck.k9.Account; import com.fsck.k9.K9; import com.fsck.k9.R; import com.fsck.k9.Account.FolderMode; +import com.fsck.k9.controller.MessagingController.SORT_TYPE; import com.fsck.k9.crypto.Apg; import com.fsck.k9.mail.store.StorageManager; import com.fsck.k9.preferences.Settings.*; @@ -156,6 +157,12 @@ public class AccountSettings { s.put("sentFolderName", Settings.versions( new V(1, new StringSetting("Sent")) )); + s.put("sortTypeEnum", Settings.versions( + new V(1, new EnumSetting(SORT_TYPE.class, Account.DEFAULT_SORT_TYPE)) + )); + s.put("sortAscending", Settings.versions( + new V(1, new BooleanSetting(Account.DEFAULT_SORT_ASCENDING)) + )); s.put("showPicturesEnum", Settings.versions( new V(1, new EnumSetting(Account.ShowPictures.class, Account.ShowPictures.NEVER)) )); From 3ebd3c1fc2f82c924c175d47763e505233ad3f86 Mon Sep 17 00:00:00 2001 From: Srinath Warrier Date: Mon, 12 Mar 2012 22:04:10 +0530 Subject: [PATCH 07/54] Create implicit sort remembering setting --- res/values/arrays.xml | 18 -------------- res/values/strings.xml | 4 ---- res/xml/account_settings_preferences.xml | 15 ------------ src/com/fsck/k9/activity/MessageList.java | 9 ++++++- .../k9/activity/setup/AccountSettings.java | 24 ------------------- 5 files changed, 8 insertions(+), 62 deletions(-) diff --git a/res/values/arrays.xml b/res/values/arrays.xml index cc96d658c..8608cb367 100644 --- a/res/values/arrays.xml +++ b/res/values/arrays.xml @@ -149,24 +149,6 @@ NOT_SECOND_CLASS - - @string/sort_by_date - @string/sort_by_subject - @string/sort_by_sender - @string/sort_by_unread - @string/sort_by_flag - @string/sort_by_attach - - - - SORT_DATE - SORT_SUBJECT - SORT_SENDER - SORT_UNREAD - SORT_FLAGGED - SORT_ATTACHMENT - - @string/account_settings_show_pictures_never @string/account_settings_show_pictures_only_from_contacts diff --git a/res/values/strings.xml b/res/values/strings.xml index a1e668f7d..51ea0c50f 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -553,10 +553,6 @@ Welcome to K-9 Mail setup. K-9 is an open source mail client for Android origin Enable refile buttons Show the Archive, Move, and Spam buttons. - Default Sort Type - Sort order - Sort in ascending order - Always show images No From contacts diff --git a/res/xml/account_settings_preferences.xml b/res/xml/account_settings_preferences.xml index 0356280ed..9fa5a11a6 100644 --- a/res/xml/account_settings_preferences.xml +++ b/res/xml/account_settings_preferences.xml @@ -56,21 +56,6 @@ android:title="@string/account_settings_color_label" android:summary="@string/account_settings_color_summary" /> - - - - Date: Mon, 12 Mar 2012 22:55:31 +0530 Subject: [PATCH 08/54] Create implicit sort remembering setting2(minor indentation error) --- src/com/fsck/k9/activity/MessageList.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/com/fsck/k9/activity/MessageList.java b/src/com/fsck/k9/activity/MessageList.java index c91565e16..9eae5ab22 100644 --- a/src/com/fsck/k9/activity/MessageList.java +++ b/src/com/fsck/k9/activity/MessageList.java @@ -1195,8 +1195,7 @@ public class MessageList mAccount.setSortType(sortType); mAccount.setSortAscending(sortAscending); mAccount.save(Preferences.getPreferences(this)); - - reSort(); + reSort(); } } From eba886b85d26ec2ffd020d51b041681f6ce7ec44 Mon Sep 17 00:00:00 2001 From: Bernhard Redl Date: Wed, 4 Apr 2012 01:46:22 +0200 Subject: [PATCH 09/54] Render html code to make white on DarkTheme (fixes 4196) --- src/com/fsck/k9/view/SingleMessageView.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/com/fsck/k9/view/SingleMessageView.java b/src/com/fsck/k9/view/SingleMessageView.java index 54b65b07b..c5109db8c 100644 --- a/src/com/fsck/k9/view/SingleMessageView.java +++ b/src/com/fsck/k9/view/SingleMessageView.java @@ -526,7 +526,13 @@ public class SingleMessageView extends LinearLayout implements OnClickListener, String type; String text = pgpData.getDecryptedData(); if (text != null) { - type = "text/plain"; + /* + * also return here html instead of text/plain. with text/plain the + * webview does not render the CSS on the darktheme to make the text + * white. so the user is not able to see the mailcontent. + */ + type = "text/html"; + } else { // getTextForDisplay() always returns HTML-ified content. text = message.getTextForDisplay(); From 5041a2c8320dc362d76a6622583a833d88c62787 Mon Sep 17 00:00:00 2001 From: cketti Date: Wed, 4 Apr 2012 10:04:57 +0200 Subject: [PATCH 10/54] SingleMessageView cleanup --- assets/empty.html | 11 ---------- assets/loading.html | 17 --------------- assets/test.html | 18 ---------------- res/values/strings.xml | 4 +++- src/com/fsck/k9/activity/MessageView.java | 5 +++-- src/com/fsck/k9/view/SingleMessageView.java | 23 +++++++++++---------- 6 files changed, 18 insertions(+), 60 deletions(-) delete mode 100644 assets/empty.html delete mode 100644 assets/loading.html delete mode 100644 assets/test.html diff --git a/assets/empty.html b/assets/empty.html deleted file mode 100644 index ae837b940..000000000 --- a/assets/empty.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - -
- No text -
- - diff --git a/assets/loading.html b/assets/loading.html deleted file mode 100644 index fc8c14ac8..000000000 --- a/assets/loading.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - -
- Loading... -
-
-
-
-
- -
- - \ No newline at end of file diff --git a/assets/test.html b/assets/test.html deleted file mode 100644 index 09d6f119e..000000000 --- a/assets/test.html +++ /dev/null @@ -1,18 +0,0 @@ - - -Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Phasellus dui dui, luctus sit amet, hendrerit ac, blandit quis, diam. Duis libero velit, elementum id, mattis ut, fermentum aliquet, tortor. Maecenas tincidunt egestas pede. Integer sagittis ipsum ut lorem. Morbi egestas egestas sapien. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Duis eget erat ac sem iaculis sollicitudin. Maecenas in velit id mauris cursus tincidunt. Sed ultrices elit in sapien ullamcorper imperdiet. Nunc viverra, lacus id varius elementum, nisl turpis lacinia tellus, sit amet viverra neque odio quis nisl. Quisque facilisis, ipsum non vulputate malesuada, leo augue elementum tortor, nec eleifend tellus lectus non massa. -

-Maecenas pulvinar rutrum risus. Phasellus mattis arcu sit amet neque. Aliquam sed quam at nulla laoreet pretium. Proin elit. Integer ullamcorper dolor a pede. Nam lobortis quam ut mauris. Pellentesque non mauris ut lacus hendrerit iaculis. In volutpat nulla et turpis. Fusce mollis. Aliquam sit amet tortor fermentum orci lacinia convallis. Donec tincidunt tortor sed erat sollicitudin gravida. In hac habitasse platea dictumst. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed pulvinar arcu consectetuer dolor. Nunc luctus aliquam leo. In hac habitasse platea dictumst. Praesent et mi sit amet ligula blandit hendrerit. Nam aliquam tincidunt est. Aliquam erat volutpat. -

-Curabitur augue. Fusce pulvinar nisi vitae diam. Donec dictum. Sed suscipit convallis magna. Ut hendrerit tortor in mauris. In at diam. Maecenas commodo. Aliquam erat volutpat. Nunc odio eros, vestibulum at, sodales id, congue et, risus. Curabitur feugiat blandit lacus. Nulla gravida placerat enim. Nunc turpis. Praesent malesuada. -

-Aenean quis erat. Vivamus non ipsum. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed metus magna, porta eu, ultricies vitae, vulputate et, urna. Sed pulvinar, massa at ultricies rhoncus, nunc eros dapibus felis, quis congue risus orci rhoncus nibh. Pellentesque quam ante, laoreet vitae, iaculis a, gravida in, nibh. In hac habitasse platea dictumst. Aliquam erat volutpat. Suspendisse augue neque, posuere eu, sollicitudin quis, sagittis et, massa. Maecenas varius sem sodales ipsum. Donec congue mi nec orci. Nam pede ipsum, varius sed, condimentum ac, rhoncus non, lorem. Integer vestibulum, neque vitae ornare euismod, mauris turpis congue massa, non venenatis arcu lorem eget metus. Sed sollicitudin, enim aliquam pharetra cursus, neque augue bibendum leo, vitae ullamcorper ante felis nec massa. Maecenas vitae urna. Proin tincidunt, urna eu sodales vulputate, nisl tellus pretium ligula, ut venenatis metus nulla eu lectus. Integer urna purus, sagittis ut, posuere sed, sagittis non, mauris. Nunc eros risus, lacinia sit amet, dictum in, faucibus quis, urna. Fusce dictum mattis enim. Vivamus luctus sagittis felis. -

-Fusce pulvinar, erat a facilisis congue, lacus libero imperdiet dui, nec luctus justo neque sit amet mauris. Praesent sodales. Sed sed nisl a arcu tempus placerat. Duis sagittis risus. Aliquam tristique. Ut a mi. Integer volutpat, turpis vitae lobortis blandit, lorem sapien suscipit arcu, sit amet dignissim felis mauris vitae ipsum. Sed elit. Mauris elementum, pede nec accumsan pretium, leo metus fringilla erat, at feugiat turpis arcu pretium urna. Morbi lorem tellus, commodo sed, convallis id, suscipit sed, leo. Donec egestas ultricies tellus. Curabitur sapien orci, interdum nec, molestie at, pharetra eu, magna. Duis pharetra orci sed felis posuere malesuada. Donec nec nisi non urna ultricies porttitor. Maecenas lectus. Sed dignissim malesuada justo. Nunc rutrum consectetuer nunc. - - - more text - - more text - - \ No newline at end of file diff --git a/res/values/strings.xml b/res/values/strings.xml index 0851d3823..6cffb0097 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -300,8 +300,8 @@ Welcome to K-9 Mail setup. K-9 is an open source mail client for Android origin More… Fetching attachment. Unable to find viewer for %s. - Download complete message + Downloading… Not all headers have been downloaded or saved. Select \"Save all headers locally\" in the account\'s incoming server settings to enable this for the future. @@ -1142,6 +1142,8 @@ the import operation. Please install a file manager application from Android Mar Open Market Close + No text + Open for viewing Share link Copy link to clipboard diff --git a/src/com/fsck/k9/activity/MessageView.java b/src/com/fsck/k9/activity/MessageView.java index 91ea29690..864668b98 100644 --- a/src/com/fsck/k9/activity/MessageView.java +++ b/src/com/fsck/k9/activity/MessageView.java @@ -980,7 +980,8 @@ public class MessageView extends K9Activity implements OnClickListener { public void run() { if (!clonedMessage.isSet(Flag.X_DOWNLOADED_FULL) && !clonedMessage.isSet(Flag.X_DOWNLOADED_PARTIAL)) { - mMessageView.loadBodyFromUrl("file:///android_asset/downloading.html"); + String text = getString(R.string.message_view_downloading); + mMessageView.showStatusMessage(text); } mMessageView.setHeaders(clonedMessage, account); mMessageView.setOnFlagListener(new OnClickListener() { @@ -1033,7 +1034,7 @@ public class MessageView extends K9Activity implements OnClickListener { } if ((MessageView.this.mMessage == null) || !MessageView.this.mMessage.isSet(Flag.X_DOWNLOADED_PARTIAL)) { - mMessageView.loadBodyFromUrl("file:///android_asset/empty.html"); + mMessageView.showStatusMessage(getString(R.string.webview_empty_message)); } } }); diff --git a/src/com/fsck/k9/view/SingleMessageView.java b/src/com/fsck/k9/view/SingleMessageView.java index c5109db8c..31df37bc2 100644 --- a/src/com/fsck/k9/view/SingleMessageView.java +++ b/src/com/fsck/k9/view/SingleMessageView.java @@ -524,15 +524,13 @@ public class SingleMessageView extends LinearLayout implements OnClickListener, resetView(); String type; - String text = pgpData.getDecryptedData(); + String text = null; + if (pgpData != null) { + text = pgpData.getDecryptedData(); + } if (text != null) { - /* - * also return here html instead of text/plain. with text/plain the - * webview does not render the CSS on the darktheme to make the text - * white. so the user is not able to see the mailcontent. - */ type = "text/html"; - + text = "
" + text + "
"; } else { // getTextForDisplay() always returns HTML-ified content. text = message.getTextForDisplay(); @@ -544,7 +542,7 @@ public class SingleMessageView extends LinearLayout implements OnClickListener, loadBodyFromText(emailText, contentType); updateCryptoLayout(account.getCryptoProvider(), pgpData, message); } else { - loadBodyFromUrl("file:///android_asset/empty.html"); + showStatusMessage(getContext().getString(R.string.webview_empty_message)); } mHasAttachments = message.hasAttachments(); @@ -596,10 +594,12 @@ public class SingleMessageView extends LinearLayout implements OnClickListener, } } - public void loadBodyFromUrl(String url) { - mMessageContentView.loadUrl(url); + public void showStatusMessage(String status) { + String text = "
" + + status + + "
"; + loadBodyFromText(text, "text/html"); mCryptoView.hide(); - } private void loadBodyFromText(String emailText, String contentType) { @@ -769,6 +769,7 @@ public class SingleMessageView extends LinearLayout implements OnClickListener, mSavedState = savedState; } + @Override public void onLayoutChanged() { if (mMessageContentView != null) { mMessageContentView.invalidate(); From e88fbf43d036a769554ffe700cc477ebccda6776 Mon Sep 17 00:00:00 2001 From: cketti Date: Wed, 4 Apr 2012 09:48:45 +0200 Subject: [PATCH 11/54] Removed unused ToggleScrollView --- src/com/fsck/k9/view/ToggleScrollView.java | 143 --------------------- 1 file changed, 143 deletions(-) delete mode 100644 src/com/fsck/k9/view/ToggleScrollView.java diff --git a/src/com/fsck/k9/view/ToggleScrollView.java b/src/com/fsck/k9/view/ToggleScrollView.java deleted file mode 100644 index 714e8ce24..000000000 --- a/src/com/fsck/k9/view/ToggleScrollView.java +++ /dev/null @@ -1,143 +0,0 @@ -package com.fsck.k9.view; - -import android.content.Context; -import android.util.AttributeSet; -import android.util.Log; -import android.view.GestureDetector; -import android.view.MotionEvent; -import android.widget.ScrollView; -import com.fsck.k9.K9; -import com.fsck.k9.controller.MessagingListener; - -/** - * An extension of {@link ScrollView} that allows scrolling to be selectively disabled. - */ -public class ToggleScrollView extends ScrollView { - private GestureDetector mDetector; - private boolean mScrolling = true; - private int mCurrentYPosition; - private double mScrollPercentage; - private ScrollToLastLocationListener mListener; - - public ToggleScrollView(Context context, AttributeSet attrs) { - super(context, attrs); - mDetector = new GestureDetector(new YScrollDetector()); - } - - public void setScrolling(boolean enable) { - mScrolling = enable; - } - - @Override - public boolean onTouchEvent(MotionEvent ev) { - return (mScrolling) ? super.onTouchEvent(ev) : true; - } - - @Override - public boolean onInterceptTouchEvent(MotionEvent ev) { - if (!mScrolling) { - return false; - } - - // This doesn't quite get us to diagonal scrolling, but it's somewhat better than what we've - // currently got. This is based on - // http://stackoverflow.com/questions/2646028/android-horizontalscrollview-within-scrollview-touch-handling - boolean result = super.onInterceptTouchEvent(ev); - // Let the original ScrollView handle ACTION_DOWN so we can stop the scroll when someone touches the screen. - if (ev.getAction() == MotionEvent.ACTION_DOWN || mDetector.onTouchEvent(ev)) { - return result; - } - - return false; - } - - // Return false if we're scrolling in the x direction. That is, decline to consume the event and - // let the parent class take a stab at it. - class YScrollDetector extends GestureDetector.SimpleOnGestureListener { - @Override - public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) { - try { - if (Math.abs(distanceY) > Math.abs(distanceX)) { - return true; - } else { - return false; - } - } catch (Exception e) { - // nothing - } - return false; - } - } - - /** - * Fetch the current percentage by which this view has been scrolled. - * @return Scroll percentage based on the top edge of the screen, from 0 to 100. This number should never really - * be 100, unless the screen is of 0 height... - */ - public double getScrollPercentage() { - // We save only the Y coordinate instead of the percentage because I don't know how expensive the - // computeVerticalScrollRange() call is. - final int scrollRange = computeVerticalScrollRange(); - if(scrollRange == 0) { - return 0; - } - return (double) mCurrentYPosition / scrollRange; - } - - /** - * Set the percentage by which we should scroll the page once we get the load complete event. This is - * based on the top edge of the view. - * @param percentage Percentage of page to scroll to. - */ - public void setScrollPercentage(final double percentage) { - Log.d(K9.LOG_TAG, "ToggleView: Setting last scroll percentage to " + percentage); - this.mScrollPercentage = percentage; - } - - /** - * Override {@link ScrollView#onScrollChanged(int, int, int, int)} to record the current x/y position. We use this - * to save our current position for future scrolling. - * - * @param x - * @param y - * @param oldx - * @param oldy - */ - @Override - protected void onScrollChanged(int x, int y, int oldx, int oldy) { - super.onScrollChanged(x, y, oldx, oldy); - - this.mCurrentYPosition = y; - // I wish Android has a TRACE log level so I wouldn't have to comment this out. This one is really noisy. - // Log.d(K9.LOG_TAG, "ToggleScrollView: mCurrentYPosition=" + y + " scrollRange=" + computeVerticalScrollRange() + " pct=" + getScrollPercentage()); - } - - /** - * This is a {@link MessagingListener} which listens for when the a message has finished being displayed on the - * screen. We'll scroll the message to the user's last known location once it's done. - */ - class ScrollToLastLocationListener extends MessagingListener { - public void messageViewFinished() { - // Don't scroll if our last position was at the top. - if(mScrollPercentage != 0.0) { - final int scrollRange = computeVerticalScrollRange(); - final int newY = (int)(mScrollPercentage * scrollRange); - Log.d(K9.LOG_TAG, "ToggleScrollView: requested " + (100 * mScrollPercentage) + "%, " + - "scrolling to " + newY + "/" + scrollRange); - scrollTo(0, newY); - } - } - } - - /** - * Fetch the {@link MessagingListener} for this ScrollView. - * @return - */ - public MessagingListener getListener() { - if(this.mListener != null) { - return this.mListener; - } else { - return this.mListener = new ScrollToLastLocationListener(); - } - } -} From 5bc28e04bce85d2b8b15fdfd862803422c454fb6 Mon Sep 17 00:00:00 2001 From: Dmitry Ashkadov Date: Fri, 6 Apr 2012 00:02:30 +0400 Subject: [PATCH 12/54] Updates to Russian translation --- res/values-ru/strings.xml | 129 +++++++++++++++++++------------------- 1 file changed, 66 insertions(+), 63 deletions(-) diff --git a/res/values-ru/strings.xml b/res/values-ru/strings.xml index fb1452369..20496a831 100644 --- a/res/values-ru/strings.xml +++ b/res/values-ru/strings.xml @@ -7,7 +7,7 @@ Лицензия Apache License, Version 2.0. Авторы: %s Информация об изменениях: %s - Мы используем следующие тертьесторонние библиотеки: %s + Мы используем следующие библиотеки третьих сторон: %s Иконки настроения: %s читать вложения электронной почты @@ -108,9 +108,9 @@ Показать/спрятать подробности Добавить Копию/СК Редактировать тему - - - + Уведомление о прочтении + Уведомление о прочтении будет запрошено + Уведомление о прочтении не будет запрошено Добавить вложение Добавить вложение (Изображение) Добавить вложение (Видео) @@ -324,8 +324,8 @@ Использовать шрифт фиксированной ширины при показе плоского текста Вернуться к списку после удаления Вернуться к списку сообщений после удаления сообщения - - + Показать след. сообщение после удаления + По умолчанию показывать след. сообщение после удаления Подтверждение действий Показывать диалог при совершении действий @@ -340,7 +340,7 @@ Время тишины Запретить сигнал, вибрацию, мигание в ночное время - Начинало времени тишины + Начало времени тишины Конец времени тишины Установить новый адрес @@ -414,7 +414,7 @@ В ходе каждого запроса Только вручную - + Автоопределение области имен IMAP Префикс пути IMAP Имя папки Черновиков @@ -550,11 +550,11 @@ При ответе цитата будет выше ответа. Формат сообщения - Плоский текст (изображения и форматирование не сохраняется) + Обычный текст (изображения и форматирование не сохраняется) HTML (сохранять изображения и форматирование) - - + Уведомление о прочтении + Всегда запрашивать уведомление о прочтении Стиль цитирования Префикс (например Gmail, Pine) @@ -582,7 +582,7 @@ Цвет учётной записи Выберите цвет учётной записи, используемый в папке и списке учётных записей - Notification LED color + Цвет светодиода для уведомления Выбрать цвет мигания для учётной записи Количество показываемых сообщений @@ -680,13 +680,13 @@ Звонок при новых сообщениях Вибрация Вибрация при новых сообщениях - Паттерн вибрации + Тип вибрации По умолчанию - паттерн 1 - паттерн 2 - паттерн 3 - паттерн 4 - паттерн 5 + Вибрация 1 + Вибрация 2 + Вибрация 3 + Вибрация 4 + Вибрация 5 Повторять вибрацию Выбор мелодии Мигать @@ -839,7 +839,7 @@ Никогда Всегда Когда \'Фоновый режим\' включен - Когда \'Фоновые данные\' & \'Автосинхронизация\' включены + Когда \'Фоновые данные\' и \'Автосинхронизация\' включены Никаких сообщшний не выбранно @@ -956,11 +956,11 @@ Дата Тело сообщения - самый крочшечный + Самый крочшечный Крошечный Еще меньше Маленький - средний + Средний Большой Наибольший @@ -1033,46 +1033,49 @@ Не получается соединиться. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Импорт и экспорт настроек + + Экспортировать настройки учетной записи + Экспортировать настройки и учетные записи + Импорт + Экспорт + Импортировать настройки + Импортировать выбранное + Глобальные настройки + Экспорт настроек... + Импорт настроек... + Сканирование файла... + Настройки были экспортированы в %s + Глобальные настройки были импортированы из %s + Импортирован %s из %s + + 1 учетная запись + %s учетных записи + %s учетных записей + + Не удалось экспортировать настройки + Не удалось экспортировать настройки из %s + Экспорт удался + Экспорт не удался + Импорт удался + Импорт не удался + Активировать учетную запись + Чтобы использовать учетную запись \"%s\", Вам необходимо указать %s. + + пароль + пароля + паролей + + Сервер для входящей почты (%s): + Сервер для исходящей почты (%s): + + Установка пароля... + Установка паролей... + + Использовать пароль от сервера для входящей почты + Активировать - + Невозможно определить версию файла %s Учётная запись\"%s\" недоступна; проверьте хранилище @@ -1080,8 +1083,8 @@ Сохранить вложение Не найден браузер файлов. Где бы вы хотели сохранить вложение? - - - + Переместить вверх + Переместить вниз + Перемещение учетной записи... From 166428c9b65f69691b89433936bbb1f22aaa9f35 Mon Sep 17 00:00:00 2001 From: Andrew Chen Date: Fri, 6 Apr 2012 11:17:48 -0700 Subject: [PATCH 13/54] Commit latest IntelliJ settings added by IntelliJ 11.1. --- k9mail.iml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/k9mail.iml b/k9mail.iml index 1d380b11c..1162b4539 100644 --- a/k9mail.iml +++ b/k9mail.iml @@ -20,6 +20,10 @@