|
|
@ -26,11 +26,14 @@ import android.graphics.drawable.Drawable;
|
|
|
|
import android.net.Uri;
|
|
|
|
import android.net.Uri;
|
|
|
|
import android.os.Build;
|
|
|
|
import android.os.Build;
|
|
|
|
import android.os.Bundle;
|
|
|
|
import android.os.Bundle;
|
|
|
|
|
|
|
|
import android.os.Parcel;
|
|
|
|
|
|
|
|
import android.os.Parcelable;
|
|
|
|
import android.text.Html;
|
|
|
|
import android.text.Html;
|
|
|
|
import android.text.SpannableStringBuilder;
|
|
|
|
import android.text.SpannableStringBuilder;
|
|
|
|
import android.text.Spanned;
|
|
|
|
import android.text.Spanned;
|
|
|
|
import android.text.style.QuoteSpan;
|
|
|
|
import android.text.style.QuoteSpan;
|
|
|
|
import android.util.AttributeSet;
|
|
|
|
import android.util.AttributeSet;
|
|
|
|
|
|
|
|
import android.view.View;
|
|
|
|
import android.view.inputmethod.EditorInfo;
|
|
|
|
import android.view.inputmethod.EditorInfo;
|
|
|
|
import android.view.inputmethod.InputConnection;
|
|
|
|
import android.view.inputmethod.InputConnection;
|
|
|
|
|
|
|
|
|
|
|
@ -65,6 +68,19 @@ public class EditTextCompose extends FixedEditText {
|
|
|
|
Helper.setKeyboardIncognitoMode(this, context);
|
|
|
|
Helper.setKeyboardIncognitoMode(this, context);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public Parcelable onSaveInstanceState() {
|
|
|
|
|
|
|
|
Parcelable superState = super.onSaveInstanceState();
|
|
|
|
|
|
|
|
return new SavedState(superState, this.raw);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void onRestoreInstanceState(Parcelable state) {
|
|
|
|
|
|
|
|
SavedState savedState = (SavedState) state;
|
|
|
|
|
|
|
|
super.onRestoreInstanceState(savedState.getSuperState());
|
|
|
|
|
|
|
|
setRaw(savedState.getRaw());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
protected void onAttachedToWindow() {
|
|
|
|
protected void onAttachedToWindow() {
|
|
|
|
// Spellchecker workaround
|
|
|
|
// Spellchecker workaround
|
|
|
@ -270,4 +286,38 @@ public class EditTextCompose extends FixedEditText {
|
|
|
|
interface ISelection {
|
|
|
|
interface ISelection {
|
|
|
|
void onSelected(boolean selection);
|
|
|
|
void onSelected(boolean selection);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static class SavedState extends View.BaseSavedState {
|
|
|
|
|
|
|
|
private boolean raw;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private SavedState(Parcelable superState, boolean raw) {
|
|
|
|
|
|
|
|
super(superState);
|
|
|
|
|
|
|
|
this.raw = raw;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private SavedState(Parcel in) {
|
|
|
|
|
|
|
|
super(in);
|
|
|
|
|
|
|
|
raw = (in.readInt() != 0);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean getRaw() {
|
|
|
|
|
|
|
|
return this.raw;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void writeToParcel(Parcel destination, int flags) {
|
|
|
|
|
|
|
|
super.writeToParcel(destination, flags);
|
|
|
|
|
|
|
|
destination.writeInt(raw ? 1 : 0);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static final Parcelable.Creator<SavedState> CREATOR = new Creator<SavedState>() {
|
|
|
|
|
|
|
|
public SavedState createFromParcel(Parcel in) {
|
|
|
|
|
|
|
|
return new SavedState(in);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public SavedState[] newArray(int size) {
|
|
|
|
|
|
|
|
return new SavedState[size];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|