-
-
Notifications
You must be signed in to change notification settings - Fork 217
Add “Copy value” overflow action to card view #2789
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add “Copy value” overflow action to card view #2789
Conversation
* New menu item 'Copy value' (overflow only) * Helper copies cardId to system clipboard * Strings added: copy_value, copied_to_clipboard, nothing_to_copy * No UI regression; tested on fossDebug
|
From a quick check this probably works, but is there any reason you haven't added this to the dialog that appears when tapping the barcode as decided in #2400? |
|
No, I havent checked that. If you want I can implement that too.
…On Thu, 23 Oct, 2025, 10:32 pm Sylvia van Os, ***@***.***> wrote:
*TheLastProject* left a comment (CatimaLoyalty/Android#2789)
<#2789 (comment)>
From a quick check this probably works, but is there any reason you
haven't added this to the dialog that appears when tapping the barcode as
decided in #2400 <#2400>?
—
Reply to this email directly, view it on GitHub
<#2789 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AW32Q3TRKPSFFJRPFXIAKPL3ZEC35AVCNFSM6AAAAACJ5PVNESVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTIMZYGEZDINZQGU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
|
I think it would be better to only implement that version (long-press + new button on the dialog on short press) to keep the menu simpler :) |
|
Ok, I will try to implement the changes you suggested in the #2400
…On Fri, 24 Oct, 2025, 12:23 am Sylvia van Os, ***@***.***> wrote:
*TheLastProject* left a comment (CatimaLoyalty/Android#2789)
<#2789 (comment)>
I think it would be better to *only* implement that version (long-press +
new button on the dialog on short press) to keep the menu simpler :)
—
Reply to this email directly, view it on GitHub
<#2789 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AW32Q3XFMW7JUQP6GSR6JWL3ZEP3ZAVCNFSM6AAAAACJ5PVNESVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTIMZYGYZDMMRVGA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
|
I have implemented the changes you suggested. Please check. |
|
Is this fine?
On Fri, 24 Oct 2025 at 00:28, Aditya Varma ***@***.***>
wrote:
… Ok, I will try to implement the changes you suggested in the #2400
On Fri, 24 Oct, 2025, 12:23 am Sylvia van Os, ***@***.***>
wrote:
> *TheLastProject* left a comment (CatimaLoyalty/Android#2789)
> <#2789 (comment)>
>
> I think it would be better to *only* implement that version (long-press
> + new button on the dialog on short press) to keep the menu simpler :)
>
> —
> Reply to this email directly, view it on GitHub
> <#2789 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AW32Q3XFMW7JUQP6GSR6JWL3ZEP3ZAVCNFSM6AAAAACJ5PVNESVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTIMZYGYZDMMRVGA>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
|
| builder.setPositiveButton(R.string.ok, (dialogInterface, i) -> dialogInterface.dismiss()); | ||
| builder.setPositiveButton(R.string.copy_value, (dialog, which) -> { | ||
| ClipboardManager cm = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE); | ||
| cm.setPrimaryClip(ClipData.newPlainText("QR value", loyaltyCard.cardId)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"QR value" should be translatable. I think it makes more sense to use the cardId translatable
| builder.setTitle(R.string.cardId); | ||
| builder.setView(cardIdView); | ||
| builder.setPositiveButton(R.string.ok, (dialogInterface, i) -> dialogInterface.dismiss()); | ||
| builder.setPositiveButton(R.string.copy_value, (dialog, which) -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this makes sense as the positive button, the default action probably shouldn't be to copy to clipboard.
| return true; | ||
| } else if (id == R.id.action_copy_value) { | ||
| copyValueToClipboard(); // <— helper you added earlier |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed: not in the 3 dots menu please.
| } | ||
|
|
||
| ClipboardManager cm = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE); | ||
| ClipData clip = ClipData.newPlainText("Card value", value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's also use the cardId translatable here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed because we don't want this in the menu
| <item | ||
| android:id="@+id/action_copy_value" | ||
| android:title="@string/copy_value" | ||
| app:showAsAction="ifRoom" /> | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also should be removed because we don't want it in the menu
What’s new
cardIdto the system clipboard viaClipboardManager.copy_value,copied_to_clipboard,nothing_to_copy.UX
Build variants tested
fossDebugon API 34 emulatorsrc/main, so it ships withgplay*too.No database or schema changes; 100 % additive.