Repository navigation
feat(android): crop and mark up a screenshot before sending it - #156
Merged
Merged
Conversation
The screenshot notification now asks whether to open the screenshot in Snap2Link, with Open and Ignore. Open shows an editor, as the desktop annotator: crop, pen, rectangle, circle, arrow, text and blur, six colours, three thicknesses, undo and redo. Send uploads the result and copies the link, as before. Sharing from another app still sends at once. Version 0.4.0.
Every image now goes through the editor, from a screenshot notification or from Share, then Snap2Link. The direct path and its PNG shortcut go.
A Select tool, as on the desktop: tap a mark to select it, drag it to move it, or delete it. The topmost mark under the finger wins, and a thin outline is easy to hit since the inside counts too.
A selected mark shows handles: its corners for a rectangle, circle, blur or pen stroke, both ends for an arrow, one corner to make a text larger or smaller. A mark never shrinks below the size a drag needs to draw it.
With a mark selected, the six colours take the hint's place: a tap recolours it, and the next marks take that colour too. A blur has none, so only the bin shows.
With a mark selected, the thickness button sits next to its colours: a tap gives the line, the text size or the blur the next thickness, and the next marks take it too. The bin moves to the top bar while a mark is selected, so that both fit a phone.
For the Text tool and a selected text, the thickness button shows an A in three sizes and reads Text size: Small, Medium or Large, since that is what it changes. The corner handle still sizes a text freely.
A tap on a text with the Text tool, or a second tap on a selected text, opens it in the text dialog, cursor at the end, to change and save it. The gestures now read the latest callbacks: the first ones they were set up with saw the marks of that time, so a text added since was missed.
The hint now ends with: tap a selected text again to edit it. The row under the image gets a little room above and below for its four lines.
Two fingers swiped left undo, swiped right redo, mirrored in a right-to-left language as the arrows are. The gesture takes the touch events before the tools do, so a mark begun by the first finger is dropped rather than drawn.
The first time the editor opens, a banner at the bottom of the image says that two fingers swiped left undo and swiped right redo. It goes with Got it or once the gesture is used, and never comes back.
Fingers spread or pinched zoom in and out, up to eight times, around where they are; zoomed in, two fingers move the view. At the normal size a sideways swipe still undoes or redoes: the gesture becomes a zoom only once the fingers move apart or together. Pinching back fits the image again, and so does going in or out of cropping. The one-time tip says that fingers spread apart zoom.
A button next to the crop controls turns the image a quarter to the right. The marks and the crop turn with it; a text turns around its middle and stays level. Each turn is a step that undo takes back, and the image that is sent is turned too.
A second button turns the image a quarter to the left, as one undo step, next to the one that turns it to the right.
A third button next to the turns mirrors the image left to right, with the marks and the crop; a text moves across but still reads the right way. A turn on a mirrored image goes the way it shows. The crop hint now has its own line above the three buttons.
A fourth button mirrors the image top to bottom, as one undo step: a left-to-right mirror and a half turn, so the marks, the crop and the texts follow the same way.
A slider under the crop buttons tilts the image from -45 to 45 degrees, by half degrees, and Straight puts it back. The image shows at once while the slider moves; the step for undo is taken when the finger lifts. The crop becomes the largest frame with no empty corner, as in photo editors. Lines turn with the image; frames and texts move with their middle and stay level. A mirror tilts the other way and a quarter turn keeps the tilt. Sizes become floats, since a tilted image has no whole size.
A blur kept its size while the image turned under it, so the corners of what it hid could show: it now grows to cover the turned area. A tilt also replaced any crop with the whole image: a cropped image now keeps its crop, cut down to the largest frame inside it once turned, so that nothing it left out comes back. An uncropped image still gets the whole frame with no empty corner.
A menu in the crop row picks the proportions: free, the image's own, 1:1, 4:3, 3:4, 16:9 or 9:16. Picking one sets the largest frame of that shape around the crop; corners and edges then keep it, a corner pulling from the opposite one and an edge staying centred. A quarter turn swaps the proportions as it swaps the crop. Whole image moves into the menu, so that the row still fits a small phone.
An Adjust tool sets the screenshot's brightness and contrast, each from -100 to 100, with Reset. The image shows the change at once and the step for undo is taken when the finger lifts. Marks keep their colours; a blur takes the adjusted colours. Turns, mirrors and tilts keep the light. With nine tools, each takes up to 44 dp, less on a narrow phone.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After a screenshot, the notification now asks whether to open it in Snap2Link, with Open and Ignore. Open shows an editor, as the desktop annotator does; Send then uploads the result and copies the link, as before.
The editor
Sharing from another app (Share, then Snap2Link) opens the same editor. The direct path and its PNG shortcut are gone: every image is decoded, edited if wanted, then saved as PNG, which also drops its metadata.
Tool names come from the desktop's
annotator.*strings; 27 new or changed strings in the 20 languages. Version 0.4.0.Checks
Hold the merge until the plugin directory review is over.