Skip to content

Instantly share code, notes, and snippets.

View kinisoftware's full-sized avatar

Joaquin Engelmo Moriche kinisoftware

View GitHub Profile
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)
{
"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",
fun HandlerInput.supportAPL() = requestEnvelope.context.system.device.supportedInterfaces.alexaPresentationAPL != null
"moviesListLayout": {
"parameters": [
"title",
"releaseDate"
],
"item": [
{
"when": "${viewport.shape == 'round'}",
"type": "Frame",
"height": "auto",
"mainLayout": {
"parameters": [
"backgroundImage",
"title",
"logo",
"movies"
],
"item": [
{
"type": "Container",
{
"type": "APL",
"version": "1.1",
"import": [...],
"resources": [...],
"styles": {...},
"layouts": {...},
"mainTemplate": {
"parameters": [
"payload"
{
"textStyleBase": {
"description": "Base font description; set color",
"values": [
{
"color": "@colorTextPrimary"
}
]
},
"textStyleBase2": {
[
{
"description": "Stock color for the dark theme",
"colors": {
"colorTextPrimary": "#f0f1ef"
}
},
{
"description": "Standard font sizes",
"dimensions": {
{
"type": "APL",
"version": "1.1",
"import": [
{
"name": "alexa-layouts",
"version": "1.0.0"
},
{
"name": "alexa-styles",
@kinisoftware
kinisoftware / UsingLocaleAPI.kt
Created October 14, 2019 17:41
UsingLocaleAPI.kt
val upcomings = theMovieDBAPI.getNowPlaying(
System.getenv("TheMovieDBApiKey"),
locale,
1,
Utils.getRegion(locale)
)