Allow copying the context menu title by long-pressing the header#25372
Open
MiMoHo wants to merge 1 commit into
Open
Allow copying the context menu title by long-pressing the header#25372MiMoHo wants to merge 1 commit into
MiMoHo wants to merge 1 commit into
Conversation
Place names and OSM note texts are often needed elsewhere, e.g. for translating a note before answering it; info and description rows were already copyable this way. The header consumes all touch events for the menu slide gestures, so the long press is detected by a gesture detector inside that touch listener. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Summary
Place names and OSM note texts shown as the context menu title are often needed elsewhere — a typical case is copying an OSM note text into a translator before answering it, since notes are frequently written in the local language. Info and description rows of the menu already support copy on long-press; the title did not.
Implementation
A plain
OnLongClickListeneron the titleTextViewnever receives events because the menu header consumes all touches for the slide gestures (InterceptorLinearLayout+slideTouchListener) — verified on an emulator, where the long-press fell through to the map and selected a new point. The long-press is therefore detected by aGestureDetectorinside the existingslideTouchListener, in the same header-area branch that already handles tap-to-expand, and copiesmenu.getTitleStr()via the existingShareMenu.copyToClipboardWithToast(). Movement cancels the long-press through the detector's built-in touch-slop handling, so the slide gestures are unaffected.Testing
Verified on an Android 15 (API 35) emulator with a debug build of this branch:
🤖 Generated with Claude Code — model: Claude Fable 5, reasoning effort: xhigh