表盘上的通知较小

时间:2014-08-18 08:45:15

标签: android wear-os

表面设置属性(标志?)如何在"小通知模式"中显示通知? - 如下:

enter image description here

而不是:

enter image description here

1 个答案:

答案 0 :(得分:1)

自从发布新的Android Wear Watchface API以来,这是可能的。要在CanvasWatchFaceService上延伸onCreate()的活动中执行此操作,请致电:

 setWatchFaceStyle(new WatchFaceStyle.Builder(AnalogWatchFaceService.this)
                .setCardPeekMode(WatchFaceStyle.PEEK_MODE_SHORT)
                ...
                .build());

setCardPeekMode(WatchFaceStyle.PEEK_MODE_SHORT)是那里的关键。它还可以显示更大的偷看卡 - WatchFaceStyle.PEEK_MODE_VARIABLE