Files
ericwyuan d9d45d983b 接入系统 Complication,补齐倒计时/自定义格式/28天累计/空气质量
字段 125 → 156 项。

Toybox.Complications(source/Comp.mc)
  这条路推翻了我之前几个「表盘做不到」的判断 —— 当时只查了 ActivityMonitor /
  UserProfile / Weather,漏了系统把这些作为 complication 发布出来:
    - 下一个日程(CIQ 确实没有日历 API,但有 CALENDAR_EVENTS complication)
    - 训练状态、完赛预测 ×4、配速预测 ×4、最近高尔夫得分
    - 本周跑步 / 骑行距离(按运动分类的,按天历史做不出来)
    - 第三方 App 1–5(CGM、补水、行情这类 App 发布的)
  需要 ComplicationSubscriber 权限。

其余补齐
  - 近 28 天累计:步数 / 卡路里 / 距离 / 楼层
  - 事件倒计时:设置里填 YYYY-MM-DD,显示还剩几天
  - 自定义时间格式、日期格式 1/2:单字母占位符(h/H/m/s/a/D/M/N/Y/y/w)
  - OWM 空气质量:AQI 等级 + 描述 + PM2.5 + PM10 + CO,走
    /data/2.5/air_pollution —— 那个接口在免费档就开放,不需要 One Call 订阅

运行时踩的坑
  - Complication.unit 不保证是 String(周跑步距离返回的就不是),直接调
    .length() 抛 Symbol Not Found。unit 和 shortLabel 都改成先 instanceof 判型。
  - 浮点 value 直接 toString 印成 "0.000000",统一格式化成一位小数。
  - 第三方 App 槽位每取一次就要走完整个迭代器,四个格子都选 App 时会走四遍。
    改成每帧只枚举一次,由 view 在绘制开始时调 Comp.beginFrame() 失效。

测试
  全字段验证的 harness 本身会触发看门狗(一次 onUpdate 里算 156 个字段),
  改成分批每帧 12 个。实际使用一帧只算 4 个,不受影响。
  156 项全部可渲染,零运行时错误;17 款设备全部编译通过。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-10 09:03:21 +08:00

171 lines
9.5 KiB
XML

