This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| return when { | |
| input.supportAPL() && movies.isNotEmpty() -> { | |
| try { | |
| val mapper = ObjectMapper() | |
| val documentMapType = object : TypeReference<HashMap<String, Any>>() {} | |
| val document = mapper.readValue<Map<String, Any>>(File("upcomingMoviesScreen.json"), documentMapType) | |
| val dataSourceMapType = object : TypeReference<HashMap<String, Any>>() {} | |
| val dataSource = mapper.readValue<Map<String, Any>>(File("upcomingMoviesScreenData.json"), dataSourceMapType) | |
| val newReleases = mapOf("newReleases" to movies) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "templateMetadata": { | |
| "backgroundUrl": "https://upcoming-movies.s3-eu-west-1.amazonaws.com/felix-mooneeram-evlkOfkQ5rE-unsplash.jpg", | |
| "title": "Estrenos de Cine", | |
| "logoUrl": "https://images-na.ssl-images-amazon.com/images/I/519R8Z0YttL.png" | |
| }, | |
| "movies": { | |
| "newReleases": [ | |
| { | |
| "title": "El Rey León", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fun HandlerInput.supportAPL() = requestEnvelope.context.system.device.supportedInterfaces.alexaPresentationAPL != null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "moviesListLayout": { | |
| "parameters": [ | |
| "title", | |
| "releaseDate" | |
| ], | |
| "item": [ | |
| { | |
| "when": "${viewport.shape == 'round'}", | |
| "type": "Frame", | |
| "height": "auto", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "mainLayout": { | |
| "parameters": [ | |
| "backgroundImage", | |
| "title", | |
| "logo", | |
| "movies" | |
| ], | |
| "item": [ | |
| { | |
| "type": "Container", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "type": "APL", | |
| "version": "1.1", | |
| "import": [...], | |
| "resources": [...], | |
| "styles": {...}, | |
| "layouts": {...}, | |
| "mainTemplate": { | |
| "parameters": [ | |
| "payload" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "textStyleBase": { | |
| "description": "Base font description; set color", | |
| "values": [ | |
| { | |
| "color": "@colorTextPrimary" | |
| } | |
| ] | |
| }, | |
| "textStyleBase2": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { | |
| "description": "Stock color for the dark theme", | |
| "colors": { | |
| "colorTextPrimary": "#f0f1ef" | |
| } | |
| }, | |
| { | |
| "description": "Standard font sizes", | |
| "dimensions": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "type": "APL", | |
| "version": "1.1", | |
| "import": [ | |
| { | |
| "name": "alexa-layouts", | |
| "version": "1.0.0" | |
| }, | |
| { | |
| "name": "alexa-styles", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| val upcomings = theMovieDBAPI.getNowPlaying( | |
| System.getenv("TheMovieDBApiKey"), | |
| locale, | |
| 1, | |
| Utils.getRegion(locale) | |
| ) |