fix LoaderManager inefficiencies

Redundant calls in ConversationActivity and ConversationListActivity
was causing unnecessary view invalidations.

Closes #2592
fork-5.53.8
Rhodey Orbits 2015-03-05 16:06:11 -08:00 zatwierdzone przez Jake McGinty
rodzic ca2c8b961e
commit db7a657001
2 zmienionych plików z 5 dodań i 9 usunięć

Wyświetl plik

@ -103,7 +103,6 @@ public class ConversationFragment extends ListFragment
initializeResources();
initializeListAdapter();
getLoaderManager().restartLoader(0, null, this);
}
private void initializeResources() {
@ -117,7 +116,7 @@ public class ConversationFragment extends ListFragment
(!this.recipients.isSingleRecipient()) || this.recipients.isGroupRecipient(),
DirectoryHelper.isPushDestination(getActivity(), this.recipients)));
getListView().setRecyclerListener((ConversationAdapter)getListAdapter());
getLoaderManager().initLoader(0, null, this);
getLoaderManager().restartLoader(0, null, this);
}
}
@ -127,12 +126,9 @@ public class ConversationFragment extends ListFragment
}
private void setCorrectMenuVisibility(Menu menu) {
ConversationAdapter adapter = (ConversationAdapter) getListAdapter();
List<MessageRecord> messageRecords = getSelectedMessageRecords();
if (actionMode != null && messageRecords.size() == 0) {
adapter.getBatchSelected().clear();
adapter.notifyDataSetChanged();
actionMode.finish();
return;
}
@ -170,9 +166,11 @@ public class ConversationFragment extends ListFragment
public void reload(Recipients recipients, long threadId) {
this.recipients = recipients;
this.threadId = threadId;
initializeListAdapter();
if (this.threadId != threadId) {
this.threadId = threadId;
initializeListAdapter();
}
}
public void scrollToBottom() {

Wyświetl plik

@ -96,8 +96,6 @@ public class ConversationListFragment extends ListFragment
});
initializeListAdapter();
initializeBatchListener();
getLoaderManager().initLoader(0, null, this);
}
@Override