These code samples were used in the Microsoft Build 2020 session How to bring your Android apps to Surface Duo with Xamarin.
The session begins with the code for this quickstart documentation. It's been copied from the Xamarin samples GitHub to this folder for reference.
In the session, this sample is used to test how the app works on the Surface Duo emulator.
In this step the sample is modified to support Android drag-and-drop. Three files are added/changed:
- Notes/ItemDragAndDropEffect.cs - Xamarin.Forms effect in common code
- Notes.Android/ItemDragAndDropEffect.cs - Effect implementation for Android
- NotesPage.xaml - Effect added to XAML
The DragAndDrop sample can be used as the 'drag target' to test.
In this step the sample is modified to support dual-screen display using the TwoPaneView
. These files are added/changed:
- Notes.Android/MainActivity.cs -
DualScreenService.Init(this);
- Notes/App.xaml.cs - use new
MainPage
- Notes/NoteEntryPage.xaml+cs - convert to ContentView, move nav/lifecycle methods
- Notes/NotesPage.xaml+cs - convert to ContentView, move nav/lifecycle methods
- Notes/MainPage.xaml+cs - hosts
TwoPaneView
and nav/lifecycle methods
Learn more about the TwoPaneView
in the docs.
Other samples:
- Duo Notes - further enhanced version of this Notes demo.
- XamarinTV
- Food delivery