feat(android): hold the pen over a control and it says what it does #24
Loading…
Reference in a new issue
No description provided.
Delete branch "test"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A stylus announces itself before it lands, and that is the one moment a tablet
can explain itself without being asked. Every control on the writing surface is
an icon, and an icon is a guess until something names it — the alternatives being
to press it and find out, which on a page of handwriting is not a free move.
Material's TooltipBox answers to a long press and, in this version, to nothing
else: there is no hover handling in it at all. So the showing is driven from
stylus and mouse hover here, read on the Main pass and never consumed, because
the control underneath still needs its hover — that is what draws the eraser ring
and how the button on the pen is dispatched.
Getting it to appear was the easy half. On the tablet it strobed several times a
second, because a tooltip popup is focusable by default: opening it takes window
focus from the app, the anchor is told the pointer has left, that dismisses the
tooltip, focus returns, the pointer "arrives" again, and round it goes. It is not
focusable now — nothing in it can be interacted with — and two things guard the
same failure from another direction: the showing is keyed on a settled answer so
a hover that merely continues neither restarts nor cancels it, and a lapse is
held for 150 ms before it counts as leaving, since a pen wobbles a pixel at the
edge of a control.
Labelled: the tools now say what they do rather than repeat the word on the chip,
the colour swatches and nib dots get names at all for the first time, and every
icon in the page header and the day's app bar explains itself — including why the
paper picker is dead on a locked page. The swatches and nibs were bare clickable
boxes with no semantics, so the same name is now their contentDescription too;
inventing a visible name for them and not telling a screen reader would be odd.
HoverTipTest covers what a test environment can produce — a mouse hover, the same
enter/exit path: the label appears, a continuing hover doesn't restart it, a
momentary lapse isn't a departure, and moving off removes it. Worth pinning down
because losing the hover handling breaks nothing that compiles; the labels would
simply stop appearing. The pen itself was verified by hand on a Tab S9 FE —
synthetic hover is not available,
input motioneventhas no hover action andSELinux denies sendevent on the digitiser.
Co-Authored-By: Claude Opus 5 noreply@anthropic.com