diff --git a/ask-sdk-core/src/com/amazon/ask/request/Predicates.java b/ask-sdk-core/src/com/amazon/ask/request/Predicates.java index eaa6426a..185786e0 100644 --- a/ask-sdk-core/src/com/amazon/ask/request/Predicates.java +++ b/ask-sdk-core/src/com/amazon/ask/request/Predicates.java @@ -17,6 +17,8 @@ import com.amazon.ask.model.IntentRequest; import com.amazon.ask.model.Request; import com.amazon.ask.model.interfaces.display.ElementSelectedRequest; +import com.amazon.ask.request.viewport.ViewportUtils; +import com.amazon.ask.request.viewport.ViewportProfile; import java.util.function.Predicate; @@ -115,4 +117,8 @@ public static Predicate persistentAttribute(String key, Object val && value.equals(i.getAttributesManager().getPersistentAttributes().get(key)); } + public static Predicate viewportProfile(ViewportProfile viewportProfile) { + return i -> viewportProfile.equals(ViewportUtils.getViewportProfile(i.getRequestEnvelope())); + } + } diff --git a/ask-sdk-core/src/com/amazon/ask/request/viewport/Density.java b/ask-sdk-core/src/com/amazon/ask/request/viewport/Density.java new file mode 100644 index 00000000..37ee0fd8 --- /dev/null +++ b/ask-sdk-core/src/com/amazon/ask/request/viewport/Density.java @@ -0,0 +1,23 @@ +/* + Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file + except in compliance with the License. A copy of the License is located at + + http://aws.amazon.com/apache2.0/ + + or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for + the specific language governing permissions and limitations under the License. + */ + +package com.amazon.ask.request.viewport; + +public enum Density { + XLOW, + LOW, + MEDIUM, + HIGH, + XHIGH, + XXHIGH; +} diff --git a/ask-sdk-core/src/com/amazon/ask/request/viewport/Orientation.java b/ask-sdk-core/src/com/amazon/ask/request/viewport/Orientation.java new file mode 100644 index 00000000..46c03ae5 --- /dev/null +++ b/ask-sdk-core/src/com/amazon/ask/request/viewport/Orientation.java @@ -0,0 +1,21 @@ +/* + Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file + except in compliance with the License. A copy of the License is located at + + http://aws.amazon.com/apache2.0/ + + or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for + the specific language governing permissions and limitations under the License. + */ + +package com.amazon.ask.request.viewport; + +public enum Orientation { + LANDSCAPE, + EQUAL, + PORTRAIT; + +} diff --git a/ask-sdk-core/src/com/amazon/ask/request/viewport/Size.java b/ask-sdk-core/src/com/amazon/ask/request/viewport/Size.java new file mode 100644 index 00000000..7e94a17f --- /dev/null +++ b/ask-sdk-core/src/com/amazon/ask/request/viewport/Size.java @@ -0,0 +1,23 @@ +/* + Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file + except in compliance with the License. A copy of the License is located at + + http://aws.amazon.com/apache2.0/ + + or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for + the specific language governing permissions and limitations under the License. + */ + +package com.amazon.ask.request.viewport; + +public enum Size { + XSMALL, + SMALL, + MEDIUM, + LARGE, + XLARGE; + +} diff --git a/ask-sdk-core/src/com/amazon/ask/request/viewport/ViewportProfile.java b/ask-sdk-core/src/com/amazon/ask/request/viewport/ViewportProfile.java new file mode 100644 index 00000000..d8d17bc8 --- /dev/null +++ b/ask-sdk-core/src/com/amazon/ask/request/viewport/ViewportProfile.java @@ -0,0 +1,28 @@ +/* + Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file + except in compliance with the License. A copy of the License is located at + + http://aws.amazon.com/apache2.0/ + + or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for + the specific language governing permissions and limitations under the License. + */ + +package com.amazon.ask.request.viewport; + +public enum ViewportProfile { + HUB_ROUND_SMALL, + HUB_LANDSCAPE_MEDIUM, + HUB_LANDSCAPE_LARGE, + MOBILE_LANDSCAPE_SMALL, + MOBILE_PORTRAIT_SMALL, + MOBILE_LANDSCAPE_MEDIUM, + MOBILE_PORTRAIT_MEDIUM, + TV_LANDSCAPE_XLARGE, + TV_PORTRAIT_MEDIUM, + TV_LANDSCAPE_MEDIUM, + UNKNOWN_VIEWPORT_PROFILE; +} diff --git a/ask-sdk-core/src/com/amazon/ask/request/viewport/ViewportUtils.java b/ask-sdk-core/src/com/amazon/ask/request/viewport/ViewportUtils.java new file mode 100644 index 00000000..ad318d8e --- /dev/null +++ b/ask-sdk-core/src/com/amazon/ask/request/viewport/ViewportUtils.java @@ -0,0 +1,148 @@ +/* + Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file + except in compliance with the License. A copy of the License is located at + + http://aws.amazon.com/apache2.0/ + + or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for + the specific language governing permissions and limitations under the License. + */ + +package com.amazon.ask.request.viewport; + +import com.amazon.ask.exception.AskSdkException; +import com.amazon.ask.model.RequestEnvelope; +import com.amazon.ask.model.interfaces.viewport.Shape; +import com.amazon.ask.model.interfaces.viewport.ViewportState; + +public class ViewportUtils { + + public static ViewportProfile getViewportProfile(RequestEnvelope requestEnvelope) { + ViewportState viewportState = requestEnvelope.getContext().getViewport(); + Shape shape = viewportState.getShape(); + int currentPixelWidth = viewportState.getCurrentPixelWidth().intValueExact(); + int currentPixelHeight = viewportState.getCurrentPixelHeight().intValueExact(); + int dpi = viewportState.getDpi().intValueExact(); + Orientation orientation = getOrientation(currentPixelHeight, currentPixelWidth); + + if (shape == Shape.ROUND && + orientation == Orientation.EQUAL && + getSize(currentPixelHeight) == Size.XSMALL && + getSize(currentPixelWidth) == Size.XSMALL && + getDensity(dpi) == Density.LOW) { + return ViewportProfile.HUB_ROUND_SMALL; + + } else if (shape == Shape.RECTANGLE && + orientation == Orientation.LANDSCAPE && + getSize(currentPixelWidth).ordinal() <= Size.MEDIUM.ordinal() && + getSize(currentPixelHeight).ordinal() <= Size.SMALL.ordinal() && + getDensity(dpi) == Density.LOW) { + return ViewportProfile.HUB_LANDSCAPE_MEDIUM; + + } else if (shape == Shape.RECTANGLE && + orientation == Orientation.LANDSCAPE && + getSize(currentPixelWidth).ordinal() >= Size.LARGE.ordinal() && + getSize(currentPixelHeight).ordinal() >= Size.SMALL.ordinal() && + getDensity(dpi) == Density.LOW) { + return ViewportProfile.HUB_LANDSCAPE_LARGE; + + } else if (shape == Shape.RECTANGLE && + orientation == Orientation.LANDSCAPE && + getSize(currentPixelWidth).ordinal() >= Size.MEDIUM.ordinal() && + getSize(currentPixelHeight).ordinal() >= Size.SMALL.ordinal() && + getDensity(dpi) == Density.MEDIUM) { + return ViewportProfile.MOBILE_LANDSCAPE_MEDIUM; + + } else if (shape == Shape.RECTANGLE && + orientation == Orientation.PORTRAIT && + getSize(currentPixelWidth).ordinal() >= Size.SMALL.ordinal() && + getSize(currentPixelHeight).ordinal() >= Size.MEDIUM.ordinal() && + getDensity(dpi) == Density.MEDIUM) { + return ViewportProfile.MOBILE_PORTRAIT_MEDIUM; + + } else if (shape == Shape.RECTANGLE && + orientation == Orientation.LANDSCAPE && + getSize(currentPixelWidth).ordinal() >= Size.SMALL.ordinal() && + getSize(currentPixelHeight).ordinal() >= Size.XSMALL.ordinal() && + getDensity(dpi) == Density.MEDIUM) { + return ViewportProfile.MOBILE_LANDSCAPE_SMALL; + + } else if (shape == Shape.RECTANGLE && + orientation == Orientation.PORTRAIT && + getSize(currentPixelWidth).ordinal() >= Size.XSMALL.ordinal() && + getSize(currentPixelHeight).ordinal() >= Size.SMALL.ordinal() && + getDensity(dpi) == Density.MEDIUM) { + return ViewportProfile.MOBILE_PORTRAIT_SMALL; + + } else if (shape == Shape.RECTANGLE && + orientation == Orientation.LANDSCAPE && + getSize(currentPixelWidth).ordinal() >= Size.XLARGE.ordinal() && + getSize(currentPixelHeight).ordinal() >= Size.MEDIUM.ordinal() && + getDensity(dpi).ordinal() >= Density.HIGH.ordinal()) { + return ViewportProfile.TV_LANDSCAPE_XLARGE; + + } else if (shape == Shape.RECTANGLE && + orientation == Orientation.PORTRAIT && + getSize(currentPixelWidth) == Size.XSMALL && + getSize(currentPixelHeight) == Size.XLARGE && + getDensity(dpi).ordinal() >= Density.HIGH.ordinal()) { + return ViewportProfile.TV_PORTRAIT_MEDIUM; + + } else if (shape == Shape.RECTANGLE && + orientation == Orientation.LANDSCAPE && + getSize(currentPixelWidth) == Size.MEDIUM && + getSize(currentPixelHeight) == Size.SMALL && + getDensity(dpi).ordinal() >= Density.HIGH.ordinal()) { + return ViewportProfile.TV_LANDSCAPE_MEDIUM; + } + return ViewportProfile.UNKNOWN_VIEWPORT_PROFILE; + } + + private static Density getDensity(int dpi) { + if (isBetween(dpi, 0, 121)) { + return Density.XLOW; + } else if (isBetween(dpi, 121, 161)) { + return Density.LOW; + } else if (isBetween(dpi, 161, 241)) { + return Density.MEDIUM; + } else if (isBetween(dpi, 241, 321)) { + return Density.HIGH; + } else if (isBetween(dpi, 321, 481)) { + return Density.XHIGH; + } else if (dpi >= 481) { + return Density.XXHIGH; + } + throw new AskSdkException("Unknown density dpi value " + dpi); + } + + private static Orientation getOrientation(int height, int width) { + if (height > width) { + return Orientation.PORTRAIT; + } else if (height < width) { + return Orientation.LANDSCAPE; + } + return Orientation.EQUAL; + } + + private static Size getSize(int dpi) { + if (isBetween(dpi, 0, 600)) { + return Size.XSMALL; + } else if (isBetween(dpi, 600, 960)) { + return Size.SMALL; + } else if (isBetween(dpi, 960, 1280)) { + return Size.MEDIUM; + } else if (isBetween(dpi, 1280, 1920)) { + return Size.LARGE; + } else if (dpi >= 1920) { + return Size.XLARGE; + } + throw new AskSdkException("Unknown size group value " + dpi); + } + + private static boolean isBetween(int x, int lower, int upper) { + return lower <= x && x < upper; + } +} \ No newline at end of file diff --git a/ask-sdk-core/tst/com/amazon/ask/request/PredicatesTest.java b/ask-sdk-core/tst/com/amazon/ask/request/PredicatesTest.java index b086cf76..5b752efa 100644 --- a/ask-sdk-core/tst/com/amazon/ask/request/PredicatesTest.java +++ b/ask-sdk-core/tst/com/amazon/ask/request/PredicatesTest.java @@ -15,6 +15,7 @@ import com.amazon.ask.attributes.AttributesManager; import com.amazon.ask.dispatcher.request.handler.HandlerInput; +import com.amazon.ask.model.Context; import com.amazon.ask.model.Intent; import com.amazon.ask.model.IntentRequest; import com.amazon.ask.model.LaunchRequest; @@ -24,8 +25,12 @@ import com.amazon.ask.model.SessionEndedRequest; import com.amazon.ask.model.Slot; import com.amazon.ask.model.interfaces.display.ElementSelectedRequest; +import com.amazon.ask.model.interfaces.viewport.Shape; +import com.amazon.ask.model.interfaces.viewport.ViewportState; +import com.amazon.ask.request.viewport.ViewportProfile; import org.junit.Test; +import java.math.BigDecimal; import java.util.Collections; import java.util.Map; @@ -179,6 +184,18 @@ public void slot_value_predicate_matching_slot_value_returns_true() { assertTrue(slotValue("foo", "bar").test(input)); } + @Test + public void viewport_profile_predicate_matching_viewport_profile_returns_true() { + HandlerInput input = getInputWithViewport(); + assertTrue(viewportProfile(ViewportProfile.HUB_ROUND_SMALL).test(input)); + } + + @Test + public void viewport_profile_predicate_non_matching_viewport_profile_returns_false() { + HandlerInput input = getInputWithViewport(); + assertFalse(viewportProfile(ViewportProfile.MOBILE_LANDSCAPE_MEDIUM).test(input)); + } + private HandlerInput getInputWithSessionAttributes(Map attributes, boolean inSessionRequest) { AttributesManager manager = mock(AttributesManager.class); when(manager.getSessionAttributes()).thenReturn(attributes); @@ -215,4 +232,18 @@ private HandlerInput getInputForRequest(Request request) { return input; } + private HandlerInput getInputWithViewport() { + ViewportState viewportState = ViewportState.builder() + .withShape(Shape.ROUND) + .withDpi(BigDecimal.valueOf(160)) + .withCurrentPixelHeight(BigDecimal.valueOf(300)) + .withCurrentPixelWidth(BigDecimal.valueOf(300)) + .build(); + + HandlerInput input = mock(HandlerInput.class); + RequestEnvelope envelope = RequestEnvelope.builder().withContext(Context.builder().withViewport(viewportState).build()).build(); + when(input.getRequestEnvelope()).thenReturn(envelope); + return input; + } + } diff --git a/ask-sdk-core/tst/com/amazon/ask/request/ViewportUtilsTest.java b/ask-sdk-core/tst/com/amazon/ask/request/ViewportUtilsTest.java new file mode 100644 index 00000000..40416b49 --- /dev/null +++ b/ask-sdk-core/tst/com/amazon/ask/request/ViewportUtilsTest.java @@ -0,0 +1,219 @@ +/* + Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file + except in compliance with the License. A copy of the License is located at + + http://aws.amazon.com/apache2.0/ + + or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for + the specific language governing permissions and limitations under the License. + */ + +package com.amazon.ask.request; + +import com.amazon.ask.model.Context; +import com.amazon.ask.model.RequestEnvelope; +import com.amazon.ask.model.interfaces.viewport.Shape; +import com.amazon.ask.model.interfaces.viewport.ViewportState; +import com.amazon.ask.request.viewport.ViewportUtils; +import com.amazon.ask.request.viewport.ViewportProfile; +import org.junit.Test; + +import java.math.BigDecimal; + +import static org.junit.Assert.assertEquals; + +public class ViewportUtilsTest { + @Test + public void rook_maps_to_hub_round_small() { + ViewportState viewportState = getViewportState("Rook"); + RequestEnvelope requestEnvelope = RequestEnvelope.builder() + .withContext(Context.builder().withViewport(viewportState).build()) + .build(); + ViewportProfile profile = ViewportUtils.getViewportProfile(requestEnvelope); + assertEquals(profile, ViewportProfile.HUB_ROUND_SMALL); + } + + @Test + public void knight_maps_to_hub_landscape_medium() { + ViewportState viewportState = getViewportState("Knight"); + RequestEnvelope requestEnvelope = RequestEnvelope.builder() + .withContext(Context.builder().withViewport(viewportState).build()) + .build(); + ViewportProfile profile = ViewportUtils.getViewportProfile(requestEnvelope); + assertEquals(profile, ViewportProfile.HUB_LANDSCAPE_MEDIUM); + } + + @Test + public void bishop_maps_to_hub_landscape_large() { + ViewportState viewportState = getViewportState("Bishop"); + RequestEnvelope requestEnvelope = RequestEnvelope.builder() + .withContext(Context.builder().withViewport(viewportState).build()) + .build(); + ViewportProfile profile = ViewportUtils.getViewportProfile(requestEnvelope); + assertEquals(profile, ViewportProfile.HUB_LANDSCAPE_LARGE); + } + + @Test + public void vox_landscape_maps_to_mobile_landscape_small() { + ViewportState viewportState = getViewportState("VoxLandscape"); + RequestEnvelope requestEnvelope = RequestEnvelope.builder() + .withContext(Context.builder().withViewport(viewportState).build()) + .build(); + ViewportProfile profile = ViewportUtils.getViewportProfile(requestEnvelope); + assertEquals(profile, ViewportProfile.MOBILE_LANDSCAPE_SMALL); + } + + @Test + public void vox_portrait_maps_to_mobile_portrait_small() { + ViewportState viewportState = getViewportState("VoxPortrait"); + RequestEnvelope requestEnvelope = RequestEnvelope.builder() + .withContext(Context.builder().withViewport(viewportState).build()) + .build(); + ViewportProfile profile = ViewportUtils.getViewportProfile(requestEnvelope); + assertEquals(profile, ViewportProfile.MOBILE_PORTRAIT_SMALL); + } + + @Test + public void fire_tablet_landscape_maps_to_mobile_landscape_medium() { + ViewportState viewportState = getViewportState("FireTabletLandscape"); + RequestEnvelope requestEnvelope = RequestEnvelope.builder() + .withContext(Context.builder().withViewport(viewportState).build()) + .build(); + ViewportProfile profile = ViewportUtils.getViewportProfile(requestEnvelope); + assertEquals(profile, ViewportProfile.MOBILE_LANDSCAPE_MEDIUM); + } + + @Test + public void fire_tablet_portrait_maps_to_mobile_portrait_medium() { + ViewportState viewportState = getViewportState("FireTabletPortrait"); + RequestEnvelope requestEnvelope = RequestEnvelope.builder() + .withContext(Context.builder().withViewport(viewportState).build()) + .build(); + ViewportProfile profile = ViewportUtils.getViewportProfile(requestEnvelope); + assertEquals(profile, ViewportProfile.MOBILE_PORTRAIT_MEDIUM); + } + + @Test + public void tv_maps_to_tv_landscape_extra_large() { + ViewportState viewportState = getViewportState("1080pTV"); + RequestEnvelope requestEnvelope = RequestEnvelope.builder() + .withContext(Context.builder().withViewport(viewportState).build()) + .build(); + ViewportProfile profile = ViewportUtils.getViewportProfile(requestEnvelope); + assertEquals(profile, ViewportProfile.TV_LANDSCAPE_XLARGE); + } + + @Test + public void tv_side_panel_maps_to_tv_portrait_medium() { + ViewportState viewportState = getViewportState("1080pTVSidePanel"); + RequestEnvelope requestEnvelope = RequestEnvelope.builder() + .withContext(Context.builder().withViewport(viewportState).build()) + .build(); + ViewportProfile profile = ViewportUtils.getViewportProfile(requestEnvelope); + assertEquals(profile, ViewportProfile.TV_PORTRAIT_MEDIUM); + } + + @Test + public void tv_bottom_panel_maps_to_tv_landscape_medium() { + ViewportState viewportState = getViewportState("1080pTVBottomPanel"); + RequestEnvelope requestEnvelope = RequestEnvelope.builder() + .withContext(Context.builder().withViewport(viewportState).build()) + .build(); + ViewportProfile profile = ViewportUtils.getViewportProfile(requestEnvelope); + assertEquals(profile, ViewportProfile.TV_LANDSCAPE_MEDIUM); + } + + @Test + public void unknown_profile_mapped() { + ViewportState viewportState = getViewportState("foo"); + RequestEnvelope requestEnvelope = RequestEnvelope.builder() + .withContext(Context.builder().withViewport(viewportState).build()) + .build(); + ViewportProfile profile = ViewportUtils.getViewportProfile(requestEnvelope); + assertEquals(profile, ViewportProfile.UNKNOWN_VIEWPORT_PROFILE); + } + + private ViewportState getViewportState(String device) { + if(device.equals("Rook")) { + return ViewportState.builder() + .withShape(Shape.ROUND) + .withDpi(BigDecimal.valueOf(160)) + .withCurrentPixelHeight(BigDecimal.valueOf(300)) + .withCurrentPixelWidth(BigDecimal.valueOf(300)) + .build(); + } else if (device.equals("Knight")) { + return ViewportState.builder() + .withShape(Shape.RECTANGLE) + .withDpi(BigDecimal.valueOf(160)) + .withCurrentPixelHeight(BigDecimal.valueOf(600)) + .withCurrentPixelWidth(BigDecimal.valueOf(960)) + .build(); + } else if (device.equals("Bishop")) { + return ViewportState.builder() + .withShape(Shape.RECTANGLE) + .withDpi(BigDecimal.valueOf(160)) + .withCurrentPixelHeight(BigDecimal.valueOf(960)) + .withCurrentPixelWidth(BigDecimal.valueOf(1280)) + .build(); + } else if (device.equals("VoxLandscape")) { + return ViewportState.builder() + .withShape(Shape.RECTANGLE) + .withDpi(BigDecimal.valueOf(240)) + .withCurrentPixelHeight(BigDecimal.valueOf(300)) + .withCurrentPixelWidth(BigDecimal.valueOf(600)) + .build(); + } else if (device.equals("VoxPortrait")) { + return ViewportState.builder() + .withShape(Shape.RECTANGLE) + .withDpi(BigDecimal.valueOf(240)) + .withCurrentPixelHeight(BigDecimal.valueOf(600)) + .withCurrentPixelWidth(BigDecimal.valueOf(300)) + .build(); + } else if (device.equals("FireTabletLandscape")) { + return ViewportState.builder() + .withShape(Shape.RECTANGLE) + .withDpi(BigDecimal.valueOf(240)) + .withCurrentPixelHeight(BigDecimal.valueOf(600)) + .withCurrentPixelWidth(BigDecimal.valueOf(960)) + .build(); + } else if (device.equals("FireTabletPortrait")) { + return ViewportState.builder() + .withShape(Shape.RECTANGLE) + .withDpi(BigDecimal.valueOf(240)) + .withCurrentPixelHeight(BigDecimal.valueOf(960)) + .withCurrentPixelWidth(BigDecimal.valueOf(600)) + .build(); + } else if (device.equals("1080pTV")) { + return ViewportState.builder() + .withShape(Shape.RECTANGLE) + .withDpi(BigDecimal.valueOf(320)) + .withCurrentPixelHeight(BigDecimal.valueOf(960)) + .withCurrentPixelWidth(BigDecimal.valueOf(1920)) + .build(); + } else if (device.equals("1080pTVSidePanel")) { + return ViewportState.builder() + .withShape(Shape.RECTANGLE) + .withDpi(BigDecimal.valueOf(320)) + .withCurrentPixelHeight(BigDecimal.valueOf(1920)) + .withCurrentPixelWidth(BigDecimal.valueOf(300)) + .build(); + } else if (device.equals("1080pTVBottomPanel")) { + return ViewportState.builder() + .withShape(Shape.RECTANGLE) + .withDpi(BigDecimal.valueOf(320)) + .withCurrentPixelHeight(BigDecimal.valueOf(600)) + .withCurrentPixelWidth(BigDecimal.valueOf(960)) + .build(); + } + return ViewportState.builder() + .withShape(Shape.RECTANGLE) + .withDpi(BigDecimal.valueOf(130)) + .withCurrentPixelHeight(BigDecimal.valueOf(1000)) + .withCurrentPixelWidth(BigDecimal.valueOf(1100)) + .build(); + } + +} diff --git a/docs/en/SDK-Supported-Alexa-Capabilities.rst b/docs/en/SDK-Supported-Alexa-Capabilities.rst index 65d0b679..28640282 100644 --- a/docs/en/SDK-Supported-Alexa-Capabilities.rst +++ b/docs/en/SDK-Supported-Alexa-Capabilities.rst @@ -46,5 +46,6 @@ Preview The following capabilities are released as Preview. The interfaces might change during a stable release. +* `APL `__ * `Connections `__ \ No newline at end of file