You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello. I found out that when trying to load a String that ends with newline, AutoFitTextView crashes the app with a StringIndexOutOfBoundsException. This does not always happen, but I am able to reproduce this bug with the following string:
String test = "(WLAN)\n";
myAutoFitTextView.setText(test);
My app crashes when the settext is excecuted. Thanks for this library, it's really needed on the Android platform.
The full stacktrace follows:
java.lang.StringIndexOutOfBoundsException: length=7; index=7
at java.lang.String.indexAndLength(String.java:500)
at java.lang.String.charAt(String.java:494)
at com.lb.auto_fit_textview.AutoResizeTextView$1.onTestSize(AutoResizeTextView.java:89)
at com.lb.auto_fit_textview.AutoResizeTextView.binarySearch(AutoResizeTextView.java:227)
at com.lb.auto_fit_textview.AutoResizeTextView.superSetTextSize(AutoResizeTextView.java:219)
at com.lb.auto_fit_textview.AutoResizeTextView.adjustTextSize(AutoResizeTextView.java:213)
at com.lb.auto_fit_textview.AutoResizeTextView.onSizeChanged(AutoResizeTextView.java:251)
at android.view.View.sizeChange(View.java:15804)
at android.view.View.setFrame(View.java:15769)
at android.widget.TextView.setFrame(TextView.java:4661)
at android.view.View.layout(View.java:15685)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1703)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1557)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1466)
at android.view.View.layout(View.java:15689)
at android.view.ViewGroup.layout(ViewGroup.java:5040)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
at android.view.View.layout(View.java:15689)
at android.view.ViewGroup.layout(ViewGroup.java:5040)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1703)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1557)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1466)
at android.view.View.layout(View.java:15689)
at android.view.ViewGroup.layout(ViewGroup.java:5040)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1703)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1557)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1466)
at android.view.View.layout(View.java:15689)
at android.view.ViewGroup.layout(ViewGroup.java:5040)
at android.support.design.widget.CoordinatorLayout.layoutChild(CoordinatorLayout.java:1091)
at android.support.design.widget.CoordinatorLayout.onLayoutChild(CoordinatorLayout.java:801)
at android.support.design.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:815)
at android.view.View.layout(View.java:15689)
at android.view.ViewGroup.layout(ViewGroup.java:5040)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
at android.view.View.layout(View.java:15689)
at android.view.ViewGroup.layout(ViewGroup.java:5040)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1703)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1557)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1466)
at android.view.View.layout(View.java:15689)
at android.view.ViewGroup.layout(ViewGroup.java:5040)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
at android.view.View.layout(View.java:15689)
at android.view.ViewGroup.layout(ViewGroup.java:5040)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1703)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1557)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1466)
at android.view.View.layout(View.java:15689)
at android.view.ViewGroup.layout(ViewGroup.java:5040)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
at android.view.View.layout(View.java:15689)
at android.view.ViewGroup.layout(ViewGroup.java:5040)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2116)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1873)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1084)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5990)
at android.view.Choreographer$CallbackRecord.run(Choreographer
The text was updated successfully, but these errors were encountered:
Hello. I found out that when trying to load a String that ends with newline, AutoFitTextView crashes the app with a StringIndexOutOfBoundsException. This does not always happen, but I am able to reproduce this bug with the following string:
My app crashes when the settext is excecuted. Thanks for this library, it's really needed on the Android platform.
The full stacktrace follows:
The text was updated successfully, but these errors were encountered: