{"id":517,"date":"2020-07-09T10:24:42","date_gmt":"2020-07-09T17:24:42","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/surface-duo\/?p=517"},"modified":"2022-05-26T10:48:30","modified_gmt":"2022-05-26T17:48:30","slug":"new-microsoft-surface-duo-app-samples","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/surface-duo\/new-microsoft-surface-duo-app-samples\/","title":{"rendered":"New Microsoft Surface Duo app samples"},"content":{"rendered":"<p>Hello\u00a0Microsoft\u00a0Surface Duo developers!<\/p>\n<p>Kristen and I are interns on the Surface Duo Developer Experience team, and we\u2019re excited to announce two new Microsoft Surface Duo dual-screen samples available that embody some of our <a href=\"https:\/\/docs.microsoft.com\/dual-screen\/introduction#dual-screen-app-patterns\">dual-screen UX patterns<\/a>. You can find them on GitHub at <a href=\"https:\/\/github.com\/microsoft\/surface-duo-app-samples\">github.com\/microsoft\/surface-duo-app-samples<\/a>.<\/p>\n<h2>Photo Editor<\/h2>\n<p>As the name suggests, <a href=\"https:\/\/github.com\/microsoft\/surface-duo-app-samples\/tree\/main\/PhotoEditor\">this sample is a simple photo editing app<\/a>. It demonstrates the <a href=\"https:\/\/docs.microsoft.com\/dual-screen\/introduction#companion-pane\">companion pane UX pattern<\/a> and how to take advantage of <a href=\"https:\/\/docs.microsoft.com\/dual-screen\/android\/sample-code\/drag-drop\">drag and drop<\/a> on dual screens.<\/p>\n<p>The Photo Editor app lets users perform three main actions:<\/p>\n<h3>Select<\/h3>\n<p>Although the application provides a default image, users can also import other photos for editing. Click on the currently displayed image to select a new image from the device\u2019s photo gallery, or just drag and drop an image file over the currently displayed image (Figure 1).<\/p>\n<p><img decoding=\"async\" width=\"750\" height=\"515\" class=\"wp-image-518\" src=\"https:\/\/devblogs.microsoft.com\/surface-duo\/wp-content\/uploads\/sites\/53\/2020\/07\/word-image.png\" alt=\"Importing an image through drag and drop\" srcset=\"https:\/\/devblogs.microsoft.com\/surface-duo\/wp-content\/uploads\/sites\/53\/2020\/07\/word-image.png 750w, https:\/\/devblogs.microsoft.com\/surface-duo\/wp-content\/uploads\/sites\/53\/2020\/07\/word-image-300x206.png 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/p>\n<p><em>Figure 1. Importing an image through drag and drop<\/em><\/p>\n<h3>Edit<\/h3>\n<p>A variety of controls are available to edit image properties, such as brightness, saturation, and warmth. As is characteristic of the <a href=\"https:\/\/docs.microsoft.com\/dual-screen\/introduction#companion-pane\">Companion Pane<\/a> pattern, the number of visible controls increases when the app is spanned across both screens (see Figures 1 and 2).<\/p>\n<p><img decoding=\"async\" width=\"750\" height=\"515\" class=\"wp-image-519\" src=\"https:\/\/devblogs.microsoft.com\/surface-duo\/wp-content\/uploads\/sites\/53\/2020\/07\/word-image-1.png\" alt=\"Dual-screen view of app (portrait)\" srcset=\"https:\/\/devblogs.microsoft.com\/surface-duo\/wp-content\/uploads\/sites\/53\/2020\/07\/word-image-1.png 750w, https:\/\/devblogs.microsoft.com\/surface-duo\/wp-content\/uploads\/sites\/53\/2020\/07\/word-image-1-300x206.png 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/p>\n<p><em>Figure 2. Dual-screen view of app (portrait)<\/em><\/p>\n<h3>Save<\/h3>\n<p>To save any changes made, click the <strong>Save <\/strong>button and a copy of the edited image will be saved to the device\u2019s photo gallery (Figure 3).<\/p>\n<p><img decoding=\"async\" width=\"471\" height=\"750\" class=\"wp-image-520\" src=\"https:\/\/devblogs.microsoft.com\/surface-duo\/wp-content\/uploads\/sites\/53\/2020\/07\/word-image-2.png\" alt=\"Dual-screen view of app (landscape)\" srcset=\"https:\/\/devblogs.microsoft.com\/surface-duo\/wp-content\/uploads\/sites\/53\/2020\/07\/word-image-2.png 471w, https:\/\/devblogs.microsoft.com\/surface-duo\/wp-content\/uploads\/sites\/53\/2020\/07\/word-image-2-188x300.png 188w\" sizes=\"(max-width: 471px) 100vw, 471px\" \/><\/p>\n<p><em>Figure 3. Dual-screen view of app (landscape)<\/em><\/p>\n<h2>Source Editor<\/h2>\n<p><a href=\"https:\/\/github.com\/microsoft\/surface-duo-app-samples\/tree\/main\/SourceEditor\">This source editor sample<\/a> features an HTML editor and formatter that enable real-time editing and previewing of formatted source code. Making use of the <a href=\"https:\/\/docs.microsoft.com\/dual-screen\/introduction#dual-view\">DualView<\/a> app pattern, users can quickly test out code ideas in a variety of orientation configurations. To save and access code changes, the app supports file saving, loading, and drag-and-drop features.<\/p>\n<h3>Single-screen view<\/h3>\n<p>In single screen mode, users can switch back and forth between code and preview mode. On the other screen, they can make use of other applications or windows like developer forums. Using buttons within the application, transitions can be triggered to switch between views (Figure 4).<\/p>\n<p><img decoding=\"async\" width=\"1099\" height=\"741\" class=\"wp-image-521\" src=\"https:\/\/devblogs.microsoft.com\/surface-duo\/wp-content\/uploads\/sites\/53\/2020\/07\/word-image-3.png\" alt=\"Single-screen preview view (portrait)\" srcset=\"https:\/\/devblogs.microsoft.com\/surface-duo\/wp-content\/uploads\/sites\/53\/2020\/07\/word-image-3.png 1099w, https:\/\/devblogs.microsoft.com\/surface-duo\/wp-content\/uploads\/sites\/53\/2020\/07\/word-image-3-300x202.png 300w, https:\/\/devblogs.microsoft.com\/surface-duo\/wp-content\/uploads\/sites\/53\/2020\/07\/word-image-3-1024x690.png 1024w, https:\/\/devblogs.microsoft.com\/surface-duo\/wp-content\/uploads\/sites\/53\/2020\/07\/word-image-3-768x518.png 768w\" sizes=\"(max-width: 1099px) 100vw, 1099px\" \/><\/p>\n<p><em>Figure 4. Single-screen preview view (portrait)<\/em><\/p>\n<h3>Dual-screen view<\/h3>\n<p>The app highlights the possibilities of developing for dual-screen devices and demonstrates the view using Surface Duo in dual-screen mode. Both screens are visible, so the UI is free of extra buttons. When using <a href=\"https:\/\/developer.android.com\/topic\/libraries\/architecture\/viewmodel\">ViewModels<\/a> and <a href=\"https:\/\/developer.android.com\/reference\/android\/arch\/lifecycle\/LiveData\">LiveData<\/a> to communicate between <a href=\"https:\/\/developer.android.com\/guide\/components\/fragments\">fragments<\/a> (the individual views), real-time preview updates and mirrored scrolling are enabled (Figure 5).<\/p>\n<p><img decoding=\"async\" width=\"1099\" height=\"742\" class=\"wp-image-522\" src=\"https:\/\/devblogs.microsoft.com\/surface-duo\/wp-content\/uploads\/sites\/53\/2020\/07\/word-image-4.png\" alt=\"Demonstration of DualView app pattern (portrait)\" srcset=\"https:\/\/devblogs.microsoft.com\/surface-duo\/wp-content\/uploads\/sites\/53\/2020\/07\/word-image-4.png 1099w, https:\/\/devblogs.microsoft.com\/surface-duo\/wp-content\/uploads\/sites\/53\/2020\/07\/word-image-4-300x203.png 300w, https:\/\/devblogs.microsoft.com\/surface-duo\/wp-content\/uploads\/sites\/53\/2020\/07\/word-image-4-1024x691.png 1024w, https:\/\/devblogs.microsoft.com\/surface-duo\/wp-content\/uploads\/sites\/53\/2020\/07\/word-image-4-768x519.png 768w\" sizes=\"(max-width: 1099px) 100vw, 1099px\" \/><\/p>\n<p><em>Figure 5. Demonstration of DualView app pattern (portrait)<\/em><\/p>\n<h3>Orientation and layout configurations<\/h3>\n<p>In addition to spanning changes in the app, rotation changes also enable increased usability. One particularly helpful feature is editing code in dual-screen portrait mode. With the keyboard on one screen and the editor on the other, the user\u2019s experience becomes like that of a laptop (Figure 6).<\/p>\n<p><img decoding=\"async\" width=\"471\" height=\"751\" src=\"https:\/\/devblogs.microsoft.com\/surface-duo\/wp-content\/uploads\/sites\/53\/2020\/07\/dual_editor_keyboard-1.png\" alt=\"Editor view with keyboard companion (landscape)\" class=\"alignnone size-full wp-image-528\" srcset=\"https:\/\/devblogs.microsoft.com\/surface-duo\/wp-content\/uploads\/sites\/53\/2020\/07\/dual_editor_keyboard-1.png 471w, https:\/\/devblogs.microsoft.com\/surface-duo\/wp-content\/uploads\/sites\/53\/2020\/07\/dual_editor_keyboard-1-188x300.png 188w\" sizes=\"(max-width: 471px) 100vw, 471px\" \/><\/p>\n<p><em>Figure 6. Editor view with keyboard companion (landscape)<\/em><\/p>\n<p>You can read more about keyboard insets in <a href=\"https:\/\/devblogs.microsoft.com\/surface-duo\/orientation-spanning-and-insets\/\">this blog post<\/a>.<\/p>\n<h2>Feedback<\/h2>\n<p>We hope these new samples are useful and help you visualize some of the common UX patterns that are possible on dual-screen devices like the Surface Duo.<\/p>\n<p>We\u2019d love to hear from you! Please leave us feedback\u00a0or just share your testing tips\u00a0using\u00a0our\u00a0<a href=\"http:\/\/aka.ms\/SurfaceDuoSDK-Feedback\">feedback forum<\/a>,\u00a0or message us on\u00a0<a href=\"https:\/\/twitter.com\/surfaceduodev\">Twitter<\/a>, <a href=\"https:\/\/github.com\/parkerschroeder\">Github (Parker)<\/a>, or <a href=\"https:\/\/github.com\/khalp\">Github (Kristen)<\/a>.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello\u00a0Microsoft\u00a0Surface Duo developers! Kristen and I are interns on the Surface Duo Developer Experience team, and we\u2019re excited to announce two new Microsoft Surface Duo dual-screen samples available that embody some of our dual-screen UX patterns. You can find them on GitHub at github.com\/microsoft\/surface-duo-app-samples. Photo Editor As the name suggests, this sample is a simple [&hellip;]<\/p>\n","protected":false},"author":90683,"featured_media":519,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[472,46],"class_list":["post-517","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-surface-duo-sdk","tag-sample","tag-surface-duo"],"acf":[],"blog_post_summary":"<p>Hello\u00a0Microsoft\u00a0Surface Duo developers! Kristen and I are interns on the Surface Duo Developer Experience team, and we\u2019re excited to announce two new Microsoft Surface Duo dual-screen samples available that embody some of our dual-screen UX patterns. You can find them on GitHub at github.com\/microsoft\/surface-duo-app-samples. Photo Editor As the name suggests, this sample is a simple [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/surface-duo\/wp-json\/wp\/v2\/posts\/517","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/surface-duo\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/surface-duo\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/surface-duo\/wp-json\/wp\/v2\/users\/90683"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/surface-duo\/wp-json\/wp\/v2\/comments?post=517"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/surface-duo\/wp-json\/wp\/v2\/posts\/517\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/surface-duo\/wp-json\/wp\/v2\/media\/519"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/surface-duo\/wp-json\/wp\/v2\/media?parent=517"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/surface-duo\/wp-json\/wp\/v2\/categories?post=517"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/surface-duo\/wp-json\/wp\/v2\/tags?post=517"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}