feat(task): 集成语音识别功能到任务列表页面
- 添加了 IntentRecognizeHelper 的导入 - 在 openTask 方法中集成 IntentRecognizeHelper.recognize 功能 - 实现了语音命令 "查看第三条任务" 的识别逻辑 - 配置了 list 场景和 openTaskDetail 相关动作 - 添加了任务数据映射为 TaskExtraItem 结构 - 设置了语音识别成功和完成回调处理
这个提交包含在:
父节点
b962a08719
当前提交
efa48f0094
文件差异因一行或多行过长而隐藏
@ -1,5 +1,6 @@
|
||||
package com.nova.brain.glass.ui
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
@ -7,6 +8,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.nova.brain.glass.R
|
||||
import com.nova.brain.glass.databinding.ActivityTaskListBinding
|
||||
import com.nova.brain.glass.helper.AsrHelper
|
||||
import com.nova.brain.glass.helper.IntentRecognizeHelper
|
||||
import com.nova.brain.glass.helper.OfflineCmdListener
|
||||
import com.nova.brain.glass.helper.OfflineCmdServiceHelper
|
||||
import com.nova.brain.glass.model.TaskItem
|
||||
@ -108,6 +110,25 @@ class TaskListActivity :
|
||||
val item = viewModel.currentItems.getOrNull(position) ?: return
|
||||
Log.d("TaskListActivity", "openTask position=$position item=$item")
|
||||
// TODO: 根据 item.taskType / item.params 路由到对应 Activity
|
||||
|
||||
IntentRecognizeHelper.recognize(
|
||||
text = "查看第三条任务",
|
||||
scence="list",
|
||||
actions = listOf("openTaskDetail", "openTaskDetailWithFilter"),
|
||||
extra = viewModel.currentItems.mapIndexed { i, item ->
|
||||
TaskExtraItem(
|
||||
index = i + 1,
|
||||
id = item.id,
|
||||
taskType = item.taskType,
|
||||
processStatus = item.processStatus,
|
||||
aiDescription = item.aiDescription
|
||||
)
|
||||
},
|
||||
onSuccess = { action ->
|
||||
},
|
||||
onComplete = {
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
|
||||
正在加载...
在新工单中引用
屏蔽一个用户