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
Post a Comment