How can I get touch input on Android Wear with OpenGL (Gles2WatchFaceService)? -


i developing watch face android wear. in order have smooth graphics, switched conventional canvas drawing opengl (i. e., canvaswatchfaceservice gles2watchfaceservice). touch input, using

    @override     public void ontapcommand(int taptype, int x, int y, long eventtime) { ... } 

that doesn't seem work under gles2watchfaceservice. how can still touch input?

i found it. style of face watch needs set accordingly (setacceptstapevents) in oncreate function:

    @override     public void oncreate(surfaceholder surfaceholder) {          super.oncreate(surfaceholder);          setwatchfacestyle(new watchfacestyle.builder(cronosurfglwatchface.this)                 ...                 .setacceptstapevents(true) // <== here!!                 ...                 .build());         ...     } 

it same canvaswatchfaceservice. reason, lost style setting while changed code canvas opengl.


Comments

Popular posts from this blog

testing - Detect whether test has failed within fixture -

AbotX : How do you create a parallel crawler that stays on and can be added to at run time from new requests -

android - Create single AAR file from multiple modules using Gradle -