1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-12-26 01:28:50 -05:00

It turns out that blindly enabling/disabling views is _Very_ expensive.

Now we only do it when switching messageview entries if it's actually
necessary
This commit is contained in:
Jesse Vincent 2010-01-04 02:11:33 +00:00
parent a926086f4b
commit a4510696aa

View File

@ -623,13 +623,19 @@ public class MessageView extends K9Activity
mAttachments.removeAllViews();
findSurroundingMessagesUid();
next.setEnabled(mNextMessageUid != null);
previous.setEnabled(mPreviousMessageUid != null);
if (next_scrolling != null)
next_scrolling.setEnabled(mNextMessageUid != null);
if (previous_scrolling != null)
previous_scrolling.setEnabled(mPreviousMessageUid != null);
boolean enableNext = (mNextMessageUid != null);
boolean enablePrev = (mPreviousMessageUid != null);
if (next.isEnabled() != enableNext)
next.setEnabled(enableNext);
if (previous.isEnabled() != enablePrev)
previous.setEnabled(enablePrev);
if (next_scrolling != null && (next_scrolling.isEnabled() != enableNext))
next_scrolling.setEnabled(enableNext);
if (previous_scrolling != null && (previous_scrolling.isEnabled() != enablePrev))
previous_scrolling.setEnabled(enablePrev);
MessagingController.getInstance(getApplication()).loadMessageForView(
mAccount,