mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-11 19:03:39 +00:00
fix LoaderManager inefficiencies
Redundant calls in ConversationActivity and ConversationListActivity was causing unnecessary view invalidations. Closes #2592
This commit is contained in:
parent
ca2c8b961e
commit
db7a657001
@ -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() {
|
||||
|
@ -96,8 +96,6 @@ public class ConversationListFragment extends ListFragment
|
||||
});
|
||||
initializeListAdapter();
|
||||
initializeBatchListener();
|
||||
|
||||
getLoaderManager().initLoader(0, null, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user