-
-
Notifications
You must be signed in to change notification settings - Fork 268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proximity detection of a specific distance #14
Comments
|
Doesn't seem to have any influence on my device. I variegated with the value, but the threshold was still around 2 cm / as without any float value. |
Weird, according to the Android Developer documentation the sensor usually returns the distance in cm so calling |
I only have one device, a Nexus 6P. With a float value of 10, the onFar Method is not even triggered anymore. (The onNear method is still triggered, but at the same distance, as without a threshold input at all.) Which device do you have? |
Closing this issue as there isn't any direct possible solution to getting proximity updates from the proximity sensor.i.e it's a hardware limitation on what kind of proximity sensor a device has. A possible solution can be using the camera to measure the distance but that's a far-fetched solution taking into account what the goals of the library are now. If in future it makes sense, will open up a new issue for the same. |
In my use case I need to trigger a special event at a customizable distance. The onNear and onFar methods work incredibly good. But the distance, when these are triggers, is too low for my use case.
There are 2 options I thought of.
A onDistance method, which will be triggered at a specific distance, which was defined/ set before.
No additional method, just changing the distance when onNear and onFar are triggered. This is actually my preferred option, since it keeps the behavior of the onNear and onFar methods but the trigger event can be placed at a specific distance. That would be pretty nice.
In my use case, a distance of between (around) 4 -15 cm must be set. Though that distance must be set dynamically.
I hope it's understandable. Thank you very much in advance.
This library is really amazing - fantastic work!
Edited my comment for a better tangibility.
The text was updated successfully, but these errors were encountered: