6

I am wondering how the Android Wear launchers like Swipify and Wear Mini Launcher intercept touch events on the android wear home screen.

I have tried adding the onTouch and onClick listeners to the Watch View Stub in my app so far, but I can not figure out how to get touches that occur outside of my app.

user3771655
  • 185
  • 1
  • 10

1 Answers1

5

In fact, the views are directly added in the WindowManager in a Service. You can take a look at this thread to understand how it works: Creating a system overlay window (always on top)

Be careful, there is an issue in the Moto 360 system at this time as explained here: https://plus.google.com/u/0/113671876130843889747/posts/9bqUcdgZnNb You will have to use the WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR flag to avoid the bottom space. By the way, you can also take a look at the code I gave in this post to understand how overlaying works. Direct link: https://github.com/PomepuyN/WatchviewStubIssue

Community
  • 1
  • 1
Nicolas POMEPUY
  • 1,123
  • 9
  • 11
  • Hi Nicolas, do you think that you could help me here? Thanks. http://stackoverflow.com/questions/26496768/android-wear-overlay-pass-on-touch-events – user3771655 Oct 21 '14 at 21:35