Giter VIP home page Giter VIP logo

Comments (4)

ivnsch avatar ivnsch commented on July 24, 2024 1

It works with showAlignTop, thanks!

from balloon.

skydoves avatar skydoves commented on July 24, 2024

setSpace sets the side space between popup and display.
It only works when used with widthRatio.

 /** sets the side space between popup and display. */
fun setSpace(@Dp value: Int): Builder = apply { this.space = context.dp2Px(value) }

You should use show the balloon with xOff and yOff.

balloon.show(anchor: View, xOff: Int, yOff: Int) // shows the balloon on an anchor view with x-off and y-off.
balloon.showAlignTop(anchor: View, xOff: Int, yOff: Int) // shows top alignment with x-off and y-off.
balloon.showAlignBottom(anchor: View, xOff: Int, yOff: Int) // shows bottom alignment with x-off and y-off.
balloon.showAlignRight(anchor: View, xOff: Int, yOff: Int) // shows right alignment with x-off and y-off.
balloon.showAlignLeft(anchor: View, xOff: Int, yOff: Int) // shows left alignment with x-off and y-off.

Same #28

from balloon.

ivnsch avatar ivnsch commented on July 24, 2024

Ok, I tried:

packageTitle.showBalloon(this, xOff = 0, yOff = yOffset)

With different values for yOffset, 5, -2, and the bubble always shows ~50dp to the bottom:

Screen Shot 2020-03-25 at 08 38 16

(In the screenshot I clicked the label "Mietwagenschutz")

I understand that I don't need to set widthRatio for yOff.

setArrowSize(10)
setHeight(65)
setDismissWhenTouchOutside(true)
setBackgroundColorResource(colorAccent)
setCornerRadius(15f)
setSpace(10)
setAlpha(1f)
setDismissWhenShowAgain(true)
setOnBalloonClickListener {
    onClick?.invoke()
}
setBalloonAnimation(ELASTIC)
setLifecycleOwner(lifecycleOwner)
setTextResource(text)
setPaddingLeft(10)
setPaddingRight(10)
setTextColorResource(white)

from balloon.

skydoves avatar skydoves commented on July 24, 2024

It seems you should use balloon.showAlignTop(anchor: View, xOff: Int, yOff: Int) // shows top alignment with x-off and y-off. with adjusting y-off. You can put a negative value of the y-off.

from balloon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.