python - 如何在图像前向列表显示中使用 TouchWrapper 组件?
问题描述
在文档中,内容不足以准确实现 TouchWrapper 组件。有谁能帮忙吗?
我已经提到 - https://developer.amazon.com/docs/alexa-presentation-language/apl-touchwrapper.html
https://medium.com/@punkpocko/alexa-apl-touch-wrappers-75d62784b3e8
def can_handle(self, handler_input):
return handler_input.request_envelope.request.type = 'Alexa.Presentation.APL.UserEvent' and handler_input.request_envelope.request.arguments.length>0 and (handler_input.request_envelope.request.arguments[0] == "Desi Flavors" or handler_input.request_envelope.request.arguments[0] == 'Global Flavors')
def handle(self, handler_input):
if handler_input.request_envelope.request.arguments[0] == "Desi Flavors":
dish ='Desi Flavors'
elif handler_input.request_envelope.request.arguments[0] == "Global Flavors":
dish ='Global Flavors'
return dish
这是 JSON- { "type":"TouchWrapper", "item":{ "type":"Text", "text":"", "color":"", "fontSize":"" }, "OnPress ":{ "type":"SendEvent", "arguments":[ "Desi Flavors", "Global Flavors" ] }
}
我希望输出结果是,如果选择 Desi Flavors,它应该存储在变量(盘)中。
解决方案
推荐阅读
- google-speech-api - 错误:14 不可用:使用 Google Speech API 连接失败
- python - 使用枚举返回字典
- java - 文本出现在运行 java GUI 代码的结果上
- xamarin - 对于 Xamarin Forms 应用程序,PCL 架构是否已经过时?
- agda - 什么是阳性检查?
- sparql - 是否可以将运算符添加到曼彻斯特语法中?
- php - Symfony 4.0 - 达到“512”的最大函数嵌套级别,中止
- xml - 在 bash 脚本中不使用 php 解析 cURL 响应
- typescript - 如何在 Konva 舞台上设置 CSS 属性?
- android - Android studio admob 奖励视频无法加载广告:3