1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-12 04:25:08 -05:00
Commit Graph

191 Commits

Author SHA1 Message Date
Joe Steele
e2c5229e85 Change when <html> tags are applied to messages.
Previously, <html>, <head>, & <body> tags were
attached to messages before they were stored locally.
But now that the <head> element also needs to include
a <meta> element (for proper MessageWebView display),
it seems unecesary to store all these tags with each
message.

Now the tags are no longer stored with the messages.  Instead,
MessageWebView applies the tags before displaying the message.

This also eliminates the need to upgrade an older
message database where all the old messages would have
otherwise needed to be wrapped with the new tags.
2013-03-01 12:59:59 -05:00
Joe Steele
28212bc04f Issue 4019 -- Fix inability to zoom out.
Thanks to davidgca...@gmail.com for references in
his comments 80 & 81.
2013-02-27 16:11:08 -05:00
cketti
d6d9effbec Remove unused stuff 2013-02-21 02:00:12 +01:00
Danny Baumann
0fac8e999d Clean up date handling.
Remove home-grown date formatting, and replace it by usage of the
DateUtils class which is present since API level 3.
2013-02-11 15:19:15 +01:00
m0viefreak
8d4a82ba0e message view: fix subject bugs
- Android does not support ellipsize in combination with maxlines
  for TextViews. This caused getEllipsisCount() in MessageTitleView
  to always fail, and the full subject was never shown in the regular
  headers area when needed.
  To work around that, check for ourselves whether the text is
  longer than 2, and ellipsize manually.

- Clicking the star button on a message caused the subject line to
  re-appear, even if it fits in the action bar title without being
  cut off. This was caused by MessageHeader.populate(), which always
  set the subject to visible.
  As a workaround: Only set subject to visible in case populate()
  actually shows a new message.

- delete res/layout/actionbar_message_view.xml, its already present
  in the actionbar_custom.xml
2013-02-11 13:47:31 +01:00
Danny Baumann
3807d2881d Fix warnings. 2013-02-11 09:19:29 +01:00
Jesse Vincent
ed90f3be44 MessageView quick contact badges 2013-02-10 19:02:17 -05:00
Jesse Vincent
fd19704fe5 show the date and time in a single view on a single line 2013-02-10 19:02:17 -05:00
Jesse Vincent
648a6eed86 move the To and Cc labels into their own Views; stop playing span games to style them 2013-02-10 19:02:17 -05:00
Jesse Vincent
82a8ac6278 There's no good reason to exclude the Subject from the "full headers" view, especicially since we now play games with it sometimes showing up in the header and sometimes in the titlebar 2013-02-10 19:02:17 -05:00
Jesse Vincent
c4b941b9b9 Switch our font sizes to have a "default", which is the size described in the XML.
Unify the text field size setting code. We should put it in a better place
2013-02-10 19:02:17 -05:00
Danny Baumann
8f3e61feab Convert theme setting value to an enum. 2013-02-08 15:24:03 +01:00
Jesse Vincent
7714bc3cfa Move "show all headers" into the menu (and out of the UI) 2013-02-07 15:27:22 -05:00
cketti
1244cc864a Make sure onSwitchComplete() is also called when animations are disabled 2013-02-06 21:21:13 +01:00
Danny Baumann
03f9b9ef0d Respect the 'enable animations' pref when animating views. 2013-02-06 10:54:13 +01:00
cketti
3286cea148 Only remove message view fragment after animation is complete 2013-02-06 00:56:33 +01:00
cketti
ac9259a0e3 Restructure MessageHeader to avoid NPE when used by MessageTitleView 2013-02-05 23:55:21 +01:00
m0viefreak
5fa7e65816 MessageView: another theme fix
- The attachments view still had the wrong background color in case
  of different global and message themes.

- The attachments view used the activity LayoutInflater, but it needs
  to use the one of the fragment.

- The background drawable for the attachments used transparency, and
  thus was completely invisible in the black theme. Fix it by adding
  another one for the black theme.
2013-02-05 23:12:52 +01:00
cketti
f5ec5cd3fb Avoid saved state being discarded when message list is modified 2013-02-05 20:00:31 +01:00
Jesse Vincent
0b04e526b4 Because we're not reusing the message view, we don't need to force scrolling. This has the side effect of cutting down on a momentary flash of message header area on display. 2013-02-05 12:26:16 -05:00
Danny Baumann
1dda0cfdbd Another unused import. 2013-02-05 14:32:56 +01:00
Danny Baumann
f51f675021 Simplify and improve message view header layout.
The star was displayed partially off-screen before.
2013-02-05 11:15:55 +01:00
m0viefreak
a74d57cb71 MessageView: Theme fix when global and message view theme differ
- Since the split-view change, MessageView is only a fragment, so we
  can't call setTheme() anymore so easily.
  Instead, use a ContextThemeWrapper and use that to inflate the
  layout. This way the message header and attachment view
  are styled correctly.

