Skip to content

Instantly share code, notes, and snippets.

@BernardGatt
Last active July 16, 2019 18:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BernardGatt/3b9314374bbf178bb66a8c83c7682da8 to your computer and use it in GitHub Desktop.
Save BernardGatt/3b9314374bbf178bb66a8c83c7682da8 to your computer and use it in GitHub Desktop.
News list example
{
"type": "listWidget",
"dataSource": "$news.articles",
"template": {
"type": "actionWidget",
"behavior": "system",
"action": "$news.articles.url",
"component": {
"type": "fixedListWidget",
"components": [{
"type": "textWidget",
"color": "primaryMain",
"text": "$news.articles.title",
"style": "headingXL",
"maxLines": 3
},
{
"type": "fixedHorizontalListWidget",
"components": [{
"type": "blockWidget",
"flex": 7,
"component": {
"type": "fixedListWidget",
"components": [{
"type": "textWidget",
"color": "mainText",
"text": "$news.articles.source.name",
"style": "bodyS",
"maxLines": 1
},
{
"type": "textWidget",
"color": "mainText",
"text": "$news.articles.description",
"style": "bodyL",
"maxLines": 4,
"overflow": "ellipsis"
}
]
}
},
{
"type": "blockWidget",
"flex": 3,
"padding": ["m", "m", "", ""],
"component": {
"type": "imageWidget",
"cornerRadius": 5,
"height": 75,
"width": 75,
"image": "$news.articles.urlToImage",
"fadeInDuration": 300
}
}
]
}
]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment