Update LocalStore code to handle the newly introduced temporary files
for attachments
Conflicts:
res/values/strings.xml
src/com/fsck/k9/activity/MessageCompose.java
Android allows other apps to access protected content of an app without requesting the
necessary permission when the app returns an Intent with FLAG_GRANT_READ_URI_PERMISSION.
This regularly happens as a result of ACTION_GET_CONTENT, i.e. what we use to pick content
to be attached to a message. Accessing that content only works while the receiving activity
is running. Afterwards accessing the content throws a SecurityException because of the
missing permission.
This commit changes K-9 Mail's behavior to copy the content to a temporary file in K-9's
cache directory while the activity is still running.
Fixes issue 4847, 5821
This also fixes bugs related to the fact that K-9 Mail didn't save a copy of attached content
in the message database.
Fixes issue 1187, 3330, 4930
- wrap chip around the whole header, including the subject
and the expanded additional headers area.
- mindor padding adjustments to make whitepsace around the
contact badge a bit more homogeneous.
Previously, they dominated both the message header as well as the
message list by their sheer size, at least on xhdpi (Nexus 4), although
they're certainly not the most important information in there.
- 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
- 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.