Last active
July 16, 2019 18:17
-
-
Save BernardGatt/3b9314374bbf178bb66a8c83c7682da8 to your computer and use it in GitHub Desktop.
News list example
This file contains 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": "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