Disabling touch wrapper in Alexa Presentation Language

592 Views Asked by At

I am having a problem with using the touch wrapper in APL, at the moment when the user touches the screen - it will completely pause the skill.

I am using this reference: apl touch wrapper doc

I have tried the following syntax in my json file with no success:

{
    "type": "APL",
    "version": "1.0",
    "imports": [
        {
            "name": "alexa-layouts",
            "version": "1.0.0"
        }
    ],
    "layouts": {},
    "mainTemplate": {
        "parameters": [
            "payload"
        ],
        "items": [
            {
                "type": "TouchWrapper",
                "height":"100vh",
                "width":"100vw",
                "disabled":"true",
                "item": {
                    "type": "Text",
                    "id":"testing",
                    "text": "testing disabled touch wrapper",
                    "color": "#66DFFF",
                    "fontSize": 30
                }

            }
        ]
    }
}

the "disabled" property doesnt seem to work, i have successfully implemented the onpress send event command, so i could find a work around this way, but it would be much better if the disabled property just worked!

Cheers!

1

There are 1 best solutions below

0
On

You can enable and disable via the touch wrapper the SetState command:

{
  "type": "SetState",
  "componentId": "your_touch_wrapper_id",
  "state": "disabled",
  "value": true
}

In APL 1.1 we have added a new section to the APL doc called onMount that you can use to send commands right away. You can try to send the command above in onMount to see if that works.