- The HTC WebView fix in SingleMessageView was returning the wrong
  background color, when message view theme and global theme differ,
  because it always used the global theme to retrieve it.
  Fix: Specifically put the light/dark values in the themes.xml,
  and get them using getContext().getTheme().resolveAttribute().
  getContext() will use the ContextThemeWrapper from above, so
  even if the global and message view themes differ, it aleays
  returns the correct one.
  The getThemeBackgroundColor() method added to the K9ActivityMagic
  interface in 309eeb72ac is now not
  needed anymore, and was removed.
2013-02-04 19:30:40 +01:00
Danny Baumann
275700e482 Fix a number of build warnings.
This gets rid of about 50 warnings. Deprecation warnings still remain,
though.
2013-02-04 11:18:49 +01:00
cketti
b02e338b49 Add animation when switching from message list to message view 2013-02-02 02:21:20 +01:00
cketti
6b143d845a Set MessageList title in action bar depending on display mode 2013-02-01 02:50:00 +01:00
Jesse Vincent
c870c5acbc make the checkmark a little wider. 2012-11-24 17:44:07 -05:00
cketti
d3f9633378 Merge branch 'fragments' 2012-10-08 14:33:33 +02:00
Jesse Vincent
f62ac401a0 make the stroke border on our color chips a bit wider to make them easier to see 2012-10-06 17:31:24 -04:00
cketti
8a226972a5 Extracted functionality common to most activities to K9ActivityCommon 2012-10-05 18:14:07 +02:00
cketti
bbcc4988ba Converted message view to a fragment
The fragment should be fully functional. The only thing missing is the
animation when showing the next/previous message.
2012-10-05 18:14:07 +02:00
Jesse Vincent
7b23704bd5 Add "cc Me" and "from me" color chips. Uprez the chips 10x so we get crisp views rather than awful bitmappy stuff 2012-10-03 21:56:28 -04:00
Jesse Vincent
0e3f87f77f Chip updates based on work by m0vie 2012-09-24 19:25:34 -04:00
Jesse Vincent
8df55d069d make the checkmarks a bit more prominent 2012-09-21 17:27:59 -04:00
Jesse Vincent
baf99b114b refactor chip code to be a little less ugly 2012-09-21 17:27:58 -04:00
Jesse Vincent
b9395da6be slight tweaks to chip shape 2012-09-21 00:50:00 -04:00
Jesse Vincent
9a8c050539 slight tweak to the new chip formats 2012-09-21 00:12:09 -04:00
Jesse Vincent
e55b1e0738 Move the message star into the chip. (Also, the "to me" information) 2012-09-20 23:30:52 -04:00
m0viefreak
771b5122d6 MessageView theme toggle: change the theme of the whole activity and not just the background of the WebView
Using dark theme with white WebView background looks very ugly,
especially when a "download complete message" or a "show images"
button is present.

This change applies the theme to the whole activity.

Also changed the text for the toggle menu. It's also shorter now,
and isn't cut off anymore on hdpi/480px wide devices.
2012-09-15 07:22:25 +02:00
Bernhard Redl
76d8e11703 +toggle option in message view to change message display theme (dark,light) permanently (Issue 1674) 2012-09-14 03:16:36 +02:00
cketti
2a05bc0caa Use ActionBarSherlock's MenuBuilder for the "more" menu 2012-09-12 18:26:51 -04:00
Jesse Vincent
c9897a5c84 Indicate read state in chips 2012-09-10 11:01:51 -04:00
Jesse Vincent
78cf804aca first pass of converting chips to colored circles 2012-09-10 10:40:20 -04:00
Andrew Chen
9fbb2b4836 Show the subject line in the MessageHeader if the ActionBar title was truncated. 2012-09-09 13:45:33 -07:00
Andrew Chen
4a416f7acd Hide subject line in MessageView since it's now displayed in the actionbar.
Now that the subject line is gone, the right side of the header is now the tallest part of the header.
Put date and time on the same line to keep the header compact.
2012-09-09 13:41:49 -07:00
Bernhard Redl
56105bcfe3 + add support for $Forwarded IMAP flag 2012-08-29 02:26:38 +02:00
cketti
c0153a1636 Display decrypted/verified messages like text/plain messages
Nicely format the text instead of wrapping it in <pre> tags.
2012-08-27 17:38:10 +02:00
cketti
2e454f0af7 Removed "System zoom controls" setting
We always allow zooming but hide (provided the Android version supports
it) the on-screen zoom controls if the device supports multi-touch,
hence pinch-to-zoom.
2012-08-15 00:21:22 +02:00
Jesse Vincent
74f04e75e3 A first spike of integrating http://code.google.com/p/android-titlebar-webview
on my nexus 7, the webview and titlebar are overlapping each other, still
2012-08-02 16:49:21 -07:00
Jesse Vincent
17a6f79365 Better solution coming up!
Revert "Added fallback for when WebView.setEmbeddedTitleBar() is not available"

