Smalesy
Smalesy

Reputation: 599

How can I pan a webview in google glass

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.

Upvotes: 4

Views: 857

Answers (3)

Smalesy
Smalesy

Reputation: 599

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

Upvotes: 0

Joe B
Joe B

Reputation: 596

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

Upvotes: 0

JRomero
JRomero

Reputation: 4868

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.

Upvotes: 1

Related Questions