Balloon icon indicating copy to clipboard operation
Balloon copied to clipboard

setArrowDrawable not show as expected arrow.

Open popeyee27 opened this issue 1 year ago • 6 comments

Please complete the following information:

  • Library Version: 1.5.3
  • Affected Device(s) : Oppo A92 (Android 11), Emulator Pixel XL (Android 13)

Describe the Bug: I try to custom tooltip arrow with .setArrowDrawable(ContextCompat.getDrawable(context, {drawable)) in my custom layout.

**The drawable with size 16x8 ** Screenshot 2566-06-14 at 15 09 18

However the arrow not show as expected. With setArrowDrawable(), It look like I only little round my arrow.

with setArrowDrawable Screenshot 2566-06-14 at 15 21 57

default Screenshot 2566-06-14 at 15 22 49

Expected Behavior: I has expected the arrow to like this no matter size of the balloon. Screenshot 2566-06-14 at 15 17 27

Should I fixed my arrow vector or set another thing? I already set setArrowPositionRules(ALIGN_ANCHOR), setArrowPosition(0.5f),setArrowOrientation(ArrowOrientation.TOP) and setArrowSize(12) before .setArrowDrawable()

popeyee27 avatar Jun 14 '23 08:06 popeyee27

The arrow must be decided by the size of your arrow. Would you able to increase the arrow size with setArrowSize(12) method?

skydoves avatar Jun 14 '23 09:06 skydoves

yes, no matter I call setArrowSize() before or after .setArrowDrawable(). I able to increase a size of arrow but it look like not my drawable arrow.

.setArrowDrawable(ContextCompat.getDrawable(context, {drawable}))
.setArrowSize(8)
Screenshot 2566-06-14 at 17 20 49
.setArrowSize(8)
.setArrowDrawable(ContextCompat.getDrawable(context,  {drawable}))
Screenshot 2566-06-14 at 17 22 30

only .setArrowDrawable(ContextCompat.getDrawable(context, {drawable})) Screenshot 2566-06-14 at 17 23 38

.setArrowSize(20)
.setArrowDrawable(ContextCompat.getDrawable(context,  {drawable}))
Screenshot 2566-06-14 at 17 24 24

popeyee27 avatar Jun 14 '23 10:06 popeyee27

ping, i think it's because the library will render it as a square, we have the same issue here.

As far as i know this is all related:

  • https://github.com/skydoves/Balloon/issues/227
  • https://github.com/skydoves/Balloon/discussions/216

alexanderfilipzik avatar Oct 06 '23 06:10 alexanderfilipzik

They guys thanks for raising this issue. I will take a look at this, but I believe it will take some time to resolve this issue since the squared-arrow size already has been used overall project. In the meantime, you can adjust your arrow image file as square or include some transparent padding on your image file itself following your preferences.

skydoves avatar Oct 07 '23 00:10 skydoves

I'm having the same issue. My design calls for an arrow with 28.dp width and 12.dp height. We tried doing the drawable trick of adding more padding top but this results on the Balloon popover being too far away from the target as you can see in this screenshot.

Hope we can have custom width and height!

Another possible solution is to be able to set negative padding between the arrow and the target to account for this empty space in the drawable. I tried setting setArrowAlignAnchorPadding or setArrowTopPadding with negative values but it just crashes.

Current behavior Expected
nubbin outline CleanShot 2023-12-13 at 15 54 20

SVG I am using:

popover_nub (2)

kikin81 avatar Dec 13 '23 23:12 kikin81

Facing the same issue. while I'm trying to add a border (include arrow)

codercoderme avatar Jan 23 '24 15:01 codercoderme