Open hscissors opened 5 years ago
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) }
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.