<strings>
<!-- Field names shown in the settings picker. -->
<string id="FldOff">关闭</string>
<string id="FldTime">时间</string>
<string id="FldUtcTime">UTC 时间</string>
<string id="FldAltTime1">第二时区 1</string>
<string id="FldAltTime2">第二时区 2</string>
<string id="FldDayMonthDay">星期 月 日</string>
<string id="FldDayDate">星期 日</string>
<string id="FldMonthDay">月 日</string>
<string id="FldDayOfMonth"></string>
<string id="FldDayShort">星期简写</string>
<string id="FldDayFull">星期全称</string>
<string id="FldMonthName">月份</string>
<string id="FldMonthNum">月份数字</string>
<string id="FldMeridiem">上午/下午</string>
<string id="FldWeekIso">周数 (ISO)</string>
<string id="FldSeconds"></string>
<string id="FldSeconds0">秒 (前导零)</string>
<string id="FldWeekCal">周数</string>
<string id="FldCustomTime">自定义时间格式</string>
<string id="FldDateFmt1">日期格式 1</string>
<string id="FldDateFmt2">日期格式 2</string>
<string id="FldCountdown">事件倒计时</string>
<string id="FldSteps">步数</string>
<string id="FldStepsRound">步数 (取整)</string>
<string id="FldStepsToGo">剩余步数</string>
<string id="FldCalories">卡路里</string>
<string id="FldActiveCal">活动卡路里</string>
<string id="FldActiveMin">活动分钟</string>
<string id="FldActiveMod">中强度分钟</string>
<string id="FldActiveVig">高强度分钟</string>
<string id="FldActiveWeek">本周活动分钟</string>
<string id="FldDistance">距离</string>
<string id="FldFloorsUp">上楼层数</string>
<string id="FldFloorsDown">下楼层数</string>
<string id="FldMetersUp">爬升高度</string>
<string id="FldPushDist">推行距离</string>
<string id="FldPushes">推行次数</string>
<string id="FldStepsWeek">本周步数</string>
<string id="FldSteps7d">近 7 天步数</string>
<string id="FldCalWeek">本周卡路里</string>
<string id="FldCal7d">近 7 天卡路里</string>
<string id="FldDistWeek">本周距离</string>
<string id="FldDist7d">近 7 天距离</string>
<string id="FldFloorsWeek">本周楼层</string>
<string id="FldFloors7d">近 7 天楼层</string>
<string id="FldActiveMin7d">近 7 天活动分钟</string>
<string id="FldSteps28d">近 28 天步数</string>
<string id="FldCal28d">近 28 天卡路里</string>
<string id="FldDist28d">近 28 天距离</string>
<string id="FldFloors28d">近 28 天楼层</string>
<string id="FldHeartRate">心率</string>
<string id="FldRestingHr">静息心率</string>
<string id="FldStress">压力指数</string>
<string id="FldPulseOx">血氧</string>
<string id="FldRespiration">呼吸频率</string>
<string id="FldBodyBattery">身体电量</string>
<string id="FldMoveBar">活动条</string>
<string id="FldMoveBarRev">活动条 (反向)</string>
<string id="FldWeight">体重</string>
<string id="FldBmi">BMI</string>
<string id="FldRecovery">恢复时间</string>
<string id="FldVo2Run">最大摄氧量 (跑)</string>
<string id="FldVo2Bike">最大摄氧量 (骑)</string>
<string id="FldBattery">电量</string>
<string id="FldBatteryDays">剩余天数</string>
<string id="FldBatteryBoth">电量 / 天数</string>
<string id="FldAlarms">闹钟</string>
<string id="FldNotifications">通知</string>
<string id="FldDoNotDisturb">勿扰模式</string>
<string id="FldBluetooth">蓝牙</string>
<string id="FldSolar">太阳能强度</string>
<string id="FldAltitude">海拔</string>
<string id="FldSeaPressure">海平面气压</string>
<string id="FldAmbPressure">环境气压</string>
<string id="FldSunrise">日出</string>
<string id="FldSunset">日落</string>
<string id="FldNextSun">下一太阳事件</string>
<string id="FldUntilSun">距太阳事件</string>
<string id="FldMoonAge">月龄</string>
<string id="FldMoonLit">月球照明</string>
<string id="FldCivilAm">民用晨光始</string>
<string id="FldNauticalAm">航海晨光始</string>
<string id="FldAstroAm">天文晨光始</string>
<string id="FldBlueAm">蓝调时刻 (晨)</string>
<string id="FldGoldenAm">黄金时刻 (晨)</string>
<string id="FldGoldenPm">黄金时刻 (昏)</string>
<string id="FldBluePm">蓝调时刻 (昏)</string>
<string id="FldCivilPm">民用昏影终</string>
<string id="FldNauticalPm">航海昏影终</string>
<string id="FldAstroPm">天文昏影终</string>
<string id="FldTemp">气温</string>
<string id="FldTempHiLo">最高/最低气温</string>
<string id="FldFeelsLike">体感温度</string>
<string id="FldTempHigh">最高气温</string>
<string id="FldTempLow">最低气温</string>
<string id="FldHumidity">湿度</string>
<string id="FldPrecip">降水概率</string>
<string id="FldWindSpeed">风速</string>
<string id="FldWindBearing">风向角</string>
<string id="FldWindDir">风向</string>
<string id="FldWeatherTime">天气更新时间</string>
<string id="FldPressureSea">海平面气压</string>
<string id="FldUvi">紫外线指数</string>
<string id="FldVisibility">能见度</string>
<string id="FldDewPoint">露点</string>
<string id="FldNextCal">下一个日程</string>
<string id="FldTrainStatus">训练状态</string>
<string id="FldRace5k">5k 完赛预测</string>
<string id="FldRace10k">10k 完赛预测</string>
<string id="FldRaceHalf">半马完赛预测</string>
<string id="FldRaceFull">全马完赛预测</string>
<string id="FldPace5k">5k 配速预测</string>
<string id="FldPace10k">10k 配速预测</string>
<string id="FldPaceHalf">半马配速预测</string>
<string id="FldPaceFull">全马配速预测</string>
<string id="FldGolfScore">最近高尔夫得分</string>
<string id="FldRunWeek">本周跑步距离</string>
<string id="FldBikeWeek">本周骑行距离</string>
<string id="FldApp1">第三方 App 1</string>
<string id="FldApp2">第三方 App 2</string>
<string id="FldApp3">第三方 App 3</string>
<string id="FldApp4">第三方 App 4</string>
<string id="FldApp5">第三方 App 5</string>
<string id="FldOwmTemp">OWM 气温</string>
<string id="FldOwmMinMax">OWM 最高/最低</string>
<string id="FldOwmFeels">OWM 体感温度</string>
<string id="FldOwmMax">OWM 最高温</string>
<string id="FldOwmMin">OWM 最低温</string>
<string id="FldOwmDescShort">OWM 天气</string>
<string id="FldOwmDescLong">OWM 天气详述</string>
<string id="FldOwmHumidity">OWM 湿度</string>
<string id="FldOwmPressure">OWM 气压</string>
<string id="FldOwmVisibility">OWM 能见度</string>
<string id="FldOwmWind">OWM 风速</string>
<string id="FldOwmWindDeg">OWM 风向角</string>
<string id="FldOwmWindDir">OWM 风向</string>
<string id="FldOwmGust">OWM 阵风</string>
<string id="FldOwmRain">OWM 1h 降雨</string>
<string id="FldOwmSnow">OWM 1h 降雪</string>
<string id="FldOwmClouds">OWM 云量</string>
<string id="FldOwmPrecip">OWM 降水概率</string>
<string id="FldOwmDew">OWM 露点</string>
<string id="FldOwmTomorrow">OWM 明日气温</string>
<string id="FldOwmMinMaxTmrw">OWM 明日高低温</string>
<string id="FldOwmDayAfter">OWM 后日气温</string>
<string id="FldOwmMinMaxD2">OWM 后日高低温</string>
<string id="FldOwmAqi">OWM 空气质量</string>
<string id="FldOwmAqiText">OWM 空气质量描述</string>
<string id="FldOwmPm25">OWM PM2.5</string>
<string id="FldOwmPm10">OWM PM10</string>
<string id="FldOwmCo">OWM 一氧化碳</string>
<string id="FldOwmCity">OWM 城市</string>
<string id="FldOwmUpdated">OWM 更新时间</string>
<string id="FldCustom1">自定义文字 1</string>
<string id="FldCustom2">自定义文字 2</string>
<string id="FldCustom3">自定义文字 3</string>
<!-- On-face captions, in FieldTable.IDS order. -->
<string id="FieldLabels">,时间,UTC,时区1,时区2,日期,日期,日期,日,星期,星期,月,月,,周,秒,秒,周,时间,日期,日期,倒计时,步数,步数,还差,千卡,活动,分钟,中强度,高强度,周分钟,距离,楼层,下楼,爬升,推行,推行,周步数,7天,周千卡,7天,周距离,7天,周楼层,7天,7天,28天,28天,28天,28天,心率,静息,压力,血氧,呼吸,体能,活动,活动,体重,BMI,恢复,摄氧,摄氧,电量,天数,电量,闹钟,通知,勿扰,蓝牙,太阳能,海拔,气压,气压,日出,日落,太阳,太阳,月龄,月相,民用晨,航海晨,天文晨,蓝调晨,黄金晨,黄金昏,蓝调昏,民用昏,航海昏,天文昏,气温,高低温,体感,最高,最低,湿度,降水,风速,风向,风向,更新,气压,紫外线,能见度,露点,日程,训练,5K,10K,半马,全马,5K配速,10K配速,半马配速,全马配速,高尔夫,跑步,骑行,App1,App2,App3,App4,App5,气温,高低温,体感,最高,最低,天气,天气,湿度,气压,能见度,风速,风向,风向,阵风,降雨,降雪,云量,降水,露点,明日,明日,后日,后日,空气,空气,PM2.5,PM10,CO,城市,更新,,,</string>
<string id="MetricSteps">步数</string>
<string id="MetricCalories">卡路里</string>
<string id="MetricDistance">距离</string>
<string id="MetricFloors">楼层</string>
<string id="MetricMoveBar">动动条</string>
<string id="MetricActiveMin">活动分钟</string>
<string id="MetricBodyBattery">身体电量</string>
</strings>