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

Add possibility to change overlay window gravity #347

Closed
gercee opened this issue Jul 7, 2022 · 2 comments
Closed

Add possibility to change overlay window gravity #347

gercee opened this issue Jul 7, 2022 · 2 comments
Assignees
Labels
Released Released already on the latest version.

Comments

@gercee
Copy link

gercee commented Jul 7, 2022

Is your feature request related to a problem?
Yes

The overlay window gravity is always centered, and we do have a need to have it positioned at the top.

Describe the solution you'd like:

We did local testing by adding the parameter into the builder and using the current gravity Gravity.CENTER as default and introduced another setter to be able to change it. And this doesn't break the current functionality and add extra possibility to configure the overlay needed for other use-cases.

@set:JvmSynthetic
public var overlayGravity: Int = Gravity.CENTER
/** sets the balloon overlay gravity. */
public fun setOverlayGravity(gravity: Int): Builder = apply {
  this.overlayGravity = gravity
}
private fun showOverlayWindow(vararg anchors: View) {
  if (builder.isVisibleOverlay) {
    val mainAnchor = anchors[0]
    if (anchors.size == 1) {
      overlayBinding.balloonOverlayView.anchorView = mainAnchor
    } else {
      overlayBinding.balloonOverlayView.anchorViewList = anchors.toList()
    }
    overlayWindow.showAtLocation(mainAnchor, builder.overlayGravity, 0, 0)
  }
}

A clear and concise description of what you want to happen.

The requirement is to use the keyboard while the tooltip is open. We are resizing the overlay window and we want the overlay gravity to stick to the top and not to the center.

@skydoves skydoves self-assigned this Jul 16, 2022
skydoves added a commit that referenced this issue Jul 16, 2022
Add the possibility to change overlay window gravity (#347)
@skydoves skydoves added the Release Next This feature will be released on next version label Jul 16, 2022
@skydoves
Copy link
Owner

Hey @gercee, thank you for reporting and suggesting this issue.
It's available on version 1.4.7-SNAPSHOT, and this will be shipped in the next release. Thanks!

@skydoves
Copy link
Owner

skydoves commented Aug 6, 2022

This has been released in version 1.4.7.

@skydoves skydoves closed this as completed Aug 6, 2022
@skydoves skydoves added Released Released already on the latest version. and removed Release Next This feature will be released on next version labels Aug 6, 2022
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