Skip to content

Commit

Permalink
APL-CORE: August 2022 Release of APL 2022.1 compliant core engine (20…
Browse files Browse the repository at this point in the history
…22.1.1)

For more details on this release refer to CHANGELOG.md

To learn about APL see: https://developer.amazon.com/docs/alexa-presentation-language/understand-apl.html
  • Loading branch information
sasirajah committed Aug 15, 2022
1 parent 35846bc commit 5fcb4d4
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [2022.1.1]

### Changed

- Bug fixes

## [2022.1.0]

This release adds support for version 2022.1 of the APL specification.
Expand Down
2 changes: 1 addition & 1 deletion aplcore/src/component/gridsequencecomponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ GridSequenceComponent::adjustChildDimensions(
auto d = crossAxisArray.at(0).asDimension(*mContext);
if (d.isAbsolute() || d.isRelative()) {
auto adjustedSize = adjustedCrossAxisSizes.at(0);
if (adjustedSize > 0) {
if (adjustedSize > 0 && autoSizeBudget >= 0) {
adjustedCrossAxisSizes.insert(adjustedCrossAxisSizes.end(), std::floor(autoSizeBudget/adjustedSize), adjustedSize);
autoSizeBudget = 0;
}
Expand Down
33 changes: 33 additions & 0 deletions unit/component/unittest_grid_sequence_component.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2294,4 +2294,37 @@ TEST_F(GridSequenceComponentTest, ScrollOffsetReinflate) {
// Validate second layout pass when scroll position need not to be adjusted after re-inflation
advanceTime(10);
ASSERT_TRUE(CheckChildrenLaidOut(component, {0,3}, true));
}

static const char* GRIDSEQUENCE_LARGE_CHILD = R"({
"type": "APL",
"version": "1.4",
"extensions":{
"name":"E",
"uri":"aplext:Event"
},
"mainTemplate": {
"parameters": [],
"item": {
"type": "GridSequence",
"scrollDirection": "vertical",
"width": 60,
"height": 40,
"childWidth": "65dp",
"childHeight": "20dp",
"items": {
"type": "Frame",
"backgroundColor": "${data}"
},
"data": [ "red", "blue", "green", "yellow", "gray", "orange", "white", "purple", "magenta", "cyan" ]
}
}
})";

TEST_F(GridSequenceComponentTest, InflateLargeChild) {
loadDocument(GRIDSEQUENCE_LARGE_CHILD);
ASSERT_TRUE(component);

ASSERT_EQ(kComponentTypeGridSequence, component->getType());
ASSERT_EQ(kScrollDirectionVertical, component->getCalculated(kPropertyScrollDirection).asInt());
}

0 comments on commit 5fcb4d4

Please sign in to comment.