Giter VIP home page Giter VIP logo

Comments (11)

Waboodoo avatar Waboodoo commented on July 24, 2024 2

Cool. I tried 1.1.8-alpha02 and it seems to fix my issue 👍. Thanks

from balloon.

gastsail avatar gastsail commented on July 24, 2024 1

This also worked for me !

from balloon.

Waboodoo avatar Waboodoo commented on July 24, 2024 1

Thanks. I will try it out in my app once I have the time 👍

from balloon.

mck182 avatar mck182 commented on July 24, 2024

This would be fantastic to have! 👍

I just wanted to add - the arrow should also switch
sides if the tooltip is rendered above or below the
anchor view, depending on the available space.

So for example, if the tooltip is shown by using
showAlignBottom(..) but it's actually shown
on top of the view due to the space constraints,
the arrow should switch as well.

from balloon.

gavingt avatar gavingt commented on July 24, 2024

This would be great. I'm not using the arrows at all currently because the place they point to is inconsistent.

from balloon.

skydoves avatar skydoves commented on July 24, 2024

Hi guys!
I think the suggestion looks good for positioning easier based on an anchor, so I implemented a ArrowConstraints functionality.

/**
 * ArrowConstraints determines the constraints of the arrow positioning.
 * [ArrowConstraints.ALIGN_BALLOON]: aligning based on the balloon.
 * [ArrowConstraints.ALIGN_ANCHOR]: aligning based on the anchor.
 */
enum class ArrowConstraints {
  /** Aligning based on the balloon. */
  ALIGN_BALLOON,

  /** Aligning based on the anchor. */
  ALIGN_ANCHOR
}

You can use like below:

setArrowConstraints(ArrowConstraints.ALIGN_ANCHOR)

Please check out the new feature works well in your environments. The version is 1.1.8-alpha01.

Download

from balloon.

Waboodoo avatar Waboodoo commented on July 24, 2024

I tried out 1.1.8-alpha01. The arrow placement seems to work fine in general, but I'm encountering a problem when trying to have the arrow point at a menu item in a toolbar (I'm using androidx.appcompat.widget.Toolbar from androidx.appcompat:appcompat:1.2.0-alpha01). In that case, the arrow position is off.

Here's a screenshot (I'm trying to have the arrow point at the item with the red background):
Screenshot from 2020-06-14 18-21-41

This is the code I use to show the balloon:

val menuItemView = toolbar.findViewById<View>(R.id.my_menu_item)
Balloon.Builder(context)
    .setText("Click here to get started. It's gonna be fun!")
    .setPadding(16)
    .setTextSize(14f)
    .setArrowConstraints(ArrowConstraints.ALIGN_ANCHOR)
    .setArrowOrientation(ArrowOrientation.TOP)
    .build()
    .showAlignBottom(menuItemView)

This might just be an oddness caused by the toolbar view.

from balloon.

skydoves avatar skydoves commented on July 24, 2024

@Waboodoo
Hi, thanks for checking it!
I just released another version 1.1.8-alpha02, the problem seems that the actual position of x should be calculated on the basis of the screen. I will also keep debugging use this new version :)

from balloon.

skydoves avatar skydoves commented on July 24, 2024

@Waboodoo
This issue is included in the new version 1.1.8 !
Thank you for your issue :)

from balloon.

znakeeye avatar znakeeye commented on July 24, 2024

I'm experiencing this toolbar offset problem with version 1.1.9.

From within my fragment, I get hold of the anchor view like this:

final View button = requireActivity().findViewById(R.id.menu_item_settings);        

Could it be that I call setSupportActionBar(myToolbar) in my activity?

from balloon.

4shutosh avatar 4shutosh commented on July 24, 2024

If anyone is wondering, It's ArrowPositionRules in the latest versions.

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.