Commit graph

1928 commits

Author SHA1 Message Date
Benoit Marty
6c146f0033
Merge pull request #1680 from vector-im/sync-localazy
Sync Strings
2023-10-30 12:38:41 +01:00
Jorge Martin Espinosa
e64f822f5a
Enable Element Call integration in rooms by default (#1685)
Also change base url to `call.element.dev`.
2023-10-30 11:33:22 +00:00
Marco Romano
7651cf1b33
Voice message button: Show proper disabled color. (#1682)
Also changes a bit our own IconButton api to allow to mirror material's and allow color customization.
2023-10-30 10:51:22 +00:00
Marco Romano
2aa9bf967b
Add a11y label to voice messages (#1683) 2023-10-30 10:41:15 +00:00
bmarty
8350382440 Sync Strings from Localazy 2023-10-30 00:10:04 +00:00
Marco Romano
563aaa6102
Don't show body in replies to voice messages but rather show "Voice message" string (#1673)
Story: https://github.com/vector-im/element-meta/issues/2106
2023-10-27 21:57:05 +00:00
jonnyandrew
8121d1a6de
Show voice message preview player progress (#1675)
* Show voice message preview player progress

* Update screenshots

* Fix test

* Some nits over mediaplayer stuff

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
Co-authored-by: Marco Romano <marcor@element.io>
2023-10-27 20:43:52 +00:00
Benoit Marty
b77089f1b6
Merge pull request #1662 from vector-im/feature/bma/secureBackupUi
Secure backup UI
2023-10-27 18:36:38 +02:00
jonnyandrew
b046493a7b
Merge pull request #1671 from vector-im/jonny/voice-message-fixes
Fix voice message preview player playing after delete/send
2023-10-27 16:49:38 +01:00
Marco Romano
81122ec33b
Track errors in VoiceMessagePresenter (#1667)
Story: https://github.com/vector-im/element-meta/issues/2085
2023-10-27 15:23:53 +00:00
Marco Romano
ed91930a97
Enable swipe to reply on voice messages (#1668)
With the new waveform view it does not conflict anymore.
2023-10-27 15:10:56 +00:00
jonnyandrew
08ba8e182a
Ensure sending pauses audio 2023-10-27 16:05:35 +01:00
jonnyandrew
71644910e8
Ensure deleting pauses audio 2023-10-27 16:05:34 +01:00
Marco Romano
a07286ace9
Split VoiceMessageType from AudioMessageType (#1664)
Currently, for compatibility reasons, we implement MSC3245v1 which puts the voice data inside an audio message type. Though at times it seems impractical to deal with a single message type which effectively represents 2 different kinds of messages.

This PR creates a new message type called `VoiceMessageType` which is used whenever we receive an event with `"msgtype": "m.audio"` which also has the `"org.matrix.msc3245.voice": {}` field. This makes it easier to process voice messages as different entities throughout the rest of the codebase.
2023-10-27 16:02:16 +02:00
David Langley
a4df8f80cc Merge branch 'develop' of https://github.com/vector-im/element-x-android into langleyd/live_waveform 2023-10-27 13:54:18 +01:00
Marco Romano
0e4141863b
Always treat waveform as List<Float> (#1663)
[MSC3246](https://github.com/matrix-org/matrix-spec-proposals/pull/3246) specifies the waveform as a list of ints because:

> Because floating point numbers are not allowed in Matrix events

Though DSP on audio data is almost always done using their floating point representation.
This PR brings the float<->int rescaling in the `matrix` module so that the application code can always work with float waveform samples.
2023-10-27 12:49:58 +00:00
Marco Romano
a6e4644cfa
Add missing screenshots in TimelineView (#1660)
Add audio, voice  and poll screenshots to TimelineView which were missing.
2023-10-27 12:18:28 +00:00
David Langley
a64003355a Merge branch 'develop' of https://github.com/vector-im/element-x-android into langleyd/live_waveform 2023-10-27 13:10:32 +01:00
David Langley
977c7e265a Fix naming and waveform previews 2023-10-27 13:06:33 +01:00
jonnyandrew
9510d43289
Add waveform to voice message preview UI (#1661)
* Add waveform to preview UI

* Update screenshots

* Make random waveform function deterministic

* Update screenshots

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2023-10-27 11:33:35 +00:00
David Langley
37f8195956 Merge branch 'develop' of https://github.com/vector-im/element-x-android into langleyd/live_waveform 2023-10-27 12:28:46 +01:00
Jorge Martin Espinosa
44de6adb86
Initial support for member suggestions (#1631)
* Initial support for member suggestion (search and UI)

* Add custom `BottomSheetScaffold` implementation to workaround several scrolling bugs

* Start searching as soon as `@` is typed, add UI following initial designs

* Extract suggestion processing code

* Extract component, add previews, fix tests

* Add tests

* Add exception from kover to the forked bottom sheet code

* Add a feature flag for mentions

- Extract composer & mention suggestions to their composable.
- Extract mentions suggestions processing to its own class.
- Add `MatrixRoom.canTriggerRoomNotification` function.
- Update strings and conditions for displaying the `@room` mention.

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2023-10-27 10:26:40 +00:00
Benoit Marty
9807ebf649 Secure backup 2023-10-27 12:18:40 +02:00
Marco Romano
b2a61f2ed3
Show correct UI when replying to a voice message (#1658)
Shows voice messages in the room summary.
Shows voice messages in the reply context menu and composer.
Show replies to voice messages in the timeline. 

(before this PR voice messages were shown the same as audio messages)

Story: https://github.com/vector-im/element-meta/issues/2106
2023-10-27 11:30:57 +02:00
Benoit Marty
bf905dd79b
Merge pull request #1651 from vector-im/feature/bma/uiUpdate
Preparatory work for SecureBackup: UI update
2023-10-27 11:03:29 +02:00
David Langley
0745587f3b
Merge branch 'develop' into langleyd/live_waveform 2023-10-27 09:37:21 +01:00
David Langley
1cb27661c8 Fix tests 2023-10-27 09:32:05 +01:00
Marco Romano
b5586cb7d8
Move MediaPlayer from messages module to new dedicated library module (#1654) 2023-10-27 09:58:17 +02:00
David Langley
db70c98af9 Merge branch 'develop' of https://github.com/vector-im/element-x-android into langleyd/live_waveform 2023-10-27 08:44:25 +01:00
Benoit Marty
aaaad23612
Merge pull request #1653 from vector-im/feature/bma/secureBackupSdk
SecureBackup: update matrix sdk module.
2023-10-27 09:35:19 +02:00
David Langley
1389c9ed24 Simple live waveform implementation. 2023-10-26 23:46:03 +01:00
Marco Romano
0457e5915c
Convert mx waveform to floats as early as possible in the chain (#1652)
This way we're sure that internally we always deal with [0;1] float samples. the [0;1024] int range is used only at the rust sdk boundary.
2023-10-26 16:58:00 +00:00
Benoit Marty
3a15b92eb6 SecureBackup: update matrix sdk module. 2023-10-26 18:02:34 +02:00
Benoit Marty
96dd7bbd8d Use DialogLikeBannerMolecule in NotificationSettingsView. 2023-10-26 17:40:51 +02:00
Benoit Marty
fa2a2e2f7f Design: extract DialogLikeBannerMolecule from RequestVerificationHeader 2023-10-26 17:40:51 +02:00
Marco Romano
00d24ce4b1
Include waveform when sending voice messages (#1650)
- New `AudioLevelCalculator` that outputs dB0v rescaled to the [0;1] range.
- `VoiceRecorder` now stores the audio levels sampled while recording, then resamples them to 100 samples to use as waveform preview.
- Waveform data is carried all the way as a `List<Float>` and converted to `List<Int>` in the [0;1024] range as per matrix spec only before sending it.
2023-10-26 17:37:24 +02:00
jonnyandrew
a67410f573
Add voice message preview player (#1646)
---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2023-10-26 15:33:58 +00:00
jonnyandrew
acd7aef6be
Move waveform UI to design system library (#1649) 2023-10-26 15:15:42 +00:00
ganfra
ec9b6ba62f
Merge pull request #1642 from vector-im/feature/fga/pin_settings
PIN : settings and branch flow
2023-10-26 16:40:38 +02:00
Jorge Martin Espinosa
030e86f56b
Update the chat screen UI using RoomInfo. (#1640)
* Update the chat screen UI using `RoomInfo`.

This is specially useful for getting live values for `hasRoomCall`.

* Ensure the first `MatrixRoomInfo` is emitted ASAP

* Try excluding `*Present$present$*` inner functions from kover as separate entities

* Update strings

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2023-10-26 14:27:42 +00:00
ganfra
b355d9fb64 PIN: address PR review 2023-10-26 15:28:18 +02:00
ganfra
ca6a30d6cc PIN : fix quality 2023-10-26 15:25:40 +02:00
Marco Romano
3ec62ad58a
Use Float instead of Double for all the level metering logic. (#1645)
This is in preparation of further changes to the way the audio level is computed and to allow recording and sending of the waveform. The main reasoning behind the change is twofold:
1) We don't need the precision of Double in our context (we just need a rough indication of the changes in audio level to successfully draw a level meter or a waveform in our UI).
2) Performance: It is true that on 64 bit CPUs single operations involving Floats or Doubles take the same amount of time (i.e one clock cycle). But there are other aspects here that vouch in favor of Floats:
	- A float takes half the space in memory compared to a double, so when storing long lists of them this can add up.
	- On Android O and greater the ART runtime can "vectorize" certain operations on lists and make use of the CPU's SIMD registers which are generally 128 bits. So by using floats 4 of them can fit and be computed at the same time whilst with doubles only 2 will fit halving the throughput.

References:
- https://source.android.com/docs/core/runtime/improvements
- https://www.slideshare.net/linaroorg/automatic-vectorization-in-art-android-runtime-sfo17216
2023-10-26 12:55:23 +00:00
ganfra
a7c83a94d3 PIN : Fix SetupPinPresenterTest 2023-10-26 14:39:13 +02:00
ganfra
e864871c0e PIN : Fix test compilation 2023-10-26 13:10:25 +02:00
Marco Romano
eca7d705a7
Merge branch 'develop' into langleyd/custom_waveform 2023-10-26 13:07:45 +02:00
Marco Romano
7d1b671426
Refactor of voice message playing code (#1643)
After PR review suggestions from @jonnyandrew 
User facing functionality doesn't change, but overall architecture and testing is better.
2023-10-26 12:51:12 +02:00
ganfra
5d98f645d2 Merge branch 'develop' into feature/fga/pin_settings 2023-10-26 11:13:52 +02:00
David Langley
bcb928cf30 -Fix waveform preview 2023-10-26 09:10:38 +01:00
David Langley
20cef08367 Don't need added state from bad merge. 2023-10-26 09:06:08 +01:00