mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-03 08:32:34 +00:00
Fix log submission OOM, improve log scrolling.
We were getting a TransactionTooLargeException when giving an EditText a very large (1.5MB+) text block. This has been resolved by switching to a RecyclerView to show the text line-by-line. As a side-effect, this improves scroll performance on lower-end devices. Also, I added a button to jump to the bottom of the log because I really wanted one :) Fixes #8124
This commit is contained in:
@@ -6,8 +6,6 @@ import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.widget.TextView;
|
||||
|
||||
import org.thoughtcrime.securesms.PassphraseRequiredActionBarActivity;
|
||||
@@ -104,53 +102,37 @@ public class ContactNameEditActivity extends PassphraseRequiredActionBarActivity
|
||||
|
||||
givenName.addTextChangedListener(new SimpleTextWatcher() {
|
||||
@Override
|
||||
void onTextChanged(String text) {
|
||||
public void onTextChanged(String text) {
|
||||
viewModel.updateGivenName(text);
|
||||
}
|
||||
});
|
||||
|
||||
familyName.addTextChangedListener(new SimpleTextWatcher() {
|
||||
@Override
|
||||
void onTextChanged(String text) {
|
||||
public void onTextChanged(String text) {
|
||||
viewModel.updateFamilyName(text);
|
||||
}
|
||||
});
|
||||
|
||||
middleName.addTextChangedListener(new SimpleTextWatcher() {
|
||||
@Override
|
||||
void onTextChanged(String text) {
|
||||
public void onTextChanged(String text) {
|
||||
viewModel.updateMiddleName(text);
|
||||
}
|
||||
});
|
||||
|
||||
prefix.addTextChangedListener(new SimpleTextWatcher() {
|
||||
@Override
|
||||
void onTextChanged(String text) {
|
||||
public void onTextChanged(String text) {
|
||||
viewModel.updatePrefix(text);
|
||||
}
|
||||
});
|
||||
|
||||
suffix.addTextChangedListener(new SimpleTextWatcher() {
|
||||
@Override
|
||||
void onTextChanged(String text) {
|
||||
public void onTextChanged(String text) {
|
||||
viewModel.updateSuffix(text);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static abstract class SimpleTextWatcher implements TextWatcher {
|
||||
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) { }
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
onTextChanged(s.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) { }
|
||||
|
||||
abstract void onTextChanged(String text);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package org.thoughtcrime.securesms.contactshare;
|
||||
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
|
||||
public abstract class SimpleTextWatcher implements TextWatcher {
|
||||
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) { }
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
onTextChanged(s.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) { }
|
||||
|
||||
public abstract void onTextChanged(String text);
|
||||
}
|
||||
Reference in New Issue
Block a user