mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-27 02:07:42 +00:00
scroll to the new message in conversation
// FREEBIE
This commit is contained in:
parent
33000582ed
commit
216446c55b
@ -1060,17 +1060,16 @@ public class ConversationActivity extends PassphraseRequiredSherlockFragmentActi
|
|||||||
this.recipients = recipients;
|
this.recipients = recipients;
|
||||||
this.threadId = threadId;
|
this.threadId = threadId;
|
||||||
|
|
||||||
if (refreshFragment) {
|
ConversationFragment fragment = (ConversationFragment) getSupportFragmentManager()
|
||||||
ConversationFragment fragment
|
|
||||||
= (ConversationFragment)this.getSupportFragmentManager()
|
|
||||||
.findFragmentById(R.id.fragment_content);
|
.findFragmentById(R.id.fragment_content);
|
||||||
|
if (refreshFragment) {
|
||||||
fragment.reload(recipients, threadId);
|
fragment.reload(recipients, threadId);
|
||||||
|
|
||||||
this.recipientsPanel.setVisibility(View.GONE);
|
this.recipientsPanel.setVisibility(View.GONE);
|
||||||
initializeTitleBar();
|
initializeTitleBar();
|
||||||
initializeSecurity();
|
initializeSecurity();
|
||||||
}
|
}
|
||||||
|
fragment.scrollToBottom();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendMessage(boolean forcePlaintext) {
|
private void sendMessage(boolean forcePlaintext) {
|
||||||
|
@ -17,6 +17,7 @@ import android.view.MenuItem;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.CursorAdapter;
|
import android.widget.CursorAdapter;
|
||||||
|
import android.widget.ListView;
|
||||||
|
|
||||||
import com.actionbarsherlock.app.SherlockListFragment;
|
import com.actionbarsherlock.app.SherlockListFragment;
|
||||||
|
|
||||||
@ -104,6 +105,16 @@ public class ConversationFragment extends SherlockListFragment
|
|||||||
initializeListAdapter();
|
initializeListAdapter();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void scrollToBottom() {
|
||||||
|
final ListView list = getListView();
|
||||||
|
list.post(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
list.setSelection(getListAdapter().getCount() - 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private void handleCopyMessage(MessageRecord message) {
|
private void handleCopyMessage(MessageRecord message) {
|
||||||
String body = message.getDisplayBody().toString();
|
String body = message.getDisplayBody().toString();
|
||||||
if (body == null) return;
|
if (body == null) return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user