[WindowManager] update to 1.0.0 stable release (#34)
* [WindowManager] update to rc01 test NuGets from CI https://github.com/xamarin/AndroidX/pull/449 * [all] update Jetpack Window Manager (rc01) * [all] update Jetpack Window Manager (1.0.0 stable) * tweaks * add comments re 1.0.0.7 stable version update * [windowmanager] config tweaks * update README for Jetpack Window Manager support
This commit is contained in:
Родитель
884a903c3c
Коммит
d5fce5d26e
|
@ -135,19 +135,19 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Xamarin.AndroidX.AppCompat">
|
<PackageReference Include="Xamarin.AndroidX.AppCompat">
|
||||||
<Version>1.2.0.5</Version>
|
<Version>1.3.1.4</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Xamarin.AndroidX.CardView">
|
<PackageReference Include="Xamarin.AndroidX.CardView">
|
||||||
<Version>1.0.0</Version>
|
<Version>1.0.0</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Xamarin.AndroidX.ConstraintLayout">
|
<PackageReference Include="Xamarin.AndroidX.ConstraintLayout">
|
||||||
<Version>2.0.4.2</Version>
|
<Version>2.1.1.3</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Xamarin.AndroidX.RecyclerView">
|
<PackageReference Include="Xamarin.AndroidX.RecyclerView">
|
||||||
<Version>1.1.0</Version>
|
<Version>1.1.0</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Xamarin.AndroidX.Window.WindowJava">
|
<PackageReference Include="Xamarin.AndroidX.Window.WindowJava">
|
||||||
<Version>1.0.0.5-beta04</Version>
|
<Version>1.0.0.7</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
|
||||||
|
|
|
@ -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-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
|
02-Dec-21 Updated to AndroidX.Window-1.0.0-beta04
|
||||||
Renamed WindowInfoRepository to WindowInfoTracker, added Activity context parameter
|
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
|
namespace CompanionPane
|
||||||
{
|
{
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
<AndroidResgenClass>Resource</AndroidResgenClass>
|
<AndroidResgenClass>Resource</AndroidResgenClass>
|
||||||
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
|
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
|
||||||
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
|
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
|
||||||
<TargetFrameworkVersion>v11.0</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v12.0</TargetFrameworkVersion>
|
||||||
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
|
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
|
||||||
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
|
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
|
||||||
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
|
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
|
||||||
|
|
|
@ -121,13 +121,13 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Xamarin.AndroidX.AppCompat">
|
<PackageReference Include="Xamarin.AndroidX.AppCompat">
|
||||||
<Version>1.2.0.5</Version>
|
<Version>1.3.1.4</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Xamarin.AndroidX.ConstraintLayout">
|
<PackageReference Include="Xamarin.AndroidX.ConstraintLayout">
|
||||||
<Version>2.0.4.2</Version>
|
<Version>2.1.1.3</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Xamarin.AndroidX.Window.WindowJava">
|
<PackageReference Include="Xamarin.AndroidX.Window.WindowJava">
|
||||||
<Version>1.0.0.5-beta04</Version>
|
<Version>1.0.0.7</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
|
||||||
|
|
|
@ -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-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
|
02-Dec-21 Updated to AndroidX.Window-1.0.0-beta04
|
||||||
Renamed WindowInfoRepository to WindowInfoTracker, added Activity context parameter
|
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
|
namespace DualView
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
|
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
|
||||||
<AndroidResgenClass>Resource</AndroidResgenClass>
|
<AndroidResgenClass>Resource</AndroidResgenClass>
|
||||||
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
|
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
|
||||||
<TargetFrameworkVersion>v11.0</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v12.0</TargetFrameworkVersion>
|
||||||
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
|
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
|
||||||
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
|
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
|
||||||
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
|
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
|
||||||
|
@ -92,10 +92,10 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Xamarin.AndroidX.AppCompat">
|
<PackageReference Include="Xamarin.AndroidX.AppCompat">
|
||||||
<Version>1.2.0.5</Version>
|
<Version>1.3.1.4</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Xamarin.AndroidX.ConstraintLayout">
|
<PackageReference Include="Xamarin.AndroidX.ConstraintLayout">
|
||||||
<Version>2.0.4.2</Version>
|
<Version>2.1.1.3</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -9,7 +9,10 @@ using Android.Webkit;
|
||||||
using Android.Widget;
|
using Android.Widget;
|
||||||
using AndroidX.AppCompat.App;
|
using AndroidX.AppCompat.App;
|
||||||
using Java.Interop;
|
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
|
namespace ExtendCanvas
|
||||||
{
|
{
|
||||||
[Activity(
|
[Activity(
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
<AndroidResgenClass>Resource</AndroidResgenClass>
|
<AndroidResgenClass>Resource</AndroidResgenClass>
|
||||||
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
|
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
|
||||||
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
|
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
|
||||||
<TargetFrameworkVersion>v11.0</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v12.0</TargetFrameworkVersion>
|
||||||
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
|
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
|
||||||
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
|
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
|
||||||
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
|
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
|
||||||
|
|
|
@ -98,16 +98,16 @@
|
||||||
<Version>12.0.3</Version>
|
<Version>12.0.3</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Xamarin.AndroidX.AppCompat">
|
<PackageReference Include="Xamarin.AndroidX.AppCompat">
|
||||||
<Version>1.2.0.5</Version>
|
<Version>1.3.1.4</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Xamarin.AndroidX.CardView">
|
<PackageReference Include="Xamarin.AndroidX.CardView">
|
||||||
<Version>1.0.0</Version>
|
<Version>1.0.0</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Xamarin.AndroidX.ConstraintLayout">
|
<PackageReference Include="Xamarin.AndroidX.ConstraintLayout">
|
||||||
<Version>2.0.4.2</Version>
|
<Version>2.1.1.3</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Xamarin.AndroidX.Window.WindowJava">
|
<PackageReference Include="Xamarin.AndroidX.Window.WindowJava">
|
||||||
<Version>1.0.0.5-beta04</Version>
|
<Version>1.0.0.7</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -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-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
|
02-Dec-21 Updated to AndroidX.Window-1.0.0-beta04
|
||||||
Renamed WindowInfoRepository to WindowInfoTracker, added Activity context parameter
|
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
|
namespace ListDetail
|
||||||
{
|
{
|
||||||
|
|
25
README.md
25
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
|
- Installed [Surface Duo emulator](https://www.microsoft.com/download/details.aspx?id=100847) or connected device
|
||||||
|
|
||||||
## Contents
|
## 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).
|
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.
|
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 `<build> (Android 11.0 - API 30)`.
|
The Surface Duo 2 emulator will appear as `<build> (Android 11.0 - API 30)`.
|
||||||
|
|
||||||
### Xamarin.Android
|
### 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)
|
![Xamarin.Android Surface Duo Companion view sample screenshot](Screenshots/xamarin-companion-shrinked.png)
|
||||||
|
|
||||||
#### CompanionPane
|
#### 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.
|
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
|
- [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
|
- [Microsoft docs](https://docs.microsoft.com/dual-screen/introduction#companion-pane) page
|
||||||
|
|
||||||
#### DragAndDrop
|
#### DragAndDrop
|
||||||
|
|
||||||
Support for drag-and-drop ensures a great user experience using all the different input types supported by the Surface Duo.
|
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).
|
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
|
- [Microsoft docs](https://docs.microsoft.com/dual-screen/xamarin/drag-drop) page
|
||||||
|
|
||||||
#### DualView
|
#### 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.
|
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.
|
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
|
- [Microsoft docs](https://docs.microsoft.com/dual-screen/introduction#extended-canvas) page
|
||||||
|
|
||||||
#### IntentToSecondScreen
|
#### 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).
|
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:
|
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
|
- [Code sample](https://github.com/microsoft/surface-duo-sdk-xamarin-samples/tree/main/IntentToSecondScreen) in repository
|
||||||
|
|
||||||
#### ListDetail
|
#### 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.
|
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.
|
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
|
- [Microsoft docs](https://docs.microsoft.com/dual-screen/introduction#list-detail) page
|
||||||
|
|
||||||
#### TwoPage
|
#### 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.
|
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.
|
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
|
- [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
|
- [Microsoft docs](https://docs.microsoft.com/dual-screen/introduction#two-page) page
|
||||||
|
|
||||||
|
|
||||||
#### WindowManager
|
#### 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
|
### 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*.
|
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)
|
![Xamarin.Forms Surface Duo Sample App Screenshot with list of all included examples](Screenshots/xamarin-forms-menu-shrinked.png)
|
||||||
|
|
||||||
#### TwoPane
|
#### 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.
|
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
|
#### 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
|
- [Microsoft docs](https://docs.microsoft.com/dual-screen/introduction#companion-pane) page
|
||||||
|
|
||||||
#### DualView
|
#### 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.
|
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.
|
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
|
- [Microsoft docs](https://docs.microsoft.com/dual-screen/introduction#dual-view) page
|
||||||
|
|
||||||
#### and many more
|
#### 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.
|
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
|
### (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.
|
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.
|
By replacing `YOUR_API_KEY` string with your actual key the map views will be displayed.
|
||||||
|
|
||||||
|
|
||||||
## Related links
|
## Related links
|
||||||
|
|
||||||
- [App samples](https://github.com/microsoft/surface-duo-app-samples)
|
- [App samples](https://github.com/microsoft/surface-duo-app-samples)
|
||||||
|
|
Двоичные данные
Screenshots/xamarin-window-manager.png
Двоичные данные
Screenshots/xamarin-window-manager.png
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 47 KiB После Ширина: | Высота: | Размер: 145 KiB |
|
@ -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-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
|
02-Dec-21 Updated to AndroidX.Window-1.0.0-beta04
|
||||||
Renamed WindowInfoRepository to WindowInfoTracker, added Activity context parameter
|
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
|
namespace TwoPage
|
||||||
{
|
{
|
||||||
|
|
|
@ -93,13 +93,13 @@
|
||||||
<ItemGroup />
|
<ItemGroup />
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Xamarin.AndroidX.AppCompat">
|
<PackageReference Include="Xamarin.AndroidX.AppCompat">
|
||||||
<Version>1.2.0.5</Version>
|
<Version>1.3.1.4</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Xamarin.AndroidX.ConstraintLayout">
|
<PackageReference Include="Xamarin.AndroidX.ConstraintLayout">
|
||||||
<Version>2.0.4.2</Version>
|
<Version>2.1.1.3</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Xamarin.AndroidX.Window.WindowJava">
|
<PackageReference Include="Xamarin.AndroidX.Window.WindowJava">
|
||||||
<Version>1.0.0.5-beta04</Version>
|
<Version>1.0.0.7</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -18,7 +18,7 @@ using Java.Interop;
|
||||||
https://github.com/googlecodelabs/android-foldable-codelab/tree/main/window-manager
|
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
|
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)
|
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
|
Use OnStart/Stop instead of OnAttachedToWindow/OnDetached
|
||||||
17-Aug-21 Updated to AndroidX.Window-1.0.0-alpha10 with
|
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-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
|
02-Dec-21 Updated to AndroidX.Window-1.0.0-beta04
|
||||||
Renamed WindowInfoRepository to WindowInfoTracker, added Activity context parameter
|
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
|
namespace WindowManagerDemo
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.companyname.windowmanager" android:installLocation="auto">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.companyname.windowmanager" android:installLocation="auto">
|
||||||
<uses-sdk android:minSdkVersion="29" android:targetSdkVersion="31" />
|
<uses-sdk android:minSdkVersion="29" android:targetSdkVersion="24" />
|
||||||
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"></application>
|
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"></application>
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
</manifest>
|
</manifest>
|
|
@ -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.
|
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)
|
![Window Manager example spanned across two screens](../Screenshots/xamarin-window-manager.png)
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">Xamarin WindowInfoRepository beta04</string>
|
<string name="app_name">Xamarin WindowInfoTracker 1.0.0.7</string>
|
||||||
<string name="window_metrics">window metrics</string>
|
<string name="window_metrics">window metrics</string>
|
||||||
<string name="layout_change_text">layout change text</string>
|
<string name="layout_change_text">layout change text</string>
|
||||||
<string name="configuration_changed">Using one logic/physical display - unspanned</string>
|
<string name="configuration_changed">Using one logic/physical display - unspanned</string>
|
||||||
|
|
|
@ -51,6 +51,7 @@
|
||||||
<AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>
|
<AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>
|
||||||
<AndroidLinkMode>SdkOnly</AndroidLinkMode>
|
<AndroidLinkMode>SdkOnly</AndroidLinkMode>
|
||||||
<EmbedAssembliesIntoApk>True</EmbedAssembliesIntoApk>
|
<EmbedAssembliesIntoApk>True</EmbedAssembliesIntoApk>
|
||||||
|
<AndroidSupportedAbis>x86;x86_64;arm64-v8a</AndroidSupportedAbis>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
|
@ -98,14 +99,14 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup />
|
<ItemGroup />
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Xamarin.AndroidX.AppCompat" Version="1.2.0.5" />
|
<PackageReference Include="Xamarin.AndroidX.AppCompat" Version="1.3.1.5" />
|
||||||
<PackageReference Include="Xamarin.AndroidX.ConstraintLayout">
|
<PackageReference Include="Xamarin.AndroidX.ConstraintLayout">
|
||||||
<Version>2.0.4.2</Version>
|
<Version>2.1.2.2</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Xamarin.AndroidX.Window.WindowJava">
|
<PackageReference Include="Xamarin.AndroidX.Window.WindowJava">
|
||||||
<Version>1.0.0.5-beta04</Version>
|
<Version>1.0.0.7</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Xamarin.Google.Android.Material" Version="1.4.0" />
|
<PackageReference Include="Xamarin.Google.Android.Material" Version="1.4.0.6" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<AndroidResource Include="Resources\drawable\ic_launcher_background.xml">
|
<AndroidResource Include="Resources\drawable\ic_launcher_background.xml">
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
|
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
|
||||||
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
|
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
|
||||||
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
|
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
|
||||||
<TargetFrameworkVersion>v11.0</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v12.0</TargetFrameworkVersion>
|
||||||
<AndroidEnableSGenConcurrent>true</AndroidEnableSGenConcurrent>
|
<AndroidEnableSGenConcurrent>true</AndroidEnableSGenConcurrent>
|
||||||
<AndroidUseAapt2>true</AndroidUseAapt2>
|
<AndroidUseAapt2>true</AndroidUseAapt2>
|
||||||
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
|
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
|
||||||
|
|
Загрузка…
Ссылка в новой задаче