mirror of
https://github.com/oxen-io/session-android.git
synced 2025-10-20 17:48:39 +00:00
Correctly initialize conversation after message sent.
This commit is contained in:
@@ -551,9 +551,12 @@ public class ConversationActivity extends SherlockFragmentActivity {
|
||||
this.threadId = threadId;
|
||||
|
||||
if (this.recipientsPanel.getVisibility() == View.VISIBLE) {
|
||||
///XXX call down to fragment! ??
|
||||
ConversationFragment fragment
|
||||
= (ConversationFragment)this.getSupportFragmentManager()
|
||||
.findFragmentById(R.id.fragment_content);
|
||||
|
||||
fragment.reload(recipients, threadId);
|
||||
|
||||
// initializeConversationAdapter();
|
||||
this.recipientsPanel.setVisibility(View.GONE);
|
||||
initializeTitleBar();
|
||||
}
|
||||
|
@@ -47,8 +47,6 @@ public class ConversationFragment extends SherlockListFragment
|
||||
initializeResources();
|
||||
initializeListAdapter();
|
||||
registerForContextMenu(getListView());
|
||||
|
||||
getLoaderManager().initLoader(0, null, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -75,6 +73,13 @@ public class ConversationFragment extends SherlockListFragment
|
||||
return false;
|
||||
}
|
||||
|
||||
public void reload(Recipients recipients, long threadId) {
|
||||
this.recipients = recipients;
|
||||
this.threadId = threadId;
|
||||
|
||||
initializeListAdapter();
|
||||
}
|
||||
|
||||
private void handleCopyMessage(MessageRecord message) {
|
||||
String body = message.getBody();
|
||||
if (body == null) return;
|
||||
@@ -141,17 +146,15 @@ public class ConversationFragment extends SherlockListFragment
|
||||
|
||||
private void initializeListAdapter() {
|
||||
if (this.recipients != null && this.threadId != -1) {
|
||||
this.setListAdapter(new ConversationAdapter(recipients, threadId, getActivity(), masterSecret, new FailedIconClickHandler()));
|
||||
this.setListAdapter(new ConversationAdapter(recipients, threadId, getActivity(),
|
||||
masterSecret, new FailedIconClickHandler()));
|
||||
getLoaderManager().initLoader(0, null, this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Loader<Cursor> onCreateLoader(int arg0, Bundle arg1) {
|
||||
if (this.threadId != -1) {
|
||||
return new ConversationLoader(getActivity(), threadId);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
return new ConversationLoader(getActivity(), threadId);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user