feat(asr): 添加无网络对话框自定义布局

- 创建新的对话框布局文件 dialog_no_network.xml
- 使用自定义布局替换原有的 AlertDialog 标题和消息设置
- 添加透明背景支持以改善对话框外观
- 保持原有的网络检查提示功能不变
这个提交包含在:
徐勤民 2026-04-20 10:08:54 +08:00
父节点 fe52fdd3f6
当前提交 806b230a3c

查看文件

@ -196,6 +196,14 @@ object AsrHelper : OfflineCmdListener {
val contentView = LayoutInflater.from(activity)
.inflate(R.layout.dialog_no_network, null)
// 黑底 + 绿色圆角线框
val density = activity.resources.displayMetrics.density
contentView.background = GradientDrawable().apply {
shape = GradientDrawable.RECTANGLE
cornerRadius = 12f * density
setColor(Color.BLACK)
setStroke((2f * density).toInt(), Color.parseColor("#FF40FF5E"))
}
noNetworkDialog = AlertDialog.Builder(activity)
.setView(contentView)
.setCancelable(false)