ViewTooltip
ViewTooltip copied to clipboard
Padding doesn't work
When adding padding as a parameter it has no effect whatsoever on the tooltips, it's like i never put them.
Hey @MohamedAkl1 did you make any progress with this? I'm running into a similar issue. Thanks
Hi @cgathergood, @MohamedAkl1 . I have the same problem, too.
However, you can set paddings earlier it will work.
here is my code
val tooltip = ViewTooltip.on(anchorView)
.text(text)
.textColor(ContextCompat.getColor(context, R.color.brown))
.textSize(TypedValue.COMPLEX_UNIT_SP, 14f)
.color(ContextCompat.getColor(context, R.color.white))
.corner(tooltipRadius)
.border(Color.black, 0f)
.padding(tooltipPadding, tooltipPadding, tooltipPadding, tooltipPadding)
.position(ViewTooltip.Position.RIGHT)
.autoHide(false, 10000)
.clickToHide(true)
.setTextGravity(Gravity.CENTER)
.distanceWithView(marginLeft.toInt())
.withShadow(true)
.animation(ViewTooltip.FadeTooltipAnimation(200))
.onHide {
hide()
}
this.tooltip = tooltip
The size of this tooltip will change.
@cgathergood it was long time ago i think that i used a custom layout for the tooltip to make it work as intended. you can try @YuanLiou 's solution it seems to be working on his end so maybe it will work i'm not sure.
Thanks @MohamedAkl1 @YuanLiou
Turns out setting the padding, earlier works as expected. Thanks for helping out!