[PR #1564] [MERGED] Add SelectableLabel Custom Renderer to allow copy of note text #2965

Closed
opened 2025-11-26 23:26:31 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/1564
Author: @jlf0dev
Created: 10/7/2021
Status: Merged
Merged: 10/8/2021
Merged by: @jlf0dev

Base: masterHead: bug/note-copy-text


📝 Commits (2)

  • 840f132 Add SelectableLabel Custom Renderer to allow copy of note text
  • 2750507 Remove editor changes from text custom field

📊 Changes

8 files changed (+106 additions, -42 deletions)

View changed files

📝 src/Android/Android.csproj (+1 -1)
src/Android/Effects/SelectableLabelEffect.cs (+0 -23)
src/Android/Renderers/SelectableLabelRenderer.cs (+25 -0)
src/App/Controls/SelectableLabel.cs (+10 -0)
src/App/Effects/SelectableLabelEffect.cs (+0 -11)
📝 src/App/Pages/Vault/ViewPage.xaml (+2 -7)
src/iOS.Core/Renderers/SelectableLabelRenderer.cs (+67 -0)
📝 src/iOS.Core/iOS.Core.csproj (+1 -0)

📄 Description

This fix allows users to copy text from Notes in the View screen.

We currently use an effect that allows this behavior for Android, but there was no iOS implementation. The only native control on iOS that allows this behavior is a UITextView. Since the Label control on Xamarin uses a UILabel natively, I had to create a SelectableLabelRenderer to replace the effect.

The renderer extends the label class so we can keep the same behavior on Android, but on iOS it implements a UITextView under the hood.

The renderer currently doesn't listen for styling changes or anything else too complex, but can always be added later if needed.

Closes #1351


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/1564 **Author:** [@jlf0dev](https://github.com/jlf0dev) **Created:** 10/7/2021 **Status:** ✅ Merged **Merged:** 10/8/2021 **Merged by:** [@jlf0dev](https://github.com/jlf0dev) **Base:** `master` ← **Head:** `bug/note-copy-text` --- ### 📝 Commits (2) - [`840f132`](https://github.com/bitwarden/android/commit/840f1322dbd29f76a9b497b593e43549597814a7) Add SelectableLabel Custom Renderer to allow copy of note text - [`2750507`](https://github.com/bitwarden/android/commit/2750507fb786df60ff30c513a8b784c4168e6ad9) Remove editor changes from text custom field ### 📊 Changes **8 files changed** (+106 additions, -42 deletions) <details> <summary>View changed files</summary> 📝 `src/Android/Android.csproj` (+1 -1) ➖ `src/Android/Effects/SelectableLabelEffect.cs` (+0 -23) ➕ `src/Android/Renderers/SelectableLabelRenderer.cs` (+25 -0) ➕ `src/App/Controls/SelectableLabel.cs` (+10 -0) ➖ `src/App/Effects/SelectableLabelEffect.cs` (+0 -11) 📝 `src/App/Pages/Vault/ViewPage.xaml` (+2 -7) ➕ `src/iOS.Core/Renderers/SelectableLabelRenderer.cs` (+67 -0) 📝 `src/iOS.Core/iOS.Core.csproj` (+1 -0) </details> ### 📄 Description This fix allows users to copy text from Notes in the View screen. We currently use an effect that allows this behavior for Android, but there was no iOS implementation. The only native control on iOS that allows this behavior is a UITextView. Since the Label control on Xamarin uses a UILabel natively, I had to create a SelectableLabelRenderer to replace the effect. The renderer extends the label class so we can keep the same behavior on Android, but on iOS it implements a UITextView under the hood. The renderer currently doesn't listen for styling changes or anything else too complex, but can always be added later if needed. Closes #1351 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-26 23:26:31 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#2965