- 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
This fixes the following scenario:
- Get a mail notification
- Click on notification -> message view appears
- Press home
- Get a new notification
- Click on notification -> last instead of new message is displayed
This way also the From: selection, To:, Cc, and Bcc: are themed correctly.
It looks more homogeneous and is consistent with the looks of the MessageView.
by default.
The message view theme isn't something the user is likely to change on a
regular basis, so we don't need to clutter the message view menu with
this setting. The menu item can still be enabled for those who want it.
The ContextThemeWrapper added in a74d57cb71
used getActivity().getApplicationContext() to get the base context.
This is wrong, because an Application context won't work for starting
activities from the WebView.
Instead, use the context that is given to us in the constructor as base
context. This is the one that would also be used if no ContextThemeWrapper
was present at all.
- 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.
When MessageListFragment is on the back stack and the device is rotated
the instance state will be restored but no new view will be created. If
the device is rotated again onSaveInstanceState() is called and we have
to take care not to assume that the views have been created.
Remove the fadeout to make things look a little less weird
Make the animations slide in from the edge. (See the aforementioned comment about jankyness)
TODO: don't remove the message view until _after_ the animation runs. Before HC, that requires rather a lot more code (writing a whole animationadapter) than it should.
TODO: get the messageview to stop jumping to hide the header area as it's displayed.
- 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.
Some people prefer them over swiping / volume keys.
They could probably be made optional so they can be hidden.
Also: delete the now unused message_view_fragment.xml and message_view_option.xml.
Calling configureMenu() inside updateMenu() doesn't update the
buttons properly. Instead, call invalidateOptionsMenu(). This forces
the menu to be re-created, and onPreareOptionsMenu() to be called.
From there, configureMenu() is called automatically.
The commit that introduced those notifications also introduced a rather
... interesting design pattern: The CertificateValidationException
notified the user of its pure existance - it's no longer a 'message'
only, but defines policy. As this is more than unusual, replace this
pattern by the MessagingController treating
CertificateValidationException specially when accessing remote folders.
Also make clear which account failed when constructing the notification.
The previous code worked fine on Android 4.2. But the lifecycle on older
Android versions (tested with 2.2) seems to be slightly different. This
should fix the problem.
- show thread as starred if at least one message in it is starred
- use arrival date of last message as thread arrival date
- use sum of message attachment counts in thread as thread attachment
count
- show thread as answered/forwarded if all messages in thread were
answered/forwarded