当前位置: 首页>>代码示例>>Java>>正文


Java PebbleTuple类代码示例

本文整理汇总了Java中com.getpebble.android.kit.util.PebbleTuple的典型用法代码示例。如果您正苦于以下问题:Java PebbleTuple类的具体用法?Java PebbleTuple怎么用?Java PebbleTuple使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PebbleTuple类属于com.getpebble.android.kit.util包,在下文中一共展示了PebbleTuple类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: clearDictionary

import com.getpebble.android.kit.util.PebbleTuple; //导入依赖的package包/类
private void clearDictionary() {
      synchronized (this.dictionary) {
          // might just be easier to instantiate a new dictionary
          final List<Integer> temp = new ArrayList<>();
          for (PebbleTuple aDictionary : this.dictionary) {
              temp.add(aDictionary.key);
          }
          for (Integer i : temp) {
              this.dictionary.remove(i);
          }
      }

/*      this.dictionary.remove(ICON_KEY);
      this.dictionary.remove(BG_KEY);
      this.dictionary.remove(NAME_KEY);
      this.dictionary.remove(BG_DELTA_KEY);
      this.dictionary.remove(PHONE_TIME_KEY);
      this.dictionary.remove(RECORD_TIME_KEY);
      this.dictionary.remove(UPLOADER_BATTERY_KEY);
      this.dictionary.remove(VIBE_KEY);

      this.dictionary.remove(COLLECT_HEALTH_KEY);
      this.dictionary.remove(NO_BLUETOOTH_KEY);

      */
  }
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:27,代码来源:PebbleDisplayTrendOld.java

示例2: getBytesLeft

import com.getpebble.android.kit.util.PebbleTuple; //导入依赖的package包/类
/**
 * @param message Current AppMessage.
 * @param pebbleCapabilities Capabilities of the Pebble you want to send message to
 * @return Maximum size of the byte array than you still can add to this message and have it successfully sent.
 *
 * @see <a href="https://developer.pebble.com/docs/c/Foundation/Dictionary/#dict_calc_buffer_size">Pebble documentation</a>
 */
public static int getBytesLeft(PebbleDictionary message, PebbleCapabilities pebbleCapabilities)
{
    int bytesLeft = pebbleCapabilities.getMaxAppmessageSize();

    bytesLeft--; // One byte of dictionary header overhead (presumably for number of entries in AppMessage)

    for (PebbleTuple entry : message)
    {
        bytesLeft -= 7; //Every entry has 7 bytes of overhead.
        bytesLeft -= entry.length;
    }

    return bytesLeft - 7; // 7 bytes is the additional overhead that would to-be-added byte array need
}
 
开发者ID:matejdro,项目名称:PebbleAndroidCommons,代码行数:22,代码来源:PebbleUtil.java


注:本文中的com.getpebble.android.kit.util.PebbleTuple类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。