hanks-zyh / HTextView

Animation effects to text, not really textview
Apache License 2.0
5.62k stars 809 forks source link

fix: OnResume getLineLeft crash #105

Open kelifu opened 5 years ago

kelifu commented 5 years ago

Modify the source code of the ScaleText class

@Override public void drawFrame(Canvas canvas) { Layout layout = mHTextView.getLayout(); if (null != layout){ ········ } }

mark99i commented 4 years ago

the same problem in FallText.java:67

java.lang.NullPointerException: Attempt to invoke virtual method 'float android.text.Layout.getLineLeft(int)' on a null object reference
    at com.hanks.htextview.fall.FallText$3.run(FallText.java:67)
    at android.os.Handler.handleCallback(Handler.java:789)
    at android.os.Handler.dispatchMessage(Handler.java:98)
    at android.os.Looper.loop(Looper.java:171)
    at android.app.ActivityThread.main(ActivityThread.java:6699)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:246)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:783)

and may be in FallText.java:102