Skip to content

TapTarget on recycler view item not working #141

@benzabill

Description

@benzabill
  • [ Yes] I have verified the issue exists on the latest version
  • [ Yes] I am able to reproduce it

Version used: 1.8

Does tap target work on recycler view item? The stacktrace (if you click into the code) shows that the width is -230, which is less than 0. But both the width and measured width are actually 1022.

I'm pulling the view through
View view = linearLayoutManager.findViewByPosition(position);
and passing it through if it's not null. I know the view is viable because I used an animation library (YoYo, an animation library on github) on this same view and it does work on it properly.

Does recycler view do something funky here?

Stack trace:
03-01 14:57:34.025 25215-25215/bentseytlin.lovetap E/AndroidRuntime: FATAL EXCEPTION: main
Process: bentseytlin.lovetap, PID: 25215
java.lang.IllegalArgumentException: Layout: -230 < 0
at android.text.Layout.(Layout.java:182)
at android.text.StaticLayout.(StaticLayout.java:478)
at android.text.StaticLayout.(StaticLayout.java:464)
at android.text.StaticLayout.(StaticLayout.java:442)
at android.text.StaticLayout.(StaticLayout.java:422)
at com.getkeepsafe.taptargetview.TapTargetView.updateTextLayouts(TapTargetView.java:824)
at com.getkeepsafe.taptargetview.TapTargetView$9.onGlobalLayout(TapTargetView.java:427)
at android.view.ViewTreeObserver.dispatchOnGlobalLayout(ViewTreeObserver.java:912)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2106)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1254)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6337)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:874)
at android.view.Choreographer.doCallbacks(Choreographer.java:686)
at android.view.Choreographer.doFrame(Choreographer.java:621)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:860)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

Android version:
7.1.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions