Workaround Android bug

pull/175/head
M66B 5 years ago
parent ec7df34e07
commit 74aad4f59f

@ -40,6 +40,24 @@ public class FixedTextView extends AppCompatTextView {
super(context, attrs, defStyleAttr); super(context, attrs, defStyleAttr);
} }
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
try {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
} catch (Throwable ex) {
/*
java.lang.ArrayIndexOutOfBoundsException: length=...; index=...
at android.text.TextLine.measure(TextLine.java:316)
at android.text.TextLine.metrics(TextLine.java:271)
at android.text.Layout.measurePara(Layout.java:2056)
at android.text.Layout.getDesiredWidth(Layout.java:164)
at android.widget.TextView.onMeasure(TextView.java:8291)
at androidx.appcompat.widget.AppCompatTextView.onMeasure(SourceFile:554)
at android.view.View.measure(View.java:22360)
*/
}
}
@Override @Override
protected void onFocusChanged(boolean focused, int direction, Rect previouslyFocusedRect) { protected void onFocusChanged(boolean focused, int direction, Rect previouslyFocusedRect) {
try { try {

Loading…
Cancel
Save