android-target-tooltip icon indicating copy to clipboard operation
android-target-tooltip copied to clipboard

Does this work with ConstrainLayout?

Open hscissors opened this issue 6 years ago • 1 comments

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.

hscissors avatar Aug 28 '19 23:08 hscissors

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) }

code-mantis avatar Apr 16 '20 11:04 code-mantis