Comments (6)
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.
@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.
@sephiroth74 If it's ok, I could add this to the wiki section
from android-target-tooltip.
Added to wiki
from android-target-tooltip.
@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.
https://github.com/sephiroth74/android-target-tooltip/wiki/Close-Policy-Documentation
from android-target-tooltip.
Related Issues (20)
- Gravity.TOP not honored with fitToScreen=True HOT 4
- Not able to click outside HOT 1
- How to have multiple gravity to the tooltip? HOT 1
- Does this work with ConstrainLayout? HOT 1
- There is a problem when Show In Multi Fragments
- Unable to show double values HOT 1
- Fix tooltip issue in RTL layout HOT 4
- How to you use in Java? HOT 2
- not working with status bar
- Missing documentation
- Latest version (2.0.5) not published in Jitpack HOT 1
- Positioning issues when upgrading from 1.x to 2.x
- Positioning Issue: Tip Window appear to be more bottom on Android 11 HOT 6
- Ripple effect is not animated in release build HOT 2
- How to set margin start
- Crashes when loading animation
- Type inference failed at new kotlin version
- Dependencies arent working HOT 1
- Arrow located is wrong on landscape on Samsung S10 API 31 HOT 1
- Stop Floating Animation of tooltip view
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-target-tooltip.