Microsoft has released a preview version of a dual-screen layout control for Java and Kotlin developers targeting Surface Duo.

“The dual-screen layout control and associated helpers will enable you to build dynamic and responsive apps that take advantage of the Microsoft Surface Duo and its two screens,” Microsoft’s Craig Dunn writes.

The dual-screen layout control builds on Microsoft’s Display Mask API, which is used on Surface Duo to determine what’s happening in areas of the screens that are not used for displaying your app’s content. It includes three elements:

SurfaceDuoLayout. A control that helps manage single-screen and dual-screen layouts in a flexible way.

SurfaceDuoScreenManager. A way to subscribe to screen mode changes and have your app respond accordingly.

ScreenHelper. Provides information about the screen and hinge to help you position elements in your UI.

SurfaceDuoLayout works like a set of two containers when the app is used in span mode and one container in single-screen mode, Microsoft says. The firm offers sample code in both Java and Kotlin.

Tagged with Surface Duo