4

I'm working on a Google Glass app that uses a webview.

In the standard Google Glass browser, you can place two fingers on the touchpad and move your head around to pan the webpage. It also overlays a crosshairs that can be used to select links.

I am trying to figure out if there is a way to programmatically enable the head controlled panning and display the cross hairs within a webview? Has anybody come across an api that allows this?

Any help will be most appreciated.

Smalesy
  • 591
  • 1
  • 7
  • 20

3 Answers3

1

That's a feature of the built in browser. You can request that such a feature be available in the GDK here otherwise I would suggest simply sending an intent to the built in browser.

JRomero
  • 4,878
  • 1
  • 27
  • 49
  • Thanks for the suggestion. Unfortunately I needed to keep control within the app so sending an intent to a browser was not a viable option. I did however follow your advice and submit a feature request to Google. – Smalesy Jan 09 '14 at 10:27
  • @Smalesy An accepted answer would be appreciated (and would help your stats too). – JRomero Jan 09 '14 at 19:06
0

As said above, this is a feature of the built-in browser. The default WebView doesn't have the cross-hairs overlay, nor does it detect Gestures. You may have to implement a GestureListener and have it send Javascript events using loadUrl().

Here's a link to the SDK For GestureListeners: https://developers.google.com/glass/develop/gdk/input/touch

Joe B
  • 596
  • 4
  • 11
0

Here is my workaround on how to do this: https://github.com/mikesmales/GoogleGlassCrosshairs

Smalesy
  • 591
  • 1
  • 7
  • 20