1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-02-26 07:53:12 +00:00

Workaround Android bug

This commit is contained in:
M66B 2020-03-01 20:43:46 +01:00
parent 19e3241be2
commit f45145d225

View file

@ -20,6 +20,7 @@ package eu.faircode.email;
*/
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.util.AttributeSet;
@ -45,6 +46,7 @@ public class FixedTextView extends AppCompatTextView {
try {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
} catch (Throwable ex) {
Log.w(ex);
/*
java.lang.ArrayIndexOutOfBoundsException: length=...; index=...
at android.text.TextLine.measure(TextLine.java:316)
@ -58,6 +60,23 @@ public class FixedTextView extends AppCompatTextView {
}
}
@Override
protected void onDraw(Canvas canvas) {
try {
super.onDraw(canvas);
} catch (Throwable ex) {
Log.w(ex);
/*
java.lang.ArrayIndexOutOfBoundsException: length=74; index=74
at android.text.TextLine.draw(TextLine.java:241)
at android.text.Layout.drawText(Layout.java:545)
at android.text.Layout.draw(Layout.java:289)
at android.widget.TextView.onDraw(TextView.java:6972)
at android.view.View.draw(View.java:19380)
*/
}
}
@Override
protected void onFocusChanged(boolean focused, int direction, Rect previouslyFocusedRect) {
try {