【问题标题】:Get Do Not Disturb settings获取请勿打扰设置
【发布时间】:2014-04-14 07:24:20
【问题描述】:

是否可以在 Pebble 表盘中检索“请勿打扰”设置?我想知道我的表盘何时应该停止通知用户,但仅限于 DND 开启时。我想也有可能获得 24/12 小时模式?

【问题讨论】:

    标签: pebble-watch pebble-sdk


    【解决方案1】:

    看起来像you cannot currently access the Do Not Disturb setting:

    我想知道是否可以访问在 Pebble 的“设置”菜单中做出的一些用户选择。 我对通知/请勿打扰设置特别感兴趣,因此我可以防止我的应用在用户不想收到任何通知时振动。

    目前没有,没有。你应该在这里推荐它:http://pages.getpebble.com/pages/suggestions,这样 Pebble 团队就会知道很多开发者都想要它。

    您可能值得添加遵循该建议并将其推荐给 Pebble。如果我们有足够多的人要求它,我们最终可能会得到它。

    至于 12 / 24 小时偏好,您可以使用 bool clock_is_24_style(),如 feature_clock_mode 示例 watchapp 所示:

    static void init() {
      window = window_create();
      window_stack_push(window, true /* Animated */);
    
      Layer *window_layer = window_get_root_layer(window);
      GRect bounds = layer_get_frame(window_layer);
      text_layer = text_layer_create((GRect){ .origin = { 0, 30 }, .size = bounds.size });
    
      // Here you go!
      text_layer_set_text(text_layer, clock_is_24h_style() ? "Mode:\n24" : "Mode:\n12");
    
      text_layer_set_font(text_layer, fonts_get_system_font(FONT_KEY_BITHAM_42_LIGHT));
      text_layer_set_text_alignment(text_layer, GTextAlignmentCenter);
      layer_add_child(window_layer, text_layer_get_layer(text_layer));
    }
    

    【讨论】:

    • 哦,那太可惜了,我也在 Pebble 建议页面上提出了建议。并感谢您找到该链接(我的 Google-fu 失败了)。也是完美的例子,谢谢!
    • @James,同意了,我也申请了这个功能。 FWIW,Modern watchface 让用户设置一个面部专用的请勿打扰时段。不理想,但它是一种实用的解决方法。
    • 我正在开发Purr,最常被请求的功能之一是免打扰,所以我希望避免编写自己的版本。但再次感谢克里斯 :)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-24
    • 2015-10-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多