florent37 / ViewTooltip

A fluent tooltip for Android
Apache License 2.0
1.08k stars 131 forks source link

error boolean android.view.View.getGlobalVisibleRect #67

Open fabrizziocht opened 5 years ago

fabrizziocht commented 5 years ago

I'm using version 1.2.1, so after run application appears its error: E/AndroidRuntime: FATAL EXCEPTION: main Process: com.webcontrol.earlyalert, PID: 17720 java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.view.View.getGlobalVisibleRect(android.graphics.Rect, android.graphics.Point)' on a null object reference at com.github.florent37.viewtooltip.ViewTooltip$3.run(ViewTooltip.java:177) at android.os.Handler.handleCallback(Handler.java:789) at android.os.Handler.dispatchMessage(Handler.java:98) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6940) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374) with previous version runs, but the tooltip not match with the layout on right or left side #64

fabrizziocht commented 5 years ago

I must pass a root view in method ".on":

ViewTooltip .on(this, base_main, btn_sync) .autoHide(true, 3000) .corner(30) .position(ViewTooltip.Position.LEFT) .text("TEST") .show() the position works well, but after fade out appears again for a second.

sanedev commented 5 years ago

Fixed Bug, and a Create PullRequest just now, Thanks. Changes: References a rootView directly -> References a decorView.