diff --git a/CompanionPane/CompanionPane.csproj b/CompanionPane/CompanionPane.csproj index 659d543..792bc04 100644 --- a/CompanionPane/CompanionPane.csproj +++ b/CompanionPane/CompanionPane.csproj @@ -135,19 +135,19 @@ - 1.2.0.5 + 1.3.1.4 1.0.0 - 2.0.4.2 + 2.1.1.3 1.1.0 - 1.0.0.5-beta04 + 1.0.0.7 diff --git a/CompanionPane/MainActivity.cs b/CompanionPane/MainActivity.cs index 075031e..be6a97f 100644 --- a/CompanionPane/MainActivity.cs +++ b/CompanionPane/MainActivity.cs @@ -20,6 +20,9 @@ using System.Linq; 02-Nov-21 Updated to AndroidX.Window-1.0.0-beta03 (note: beta03 was never deployed to NuGet.org) 02-Dec-21 Updated to AndroidX.Window-1.0.0-beta04 Renamed WindowInfoRepository to WindowInfoTracker, added Activity context parameter +16-Dec-21 Updated to AndroidX.Window-1.0.0-rc01 +27-Jan-22 Updated to AndroidX.Window-1.0.0 stable release! +09-Feb-22 Updated to AndroidX.Window-1.0.0 stable */ namespace CompanionPane { diff --git a/DragAndDrop/DragAndDrop.csproj b/DragAndDrop/DragAndDrop.csproj index 0b8cfaa..718b1dc 100644 --- a/DragAndDrop/DragAndDrop.csproj +++ b/DragAndDrop/DragAndDrop.csproj @@ -18,7 +18,7 @@ Resource Off false - v11.0 + v12.0 Properties\AndroidManifest.xml Resources Assets diff --git a/DualView/DualView.csproj b/DualView/DualView.csproj index 5458b46..e4ef52a 100644 --- a/DualView/DualView.csproj +++ b/DualView/DualView.csproj @@ -121,13 +121,13 @@ - 1.2.0.5 + 1.3.1.4 - 2.0.4.2 + 2.1.1.3 - 1.0.0.5-beta04 + 1.0.0.7 diff --git a/DualView/MainActivity.cs b/DualView/MainActivity.cs index f52cedc..f03fafb 100644 --- a/DualView/MainActivity.cs +++ b/DualView/MainActivity.cs @@ -19,6 +19,9 @@ using Android.Util; 02-Nov-21 Updated to AndroidX.Window-1.0.0-beta03 (note: beta03 was never deployed to NuGet.org) 02-Dec-21 Updated to AndroidX.Window-1.0.0-beta04 Renamed WindowInfoRepository to WindowInfoTracker, added Activity context parameter +16-Dec-21 Updated to AndroidX.Window-1.0.0-rc01 +27-Jan-22 Updated to AndroidX.Window-1.0.0 stable release! +09-Feb-22 Updated to AndroidX.Window-1.0.0 stable */ namespace DualView { diff --git a/ExtendCanvas/ExtendCanvas.csproj b/ExtendCanvas/ExtendCanvas.csproj index e3c0a08..343910d 100644 --- a/ExtendCanvas/ExtendCanvas.csproj +++ b/ExtendCanvas/ExtendCanvas.csproj @@ -17,7 +17,7 @@ Resources\Resource.designer.cs Resource Off - v11.0 + v12.0 Properties\AndroidManifest.xml Resources Assets @@ -92,10 +92,10 @@ - 1.2.0.5 + 1.3.1.4 - 2.0.4.2 + 2.1.1.3 diff --git a/ExtendCanvas/MainActivity.cs b/ExtendCanvas/MainActivity.cs index 9908485..6756654 100644 --- a/ExtendCanvas/MainActivity.cs +++ b/ExtendCanvas/MainActivity.cs @@ -9,7 +9,10 @@ using Android.Webkit; using Android.Widget; using AndroidX.AppCompat.App; using Java.Interop; - +/* +16-Dec-21 Updated to AndroidX.Window-1.0.0-rc01 +09-Feb-22 Updated to AndroidX.Window-1.0.0 stable +*/ namespace ExtendCanvas { [Activity( diff --git a/IntentToSecondScreen/IntentToSecondScreen.csproj b/IntentToSecondScreen/IntentToSecondScreen.csproj index f36ac5c..175e16b 100644 --- a/IntentToSecondScreen/IntentToSecondScreen.csproj +++ b/IntentToSecondScreen/IntentToSecondScreen.csproj @@ -18,7 +18,7 @@ Resource Off false - v11.0 + v12.0 Properties\AndroidManifest.xml Resources Assets diff --git a/ListDetail/ListDetail.csproj b/ListDetail/ListDetail.csproj index ce78379..3651350 100644 --- a/ListDetail/ListDetail.csproj +++ b/ListDetail/ListDetail.csproj @@ -98,16 +98,16 @@ 12.0.3 - 1.2.0.5 + 1.3.1.4 1.0.0 - 2.0.4.2 + 2.1.1.3 - 1.0.0.5-beta04 + 1.0.0.7 diff --git a/ListDetail/MainActivity.cs b/ListDetail/MainActivity.cs index 521ae08..eabdc98 100644 --- a/ListDetail/MainActivity.cs +++ b/ListDetail/MainActivity.cs @@ -19,6 +19,9 @@ using Android.Util; 02-Nov-21 Updated to AndroidX.Window-1.0.0-beta03 (note: beta03 was never deployed to NuGet.org) 02-Dec-21 Updated to AndroidX.Window-1.0.0-beta04 Renamed WindowInfoRepository to WindowInfoTracker, added Activity context parameter +16-Dec-21 Updated to AndroidX.Window-1.0.0-rc01 +27-Jan-22 Updated to AndroidX.Window-1.0.0 stable release! +09-Feb-22 Updated to AndroidX.Window-1.0.0 stable */ namespace ListDetail { diff --git a/README.md b/README.md index 89bb6d9..a099ce3 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ Before running the samples, be sure that you have the following items installed - Installed [Surface Duo emulator](https://www.microsoft.com/download/details.aspx?id=100847) or connected device ## Contents + This repository features native Xamarin.Android and Xamarin.Forms samples for [different approaches how to work with two screens](https://docs.microsoft.com/dual-screen/introduction). Be sure the Surface Duo emulator is already running or your device is attached to your computer. Select the target of your choicet from the Visual Studio device list before running the sample. @@ -33,17 +34,22 @@ Be sure the Surface Duo emulator is already running or your device is attached t The Surface Duo 2 emulator will appear as ` (Android 11.0 - API 30)`. ### Xamarin.Android -Every sample of Xamarin.Android is a runable project. To start for example the `CampanionPane` sample, expand the `Xamarin.Android Native` folder and set the related sample as *Startup project*. + +The Xamarin.Android samples all use the [Xamarin.AndroidX.Window.WindowJava](https://www.nuget.org/packages/Xamarin.AndroidX.Window.WindowJava/) NuGet, which exposes the Jetpack Window Manager package for dual-screen and foldable support on Surface Duo and other devices. + +Every sample of Xamarin.Android is a runnable project. To start for example the `CampanionPane` sample, expand the `Xamarin.Android Native` folder and set the related sample as *Startup project*. ![Xamarin.Android Surface Duo Companion view sample screenshot](Screenshots/xamarin-companion-shrinked.png) #### CompanionPane + The `companion pane` pattern is a great opportunity to take advantage of added screen real-estate by taking second-level surfaces that are otherwise hidden and exposing them when the app is spanned. - [Code sample](https://github.com/microsoft/surface-duo-sdk-xamarin-samples/tree/main/CompanionPane) in repository - [Microsoft docs](https://docs.microsoft.com/dual-screen/introduction#companion-pane) page #### DragAndDrop + Support for drag-and-drop ensures a great user experience using all the different input types supported by the Surface Duo. This sample demonstrates how to implement drag-and drop in your Android app, following the [Android drag and drop guidance](https://developer.android.com/guide/topics/ui/drag-drop). @@ -52,6 +58,7 @@ This sample demonstrates how to implement drag-and drop in your Android app, fol - [Microsoft docs](https://docs.microsoft.com/dual-screen/xamarin/drag-drop) page #### DualView + Having two screens provides a natural affordance to compare and contrast two versions of the same type of content side-by-side, like two images, lists, or documents. It can also be used to show the same information in two different ways at the same time, with each screen working seamlessly to provide more information to the user. For example, a list of restaurants on one screen, and a map with locations on the other. @@ -68,12 +75,14 @@ This pattern only applies to the canvas portion of the UI. You may still need to - [Microsoft docs](https://docs.microsoft.com/dual-screen/introduction#extended-canvas) page #### IntentToSecondScreen + This sample demonstrates how to cause an activity to open on the second screen (as long as it's empty, otherwise the activity will launch over the current one). In the main activity, choose an option to start: another activity from the current app or a URL in a browser window: - [Code sample](https://github.com/microsoft/surface-duo-sdk-xamarin-samples/tree/main/IntentToSecondScreen) in repository #### ListDetail + The *list-detail* pattern has a main pane (usually with a list view) and a details pane for content. When an item in the list is selected, the details pane is updated. This pattern is naturally good for when you have a wider viewing area. It is frequently used for email and address books. Taking advantage of the two distinct screens and snapping to the natural boundary, you could use one screen to show the "items" list and the other to show details of the selected item. @@ -82,22 +91,27 @@ Taking advantage of the two distinct screens and snapping to the natural boundar - [Microsoft docs](https://docs.microsoft.com/dual-screen/introduction#list-detail) page #### TwoPage + Some apps naturally tend to a book-like paging experience. You can use the natural boundary to show several items from a collection -like pages or pictures - which otherwise might have required the user to view one at a time. Depending on your app, you could decide to paginate per 2 pages or advance one page at a time. - [Code sample](https://github.com/microsoft/surface-duo-sdk-xamarin-samples/tree/main/TwoPage) in repository - [Microsoft docs](https://docs.microsoft.com/dual-screen/introduction#two-page) page - #### WindowManager -Visit the [Window Manager for Xamarin docs](https://docs.microsoft.com/dual-screen/xamarin/) for more information on using Window Manager in your apps. + +Visit the [Jetpack Window Manager for Xamarin docs](https://docs.microsoft.com/dual-screen/xamarin/jetpack-window-manager/) for more information on using Jetpack Window Manager in your apps. ### Xamarin.Forms + +The Xamarin.Forms samples all use the [Xamarin.Forms.DualScreen](https://www.nuget.org/packages/Xamarin.Forms.DualScreen/) NuGet, which exposes the underlying [Xamarin.DuoSDK](https://www.nuget.org/packages/Xamarin.DuoSDK) NuGet that only works on Surface Duo devices. + All samples on how to use the SDK using Xamarin.Forms are in one sample app. Expand the solution's `Xamarin.Forms` folder and ensure the `DualScreenDemos.Android` project is the *startup project*. ![Xamarin.Forms Surface Duo Sample App Screenshot with list of all included examples](Screenshots/xamarin-forms-menu-shrinked.png) #### TwoPane + The `TwoPaneView playground` lets you experiment with the different layout options it supports. [Read the TwoPaneView docs](https://docs.microsoft.com/dual-screen/xamarin/twopaneview) for details on how to control the layout. #### CompanionPane @@ -107,6 +121,7 @@ The `companion pane` pattern is a great opportunity to take advantage of added s - [Microsoft docs](https://docs.microsoft.com/dual-screen/introduction#companion-pane) page #### DualView + Having two screens provides a natural affordance to compare and contrast two versions of the same type of content side-by-side, like two images, lists, or documents. It can also be used to show the same information in two different ways at the same time, with each screen working seamlessly to provide more information to the user. For example, a list of restaurants on one screen, and a map with locations on the other. @@ -114,10 +129,9 @@ It can also be used to show the same information in two different ways at the sa - [Microsoft docs](https://docs.microsoft.com/dual-screen/introduction#dual-view) page #### and many more + The sample itself uses diffrent controls itself that brings the unique features of dual screen devices to life. Other examples are focuses on diffrent APIs like the `Xamarin.Forms DualScreenInfo API`. [Read the Microsoft docs article](https://docs.microsoft.com/dual-screen/xamarin/dualscreeninfo) for further information. - - ### (Optional) Add API keys To use the **DualView** and **ExtendCanvas** samples, you will first need to create an Google Map API key. Follow the instructions outlined [here](https://developers.google.com/maps/documentation/javascript/get-api-key) to create an API key. @@ -131,7 +145,6 @@ After you have an API key, put it in the following files: By replacing `YOUR_API_KEY` string with your actual key the map views will be displayed. - ## Related links - [App samples](https://github.com/microsoft/surface-duo-app-samples) @@ -155,4 +168,4 @@ provided by the bot. You will only need to do this once across all repos using o This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or -contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. \ No newline at end of file +contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. diff --git a/Screenshots/xamarin-window-manager.png b/Screenshots/xamarin-window-manager.png index de5cabc..7d70cac 100644 Binary files a/Screenshots/xamarin-window-manager.png and b/Screenshots/xamarin-window-manager.png differ diff --git a/TwoPage/MainActivity.cs b/TwoPage/MainActivity.cs index 7179a86..fa0e790 100644 --- a/TwoPage/MainActivity.cs +++ b/TwoPage/MainActivity.cs @@ -34,6 +34,9 @@ using Android.Util; 02-Nov-21 Updated to AndroidX.Window-1.0.0-beta03 (note: beta03 was never deployed to NuGet.org) 02-Dec-21 Updated to AndroidX.Window-1.0.0-beta04 Renamed WindowInfoRepository to WindowInfoTracker, added Activity context parameter +16-Dec-21 Updated to AndroidX.Window-1.0.0-rc01 +27-Jan-22 Updated to AndroidX.Window-1.0.0 stable release! +09-Feb-22 Updated to AndroidX.Window-1.0.0 stable */ namespace TwoPage { diff --git a/TwoPage/TwoPage.csproj b/TwoPage/TwoPage.csproj index ee7dce6..899bf39 100644 --- a/TwoPage/TwoPage.csproj +++ b/TwoPage/TwoPage.csproj @@ -93,13 +93,13 @@ - 1.2.0.5 + 1.3.1.4 - 2.0.4.2 + 2.1.1.3 - 1.0.0.5-beta04 + 1.0.0.7 diff --git a/WindowManager/MainActivity.cs b/WindowManager/MainActivity.cs index 9631af7..27fa916 100644 --- a/WindowManager/MainActivity.cs +++ b/WindowManager/MainActivity.cs @@ -18,7 +18,7 @@ using Java.Interop; https://github.com/googlecodelabs/android-foldable-codelab/tree/main/window-manager which is part of a Google Codelab that explains how to use Window Manager -19-Jul-21 Update to androidx.window-1.0.0-apha09 +19-Jul-21 Update to androidx.window-1.0.0-alpha09 FoldingFeature API changes - some properties became methods (GetOrientation, GetState, GetOcclusionType) and their types became "enums" (static class fields) Use OnStart/Stop instead of OnAttachedToWindow/OnDetached 17-Aug-21 Updated to AndroidX.Window-1.0.0-alpha10 with @@ -30,6 +30,9 @@ using Java.Interop; 02-Nov-21 Updated to AndroidX.Window-1.0.0-beta03 (note: beta03 was never deployed to NuGet.org) 02-Dec-21 Updated to AndroidX.Window-1.0.0-beta04 Renamed WindowInfoRepository to WindowInfoTracker, added Activity context parameter +16-Dec-21 Updated to AndroidX.Window-1.0.0-rc01 +27-Jan-22 Updated to AndroidX.Window-1.0.0 stable release! +09-Feb-22 Updated to AndroidX.Window-1.0.0 stable */ namespace WindowManagerDemo { diff --git a/WindowManager/Properties/AndroidManifest.xml b/WindowManager/Properties/AndroidManifest.xml index a44c992..15a2506 100644 --- a/WindowManager/Properties/AndroidManifest.xml +++ b/WindowManager/Properties/AndroidManifest.xml @@ -1,6 +1,6 @@  - + \ No newline at end of file diff --git a/WindowManager/README.md b/WindowManager/README.md index 646e429..d333952 100644 --- a/WindowManager/README.md +++ b/WindowManager/README.md @@ -2,7 +2,7 @@ Visit the [Window Manager for Xamarin docs](https://docs.microsoft.com/dual-screen/xamarin/) for more information on using Window Manager in your apps. -> NOTE: uses Xamarin.Android.Window.WindowJava-1.0.0.5-beta04, based on Jetpack Window Manager beta04 packages +> NOTE: uses Xamarin.Android.Window.WindowJava-1.0.0.7, based on Jetpack Window Manager 1.0.0 stable packages ![Window Manager example spanned across two screens](../Screenshots/xamarin-window-manager.png) diff --git a/WindowManager/Resources/values/strings.xml b/WindowManager/Resources/values/strings.xml index 0103848..4541abc 100644 --- a/WindowManager/Resources/values/strings.xml +++ b/WindowManager/Resources/values/strings.xml @@ -1,5 +1,5 @@ - Xamarin WindowInfoRepository beta04 + Xamarin WindowInfoTracker 1.0.0.7 window metrics layout change text Using one logic/physical display - unspanned diff --git a/WindowManager/WindowManager.csproj b/WindowManager/WindowManager.csproj index a76270a..ffe7679 100644 --- a/WindowManager/WindowManager.csproj +++ b/WindowManager/WindowManager.csproj @@ -51,6 +51,7 @@ False SdkOnly True + x86;x86_64;arm64-v8a @@ -98,14 +99,14 @@ - + - 2.0.4.2 + 2.1.2.2 - 1.0.0.5-beta04 + 1.0.0.7 - + diff --git a/XamarinForms/DualScreenDemos.Android/DualScreenDemos.Android.csproj b/XamarinForms/DualScreenDemos.Android/DualScreenDemos.Android.csproj index 2f80aea..e35395e 100644 --- a/XamarinForms/DualScreenDemos.Android/DualScreenDemos.Android.csproj +++ b/XamarinForms/DualScreenDemos.Android/DualScreenDemos.Android.csproj @@ -16,7 +16,7 @@ Properties\AndroidManifest.xml Resources Assets - v11.0 + v12.0 true true Xamarin.Android.Net.AndroidClientHandler