[PR #1343] [MERGED] Share-to-Send for Android #2843

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

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/1343
Author: @mpbw2
Created: 3/29/2021
Status: Merged
Merged: 3/31/2021
Merged by: @mpbw2

Base: masterHead: feature-share-to-send


📝 Commits (2)

📊 Changes

16 files changed (+203 additions, -38 deletions)

View changed files

📝 src/Android/MainActivity.cs (+52 -2)
📝 src/Android/Services/DeviceActionService.cs (+11 -0)
📝 src/App/Abstractions/IDeviceActionService.cs (+1 -0)
📝 src/App/App.xaml.cs (+11 -2)
📝 src/App/Models/AppOptions.cs (+4 -1)
📝 src/App/Pages/Send/SendAddEditPage.xaml (+3 -2)
📝 src/App/Pages/Send/SendAddEditPage.xaml.cs (+35 -1)
📝 src/App/Pages/Send/SendAddEditPageViewModel.cs (+36 -6)
📝 src/App/Pages/Send/SendGroupingsPage/SendGroupingsPage.xaml.cs (+17 -20)
📝 src/App/Pages/Send/SendGroupingsPage/SendGroupingsPageViewModel.cs (+1 -1)
📝 src/App/Pages/Send/SendsPageViewModel.cs (+1 -1)
📝 src/App/Pages/TabsPage.cs (+10 -1)
📝 src/App/Resources/AppResources.Designer.cs (+6 -0)
📝 src/App/Resources/AppResources.resx (+4 -0)
📝 src/App/Utilities/AppHelpers.cs (+6 -1)
📝 src/iOS.Core/Services/DeviceActionService.cs (+5 -0)

📄 Description

Overview

Added the ability to share from other apps directly to Bitwarden Send.

Files Changed/Added

Android:

  • DeviceActionService.cs: Implemented CloseMainApp() method for returning to source app upon completing the share operation
  • MainActivity.cs: Added IntentFilter to declare receivable mime types, and logic to parse the intent and place the results into AppOptions

App:

  • IDeviceActionService.cs: Added CloseMainApp() method for use by Android
  • AppOptions.cs: Added CreateSend property for maintaining received Send data through the auth/unlock process
  • SendGroupingsPage.xaml.cs: Added AppOptions to constructor to load received Send data during LoadOnAppearedAsync process, and removed ShowPreviousPageAsync pasta
  • SendGroupingsPageViewModel.cs: Added null appOptions arg when pushing modal SendAddEditPage
  • SendAddEditPage.xaml: Adjusted component visibility based on smarter properties declared below
  • SendAddEditPage.xaml.cs: Added AppOptions to constructor to load received Send data, and handled any existing create request by populating key Send values and adjusting UI accordingly
  • SendAddEditPageViewModel.cs: Added IsAddFromShare property to drive UI and share completion behavior, and ShowTypeButtons property to include IsAddFromShare in the decision to display type buttons (they aren't displayed when sharing to Send as the type is declared by the mime type of the data to share)
  • SendsPageViewModel.cs: Added null appOptions arg when pushing modal SendAddEditPage
  • TabsPage.cs: Passed AppOptions reference to SendGroupingsPage and added programmatic support for jumping direction to Send tab
  • AppResources.resx: Added new Send-specific 'premium required' string for when non-premium users attempt to share a file from a 3rd party app
  • AppHelpers.cs: Added null appOptions arg when pushing modal SendAddEditPage, and included Send as an alternate MainPage if the appOptions data is populated
  • App.xaml.cs: Added handler for popAllAndGoToTabSend message, and included Send as a MainPage if appOptions data is populated

iOS.Core:

  • DeviceActionService.cs: Implemented CloseMainApp() method though only used for Android

Screenshots

Sharing app from Play Store:

01

02

Sharing photo from Camera:

03

04

05

Sharing text from selection:

06

07

08


🔄 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/1343 **Author:** [@mpbw2](https://github.com/mpbw2) **Created:** 3/29/2021 **Status:** ✅ Merged **Merged:** 3/31/2021 **Merged by:** [@mpbw2](https://github.com/mpbw2) **Base:** `master` ← **Head:** `feature-share-to-send` --- ### 📝 Commits (2) - [`c69510b`](https://github.com/bitwarden/android/commit/c69510b20dbae99a78d9bea6d63afe737fb9d194) Android implementation - [`444be7e`](https://github.com/bitwarden/android/commit/444be7eeb3cc1eee5731eba5442c96f4d2d0e660) remove iOS attempt for now ### 📊 Changes **16 files changed** (+203 additions, -38 deletions) <details> <summary>View changed files</summary> 📝 `src/Android/MainActivity.cs` (+52 -2) 📝 `src/Android/Services/DeviceActionService.cs` (+11 -0) 📝 `src/App/Abstractions/IDeviceActionService.cs` (+1 -0) 📝 `src/App/App.xaml.cs` (+11 -2) 📝 `src/App/Models/AppOptions.cs` (+4 -1) 📝 `src/App/Pages/Send/SendAddEditPage.xaml` (+3 -2) 📝 `src/App/Pages/Send/SendAddEditPage.xaml.cs` (+35 -1) 📝 `src/App/Pages/Send/SendAddEditPageViewModel.cs` (+36 -6) 📝 `src/App/Pages/Send/SendGroupingsPage/SendGroupingsPage.xaml.cs` (+17 -20) 📝 `src/App/Pages/Send/SendGroupingsPage/SendGroupingsPageViewModel.cs` (+1 -1) 📝 `src/App/Pages/Send/SendsPageViewModel.cs` (+1 -1) 📝 `src/App/Pages/TabsPage.cs` (+10 -1) 📝 `src/App/Resources/AppResources.Designer.cs` (+6 -0) 📝 `src/App/Resources/AppResources.resx` (+4 -0) 📝 `src/App/Utilities/AppHelpers.cs` (+6 -1) 📝 `src/iOS.Core/Services/DeviceActionService.cs` (+5 -0) </details> ### 📄 Description **Overview** Added the ability to share from other apps directly to Bitwarden Send. **Files Changed/Added** Android: - **DeviceActionService.cs**: Implemented `CloseMainApp()` method for returning to source app upon completing the share operation - **MainActivity.cs**: Added `IntentFilter` to declare receivable mime types, and logic to parse the intent and place the results into `AppOptions` App: - **IDeviceActionService.cs**: Added `CloseMainApp()` method for use by Android - **AppOptions.cs**: Added `CreateSend` property for maintaining received Send data through the auth/unlock process - **SendGroupingsPage.xaml.cs**: Added `AppOptions` to constructor to load received Send data during `LoadOnAppearedAsync` process, and removed `ShowPreviousPageAsync` pasta - **SendGroupingsPageViewModel.cs**: Added null appOptions arg when pushing modal `SendAddEditPage` - **SendAddEditPage.xaml**: Adjusted component visibility based on smarter properties declared below - **SendAddEditPage.xaml.cs**: Added `AppOptions` to constructor to load received Send data, and handled any existing create request by populating key Send values and adjusting UI accordingly - **SendAddEditPageViewModel.cs**: Added `IsAddFromShare` property to drive UI and share completion behavior, and `ShowTypeButtons` property to include `IsAddFromShare` in the decision to display type buttons (they aren't displayed when sharing to Send as the type is declared by the mime type of the data to share) - **SendsPageViewModel.cs**: Added null appOptions arg when pushing modal `SendAddEditPage` - **TabsPage.cs**: Passed `AppOptions` reference to `SendGroupingsPage` and added programmatic support for jumping direction to Send tab - **AppResources.resx**: Added new Send-specific 'premium required' string for when non-premium users attempt to share a file from a 3rd party app - **AppHelpers.cs**: Added null appOptions arg when pushing modal `SendAddEditPage`, and included Send as an alternate MainPage if the appOptions data is populated - **App.xaml.cs**: Added handler for `popAllAndGoToTabSend` message, and included Send as a MainPage if appOptions data is populated iOS.Core: - **DeviceActionService.cs**: Implemented `CloseMainApp()` method though only used for Android **Screenshots** _Sharing app from Play Store:_ ![01](https://user-images.githubusercontent.com/59324545/112889476-aeb37e80-90a3-11eb-9bd5-2852b7f6cc3f.png) ![02](https://user-images.githubusercontent.com/59324545/112889481-afe4ab80-90a3-11eb-9d0d-3efcd9fc5494.png) _Sharing photo from Camera:_ ![03](https://user-images.githubusercontent.com/59324545/112889486-b2470580-90a3-11eb-9c2a-709d3de385b9.png) ![04](https://user-images.githubusercontent.com/59324545/112889493-b3783280-90a3-11eb-8720-dcb6d9629e1b.png) ![05](https://user-images.githubusercontent.com/59324545/112889499-b541f600-90a3-11eb-8f2e-8863485a8c35.png) _Sharing text from selection:_ ![06](https://user-images.githubusercontent.com/59324545/112889503-b6732300-90a3-11eb-8604-f3230e6bdff8.png) ![07](https://user-images.githubusercontent.com/59324545/112889509-b7a45000-90a3-11eb-908d-8f692f289031.png) ![08](https://user-images.githubusercontent.com/59324545/112890271-ac055900-90a4-11eb-83ea-988eaf3fa26a.png) --- <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:24:52 -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#2843