Ok here is a relatively simple, Free to use, library that utilizes the Hover gesture. This is what is used by Samsung to create their 'Air View' on the S4 and I believe the Note 2 and some Note tabs. I also believe this works on 1 or 2 SONY models, but not sure which ones. Hopefully more devices will support in future.
The release is v1.00 but the code is still the same as the beta as no problems were raised.
Update: v 1.1:
It was reported to me that on earlier versions (I'm assuming < 14), a NoClassDefFoundError occurred. I have amended the library to solve this issue.
Thanks to @mcmanu for reporting
There is only one method and 3 raised events.
AirView
Author: BarxDroid
Version: 1.10
To install, simply unpack and copy the .jar and .xml to libs folder as usual.
You must edit the manifest and add the following code:
There is a demo project added below too to demonstrate the usage. I have updated the code a tiny bit compared to the beta demo, just to make the placement of the panel shown on the button hover prettier.
Notes:
The x, y, co-ordinates returned are relative to the assigned view, not the activity.
The device HAS to support the Hover gesture. To my knowledge the only device that support are the Samsung AirView compatible devices. S4, Note 2 (think Note too but not 100%) and some Sammy tabs). Please report compatibility to help others.
As always, any questions, ask away. All feedback welcome, Good or Bad
Source Code available Here
The release is v1.00 but the code is still the same as the beta as no problems were raised.
Update: v 1.1:
It was reported to me that on earlier versions (I'm assuming < 14), a NoClassDefFoundError occurred. I have amended the library to solve this issue.
Thanks to @mcmanu for reporting
There is only one method and 3 raised events.
AirView
Author: BarxDroid
Version: 1.10
- AirViewListener
Events:- HoverEnd (x as Float As , y as Float As )
- HoverMove (x as Float As , y as Float As )
- HoverStart (x as Float As , y as Float As )
- Initialize (view As View, Eventname As String)
Initializes a Hover Listener against a given View.
View - The View that will react to the Hover event
EventName - The sub that will handle the events
Be sure to add the following to the manifest using the Manifest Editor:-
AddActivityText(Main, <intent-filter>
<action android:name="com.sec.android.airview.HOVER" />
</intent-filter>)
To install, simply unpack and copy the .jar and .xml to libs folder as usual.
You must edit the manifest and add the following code:
B4X:
AddActivityText(Main, <intent-filter>
<action android:name="com.sec.android.airview.HOVER" />
</intent-filter>)
There is a demo project added below too to demonstrate the usage. I have updated the code a tiny bit compared to the beta demo, just to make the placement of the panel shown on the button hover prettier.
Notes:
The x, y, co-ordinates returned are relative to the assigned view, not the activity.
The device HAS to support the Hover gesture. To my knowledge the only device that support are the Samsung AirView compatible devices. S4, Note 2 (think Note too but not 100%) and some Sammy tabs). Please report compatibility to help others.
As always, any questions, ask away. All feedback welcome, Good or Bad
Source Code available Here
Attachments
Last edited: