![]() This makes RecyclerView automatically change its behavior depending on screen mode. ![]() There are two new layout manager classes in RecyclerView library: Just add the implementation lines as shown above directly to your module-level adle file (see the docs for more info, or explore the package on ). JCenter is a default repository in Android Studio which means you’ll no longer need to add our maven repository feed to your top-level adle file when you include our libraries in your app. Starting with this release we are publishing to the JCenter repository. When you update to this version of the libraries, you should move any dual-screen specific code that was in onCreate to a listener so that your code can work with both core implementations. This means that in onCreate you can add a listener for screen mode change events. The new ScreenManager implementation compensates for this by refactoring the libraries with an event-driven architecture. Instead, the details are accessed after the activity onAttachToWindow callback.Įxisting apps that used the display-mask API in the onCreate method (to lay out views, for example) should move that code later in the activity lifecycle. To align with the lifecycle supported by Window Manager, the library code no longer accesses dual-screen properties in the onCreate method. When you add the other modules (BottomNavigation, etc), they will all work the same regardless of which ScreenManager is included. Implementation ":screenmanager-displaymask:1.0.0-beta1" If you would like to try out the dual-screen libraries in conjunction with the Display Mask API, include the correct ScreenManager component with this gradle line: Over time, the Jetpack Window Manager implementation will be preferred as it provides support for other foldable devices, helping developers get the best return from their investments in dual-screen enhancements.Įxisting apps built on the Display Mask API can continue to use it. Being able to easily swap the implementation allows you to test both, and release with the version you feel most comfortable with. ![]() The underlying Jetpack Window Manager is currently in alpha. The rest of the modules all behave identically, regardless of which ScreenManager has been used, including: Implementation ":screenmanager-windowmanager:1.0.0-beta1" ![]() With this release we now provide the option to use the Jetpack Window Manager as the device interface, which will work with foldable devices beyond the Surface Duo.ĭual-screen device support is encapsulated in the ScreenManager component – use this gradle line to add to your app: Older versions of the dual-screen libraries used the Microsoft display-mask API to provide dual-screen awareness. This blog post explains how to switch between Window Manager and the Display Mask API, tips for migrating from the previous version, and discusses the other new features of this release. Transparency and animation support added to BottomNavigation and Tabs. New RecyclerView layout manager for Microsoft Surface Duo. Includes UI and unit tests for each component. Refactor code so that DisplayMask can still be used by existing developers. Jetpack Window Manager is an option for the core device interface layer. We’ve made the underlying device interface swappable, so you can continue to use the existing Display Mask API as long as you wish and migrate to Window Manager when you’re ready. We’re excited to announce version 1.0.0-beta1 of our dual-screen libraries for Microsoft Surface Duo, which integrates Google’s Jetpack Window Manager support.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |