fix: VibrationDefaults Int→Float 字面量加 f 后缀
Kotlin 不做 Int→Float 隐式转换,shockTime/shockIntervalTime 改为 Float 后默认值需要加 f 后缀(1→1f, 0→0f)。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -17,73 +17,73 @@ object VibrationDefaults {
|
|||||||
// planId 2: 新消息
|
// planId 2: 新消息
|
||||||
2 to VibrationPattern(
|
2 to VibrationPattern(
|
||||||
planId = 2, planName = "新消息",
|
planId = 2, planName = "新消息",
|
||||||
shockTime = 1, shockTimes = 2, shockIntervalTime = 1, shockCycleTimes = 1,
|
shockTime = 1f, shockTimes = 2, shockIntervalTime = 1f, shockCycleTimes = 1,
|
||||||
audioResId = 0
|
audioResId = 0
|
||||||
),
|
),
|
||||||
// planId 3: 未读提醒
|
// planId 3: 未读提醒
|
||||||
3 to VibrationPattern(
|
3 to VibrationPattern(
|
||||||
planId = 3, planName = "未读提醒",
|
planId = 3, planName = "未读提醒",
|
||||||
shockTime = 1, shockTimes = 3, shockIntervalTime = 1, shockCycleTimes = 1,
|
shockTime = 1f, shockTimes = 3, shockIntervalTime = 1f, shockCycleTimes = 1,
|
||||||
audioResId = 0
|
audioResId = 0
|
||||||
),
|
),
|
||||||
// planId 4: 单次打卡成功
|
// planId 4: 单次打卡成功
|
||||||
4 to VibrationPattern(
|
4 to VibrationPattern(
|
||||||
planId = 4, planName = "单次打卡成功",
|
planId = 4, planName = "单次打卡成功",
|
||||||
shockTime = 1, shockTimes = 1, shockIntervalTime = 0, shockCycleTimes = 1,
|
shockTime = 1f, shockTimes = 1, shockIntervalTime = 0f, shockCycleTimes = 1,
|
||||||
audioResId = R.raw.punch_success
|
audioResId = R.raw.punch_success
|
||||||
),
|
),
|
||||||
// planId 5: 批量打卡成功
|
// planId 5: 批量打卡成功
|
||||||
5 to VibrationPattern(
|
5 to VibrationPattern(
|
||||||
planId = 5, planName = "批量打卡成功",
|
planId = 5, planName = "批量打卡成功",
|
||||||
shockTime = 1, shockTimes = 2, shockIntervalTime = 1, shockCycleTimes = 1,
|
shockTime = 1f, shockTimes = 2, shockIntervalTime = 1f, shockCycleTimes = 1,
|
||||||
audioResId = R.raw.punch_success
|
audioResId = R.raw.punch_success
|
||||||
),
|
),
|
||||||
// planId 6: 进入打卡范围
|
// planId 6: 进入打卡范围
|
||||||
6 to VibrationPattern(
|
6 to VibrationPattern(
|
||||||
planId = 6, planName = "进入打卡范围",
|
planId = 6, planName = "进入打卡范围",
|
||||||
shockTime = 1, shockTimes = 1, shockIntervalTime = 0, shockCycleTimes = 1,
|
shockTime = 1f, shockTimes = 1, shockIntervalTime = 0f, shockCycleTimes = 1,
|
||||||
audioResId = R.raw.open_success
|
audioResId = R.raw.open_success
|
||||||
),
|
),
|
||||||
// planId 7: 打卡失败
|
// planId 7: 打卡失败
|
||||||
7 to VibrationPattern(
|
7 to VibrationPattern(
|
||||||
planId = 7, planName = "打卡失败",
|
planId = 7, planName = "打卡失败",
|
||||||
shockTime = 1, shockTimes = 3, shockIntervalTime = 1, shockCycleTimes = 2,
|
shockTime = 1f, shockTimes = 3, shockIntervalTime = 1f, shockCycleTimes = 2,
|
||||||
audioResId = 0
|
audioResId = 0
|
||||||
),
|
),
|
||||||
// planId 8: NFC 开启
|
// planId 8: NFC 开启
|
||||||
8 to VibrationPattern(
|
8 to VibrationPattern(
|
||||||
planId = 8, planName = "NFC开启",
|
planId = 8, planName = "NFC开启",
|
||||||
shockTime = 1, shockTimes = 1, shockIntervalTime = 0, shockCycleTimes = 1,
|
shockTime = 1f, shockTimes = 1, shockIntervalTime = 0f, shockCycleTimes = 1,
|
||||||
audioResId = R.raw.open_punch
|
audioResId = R.raw.open_punch
|
||||||
),
|
),
|
||||||
// planId 9: NFC 关闭
|
// planId 9: NFC 关闭
|
||||||
9 to VibrationPattern(
|
9 to VibrationPattern(
|
||||||
planId = 9, planName = "NFC关闭",
|
planId = 9, planName = "NFC关闭",
|
||||||
shockTime = 1, shockTimes = 1, shockIntervalTime = 0, shockCycleTimes = 1,
|
shockTime = 1f, shockTimes = 1, shockIntervalTime = 0f, shockCycleTimes = 1,
|
||||||
audioResId = R.raw.close_punch
|
audioResId = R.raw.close_punch
|
||||||
),
|
),
|
||||||
// planId 10: 离线
|
// planId 10: 离线
|
||||||
10 to VibrationPattern(
|
10 to VibrationPattern(
|
||||||
planId = 10, planName = "离线",
|
planId = 10, planName = "离线",
|
||||||
shockTime = 1, shockTimes = 2, shockIntervalTime = 1, shockCycleTimes = 1,
|
shockTime = 1f, shockTimes = 2, shockIntervalTime = 1f, shockCycleTimes = 1,
|
||||||
audioResId = R.raw.offline
|
audioResId = R.raw.offline
|
||||||
),
|
),
|
||||||
// planId 11: 开门失败
|
// planId 11: 开门失败
|
||||||
11 to VibrationPattern(
|
11 to VibrationPattern(
|
||||||
planId = 11, planName = "开门失败",
|
planId = 11, planName = "开门失败",
|
||||||
shockTime = 1, shockTimes = 2, shockIntervalTime = 1, shockCycleTimes = 1,
|
shockTime = 1f, shockTimes = 2, shockIntervalTime = 1f, shockCycleTimes = 1,
|
||||||
audioResId = R.raw.open_failed
|
audioResId = R.raw.open_failed
|
||||||
),
|
),
|
||||||
// planId 12: 无权限开门
|
// planId 12: 无权限开门
|
||||||
12 to VibrationPattern(
|
12 to VibrationPattern(
|
||||||
planId = 12, planName = "无权限开门",
|
planId = 12, planName = "无权限开门",
|
||||||
shockTime = 1, shockTimes = 2, shockIntervalTime = 1, shockCycleTimes = 1,
|
shockTime = 1f, shockTimes = 2, shockIntervalTime = 1f, shockCycleTimes = 1,
|
||||||
audioResId = R.raw.no_auth_open
|
audioResId = R.raw.no_auth_open
|
||||||
),
|
),
|
||||||
// planId 13: 正在开锁
|
// planId 13: 正在开锁
|
||||||
13 to VibrationPattern(
|
13 to VibrationPattern(
|
||||||
planId = 13, planName = "正在开锁",
|
planId = 13, planName = "正在开锁",
|
||||||
shockTime = 1, shockTimes = 1, shockIntervalTime = 0, shockCycleTimes = 1,
|
shockTime = 1f, shockTimes = 1, shockIntervalTime = 0f, shockCycleTimes = 1,
|
||||||
audioResId = R.raw.open_locking
|
audioResId = R.raw.open_locking
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user