Skip to content

feat(android): crop and mark up a screenshot before sending it - #156

Merged
amys94fr merged 20 commits into
mainfrom
feat/android-editor
Nov 10, 2026
Merged

amys94fr merged 20 commits into
mainfrom
feat/android-editor

Conversation

@amys94fr

@amys94fr amys94fr commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

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

  • Crop first: drag the corners, the edges or the frame; "Whole image" puts it back. The other tools then show only what is kept.
  • Adjust: a tool for brightness and contrast, each from -100 to 100, with Reset; marks keep their colours, a blur takes the adjusted ones.
  • Proportions: a menu in the crop row picks free, the image's own, 1:1, 4:3, 3:4, 16:9 or 9:16; corners and edges then keep the shape, and a quarter turn swaps it. Whole image is in that menu.
  • Rotate and flip: buttons next to the crop controls turn the image a quarter to the left or to the right, or mirror it left to right or top to bottom. A slider tilts it freely from -45 to 45 degrees (Straight puts it back): it shows at once. An uncropped image gets the largest frame with no empty corner; a cropped one keeps its crop, cut down so that nothing it left out comes back, and a blur grows to cover all it hid once turned. Marks and crop turn with it, a text stays level and readable, and undo takes each step back.
  • Select, as on the desktop: tap a mark to select it (a dashed frame with handles), drag it to move it, pull a handle to resize it, tap a colour to recolour it or the thickness button to change its line, text size or blur (the next marks take both; for a text the button shows an A in three sizes and reads "Text size"), or delete it with the bin, which shows in the top bar while a mark is selected. Handles: the corners for a rectangle, circle, blur or pen stroke, both ends for an arrow, one corner for a text, which grows or shrinks. The topmost mark under the finger wins; inside a rectangle or circle counts, so a thin outline is easy to hit.
  • Edit a text: a tap on a text with the Text tool, or a second tap on a selected text, opens it in the text dialog to change it.
  • Two-finger zoom: spread or pinch to zoom up to 8x around the fingers; zoomed in, two fingers move the view. Pinching back, or going in or out of cropping, fits the image again.
  • Two-finger swipe: left undoes, right redoes at the normal size (mirrored in right-to-left languages); the gesture turns into a zoom only once the fingers move apart or together. A mark begun by the first finger is dropped. The first time the editor opens, a tip at the bottom of the image says so, once.
  • Pen, rectangle, circle, arrow, text, blur, the desktop's six colours and three thicknesses (one button that cycles, so that the row fits a phone), undo and redo (50 steps).
  • One renderer draws on screen and on the image that is sent, so both match. Sizes follow the image (1/360 of its shorter side), so marks look the same on a phone screenshot and on a large photo.
  • The blur halves the area again and again, then doubles it back: soft, no blocks. While drawing it, a dashed frame stands in, as on the desktop.
  • Always dark, with light status bar icons, as photo editors are. Tools and colours are radio groups with names for TalkBack.
  • The crop and marks live in the ViewModel, so a turn of the screen keeps them.

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

  • 95 unit tests (49 new: undo and redo, crop handles and limits, view mapping, sizes, hitting, moving, resizing, recolouring and thickening marks, finding a text to edit, zooming around the fingers, turning, mirroring and tilting marks and crop, a tilt never showing what a blur or a crop hid, frames of fixed proportions, the light's colour matrix; the 2 tests of the removed PNG shortcut go), lint with no finding in the new code, strings up to date.
  • On the Android 13 emulator: notification with Open and Ignore, Ignore removes it, Open shows the editor, crop, rectangle, arrow, pen in two thicknesses, text, blur, undo, then Send reaches the security check, cancelled there: nothing was uploaded. A share from the gallery opens the editor too, and the cross closes it. Select: a mark is selected with a tap, moved by dragging, resized by its handles (a rectangle's corner, an arrow's tip), recoloured, made thicker, deleted with the bin; a text edited from the Text tool and from a second tap, a two-finger swipe left then right undoing and redoing a rectangle (sent through the emulator console) while one finger still draws, the tip shown on the first opening only and closed by the swipe, a 3x zoom, a circle drawn while zoomed landing where the finger was, then pinched back to fit, and the swipe still undoing after it, a quarter turn with a rectangle and a text, undone and redone, then a pen stroke on the turned image; a quarter turn to the left, undone in one step, a mirror with a rectangle and a text, then a quarter turn of the mirrored image, a top-to-bottom mirror, a 12 degree tilt with its crop free of empty corners, and Straight back to the original, 1:1 then a corner pulled, 4:3 turning into 3:4 with a quarter turn, brightness +51 and contrast +42 with a red rectangle kept red, Reset then undo, and undo brings it back. Test screenshots deleted.

Hold the merge until the plugin directory review is over.

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.
@amys94fr
amys94fr merged commit 3d10b77 into main Nov 10, 2026
12 checks passed
@amys94fr
amys94fr deleted the feat/android-editor branch November 10, 2026 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant