Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arrow is hidden behind Balloon #123

Closed
osrl opened this issue Nov 22, 2020 · 10 comments
Closed

Arrow is hidden behind Balloon #123

osrl opened this issue Nov 22, 2020 · 10 comments
Assignees
Labels
Released Released already on the latest version.

Comments

@osrl
Copy link

osrl commented Nov 22, 2020

Please complete the following information:

  • Library Version v1.2.5

Describe the Bug:

Arrow is hidden behind the balloon. I'm using the same example as "Create using kotlin dsl" section

screen

When I inspected the layout, I discovered that balloon_content's padding is 0, even if it's set on initializeBalloonContent function correctly.

Screen Shot 2020-11-22 at 19 42 36

Expected Behavior:

balloon_content's padding should be set correctly

@osrl
Copy link
Author

osrl commented Nov 23, 2020

One more note: custom layout's paddings are somehow removed too

@skydoves
Copy link
Owner

skydoves commented Nov 23, 2020

@osrl
Hmm... Hmm... Can you show me your implementation of the createBalloon ?
And is the same issue occur in the demo?

@osrl
Copy link
Author

osrl commented Nov 23, 2020

Sure, I got it from README and removed some irrelevant setup code.

val balloon = createBalloon(context) {
  setArrowSize(10)
  setWidthRatio(1.0f)
  setHeight(65)
  setArrowPosition(0.7f)
  setCornerRadius(4f)
  setAlpha(0.9f)
  setText("You can access your profile from now on.")
  setBackgroundColorResource(R.color.colorPrimary) //used a red color with alpha 
  setBalloonAnimation(BalloonAnimation.FADE)
  setLifecycleOwner(lifecycleOwner)
}

Also please note the two different colors on the balloon. I'm not sure why this happens. Layout inspector didn't even show the view with different color

@skydoves
Copy link
Owner

skydoves commented Nov 26, 2020

Um.. this is really difficult to track the issue.
Could you please create an example project?
I don't know exactly but I guess it depends on some theme styles in your project.

@osrl
Copy link
Author

osrl commented Nov 30, 2020

It really depends on my style. This happens when fitsSystemWindows is true. Also app theme is Theme.MaterialComponents.Light.DarkActionBar. I tried with the demo. Same issue occurs.

@skydoves
Copy link
Owner

skydoves commented Dec 1, 2020

Try this:

styles.xml

<style name="BalloonTheme" parent="Theme.AppCompat.Light">
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
    <item name="android:fitsSystemWindows">false</item>
  </style>

Balloon.Builder

val styledContext: Context = ContextThemeWrapper(context, R.style.BalloonTheme)

    return Balloon.Builder(styledContext)
      .setText("You can edit your profile now!")
      .setArrowSize(10)
      .setWidthRatio(1.0f)
      .setArrowConstraints(ArrowConstraints.ALIGN_ANCHOR)
      .setArrowPosition(0.5f)
      .setPadding(12)
      .setMarginRight(12)

@skydoves
Copy link
Owner

skydoves commented Dec 1, 2020

I feel the android:fitsSystemWindows attribute should be always false for this library, hence It will be included in the next release.
Thanks for your issue :)

@skydoves skydoves added the Release Next This feature will be released on next version label Dec 1, 2020
@skydoves skydoves self-assigned this Dec 1, 2020
@skydoves skydoves added Released Released already on the latest version. and removed Release Next This feature will be released on next version labels Dec 1, 2020
@skydoves
Copy link
Owner

skydoves commented Dec 1, 2020

@osrl

This issue is resolved in the new release 1.2.7.
Thanks for your issue :)

@skydoves
Copy link
Owner

skydoves commented Dec 8, 2020

@osrl
Any updates?

@osrl
Copy link
Author

osrl commented Dec 8, 2020

It's resolved thanks

@osrl osrl closed this as completed Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Released Released already on the latest version.
Projects
None yet
Development

No branches or pull requests

2 participants