Giter VIP home page Giter VIP logo

Comments (4)

kashifo avatar kashifo commented on May 19, 2024 1

If you set tooltip on rootView like this, it'll hide automatically when parent view is not visible.
ViewTooltip.on(context, relView, imgDot)...

from viewtooltip.

tronious avatar tronious commented on May 19, 2024

I added the following to the ViewTooltip class.

public class ViewTooltip {
    private static ArrayList<TooltipView> allToolTips = new ArrayList<>();
    public static void hideAllVisibleToolTips() {
        for (TooltipView tip: allToolTips) {
            tip.removeNow();
        }
    }

then in the Tooltip constructor I added (right above setWithShadow(true);)

**allToolTips.add(TooltipView.this);**
You can then call this function ViewTooltip.hideAllVisibleToolTips() when navigating away from your fragment.

It works well for me.

from viewtooltip.

kalyandechiraju avatar kalyandechiraju commented on May 19, 2024

Nice! In which version will this be available?

I am currently using 1.1.5 and I solved it in a dirty way by saving the instance of tooltip as a member variable in Fragment instead of local. So that on certain events I can check if it's not null and call closeNow on it.

from viewtooltip.

tronious avatar tronious commented on May 19, 2024

I didnt have any plans to push the change. Someone is welcome to if they'd like.

What I wrote above is really everything that's needed to make it work.

Whenever I load a new fragment I just call

ViewTooltip.hideAllVisibleTooltips()

In my code and they get removed.

from viewtooltip.

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.