diff --git a/CompanionPane/README.md b/CompanionPane/README.md new file mode 100644 index 0000000..941dfa2 --- /dev/null +++ b/CompanionPane/README.md @@ -0,0 +1,11 @@ +# CompanionPane sample for Surface Duo with Xamarin.Android + +Read about the [Companion pane user experience](https://docs.microsoft.com/dual-screen/introduction#companion-pane) and visit the [docs page](https://docs.microsoft.com/dual-screen/android/sample-code/companion-pane) for more information. + +![Companion pane sample](Screenshots/companion-pane-500.png) + +## Related links + +- [Introduction to dual-screen devices](https://docs.microsoft.com/dual-screen/introduction) +- [Get the Surface Duo emulator](https://docs.microsoft.com/dual-screen/android/emulator/) +- [Xamarin.Android documentation](https://docs.microsoft.com/xamarin/android/) diff --git a/CompanionPane/Screenshots/companion-pane-500.png b/CompanionPane/Screenshots/companion-pane-500.png new file mode 100644 index 0000000..7150677 Binary files /dev/null and b/CompanionPane/Screenshots/companion-pane-500.png differ diff --git a/DragAndDrop/README.md b/DragAndDrop/README.md new file mode 100644 index 0000000..4728a46 --- /dev/null +++ b/DragAndDrop/README.md @@ -0,0 +1,12 @@ +# Drag and drop sample for Surface Duo (using C# and Xamarin) + +Visit the [drag and drop docs page](https://docs.microsoft.com/dual-screen/android/sample-code/drag-drop/) for more information. + +To test drag and drop behavior, drag the image or text from the left screen onto the target areas on the right: + +![Drag and drop sample](Screenshots/drag-drop-500.png) + +## Related links + +- [Drag and drop for Surface Duo doc](https://docs.microsoft.com/dual-screen/android/sample-code/drag-drop/) +- [Get the Surface Duo emulator](https://docs.microsoft.com/dual-screen/android/emulator/) diff --git a/DragAndDrop/Screenshots/drag-drop-500.png b/DragAndDrop/Screenshots/drag-drop-500.png new file mode 100644 index 0000000..97cfacd Binary files /dev/null and b/DragAndDrop/Screenshots/drag-drop-500.png differ diff --git a/DualView/README.md b/DualView/README.md new file mode 100644 index 0000000..27d3952 --- /dev/null +++ b/DualView/README.md @@ -0,0 +1,11 @@ +# DualView sample for Surface Duo with Xamarin.Android + +Read about the [Dual view user experience](https://docs.microsoft.com/dual-screen/introduction#dual-view) and visit the [docs page](https://docs.microsoft.com/dual-screen/android/sample-code/dual-view) for more information. + +![Dual view sample spanned across two screens](Screenshots/dual-view-500.png) + +## Related links + +- [Introduction to dual-screen devices](https://docs.microsoft.com/dual-screen/introduction) +- [Get the Surface Duo emulator](https://docs.microsoft.com/dual-screen/android/emulator/) +- [Xamarin.Android documentation](https://docs.microsoft.com/xamarin/android/) diff --git a/DualView/Screenshots/dual-view-500.png b/DualView/Screenshots/dual-view-500.png new file mode 100644 index 0000000..08cd92d Binary files /dev/null and b/DualView/Screenshots/dual-view-500.png differ diff --git a/ExtendCanvas/README.md b/ExtendCanvas/README.md new file mode 100644 index 0000000..b756f94 --- /dev/null +++ b/ExtendCanvas/README.md @@ -0,0 +1,11 @@ +# ExtendCanvas sample for Surface Duo with Xamarin.Android + +Read about the [Extended Canvas user experience](https://docs.microsoft.com/dual-screen/introduction#extended-canvas) and visit the [docs page](https://docs.microsoft.com/dual-screen/android/sample-code/extended-canvas) for more information. + +![Extended canvas sample spanned across two screens](Screenshots/extended-canvas-500.png) + +## Related links + +- [Introduction to dual-screen devices](https://docs.microsoft.com/dual-screen/introduction) +- [Get the Surface Duo emulator](https://docs.microsoft.com/dual-screen/android/emulator/) +- [Xamarin.Android documentation](https://docs.microsoft.com/xamarin/android/) diff --git a/ExtendCanvas/Screenshots/extended-canvas-500.png b/ExtendCanvas/Screenshots/extended-canvas-500.png new file mode 100644 index 0000000..472af9f Binary files /dev/null and b/ExtendCanvas/Screenshots/extended-canvas-500.png differ diff --git a/IntentToSecondScreen/README.md b/IntentToSecondScreen/README.md new file mode 100644 index 0000000..ffbaaf4 --- /dev/null +++ b/IntentToSecondScreen/README.md @@ -0,0 +1,38 @@ +# Intent to second screen sample for Surface Duo (using C# and Xamarin) + +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: + +![Intent to second screen menu](Screenshots/intent-second-screen-menu-500.png) + +If the launcher is still visible on the other screen, the new activity will appear there: + +![Intent opened on second screen](Screenshots/intent-second-screen-500.png) + +The sample uses these functions to set the intent flags required to start on the second screen if available: + +```csharp +void StartIntentSecondActivity() +{ + var intent = new Intent(this, typeof(SecondActivity)); + // Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT is required to launch a second activity + // on a second display while still keeping the first activity on the first display + // (not pausing/stopping it) + intent.AddFlags(ActivityFlags.LaunchAdjacent | ActivityFlags.NewTask); + StartActivity(intent); +} + +void StartIntentBrowserApp(string url) +{ + var intent = new Intent(Intent.ActionView, Android.Net.Uri.Parse(url)); + intent.AddFlags(ActivityFlags.LaunchAdjacent | ActivityFlags.NewTask); + StartActivity(intent); +} +``` + +## Related links + +- [Launch intent to second screen docs](https://docs.microsoft.com/dual-screen/android/sample-code/launch-to-second-screen/) +- [Introduction to dual-screen devices](https://docs.microsoft.com/dual-screen/introduction) +- [Get the Surface Duo emulator](https://docs.microsoft.com/dual-screen/android/emulator/) diff --git a/IntentToSecondScreen/Screenshots/intent-second-screen-500.png b/IntentToSecondScreen/Screenshots/intent-second-screen-500.png new file mode 100644 index 0000000..41f677b Binary files /dev/null and b/IntentToSecondScreen/Screenshots/intent-second-screen-500.png differ diff --git a/IntentToSecondScreen/Screenshots/intent-second-screen-menu-500.png b/IntentToSecondScreen/Screenshots/intent-second-screen-menu-500.png new file mode 100644 index 0000000..9bc7abc Binary files /dev/null and b/IntentToSecondScreen/Screenshots/intent-second-screen-menu-500.png differ diff --git a/MasterDetail/README.md b/MasterDetail/README.md new file mode 100644 index 0000000..1ba912b --- /dev/null +++ b/MasterDetail/README.md @@ -0,0 +1,11 @@ +# List-detail sample for Surface Duo with Xamarin.Android + +Read about the [List detail user experience](https://docs.microsoft.com/dual-screen/introduction#list-detail) and visit the [docs page](https://docs.microsoft.com/dual-screen/android/sample-code/list-detail) for more information. + +![List detail example spanned across two screens](Screenshots/list-detail-500.png) ![List detail on a single screen](Screenshots/list-detail-250.png) + +## Related links + +- [Introduction to dual-screen devices](https://docs.microsoft.com/dual-screen/introduction) +- [Get the Surface Duo emulator](https://docs.microsoft.com/dual-screen/android/emulator/) +- [Xamarin.Android documentation](https://docs.microsoft.com/xamarin/android/) diff --git a/MasterDetail/Screenshots/list-detail-250.png b/MasterDetail/Screenshots/list-detail-250.png new file mode 100644 index 0000000..4de80ac Binary files /dev/null and b/MasterDetail/Screenshots/list-detail-250.png differ diff --git a/MasterDetail/Screenshots/list-detail-500.png b/MasterDetail/Screenshots/list-detail-500.png new file mode 100644 index 0000000..d5f2fb9 Binary files /dev/null and b/MasterDetail/Screenshots/list-detail-500.png differ diff --git a/TwoPage/README.md b/TwoPage/README.md new file mode 100644 index 0000000..645f321 --- /dev/null +++ b/TwoPage/README.md @@ -0,0 +1,11 @@ +# TwoPage sample for Surface Duo with Xamarin.Android + +Read about the [Two Page user experience](https://docs.microsoft.com/dual-screen/introduction#two-page) and visit the [docs page](https://docs.microsoft.com/dual-screen/android/sample-code/two-page) for more information. + +![Two Page example spanned across two screens](Screenshots/two-page-500.png) + +## Related links + +- [Introduction to dual-screen devices](https://docs.microsoft.com/dual-screen/introduction) +- [Get the Surface Duo emulator](https://docs.microsoft.com/dual-screen/android/emulator/) +- [Xamarin.Android documentation](https://docs.microsoft.com/xamarin/android/) diff --git a/TwoPage/Screenshots/two-page-500.png b/TwoPage/Screenshots/two-page-500.png new file mode 100644 index 0000000..5c35923 Binary files /dev/null and b/TwoPage/Screenshots/two-page-500.png differ diff --git a/XamarinForms/README.md b/XamarinForms/README.md new file mode 100644 index 0000000..7251f1c --- /dev/null +++ b/XamarinForms/README.md @@ -0,0 +1,23 @@ +# Xamarin.Forms sample for Surface Duo + +This solution contains two projects: + +- **DualScreenDemos** - the Xamarin.Forms shared-code for this sample. +- **DualScreenDemos.Android** - the Android app (set this as the Startup Project). + +The code uses the [Xamarin.Forms.DualScreen](https://www.nuget.org/packages/Xamarin.Forms.DualScreen/) NuGet package to enable Surface Duo-specific dual-screen functionality. + +The menu of options available in the sample is shown below. It includes basic demonstrations of each of the five [dual-screen UX patterns](https://docs.microsoft.com/dual-screen/introduction#dual-screen-app-patterns) as well as the TwoPaneView playground: + +![Surface Duo sample app menu](Screenshots/xamarin-forms-menu-500.png) + +The TwoPaneView control is a new layout optimized for the Surface Duo, but which provides a powerful split-view control that works on all platforms: + +![Surface Duo Xamarin.Forms TwoPaneView demo screen](Screenshots/xamarin-forms-twopaneview-500.png) + +## Related links + +- [Introduction to dual-screen devices](https://docs.microsoft.com/dual-screen/introduction) +- [Get the Surface Duo emulator](https://docs.microsoft.com/dual-screen/android/emulator/) +- [Surface Duo Xamarin developer docs](https://docs.microsoft.com/dual-screen/xamarin/) +- [Xamarin.Forms docs](https://docs.microsoft.com/xamarin/xamarin-forms/app-fundamentals/dual-screen/) diff --git a/XamarinForms/Screenshots/xamarin-forms-menu-500.png b/XamarinForms/Screenshots/xamarin-forms-menu-500.png new file mode 100644 index 0000000..d55666f Binary files /dev/null and b/XamarinForms/Screenshots/xamarin-forms-menu-500.png differ diff --git a/XamarinForms/Screenshots/xamarin-forms-twopaneview-500.png b/XamarinForms/Screenshots/xamarin-forms-twopaneview-500.png new file mode 100644 index 0000000..a80d2c3 Binary files /dev/null and b/XamarinForms/Screenshots/xamarin-forms-twopaneview-500.png differ