This reverts commit 6073b9d3fa.
2012-08-02 16:11:10 -07:00
cketti
5467a71cbf Added work-around for image loading bug in Android 4.0's WebView
Fixes issue 3997
2012-07-16 02:14:42 +02:00
cketti
b72fcd9d4b Only use the single-column layout on known good Android versions
Fixes issue 3820
2012-07-13 23:04:04 +02:00
cketti
a281b3401e Extracted code to disable Lint warning when using newer API 2012-07-07 15:03:23 +02:00
cketti
6073b9d3fa Added fallback for when WebView.setEmbeddedTitleBar() is not available
The (undocumented) method WebView.setEmbeddedTitleBar() was removed in
Android 4.1 which caused the message header to never be displayed.
This fallback is only a temporary fix. We really need to come up with a
solution that feels like the previous (setEmbeddedTitleBar) behavior.
2012-06-29 00:14:06 +02:00
cketti
ee1288ee75 Disable special screen reader mode on ICS
The default message view is accessible enough.
Info and original patch provided by Nolan Darilek.

See issue 4153
2012-06-18 03:17:02 +02:00
Bernhard Redl
39f5587f30 Fixed Issue 4222. Use of the wrong method to get device-SDK version resulting in errors on ApiLevel 7 (2.1) devices. 2012-04-17 00:09:00 +02:00
cketti
e88fbf43d0 Removed unused ToggleScrollView 2012-04-04 10:04:57 +02:00
cketti
5041a2c832 SingleMessageView cleanup 2012-04-04 10:04:57 +02:00
Bernhard Redl
eba886b85d Render html code to make white on DarkTheme (fixes 4196) 2012-04-04 01:46:22 +02:00
cketti
4612ceb3c8 Enabled dark theme for MessageCompose and MessageView 2012-04-03 07:55:51 +02:00
cketti
5819d27394 Added long-press popup menu to WebView in SingleMessageView
Actions:
- Open link for viewing
- Share link
- Copy link to clipboard
- View image
- Download/save image
- Copy image URL to clipboard
- Call number
- Save phone number to Contacts
- Copy phone number to clipboard
- Send mail
- Save to Contacts
- Copy email address to clipboard

This is based on work done by kernelhunter92 and ShellZero.

Fixed issue 1248
2012-04-01 22:46:36 +02:00
cketti
1596ddfaab Moved sanitizeFilename() to com.fsck.k9.helper.Utility 2012-04-01 21:14:43 +02:00
cketti
482ae352c1 Reverted most of the recent message header changes
Clicking the additional headers area still allows to hide that view
again.
2012-03-18 04:51:29 +01:00
cketti
faf9dc6e02 Restored show/more less indicator in the message header 2012-03-06 04:38:08 +01:00
m0viefreak
8d12244a9c Message header changes
* remove expand/collapse arrows, instead use the background area of the header to toggle
* allow expanding of To: and Cc: texts when too long and cut off by clicking on them
2012-03-02 06:15:55 +01:00
m0viefreak
f1baa8f461 invalidate message content WebView when the message header changes
This fixes redraw issues where text appears doubled or is cut off
2012-03-02 05:16:58 +01:00
cketti
ba979808fe Use AttachmentView instance as onClick and onLongClick listener 2012-02-27 21:45:47 +01:00
cketti
206c559236 Don't handle exceptions in AttachmentView.populateFromPart()
We now catch exceptions in SingleMessageView.renderAttachments(). This
way we can avoid adding AttachmentViews that couldn't be properly
populated.
2012-02-27 21:45:47 +01:00
cketti
25dff5ae6a Don't choke on invalid size parameters for attachment parts 2012-02-27 21:45:46 +01:00
cketti
2cb31a2fac Added button to show unnamed and inline attachments 2012-02-27 21:45:46 +01:00
cketti
7c97527d73 Allow message header to scroll when displaying the attachment list 2012-02-25 00:43:09 +01:00
cketti
c1d663b084 Save/restore instance state for MessageHeader 2012-02-24 04:07:29 +01:00
cketti
4e12dc154e Save/restore instance state for SingleMessageView 2012-02-24 03:43:42 +01:00
cketti
2c09d75afa Switch to "message view" when displayMessageBody() is called 2012-02-23 00:10:47 +01:00
cketti
18c96f94d6 Retain "show pictures" state on orientation change 2012-02-22 23:26:59 +01:00
cketti
2b54599c2b Small code cleanup 2012-02-22 22:56:05 +01:00
cketti
0ef9c516be Moved click listener from MessageView to SingleMessageView 2012-02-22 22:44:31 +01:00
cketti
80cb0cce35 Changed the layout to include a color chip again 2012-02-21 23:38:43 +01:00
cketti
ec6645bf6a Avoid creating new objects for handling click events 2012-02-21 16:21:47 +01:00
cketti
309eeb72ac Got rid of the ScrollView in MessageView
The ScrollView around the WebView caused all sorts of problems. This
change removes the ScrollView and uses the undocumented method
WebView.setEmbeddedTitleBar() to set the MessageHeader view as "title
bar" of the WebView. This allows MessageHeader to scroll away making
more room for the WebView.
All of the "magic title bar" code was originally implemented by Jesse
for Kaiten.

