Giter Site home page Giter Site logo

Comments (6)

Sulfkain avatar Sulfkain commented on August 22, 2024 2

Hello @whoyawn.
Ok, Thanks!
But don't you think we should update too the main wiki page?, but the users will not found this wiki documentation you created.

I have add the link on main wiki
https://github.com/sephiroth74/android-target-tooltip/wiki

I have edited the policy documentation too to explianed better, this could be even better if the explanation will be on a JavaDoc on code. Sorry but I don't have the time right now to make a PR about it.

from android-target-tooltip.

Sulfkain avatar Sulfkain commented on August 22, 2024

@stripathi669 I now this is reaaaally old, but well.. for future readers.

I was diving on the code and the fast documentation is on this code:

        override fun onTouchEvent(event: MotionEvent): Boolean {
            if (!isShowing || !isVisible || !mActivated) return false

            Timber.i("onTouchEvent: $event")
            Timber.d("event position: ${event.x}, ${event.y}")

            val r1 = Rect()
            mTextView.getGlobalVisibleRect(r1)
            val containsTouch = r1.contains(event.x.toInt(), event.y.toInt())

            if (mClosePolicy.anywhere()) {
                hide()
            } else if (mClosePolicy.inside() && containsTouch) {
                hide()
            } else if (mClosePolicy.outside() && !containsTouch) {
                hide()
            }

            return mClosePolicy.consume()
}

INSIDE => hides when clicked INSIDE the tooltip
OUTSIDE => hides when clicked OUTSIDE the tooltip
CONSUME=> Consume the click on the view, so no click is propagated to the rest of the view.
This has some weird behaviour, because if you set to
False -> when clicking will pass the touches too on the below views
True -> when you try to touch or do a gesture this will not act to your touches

So ANYWARE_CONSUME => hide on any touch and no elements below will be touched
INSIDE_NO_CONSUME => hide on click inside BUT the elements below will be clicked too (TOO WEIRD!)
and so on.

Hope this helps

from android-target-tooltip.

Sulfkain avatar Sulfkain commented on August 22, 2024

@sephiroth74 If it's ok, I could add this to the wiki section

from android-target-tooltip.

whoyawn avatar whoyawn commented on August 22, 2024

Added to wiki

from android-target-tooltip.

Sulfkain avatar Sulfkain commented on August 22, 2024

@whoyawn Could you please paste the link to the doc, because I cannot find it on the wiki space https://github.com/sephiroth74/android-target-tooltip/wiki

Thanks!

from android-target-tooltip.

whoyawn avatar whoyawn commented on August 22, 2024

https://github.com/sephiroth74/android-target-tooltip/wiki/Close-Policy-Documentation

from android-target-tooltip.

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.