mirror of
https://github.com/moparisthebest/k-9
synced 2025-01-14 07:08:00 -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:
parent
a926086f4b
commit
a4510696aa
@ -623,13 +623,19 @@ public class MessageView extends K9Activity
|
|||||||
mAttachments.removeAllViews();
|
mAttachments.removeAllViews();
|
||||||
findSurroundingMessagesUid();
|
findSurroundingMessagesUid();
|
||||||
|
|
||||||
next.setEnabled(mNextMessageUid != null);
|
|
||||||
previous.setEnabled(mPreviousMessageUid != null);
|
|
||||||
|
|
||||||
if (next_scrolling != null)
|
boolean enableNext = (mNextMessageUid != null);
|
||||||
next_scrolling.setEnabled(mNextMessageUid != null);
|
boolean enablePrev = (mPreviousMessageUid != null);
|
||||||
if (previous_scrolling != null)
|
|
||||||
previous_scrolling.setEnabled(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(
|
MessagingController.getInstance(getApplication()).loadMessageForView(
|
||||||
mAccount,
|
mAccount,
|
||||||
|
Loading…
Reference in New Issue
Block a user