Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does this work with ConstrainLayout? #140

Open
hscissors opened this issue Aug 28, 2019 · 1 comment
Open

Does this work with ConstrainLayout? #140

hscissors opened this issue Aug 28, 2019 · 1 comment

Comments

@hscissors
Copy link

I'm spiking this library right now and every time I built the tooltip and anchor it to a view in a constraint layout, the tooltip only appears in the top left corner of the screen.

@code-mantis
Copy link

It works everywhere, you just have to make sure the view (u are attaching the tooltip to) is already created and it's coordinates, height and width is calculated so the library can display the tooltip in the correct place.. simply put the ToolTip code in [view you are attaching to].post{}, like this:

img_category.post {
Tooltip.Builder(img_category.context)
.anchor(img_category,0,0 ,false)
.text(resources.getString(R.string.lbl_change_img))
.arrow(true)
.floatingAnimation(Tooltip.Animation.SLOW)
.closePolicy(ClosePolicy.TOUCH_NONE)
.overlay(false)
.create()
.doOnHidden { }
.doOnFailure { }
.doOnShown { }
.show(img_category, Tooltip.Gravity.BOTTOM, false)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants