Skip to content
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

Add support for sending images from the keyboard #2131

Merged
merged 2 commits into from
Jan 8, 2024

Conversation

bmarty
Copy link
Member

@bmarty bmarty commented Dec 29, 2023

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other :

Content

Add ability to send media from the keyboard

Need matrix-org/matrix-rich-text-editor#915

Motivation and context

Better integration with the major Android keyboards, and parity with EA.
Closes #1977

Screenshots / GIFs

SendImageFromKb

Tests

  • Open a room with permission to send message
  • From the keyboard, select an image
  • observe that the image is sent to the room

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

Copy link
Member

@jmartinesp jmartinesp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this on several devices and it worked just fine on all but one, but I've also seen other weird issues in it, so it might be an OS issue.

Worst case scenario: we'll need to re-visit this feature in the feature to find what's wrong with that specific device.

@bmarty bmarty changed the title Add support for sending images from the keyboard #1977 Add support for sending images from the keyboard - WAITING FOR RICH TEXT EDITOR RELEASE 2.23.0 #1977 Dec 29, 2023
@jmartinesp
Copy link
Member

Btw, I tested this again with another device and it also worked as expected, so I have no idea what's the problem with the one I used for testing before. I guess we can merge this if the CI passes?

@bmarty
Copy link
Member Author

bmarty commented Jan 4, 2024

Using the device with the issue @jmartinesp does it work correctly with EA (with RTE disabled), or with other messaging apps or anything else supporting sending image from KB?

@jmartinesp
Copy link
Member

jmartinesp commented Jan 4, 2024

Using the device with the issue @jmartinesp does it work correctly with EA (with RTE disabled), or with other messaging apps or anything else supporting sending image from KB?

In EA it works with the RTE disabled, it also works in Telegram or the SMS app 😞 .

I have some logs:

E CommitContentHelper: CommitContentHelper.share():53 No shareable uris mime-types [image/png] match editor mime-types []

@jmartinesp
Copy link
Member

jmartinesp commented Jan 4, 2024

I actually got it working! We need to override commitContent to return true in the InterceptInputConnection class in the RTE editor (I guess depending on the API version it returns true or false by default), and possibly add some extra config in onCreateInputConnection. I'll check the details tomorrow.

@jmartinesp
Copy link
Member

I actually got it working! We need to override commitContent to return true in the InterceptInputConnection class in the RTE editor (I guess depending on the API version it returns true or false by default), and possibly add some extra config in onCreateInputConnection. I'll check the details tomorrow.

Added a fix here: matrix-org/matrix-rich-text-editor#919

@bmarty
Copy link
Member Author

bmarty commented Jan 8, 2024

(Updated the branch to get the latest version of the RTE lib)

@bmarty bmarty changed the title Add support for sending images from the keyboard - WAITING FOR RICH TEXT EDITOR RELEASE 2.23.0 #1977 Add support for sending images from the keyboard Jan 8, 2024
Copy link

sonarcloud bot commented Jan 8, 2024

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link
Contributor

github-actions bot commented Jan 8, 2024

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/Nd3GRn

Copy link

codecov bot commented Jan 8, 2024

Codecov Report

Attention: 12 lines in your changes are missing coverage. Please review.

Comparison is base (ad9a174) 67.00% compared to head (b6f88f9) 66.98%.
Report is 2 commits behind head on develop.

Files Patch % Lines
...s/impl/messagecomposer/MessageComposerPresenter.kt 0.00% 8 Missing and 1 partial ⚠️
...ages/impl/messagecomposer/MessageComposerEvents.kt 0.00% 1 Missing ⚠️
...ssages/impl/messagecomposer/MessageComposerView.kt 50.00% 1 Missing ⚠️
...ent/android/libraries/textcomposer/TextComposer.kt 80.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2131      +/-   ##
===========================================
- Coverage    67.00%   66.98%   -0.03%     
===========================================
  Files         1376     1376              
  Lines        34243    34259      +16     
  Branches      7456     7459       +3     
===========================================
+ Hits         22945    22948       +3     
- Misses        7675     7686      +11     
- Partials      3623     3625       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bmarty bmarty added the Run-Maestro Starts a Maestro Cloud session to run integration tests label Jan 8, 2024
@bmarty bmarty enabled auto-merge January 8, 2024 08:31
@github-actions github-actions bot removed the Run-Maestro Starts a Maestro Cloud session to run integration tests label Jan 8, 2024
@bmarty bmarty merged commit cd25990 into develop Jan 8, 2024
16 of 18 checks passed
@bmarty bmarty deleted the feature/bma/sendImageFromKeyboard branch January 8, 2024 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Be able to send image from keyboard
2 participants