You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Copied list detail framework
Copied framework from list/detail sample
* Refaactor package and app name
* Update launcher icon
* Add light/dark themes
* Update dark theme colors
* Added variable width drawing and erasing
Now supports constant pressure feedback and erasing
* Fixed finger drawing
Fixed an issue with the stroke instantiation when using finger to draw
* linting
newlines newlines newlines
* Fix toolbar and add floating action button
* Added basic saving
saved files do not persist yet
* Improved serialization for drawings
drawings can now be saved and redrawn
* Added auto saving and loading
any drawing changes are saved and loaded on fragment lifetime changes
* Linting
Passes ktlint, still has some lint issues that may be better for you to fix
* Note addition
Create Note model and connect floating action button to the addition of notes to the list
* Modify note fragment to have modes
* Connect note model to UI
* Worked on file persistence
notes are associated with unique items in a list
* Very basic startup loading
List fragment reads some metadata and loads appropriate notes
* Improved single tab note saving
Added coordination between notes and directory entries by implementing inodes
* Fixed formatting
Renamed some files and methods to account for the addition of inodes
* Simplified INode
set default values for inode
* Remove unused sample files
Any movie-related fragments/layouts
* Refactor file names
* Update icon
* Extract current toolbars to separate xml files
* Add navigation and actions to note fragment toolbar
* Add primary and contextual toolbars to note list fragment
* Linting
* Refactor NoteFragment to NoteDetailFragment
* Convert property to getter
* added deletion
implemented backend code for deleting files
* hooked up deletion to front end
can perform deletion on list and detail fragments
* linting
fixed formatting issues
* Add getting started screen for first span
* Implement fragment behavior after spanning changes
* Address PR feedback
* started categories backend
changing DataProvider structure to support categories
* Category switching
can now switch between categories
* Category options added
categories can be renamed, added, and deleted
* Resolved bugs with persistence
* linting
* Code cleanup
* Add pen mode to toolbar
* Modify selection mode code
Fix icon color issue and clean up methods
* Linting
* Cleanup
* fixed despan deletion bug
* updated dependencies
* Add twonote to CI process
* Small UI fixes
* Add pen tools buttons
* Add unlimited pen colors
* Remove unused code
* Show custom color
* Linting caught by our functioning CI
* Working drag and drop
fixed permission issues with reading files and imported code from source editor
* Fixed drag and drop permissions
can now import generic txt file from any app
* fullscreen drag and drop
txt file can be dragged on any part of the screen
* Share note as image
* Code cleanup
* Fix custom color crash
When empty string was entered, the parseColor threw a different kind of exception
* Add more comments
* Add extended view when rotated/spanned
* Reorganize updateINode method
* Update MainActivity to use fragment handler
* Linting
* Fix fragment switching/logic
* Fix category switching bug
* xml file code clean up!
Adding copyright (because I always forget to add them) and removing unused attributes
* Added image drop target
* Image repositioning
Image movement within app
* Image resizing and repositioning
drag image on long click, resize with pinch
* Added picture mode to toolbar
can switch between picture, ink, and text modes
* Switched toolbar icons
The three modes have their own dedicated menu items now
* Make newer strokes appear on top
* Resize drawings when rotated to extended view
* Update pen tools menu with highlight and new icons
* Fix rotation bugs
* Move constants to Defines
* Add eraser and refine pen tools
* Linting
* saving rough draft
* Image saving
images are converted to bitmap strings and saved in the respective note
* cleanup
* extra comments
* Window switch
switch to appropriate window on drag event
* Fix linting issue
* Remove unimplemented menu items
* Add rotation handling to images
* Implement image deletion
* Fix rotation and deletion bugs
* Address PR comments
* Update TwoNote readme
* Update existing readmes for consistency
* Update drag-drop link
* Update readme
* Updated references
* wip
* Uncapitalize app pattern names
* Reorganize feature list
* Add screenshots to readme
* Add categories/highlight screenshot
* Address PR comments
* removed unnecessary viewmodel
DrawViewModel was not critical to code
* reformatted handlers
* fixed merge artifacts
* removed unnecessary viewmodel
DrawViewModel was not critical to code
* reformatted handlers
* resolved duplicates on merge
* cleaned up fragment focused code
* Cleaned up code related to pen
* cleaned up general app code
* removed default note names
* fixed issues with text newlines
* Reorganize folder structure
* Add copyright to source files
* Clean up xml files
* Clean up NoteDetailFragment
Reorganize methods, add comments, remove unused attributes
* Clean up MainActivity
* Clean up gradle files
* Clean up handlers
* Start NoteListFragment commenting
* added method headers for utils/fragments
* Added comments for models
* Additional code cleanup
* Added file headers
* fixed merge issues
* linting
* Update readme for samples browser compatibility
Co-authored-by: Kristen Halper <t-krhalp@microsoft.com>
Co-authored-by: Kristen Halper <khalp@vt.edu>
description: "Uses the Companion Pane dual-screen pattern and drag/drop features in a photo editing app for the Surface Duo."
4
+
description: "Uses the companion pane dual-screen pattern and drag and drop features in a photo editing app for the Surface Duo."
5
5
languages:
6
6
- kotlin
7
7
products:
8
8
- surface-duo
9
9
urlFragment: photo-editor
10
10
---
11
11
12
-
# Photo Editor
12
+
# PhotoEditor
13
13
14
14
This Kotlin application implements a simple photo editor that lets users select, edit, and save images. Screenshots of the application and its behavior are available [here](screenshots/).
15
15
16
-
## Prerequisites
16
+
## Getting Started
17
17
18
-
* Android Studio
19
-
* Surface Duo emulator
18
+
To learn how to load apps on the Surface Duo emulator, see the [documentation](https://docs.microsoft.com/dual-screen/android), and follow [the blog](https://devblogs.microsoft.com/surface-duo).
20
19
21
-
This application also uses a beta release of the [Constraint Layout](https://developer.android.com/jetpack/androidx/releases/constraintlayout) package to facilitate image editing with the ImageFilterView class, and all button icons were downloaded from the [Android Material Design](https://material.io/resources/icons/?style=baseline) website.
22
-
23
-
## Running the sample
24
-
25
-
* Start Android Studio.
26
-
* Open the PhotoEditor project: **File > Open**, navigate to file location of the the **PhotoEditor** folder, then click **OK**.
27
-
* Build your project: **Build > Make Project** or **Ctrl+F9**
28
-
* Start the Surface Duo emulator
29
-
* Select **"Microsoft SurfaceDuoEmulator API 29"** or **"Virtual Device"** from the list of Running Devices.
30
-
* Run the project on the emulator: **Run > Run 'app'**, **Ctrl+F2**, or click the green play button.
31
-
32
-
## Key concepts
20
+
> [!NOTE]
21
+
> This application uses a beta release of the [Constraint Layout library](https://developer.android.com/jetpack/androidx/releases/constraintlayout) to facilitate image editing with the [ImageFilterView](https://developer.android.com/reference/androidx/constraintlayout/utils/widget/ImageFilterView) class.
33
22
34
-
### App features
23
+
##Features
35
24
36
-
* Select: click on current image to open photo gallery or drag and drop image file
37
-
* Edit: click on buttons and adjust sliders to modify image properties
38
-
- Buttons: rotate left and right
39
-
- Sliders: saturation, brightness, warmth
40
-
* Save: click save button to download edited image to device (see below)
25
+
This app supports three main actions: selection, editing, and saving. To select a photo, click on the current image to open the device's photo gallery. To modify image properties, use the buttons and sliders. Finally, to save the changes in a new photo, click the save button.
41
26
42
27

43
28
44
29
### Companion Pane
45
30
46
-
This sample shows how the [Companion Pane](https://docs.microsoft.com/dual-screen/introduction#companion-pane) dual-screen app pattern can be used to make more tools and controls available to users when the app is spanned. When in single-screen mode, the app only shows users three controls: the slider, the rotation buttons, and the save button. In order to modify all possible properties with the slider, the user must interact with the dropdown menu. This ensures that the chosen image is large enough on the screen to inspect any edits.
31
+
This sample shows how the [companion pane](https://docs.microsoft.com/dual-screen/introduction#companion-pane) dual-screen app pattern can be used to make more tools and controls available to users when the app is spanned. When in single-screen mode, the app only shows users three controls: the slider, the rotation buttons, and the save button. In order to modify all possible properties with the slider, the user must interact with the dropdown menu. This ensures that the chosen image is large enough on the screen to inspect any edits.
47
32
48
33
When switched to dual-screen mode, however, the entire left screen can be dedicated to image display. This frees up the right screen to display more editing controls. As a result, a dropdown menu is no longer needed and all three slider controls can be displayed.
49
34
50
-
### Drag and drop
35
+
### Drag and Drop
36
+
37
+
This sample also demonstrates how drag and drop features can simplify file transfer across screens and between applications. Instead of clicking to open the photo gallery and select a new photo, users can simply drag the desired image file into the app and drop it over the currently displayed image, as shown below. For more information, check out this [drag and drop sample](https://github.com/microsoft/surface-duo-sdk-samples-kotlin/tree/master/DragAndDrop).
51
38
52
-
This sample also demonstrates how drag and drop features can simplify file transfer across screens and between applications. For more information on drag and drop, check out [this sample](https://github.com/microsoft/surface-duo-sdk-samples-kotlin/tree/master/draganddrop).
39
+

53
40
54
-
### Dualscreen layout
41
+
### Dual-screen Layout
55
42
56
-
The SurfaceDuoLayout element of the [DualScreen-Layout](https://docs.microsoft.com/dual-screen/android/api-reference/dualscreen-layout?tabs=java) package is the key to developing applications on the Surface Duo. This layout provides different attributes for single-screen and dual-screen views, and example usage can be seen in [activity_main.xml](app/src/main/res/layout/activity_main.xml).
43
+
The SurfaceDuoLayout element of the [dual-screen layout](https://docs.microsoft.com/dual-screen/android/api-reference/dualscreen-library/) package is the key to developing applications on the Surface Duo. This layout provides different attributes for single-screen and dual-screen views, and example usage can be seen in [activity_main.xml](app/src/main/res/layout/activity_main.xml).
57
44
58
45
> [!NOTE]
59
-
> When defining landscape and portrait orientations for the dual-screen view, the two screens are treated as one. That means the dual-screen landscape orientation is when the single-screen orientation would be considered portrait (shown below) and vice versa. For more tips, check out [this blog post](https://devblogs.microsoft.com/surface-duo/introducing-dual-screen-layouts-android/).
46
+
> When defining landscape and portrait xml resources in Android Studio for the dual-screen view, the two screens are treated as one. That means the dual-screen landscape orientation is when the single-screen orientation would be considered portrait (shown below) and vice versa. For more tips, check out [this blog post](https://devblogs.microsoft.com/surface-duo/introducing-dual-screen-layouts-android/).
@@ -73,3 +60,15 @@ provided by the bot. You will only need to do this once across all repos using o
73
60
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
74
61
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
75
62
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
63
+
64
+
## License
65
+
66
+
Copyright (c) Microsoft Corporation.
67
+
68
+
MIT License
69
+
70
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
71
+
72
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
73
+
74
+
THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copy file name to clipboardExpand all lines: README.md
+30Lines changed: 30 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,24 @@ This repo contains sample Android applications for Microsoft Surface Duo.
8
8
9
9
To learn how to load apps on the Surface Duo emulator, see the [documentation](https://docs.microsoft.com/dual-screen/android), and follow [the blog](https://devblogs.microsoft.com/surface-duo).
Includes examples of the [companion pane](https://docs.microsoft.com/dual-screen/introduction#dual-view) app pattern, drag and drop import for images, and [UI testing](https://docs.microsoft.com/dual-screen/android/espresso-ui-tests).
Includes examples of the [dual view](https://docs.microsoft.com/dual-screen/introduction#dual-view) app pattern, drag and drop import for text, and [UI testing](https://docs.microsoft.com/dual-screen/android/espresso-ui-tests).
Includes examples of the [list-detail](https://docs.microsoft.com/dual-screen/introduction#master-detail) and [extended canvas](https://docs.microsoft.com/dual-screen/introduction#extended-canvas) app patterns, drag and drop import for text and images, and pen events.
@@ -31,3 +49,15 @@ provided by the bot. You will only need to do this once across all repos using o
31
49
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
32
50
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
33
51
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
52
+
53
+
## License
54
+
55
+
Copyright (c) Microsoft Corporation.
56
+
57
+
MIT License
58
+
59
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
60
+
61
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
62
+
63
+
THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
app pattern, users are able to edit and preview any changes simultaneously without switching
18
-
windows.
14
+
This sample contains a Kotlin application designed for Surface Duo. The application is an HTML editor that enables real-time rendering of formatted source code. Making use of the [dual view](https://docs.microsoft.com/dual-screen/introduction#dual-view) app pattern, users are able to edit and preview any changes simultaneously without switching windows.
19
15
20
16
## Getting Started
21
17
22
-
To learn how to load your app on to emulator, and to use it, see the full documentation here: [https://docs.microsoft.com/dual-screen](https://docs.microsoft.com/dual-screen)
18
+
To learn how to load apps on the Surface Duo emulator, see the [documentation](https://docs.microsoft.com/dual-screen/android), and follow [the blog](https://devblogs.microsoft.com/surface-duo).
0 commit comments