Commit graph

1651 commits

Author SHA1 Message Date
David Langley
1a2b728361 lint 2023-10-27 08:45:20 +01: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
David Langley
416aa3b64a FIx height and concurrent exception
- Fix live waveform hight
- Fix concurrent modification exception when sharing levels
- Tidy up width of live waveform
2023-10-27 08:41:08 +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
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
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
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
renovate[bot]
71ef76ad86
Update dependency org.matrix.rustcomponents:sdk-android to v0.1.65 (#1639)
* Update dependency org.matrix.rustcomponents:sdk-android to v0.1.65

* Fix broken verification flow

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
2023-10-26 08:59:06 +02:00
ganfra
54cd62ab76 PIN: branch SignOut 2023-10-25 11:15:15 +02:00
David Langley
6fa73963c1
Merge branch 'develop' into dla/feature/custom_room_notification_settings_list 2023-10-24 22:18:38 +01:00
jonnyandrew
8c7a0c0e0a
Allow deleting a recorded voice message (#1635)
---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2023-10-24 21:02:19 +00:00
David Langley
75e95333a8 Unit and Snapshot tests for error and loading states. 2023-10-24 21:39:53 +01:00
David Langley
4784235f8d
Merge branch 'develop' into dla/feature/custom_room_notification_settings_list 2023-10-24 17:20:15 +01:00
Benoit Marty
b4cc11ec1e Test coverage: Add test on DefaultNavigationStateService 2023-10-24 17:17:15 +02:00
Benoit Marty
0b984327db
Merge pull request #1632 from vector-im/feature/bma/backupMapper
Add `BackupState` and `BackupStateMapper`
2023-10-24 16:06:59 +02:00
ganfra
d2d6cab839 PIN : start branching logic 2023-10-24 14:19:52 +02:00
jonnyandrew
f1b142f002
Add voice message recording duration indicator and limit (#1628)
---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2023-10-24 11:44:53 +00:00
Benoit Marty
04ed06cf9a Add BackupState and BackupStateMapper from the feature/bma/secureBackup branch to ensure that we do not upgrade the SDK with no support of KeyBackup.
This will act as a poison pill to avoid mistake when building new version of the SDK.
2023-10-24 11:12:06 +02:00
jonnyandrew
8c0d9cc6a0
Add progress indicator for sending voice messages (#1618)
---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2023-10-24 08:36:42 +00:00
Jorge Martin Espinosa
fc8d16693b
Set tracing of matrix_sdk_ui::timeline to trace (#1630) 2023-10-24 09:37:41 +02:00
ganfra
6170dd45bc Fix dagger compilation 2023-10-23 20:55:58 +02:00
jonnyandrew
b476654489
Record and send voice messages (#1596)
---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2023-10-23 17:28:00 +00:00
ganfra
005e5cc1a1
Merge pull request #1624 from vector-im/feature/fga/pin_auth_ui
PIN : unlock screen ui
2023-10-23 16:35:22 +02:00
Benoit Marty
8ca42d4cfc Konsist: add test to ensure that functions with @PreviewsDayNight contain ElementTheme composable, and fix existing issues. 2023-10-23 12:23:27 +02:00
jonnyandrew
7048da2e20
Fix issue where text is cleared when cancelling a reply (#1617) 2023-10-23 08:31:32 +00:00
ElementBot
c8dc364147
Sync Strings (#1623)
* Sync Strings from Localazy

* Fix strings

* Update screenshots

---------

Co-authored-by: bmarty <bmarty@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
2023-10-23 08:20:49 +00:00
renovate[bot]
244c45797f
Update dependency org.matrix.rustcomponents:sdk-android to v0.1.63 (#1619)
* Update dependency org.matrix.rustcomponents:sdk-android to v0.1.63

* Update Element Call integrated APIs

* Take into account the new `MessageType.Other` from the SDK

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
Co-authored-by: Benoit Marty <benoit@matrix.org>
2023-10-20 22:32:59 +02:00
David Langley
5adcaef569 Add new ui for room notifications screen
- Add new ui for room notifications screen
- Fix error when changing default notification setting.
2023-10-20 21:08:44 +01:00
ganfra
fd63220ee0 Fix compilation 2023-10-20 20:26:04 +02:00
ganfra
67d4271f4d Pin unlock : add signout prompt 2023-10-20 18:52:56 +02:00
Benoit Marty
8aa706e97d
Merge pull request #1614 from vector-im/feature/bma/removeAppNameProvider
Remove AppNameProvider, we have buildMeta now.
2023-10-20 14:28:05 +02:00
Marco Romano
f787867e87
Document the nuances in UserId and SessionId types. (#1616) 2023-10-20 12:25:20 +00:00
Benoit Marty
510bdd47af Remove AppNameProvider, we have buildMeta now. 2023-10-20 10:41:39 +02:00
ganfra
20c2ee9e3a Merge branch 'develop' into feature/fga/pin_create_ui 2023-10-19 22:26:21 +02:00
Jorge Martin Espinosa
46f78ef700
Integrate Element Call with widget API (#1581)
* Integrate Element Call with widget API.

- Add `appconfig` module and extract constants that can be overridden in forks there.
- Add an Element Call feature flag, disabled by default.
- Refactor the whole `ElementCallActivity`, move most logic out of it.
- Integrate with the Rust Widget Driver API (note the Rust SDK version used in this PR lacks some needed changes to make the calls actually work).
- Handle calls differently based on `CallType`.
- Add UI to create/join a call.

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2023-10-19 15:38:43 +00:00
David Langley
e2adecbcf4
Merge branch 'develop' into dla/feature/custom_room_notification_settings_list 2023-10-19 16:36:30 +01:00
David Langley
7505ac8eda Fix tests and lint 2023-10-19 16:17:57 +01:00
ganfra
7ebe6719da Pin create: use localazy strings 2023-10-19 16:28:20 +02:00
Marco Romano
33f5c8efb8
Add global context.cacheDir provider. (#1606)
## Type of change

- [ ] Feature
- [ ] Bugfix
- [x] Technical
- [ ] Other :

## Content

Dagger now provides the app's `cacheDir` when requesting a `@CacheDirectory File`  type.

## Motivation and context

To support some upcoming code that needs the `cacheDir` to be changed during tests.
2023-10-19 14:07:45 +02:00
Marco Romano
5a7f77bc92
Extract more content from audio messages. (#1607)
`TimelineItemAudioContent`:
- Use `java.time.Duration` instead of milliseconds. This will ease up things in the future because currently milliseconds are sent over the wire but in the future seconds will be sent (as per the stable MSC). Using `Duration` will allow our downstream code to be independent of what's passed over the wire.
- Rename `audioSource` property to `mediaSource` to better match its type.

`AudioMessageType`:
- Add and populate new fields `details` and `isVoiceMessage` to be used by voice messages.
2023-10-19 13:32:43 +02:00
Marco Romano
79d2941fe4
Include desugaring lib also in library modules (#1604)
## Type of change

- [ ] Feature
- [ ] Bugfix
- [x] Technical
- [ ] Other :

## Content

Includes the `coreLibraryDesugaring(libs.android.desugar)` dependency in all modules which use one of our gradle plugins.

## Motivation and context

Right now desugaring is enabled also in library modules but the desugar dependency is not included in those.
This causes some unwanted side effects such as being unable to run compose previews in an emu.

This change will also include the desugar dependency in those libraries.
2023-10-19 09:00:32 +00:00