Skip to content

Instantly share code, notes, and snippets.

@arunjeetsingh
Last active July 24, 2020 23:48
Show Gist options
  • Save arunjeetsingh/360de0d636c34873d7f97c4f973438f7 to your computer and use it in GitHub Desktop.
Save arunjeetsingh/360de0d636c34873d7f97c4f973438f7 to your computer and use it in GitHub Desktop.
{
"document": {
"type": "APL",
"version": "1.4",
"import": [
{
"name": "alexa-layouts",
"version": "1.2.0"
}
],
"mainTemplate": {
"parameters": [
"itemList"
],
"items": [
{
"type": "Container",
"width": "100%",
"height": "100%",
"items": [
{
"type": "AlexaHeader",
"headerBackButton": true,
"headerBackButtonAccessibilityLabel": "back",
"headerTitle": "Notifications"
},
{
"type": "Sequence",
"width": "100%",
"height": "80%",
"data": "${itemList.items}",
"items": [
{
"type": "Container",
"when": "${data.itemType == 'subHeading'}",
"paddingLeft": "${hideHorizontalMargin ? ((@viewportProfile != @tvLandscapeOverlay) ? 0 : '@listItemMarginLeft') : @listItemMarginLeft}",
"paddingRight": "${hideHorizontalMargin ? ((@viewportProfile != @tvLandscapeOverlay) ? 0 : '@listItemMarginRight') : @listItemMarginLeft}",
"items": [
{
"type": "Text",
"text": "${data.primaryText}",
"style": "textStyleCallout",
"paddingTop": "@listItemPaddingBottomTouchForward",
"paddingBottom": "@listItemPaddingBottomTouchForward"
},
{
"type": "AlexaDivider"
}
]
},
{
"type": "AlexaTextListItem",
"when": "${data.itemType == 'notification'}",
"primaryText": "${data.primaryText}",
"secondaryText": "${data.secondaryText}",
"secondaryTextPosition": "bottom",
"touchForward": true,
"imageThumbnailSource": "${data.imageSource}",
"hideOrdinal": true,
"hideDivider": "${data.itemBeforeSubHeading}"
}
]
}
]
}
]
}
},
"datasources": {
"itemList": {
"items": [
{
"itemType": "subHeading",
"primaryText": "Recent"
},
{
"itemType": "notification",
"primaryText": "The order is on its way.",
"secondaryText": "<b>Today, 5:41 PM</b> * Domino's",
"imageSource": "https://d2o906d8ln7ui1.cloudfront.net/images/md_brie.png"
},
{
"itemType": "notification",
"primaryText": "A shipment will arrive today.",
"secondaryText": "<b>Today, 9:41 AMM</b> * Amazon Shopping",
"imageSource": "https://d2o906d8ln7ui1.cloudfront.net/images/sm_cheddar.png"
},
{
"itemType": "notification",
"primaryText": "Two months ago, you purchased Kindle Oasis on Amazon. How many stars would you rate it, from one to five?",
"secondaryText": "<b>Sep 1, 9:41 AM</b> * Amazon Shopping",
"imageSource": "https://d2o906d8ln7ui1.cloudfront.net/images/sm_blue.png",
"itemBeforeSubHeading": true
},
{
"itemType": "subHeading",
"primaryText": "Previously Read"
},
{
"itemType": "notification",
"primaryText": "Brie",
"secondaryText": "<b>Serving Size: 1oz (28g)</b> * 95 cal",
"imageSource": "https://d2o906d8ln7ui1.cloudfront.net/images/sm_brie.png"
},
{
"itemType": "notification",
"primaryText": "Cheddar",
"secondaryText": "<b>Serving Size: 1oz (28g)</b> * 113 cal",
"imageSource": "https://d2o906d8ln7ui1.cloudfront.net/images/sm_cheddar.png"
},
{
"itemType": "notification",
"primaryText": "Parm",
"secondaryText": "<b>Serving Size: 1oz (28g)</b> * 122 cal",
"imageSource": "https://d2o906d8ln7ui1.cloudfront.net/images/sm_parm.png"
}
]
}
},
"sources": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment