简体   繁体   English

Android Wear:时钟下的Peek卡背景

[英]Android Wear: Peek card background under clocks

I am trying to build an analog version of "Simple" watch face. 我正在尝试构建“简单”表盘的模拟版本。 Example code is clear enough, I based my code on SweepWatchFaceService.java, but when I set .setBackgroundVisibility(WatchFaceStyle.BACKGROUND_VISIBILITY_PERSISTENT) on surface holder, it covers the clocks (canvas). 示例代码很清楚,我的代码基于SweepWatchFaceService.java,但是当我在表面支架上设置.setBackgroundVisibility(WatchFaceStyle.BACKGROUND_VISIBILITY_PERSISTENT)时,它覆盖了时钟(画布)。 Is there a simple way to render peek card background as a surface holder (watch face) background? 有没有一种简单的方法可以将窥视卡背景渲染为表面支架(表盘)背景?

It is not possible. 这不可能。

The watch face is rendered as a wallpaper, while the notification backgrounds are rendered inside the top activity. 表盘表面呈现为墙纸,而通知背景则呈现在top活动中。 As a results, the backgrounds are always over the watch face. 结果,背景总是覆盖在表盘上。

The reason you can show the digital watch face (if you set the WatchFaceStyle option) is because the top activity also renders that. 之所以可以显示数字表盘表面(如果设置了WatchFaceStyle选项),是因为顶部活动也将其呈现出来。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM