1
0
Форкнуть 0
Xamarin Samples for Surface Duo SDK
Перейти к файлу
Craig Dunn df7a8d76f4
ensure ScreenHelper reacts to configuration changes (#10)
fixes #9
2021-01-06 08:51:24 -08:00
CompanionPane ensure ScreenHelper reacts to configuration changes (#10) 2021-01-06 08:51:24 -08:00
DragAndDrop add readmes for all sample folders in the solution (#8) 2021-01-06 08:48:26 -08:00
DualView ensure ScreenHelper reacts to configuration changes (#10) 2021-01-06 08:51:24 -08:00
ExtendCanvas add readmes for all sample folders in the solution (#8) 2021-01-06 08:48:26 -08:00
IntentToSecondScreen add readmes for all sample folders in the solution (#8) 2021-01-06 08:48:26 -08:00
MasterDetail ensure ScreenHelper reacts to configuration changes (#10) 2021-01-06 08:51:24 -08:00
Screenshots update readme for samples browser (#7) 2020-08-11 12:24:03 -07:00
TwoPage ensure ScreenHelper reacts to configuration changes (#10) 2021-01-06 08:51:24 -08:00
XamarinForms add readmes for all sample folders in the solution (#8) 2021-01-06 08:48:26 -08:00
.gitignore Added samples 2020-01-20 13:16:35 -05:00
CODE_OF_CONDUCT.md Initial CODE_OF_CONDUCT.md commit 2020-01-20 08:48:25 -08:00
LICENSE Updating LICENSE to template content 2020-01-20 08:48:27 -08:00
README.md update readme for samples browser (#7) 2020-08-11 12:24:03 -07:00
SECURITY.md Initial SECURITY.md commit 2020-01-20 08:48:29 -08:00
Xamarin.Duo.Samples.sln Make Forms sample grab latest DuoSDK 2020-02-21 23:06:05 -05:00

README.md

page_type name languages products description urlFragment
sample Surface Duo - Xamarin SDK samples
csharp
surface-duo
xamarin
Samples showing how to use the Surface Duo SDK to achieve dual-screen user interface patterns using Xamarin and Xamarin.Forms. all

Surface Duo - Xamarin SDK samples

This repo contains Xamarin and Xamarin.Forms Android samples for Surface Duo, all accessible from a single Visual Studio solution.

Get Started

To learn how to load your app on to emulator, and to use it, refer to the Surface Duo developer docs and Xamarin.Forms dual-screen docs.

Build and Test

Xamarin.Forms

  1. Open the Xamarin.Duo.Samples solution

  2. Expand the Xamarin.Forms folder and ensure the DualScreenDemos.Android project is the startup project

  3. Start the Surface Duo emulator - once it has started it will appear in the Visual Studio device list

  4. Run the project, and you will see a menu of different examples to try:

    Menu of Xamarin.Forms dual-screen demos

The TwoPaneView playground lets you experiment with the different layout options it supports. Read the TwoPaneView docs for details on how to control the layout.

Menu of Xamarin.Forms TwoPaneView control playground

Xamarin.Android

  1. Open the Xamarin.Duo.Samples solution
  2. Expand the Xamarin.Android native folder
  3. Choose one of the projects listed as the startup project (eg. Companion Pane, DragAndDrop, DualView, ExtendCanvas, IntentToSecondScreen, MasterDetail, TwoPage)
  4. Start the Surface Duo emulator - once it has started it will appear in the Visual Studio device list
  5. Run the project
  6. Change the startup project to try each sample

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 to create an API key.

After you have an API key, put it in the following files:

  • DualView/Resources/Assets/googlemap.html
  • ExtendCanvas/Resources/Assets/googlemapsearch.html
  • XamarinForms/Xamarin.Duo.Forms.Samples.Android/Assets/googlemap.html
  • XamarinForms/Xamarin.Duo.Forms.Samples.Android/Assets/googlemapsearch.html

By replacing YOUR_API_KEY string with your actual key the map views will be displayed.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.