Android的磨损启动 [英] Android Wear Launcher

查看:206
本文介绍了Android的磨损启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道的Andr​​oid Wear发射像Swipify以及如何穿迷你发射器的 Android的磨损主屏幕上截取的触摸事件

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

我曾尝试加入onTouch和的onClick监听器监视查看存根在我的应用程序,到目前为止,但我想不出如何让我的应用程序外面发生接触。

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.

推荐答案

其实,意见直接添加在窗口管理器服务。 你可以看看这个线程,以了解它是如何工作的:<一href="http://stackoverflow.com/questions/4481226/creating-a-system-overlay-window-always-on-top">Creating系统覆盖窗口(总在最前)

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)

要小心,有这个时间是在摩托360系统中的问题,因为在这里解释:<一href="https://plus.google.com/u/0/113671876130843889747/posts/9bqUcdgZnNb">https://plus.google.com/u/0/113671876130843889747/posts/9bqUcdgZnNb 你将不得不使用 WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR 标志,以免底部空间。顺便说一句,你也可以看看在code我放弃这个职位,以了解覆盖工作。直接链接:<一href="https://github.com/PomepuyN/WatchviewStubIssue">https://github.com/PomepuyN/WatchviewStubIssue

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

这篇关于Android的磨损启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