cketti
f87ab53b9b
Try original and inferred MIME type to find best viewer for attachment
...
In order for Android to find apps that are capable of opening an attachment for
viewing the ACTION_VIEW Intent needs to contain an appropriate MIME type.
Ideally, we'd use the MIME type specified for the attachment in the message.
But often the supplied MIME type is wrong/useless. So we look at the file
extension to try to come up with a sensible MIME type on our own. We then go
on to ask Android which of the two MIME types leads to more apps claiming to
be able to open our attachment for viewing and use that one.
2014-11-10 03:10:09 +01:00
cketti
11a9eff109
Extract intent creation code to method
2014-11-09 20:46:46 +01:00
cketti
6cb3c991db
No longer pretend there are attachment types we don't care about
2014-10-20 21:26:18 -04:00
cketti
3c4ad91614
Fix method names/visibility
2014-10-20 21:24:18 -04:00
cketti
d3073be89a
Rearrange fields/methods
2014-10-20 21:21:09 -04:00
cketti
83d876f246
Inline method
2014-10-20 21:16:31 -04:00
cketti
f6822c973d
Clean up comments
2014-10-20 21:13:58 -04:00
cketti
1e89314f3e
Remove "m" prefix for field names
2014-10-20 21:09:23 -04:00
cketti
b3bc85ba10
Split 'populateFromPart' into multiple methods
2014-10-20 21:06:31 -04:00
cketti
ca88f59c05
Create named class for loading and displaying attachment thumbnails
2014-10-20 20:46:46 -04:00
cketti
4299eb9771
Rename method and improve documentation
2014-10-20 20:28:38 -04:00
cketti
4a6c52947d
Make all fields of AttachmentView private
2014-10-20 20:14:04 -04:00
cketti
187d760e5f
Extract code to display error/status messages to a separate method
2014-10-20 19:50:41 -04:00
cketti
dfe1771fcb
Fix formatting
2014-10-20 19:39:16 -04:00
cketti
b7a8c9b707
Remove unused code
2014-10-20 19:34:16 -04:00
yulin2
fa7118dab3
Put long-running operation into AsyncTask
2014-03-01 06:04:50 +01:00
Joe Steele
2df436e7bc
Close stream when done (StrictMode error).
2013-08-02 12:56:10 -04:00
cketti
1596ddfaab
Moved sanitizeFilename() to com.fsck.k9.helper.Utility
2012-04-01 21:14:43 +02: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
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
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
Bernhard Redl
ab4bae214f
Make attachment saving respect the new preference. Allow long-press to
...
choose a folder.
(new constant renamed from CHOOSE_FOLDER to CHOOSE directory for
clarity)
2011-04-24 14:01:03 +10:00
Bernhard Redl
96842b3ce6
Unroll import statements in AttachmentView.java
2011-04-24 13:56:54 +10:00
cketti
0aa03ccdc4
Extract MIME type fixup code to method MimeUtility.getMimeTypeForViewing()
2011-03-25 00:37:53 +01:00
cketti
522634fba7
Extend AttachmentProvider to be able to get "raw" attachment
...
AttachmentProvider can now return an attachment with an unmodified
MIME type. However, when viewing attachments this is not desirable. So
we try hard to return a sensible MIME type (use extension to look up
a MIME type if it's originally "application/octet-stream"; or replace
with canonical MIME type if it's known to be wrong, e.g.
"image/jpg" -> "image/jpeg")
2011-03-24 23:36:59 +01:00
Jesse Vincent
7cd99bdfd2
When some message has an Application/octet-stream .jpg attachment, be a
...
bit more lenient and treat it as application/octet-stream, so we can
look up the content type by file extension
2011-02-07 20:34:08 -05:00
Jesse Vincent
12d1097a24
Big, scary massive "ant astyle" to get us back to something
...
approximating AOSP coding standards.
2011-02-06 17:09:48 -05:00
Jesse Vincent
4a558c5ac5
Revert the active part of "Update issue 848"
...
This reverts commit 9fc94115adb58dcd8a64227a93d0e6e707d7752d.
It turns out that disabling the "View attachment" button (rather than
giving a useful error message telling the user what mime type the app
needs to support) was confusing to users.
2011-01-28 03:33:49 +00:00
Jesse Vincent
d59600653c
astyle
2011-01-18 00:04:11 +00:00
Marcus Wolschon
fc4b64c559
Update issue 848
...
"view" only enabled for attachments if there is an actual
application on the phone to view this kind of file.
2011-01-17 10:41:48 +00:00
Jesse Vincent
39ef6584a8
continue to extract attachment code out to AttachmentView
2011-01-06 16:56:37 +00:00
Jesse Vincent
19c5324316
Extract AttachmentView and MediaScannerNotifier into their own classes
2011-01-06 16:56:20 +00:00