Skip to content

Commit

Permalink
[.NET][WPF][HTML] Update BackgroundImage implementation for spec chan…
Browse files Browse the repository at this point in the history
…ges (microsoft#2806)

* Update property names for cover, fillMode and ImageFillMode

* Update json payloadsa

* Remove extra files

* Update rendering behaviour in WPG

* Add HTML support for cover vertical and horizontal alignment

* Add test for more visible results of vertical and horizontal alignment

* Update and add more tests

* Add missing file

* Fix deleted test file

* Fix readded test

* Fix readded test again

* Update tests results

* Update card list for project

* Fix the fix
  • Loading branch information
almedina-ms committed May 9, 2019
1 parent e2218fd commit 7b73402
Show file tree
Hide file tree
Showing 339 changed files with 959 additions and 162 deletions.
148 changes: 148 additions & 0 deletions samples/Tests/BackgroundImage.VerticalAndHorizontalAlignment.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
{
"$schema": "http:https://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.2",
"body": [
{
"type": "Container",
"backgroundImage": {
"url": "https://picsum.photos/id/237/200/200",
"verticalAlignment": "top"
},
"items": [
{
"type": "TextBlock",
"text": "This container has a background with a verticalAlignment of top",
"wrap": true
},
{
"type": "TextBlock",
"text": "Container 1 - Text 2 - Stretch"
},
{
"type": "TextBlock",
"text": "Container 1 - Text 3 - Stretch"
}
]
},
{
"type": "Container",
"backgroundImage": {
"url": "https://picsum.photos/id/237/200/200",
"verticalAlignment": "center"
},
"items": [
{
"type": "TextBlock",
"text": "This container has a background with a verticalAlignment of center",
"wrap": true
},
{
"type": "TextBlock",
"text": "Container 1 - Text 2 - Stretch"
},
{
"type": "TextBlock",
"text": "Container 1 - Text 3 - Stretch"
}
]
},
{
"type": "Container",
"backgroundImage": {
"url": "https://picsum.photos/id/237/200/200",
"verticalAlignment": "bottom"
},
"items": [
{
"type": "TextBlock",
"text": "This container has a background with a verticalAlignment of bottom",
"wrap": true
},
{
"type": "TextBlock",
"text": "Container 1 - Text 2 - Stretch"
},
{
"type": "TextBlock",
"text": "Container 1 - Text 3 - Stretch"
}
]
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "auto",
"backgroundImage": {
"url": "https://picsum.photos/id/237/200/200",
"horizontalAlignment": "left",
},
"items": [
{
"type": "TextBlock",
"text": "Background is left aligned",
"wrap": true
},
{
"type": "TextBlock",
"text": "Background is left aligned",
"wrap": true
},
{
"type": "TextBlock",
"text": "Background is left aligned",
"wrap": true
},
{
"type": "TextBlock",
"text": "Background is left aligned",
"wrap": true
},
{
"type": "TextBlock",
"text": "Background is left aligned",
"wrap": true
},
{
"type": "TextBlock",
"text": "Background is left aligned",
"wrap": true
}
]
},
{
"type": "Column",
"width": "auto",
"backgroundImage": {
"url": "https://picsum.photos/id/237/200/200",
"horizontalAlignment": "center"
},
"items": [
{
"type": "TextBlock",
"text": "Background is center aligned",
"wrap": true
}
]
},
{
"type": "Column",
"width": "auto",
"backgroundImage": {
"url": "https://picsum.photos/id/237/200/200",
"horizontalAlignment": "right"
},
"items": [
{
"type": "TextBlock",
"text": "Background is right aligned",
"wrap": true
}
]
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"$schema": "http:https://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.2",
"backgroundImage": {
"url": "https://picsum.photos/id/237/200/200",
"verticalAlignment": "center",
"horizontalAlignment": "center"
},
"body": [
{
"type": "TextBlock",
"text": "Text in body"
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "auto",
"items": [
{
"type": "TextBlock",
"text": "Text in Column 1"
}
]
},
{
"type": "Column",
"width": "auto",
"items": [
{
"type": "TextBlock",
"text": "Text in Column 2"
}
]
}
]
},
{
"type": "Container",
"items": [
{
"type": "TextBlock",
"text": "Text 1 in Container"
},
{
"type": "TextBlock",
"text": "Text 2 in Container"
},
{
"type": "TextBlock",
"text": "Text 3 in Container"
}
]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "1.2",
"backgroundImage": {
"url": "https://picsum.photos/60/60?image=101",
"mode": "repeat"
"fillMode": "repeat"
},
"body": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "1.2",
"backgroundImage": {
"url": "https://picsum.photos/60/60?image=101",
"mode": "repeatHorizontally",
"fillMode": "repeatHorizontally",
"verticalAlignment": "center"
},
"body": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "1.2",
"backgroundImage": {
"url": "https://picsum.photos/60/60?image=101",
"mode": "repeatVertically",
"fillMode": "repeatVertically",
"horizontalAlignment": "center"
},
"body": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "1.2",
"backgroundImage": {
"url": "https://picsum.photos/60/60?image=101",
"mode": "repeat"
"fillMode": "repeat"
},
"body": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "1.2",
"backgroundImage": {
"url": "https://picsum.photos/60/60?image=101",
"mode": "repeatHorizontally",
"fillMode": "repeatHorizontally",
"verticalAlignment": "center"
},
"body": [
Expand Down
14 changes: 7 additions & 7 deletions samples/v1.2/Elements/Column.BackgroundImage.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"width": "auto",
"backgroundImage": {
"url": "https://picsum.photos/30/30?image=101",
"mode": "repeat"
"fillMode": "repeat"
},

"items": [
Expand Down Expand Up @@ -67,7 +67,7 @@
"width": "auto",
"backgroundImage": {
"url": "https://picsum.photos/30/30?image=101",
"mode": "repeatHorizontally"
"fillMode": "repeatHorizontally"
},
"items": [
{
Expand All @@ -81,7 +81,7 @@
"width": "auto",
"backgroundImage": {
"url": "https://picsum.photos/30/30?image=101",
"mode": "repeatHorizontally",
"fillMode": "repeatHorizontally",
"verticalAlignment": "center"
},
"items": [
Expand All @@ -96,7 +96,7 @@
"width": "auto",
"backgroundImage": {
"url": "https://picsum.photos/30/30?image=101",
"mode": "repeatHorizontally",
"fillMode": "repeatHorizontally",
"verticalAlignment": "bottom"
},
"items": [
Expand All @@ -116,7 +116,7 @@
"width": "auto",
"backgroundImage": {
"url": "https://picsum.photos/30/30?image=101",
"mode": "repeatVertically"
"fillMode": "repeatVertically"
},
"items": [
{
Expand All @@ -130,7 +130,7 @@
"width": "auto",
"backgroundImage": {
"url": "https://picsum.photos/30/30?image=101",
"mode": "repeatVertically",
"fillMode": "repeatVertically",
"horizontalAlignment": "center"
},
"items": [
Expand All @@ -145,7 +145,7 @@
"width": "auto",
"backgroundImage": {
"url": "https://picsum.photos/30/30?image=101",
"mode": "repeatVertically",
"fillMode": "repeatVertically",
"horizontalAlignment": "right"
},
"items": [
Expand Down
14 changes: 7 additions & 7 deletions samples/v1.2/Elements/Container.BackgroundImage.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"type": "Container",
"backgroundImage": {
"url": "https://picsum.photos/30/30?image=101",
"mode": "repeat"
"fillMode": "repeat"
},
"items": [
{
Expand All @@ -46,7 +46,7 @@
"type": "Container",
"backgroundImage": {
"url": "https://picsum.photos/30/30?image=101",
"mode": "repeatHorizontally"
"fillMode": "repeatHorizontally"
},
"items": [
{
Expand All @@ -63,7 +63,7 @@
"type": "Container",
"backgroundImage": {
"url": "https://picsum.photos/30/30?image=101",
"mode": "repeatHorizontally",
"fillMode": "repeatHorizontally",
"verticalAlignment": "center"
},
"items": [
Expand All @@ -81,7 +81,7 @@
"type": "Container",
"backgroundImage": {
"url": "https://picsum.photos/30/30?image=101",
"mode": "repeatHorizontally",
"fillMode": "repeatHorizontally",
"verticalAlignment": "bottom"
},
"items": [
Expand All @@ -99,7 +99,7 @@
"type": "Container",
"backgroundImage": {
"url": "https://picsum.photos/30/30?image=101",
"mode": "repeatVertically"
"fillMode": "repeatVertically"
},
"items": [
{
Expand All @@ -120,7 +120,7 @@
"type": "Container",
"backgroundImage": {
"url": "https://picsum.photos/30/30?image=101",
"mode": "repeatVertically",
"fillMode": "repeatVertically",
"horizontalAlignment": "center"
},
"items": [
Expand All @@ -142,7 +142,7 @@
"type": "Container",
"backgroundImage": {
"url": "https://picsum.photos/30/30?image=101",
"mode": "repeatVertically",
"fillMode": "repeatVertically",
"horizontalAlignment": "right"
},
"items": [
Expand Down
Loading

0 comments on commit 7b73402

Please sign in to comment.