Because WebView doesn't support a scrolling footer we can no longer
support scrolling buttons or attachments at the end of the message. Now
users can switch from message view to attachment view via a button just
below the message headers.

I also copied some code for which I was too lazy to create a separate
commit. It allows to display attachments we didn't use to show by
clicking on a "More..." button in the attachment view. Those
attachments are mostly images referenced by the HTML part (e.g.
background images).

Fixes issue 3291
2012-02-21 05:07:01 +01:00
cketti
53ae9d7fe7 Avoid exception when a screen reader is installed but not active. 2012-02-16 14:52:56 +01:00
cketti
35b5aebdb3 Add debug message when saving an attachment to SD card fails 2012-02-03 01:22:37 +01:00
cketti
1165787129 Changed regular expression for invalid characters in a file name 2012-01-27 03:39:08 +01:00
cketti
6c23e204ba Replace invalid characters in file name instead of removing them 2012-01-27 03:21:20 +01:00
cketti
68f5f009f1 Whitespace cleanup 2012-01-27 03:07:44 +01:00
wilian-cb
9a0f650cd9 3674: Displaying the final file name. 2012-01-27 02:44:01 +01:00
wilian-cb
193450cd63 3674: Illegal characters used in file names are being removed when saving them on the device. 2012-01-27 02:44:01 +01:00
cketti
8e627834c1 Changed font size unit from DIP to SP
"Scale-independent Pixels - this is like the dp unit, but it is also
scaled by the user's font size preference. It is recommend you use this
unit when specifying font sizes, so they will be adjusted for both the
screen density and the user's preference." - Android Developer Docs
2012-01-12 02:18:41 +01:00
András Veres-Szentkirályi
1949067979 Removed unnecessary return statement 2011-12-26 02:28:30 +01:00
András Veres-Szentkirályi
de30c712f9 Removed duplicate import 2011-12-26 02:28:30 +01:00
cketti
fe727f8b20 Merge pull request #98 from cketti/remove_legacy_code
Remove legacy code
2011-11-15 20:07:23 -08:00
Jesse Vincent
a8ef6594ec Preserve header order (with the exception of duplicate headers like
"received" they all show up where the first one did
2011-11-15 00:00:42 -05:00
cketti
07fa0c7264 Use Build.VERSION.SDK_INT instead of parsing Build.VERSION.SDK 2011-11-10 05:39:04 +01:00
Andrew Chen
ef631e21d1 Merge pull request #83 from andrewachen/messageview_save_location
Restore position in MessageView after rotation screen.
2011-11-07 09:57:18 -08:00
Jesse Vincent
7ca72b9d0f Work around broken office suites by sending an explicit mime type with files we open 2011-11-06 17:00:25 -05:00
Andrew Chen
f6eea9f014 Move the listener logic out of the Activity and into the View.
Change variable naming in ToggleScrollView to meet standard.
Cache the result of computeVerticalScrollRange() in ToggleScrollView.
2011-11-03 09:14:42 -07:00
Andrew Chen
763ff2752d Scroll to the last known position in the MessageView when rotating the screen. 2011-11-02 16:39:23 -07:00
Andrew Chen
f884e967c9 Use MimeHeader.* constants when referring to content headers. Minor whitespace changes. 2011-11-02 08:34:06 -07:00
Andrew Gaul
220e55603d Spelling corrections 2011-10-05 22:04:39 -07:00
cketti
88dc36da8a Added a check to prevent an ArrayIndexOutOfBoundsException
Fixes issue 3683
2011-10-01 20:30:22 +02:00