mirror of https://github.com/M66B/FairEmail.git
Workaround word iterator bug Android <= M
This commit is contained in:
parent
30013fb22e
commit
637c97e2da
|
@ -24,6 +24,7 @@ import android.content.ClipboardManager;
|
|||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Rect;
|
||||
import android.os.Build;
|
||||
import android.text.Selection;
|
||||
import android.text.Spannable;
|
||||
import android.text.Spanned;
|
||||
|
@ -107,6 +108,20 @@ public class FixedTextView extends AppCompatTextView {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean dispatchTouchEvent(MotionEvent event) {
|
||||
// https://issuetracker.google.com/issues/37068143
|
||||
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.M &&
|
||||
hasSelection() &&
|
||||
event.getActionMasked() == MotionEvent.ACTION_DOWN) {
|
||||
CharSequence text = getText();
|
||||
setText(null);
|
||||
setText(text);
|
||||
}
|
||||
|
||||
return super.dispatchTouchEvent(event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent event) {
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue