Closed danielchh closed 5 years ago
I've tested on Nexus 6P, Samsung S8+, Pixel 2 and it works fine. But on OnePlus 6 the tooltip will always appear a bit lower (like 40 dp lower). I guess it's because of unusual aspect ratio.
Here is a code I'm using. `
<item name="ttlm_strokeColor">@color/gray</item> <item name="ttlm_backgroundColor">@color/white</item> <item name="ttlm_strokeWeight">1dp</item> <item name="ttlm_cornerRadius">5dp</item> <item name="ttlm_overlayStyle">@style/ToolTipOverlay</item> </style>
`
private fun showInfoBubble(at: View, messageId: Int) { val message = resources.getText(messageId) Tooltip.Builder(at.context) .anchor(at) .text(message) .maxWidth(resources.getDimension(R.dimen.bubble_width).toInt()) .styleId(R.style.ToolTipStyle) .arrow(false) .closePolicy(ClosePolicy.TOUCH_ANYWHERE_CONSUME) .create() .show(view!!, Tooltip.Gravity.LEFT, false) }
This happens with every gravity I'm using.
yeah, I see the problem too
actually it looks like an API issue more than the device aspect ratio
I've tested on Nexus 6P, Samsung S8+, Pixel 2 and it works fine. But on OnePlus 6 the tooltip will always appear a bit lower (like 40 dp lower). I guess it's because of unusual aspect ratio.
Here is a code I'm using. `
`
private fun showInfoBubble(at: View, messageId: Int) { val message = resources.getText(messageId) Tooltip.Builder(at.context) .anchor(at) .text(message) .maxWidth(resources.getDimension(R.dimen.bubble_width).toInt()) .styleId(R.style.ToolTipStyle) .arrow(false) .closePolicy(ClosePolicy.TOUCH_ANYWHERE_CONSUME) .create() .show(view!!, Tooltip.Gravity.LEFT, false) }
This happens with every gravity I'm using.