Commit Graph

55 Commits

Author SHA1 Message Date
renovate[bot]
6d3b816bf5 Update dependency app.cash.molecule:molecule-runtime to v1 (#925)
* Update dependency app.cash.molecule:molecule-runtime to v1

* Replace `RecompositionClock` with `RecompositionMode`

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
2023-07-20 07:36:19 +02:00
ganfra
42c3e21b3d Fix tests 2023-07-18 22:27:44 +02:00
ganfra
9e4888c4ab Update rust sdk to 0.1.34 2023-07-18 20:12:51 +02:00
ElementBot
045d957f91 Sync Strings (#882)
* Sync Strings from Localazy

* Update screenshots

---------

Co-authored-by: bmarty <bmarty@users.noreply.github.com>
2023-07-17 10:22:15 +02:00
Benoit Marty
16f30db20e Move TypographyAliases next to ColorAliases 2023-07-11 11:29:56 +02:00
Benoit Marty
84fad3e7f3 Create alias for typography (more semantic name). aliasButtonText 2023-07-11 10:29:06 +02:00
Benoit Marty
529f6d681e Create alias for typography (more semantic name). aliasScreenTitle 2023-07-11 10:29:06 +02:00
Benoit Marty
f0d3b9da53 Remove fontWeight parameter. Must use style only. 2023-07-10 17:33:42 +02:00
Benoit Marty
247348b372 TextStyle again. 2023-07-10 17:33:42 +02:00
Benoit Marty
7be0e3ea4b Remove ElementTextStyles. Only ElementTheme.typography.* styles must be used now. 2023-07-10 17:33:42 +02:00
Jorge Martin Espinosa
9170c5eb71 Display room invitation notification (#735)
* Notifications: Add some extra mappings so we keep the original contents and can pass it later to an UI layer

* Fix notifications not appearing for a room if the app was on that room when it went to background.

* Modernize how we create spannable strings for notifications, remove unneeded dependency

* Remove actions from invite notifications temporarily

* Add `NotificationDrawerManager` interface to be able to clear membership notifications when accepting or rejecting a room invite

* Fix tests

* Add comment to clarify some weird behaviours

* Address review comments

* Set circle shape for `largeBitmap` in message notifications

* Fix no avatar in DM rooms

* Fix rebase issues

* Add invite list pending intent:

- Refactor pending intents.
- Make `DeepLinkData` a sealed interface.
- Fix and add tests.

* Rename `navigate__` functions to `attach__`

* Add an extra test case for the `InviteList` deep link

* Address most review comments.

* Fix rebase issue

* Add fallback notification type, allow dismissing invite notifications.

Fallback notifications have a different underlying type and can be dismissed at will.

* Fix tests
2023-07-10 14:34:58 +02:00
Marco Romano
f33561c25d Revert "Auto generate dark mode previews and screenshots (#776)" (#784)
This reverts commit 79b529193c.
2023-07-05 15:47:53 +02:00
Marco Romano
79b529193c Auto generate dark mode previews and screenshots (#776)
With this change, composable previews and screenshots should be created with just:
```
@ElementPreviews
@Composable
fun MyViewPreview() {
    ElementPreview { 
        MyView()
    }
}
```

- Adds `@ElementPreviews` which is a shorthand for:
```
@Preview(name = "D")
@Preview(name = "N", uiMode = Configuration.UI_MODE_NIGHT_YES)
```
Should be used in connection with the now public `fun ElementPreview()` composable.

- Adds ElementPreviews to previewAnnotations in dangerfile
- Screenshots of night mode previews are now rendered with night mode
- Replaces `ElementPreviewLight` and `ElementThemedPreview` with `ElementPreview`
- Deprecates `ElementPreviewDark` which should be removed.
- Remaining usages of `ElementPreviewDark` are now ignored during screenshot tests
2023-07-05 13:58:24 +02:00
bmarty
bd3dd76039 Sync Strings from Localazy 2023-07-03 00:11:17 +00:00
Benoit Marty
c06a0d46f6 Improve API of UnreadIndicatorAtom 2023-06-29 18:17:37 +02:00
Benoit Marty
b75100b2ab Rename color alias 2023-06-29 18:17:37 +02:00
Benoit Marty
9345cbb724 Unread indicator color changed to iconAccentTertiary 2023-06-29 18:17:37 +02:00
ganfra
e3744636b6 Merge branch 'develop' into feature/fga/room_list_api 2023-06-28 15:14:06 +02:00
Benoit Marty
6a1004cbcd Fix test 2023-06-27 19:49:54 +02:00
Benoit Marty
2efbfab939 Cleanup 2023-06-27 19:49:54 +02:00
Benoit Marty
1b84d8e3ee Fix test compilation issue. 2023-06-27 19:43:03 +02:00
Benoit Marty
5c27952194 Create UnreadIndicatorAtom with preview. 2023-06-27 19:31:44 +02:00
Benoit Marty
d6f2d7a5d3 Rework AvatarSize.
Remove default value for AvatarSize, it has to be explicitely provided.
2023-06-27 19:23:37 +02:00
Yoan Pintas
e7e225dd3a Add JoinedRoom posthog event (#687) 2023-06-27 16:32:20 +00:00
Benoit Marty
d782162f27 Merge pull request #684 from vector-im/feature/bma/stringR
Quick PR to introduce `CommonStrings` type alias
2023-06-27 16:00:31 +02:00
ganfra
3d872ec0e2 RoomList: fix tests and sample 2023-06-27 14:06:58 +02:00
Marco Romano
2a82e1b4e4 Async API improvements "v2" (#672)
* Async API improvements "v2"

**NB: This PR actually changes only 3 files in `libraries/architecture/`. All the other changes are automated refactors to fix the calling code.**

This is a proposal for improvements to our `Async` type as discussed in: https://github.com/vector-im/element-x-android/pull/598/files#r1230664392 and in other chats.

Please bear in mind it is just a proposal, I'd love to hear your feedback about it, especially when it comes to naming: I've tried to make parameter and function names use a terminology similar to what we find in the Kotlin stdlib and its `Result` type.

I'm inclined to like more the non-extension flavours of the new `run*` APIs, though I'd also like your feedback about what API shape you prefer.

### Summary of the changes:
#### Functional
- Adds `exceptionOrNull()` API to complement the existing `dataOrNull()` API.
- Adds `isFailure()`, `isLoading()`, `isSuccess()` and `isUninitialized()` courtesy APIs.
- Renames `executeResult()` to `runUpdatingState()`:
	- Becomes the base API to which all the other similarly named APIs call into.
	- Makes it inline.
	- Adds contract.
	- Passes over any `prevData` to newre Async states.
	- Passes through the `block`s return value.
	- Adds unit tests.
- Renames `execute` to `runCatchingUpdatingState()` and makes it just call into `runUpdatingState()`
- Adds extension function overloads to the `run*` functions to accept `MutableState` as receiver

#### Cosmetics
- Reorders classes and methods in alphabetic order.
- Reorder parameter names to mimic conventions in Kotlin stdlib.
- Adds docstrings where useful.

* Use `fold()`

* rename pop to popFirst

* Add docstrings

* Please Detekt

* Rename exception to error.

* Please detekt

* Update existing usages.
2023-06-27 13:37:23 +02:00
ganfra
2a24d0196e Merge branch 'develop' into feature/fga/room_list_api 2023-06-27 10:47:50 +02:00
Benoit Marty
4a8c49fa28 Use CommonStrings everywhere 2023-06-27 09:45:00 +02:00
ganfra
e5c86675a4 RoomList: more rework on RoomSummaryDataSource 2023-06-26 18:02:53 +02:00
bmarty
9c5c578c67 Sync Strings from Localazy 2023-06-26 00:10:53 +00:00
ganfra
8ce65b4429 RoomList: change a bit the api of RoomSummaryDataSource 2023-06-22 12:34:07 +02:00
github-actions[bot]
3f7738c001 Sync Strings (#630)
* Sync Strings from Localazy

* Update strings, remove broken German translation

* Update screenshots

---------

Co-authored-by: bmarty <bmarty@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2023-06-19 11:18:01 +00:00
Benoit Marty
9321a9f718 Introduce simulateLongTask to ensure that the Presenter State Loading is visible.
Also do some cleanup on the tests.
2023-06-15 10:57:05 +02:00
Chris Smith
4b40a40b3b Invites: increase vertical padding to 16dp 2023-06-06 16:44:18 +01:00
github-actions[bot]
03c28ac52d Sync Strings (#522)
Sync Strings from Localazy
2023-06-05 15:26:50 +00:00
Chris Smith
9d52beb525 Invites: simplify string building 2023-06-05 11:51:00 +01:00
Chris Smith
e357f50379 Removed translated lines with wrong params 2023-06-02 15:53:01 +01:00
Chris Smith
ac6b2192a5 More string fiddling 2023-06-02 14:22:35 +01:00
Chris Smith
edf22ac373 Invites: tweak actions for decline dialog 2023-06-01 17:06:08 +01:00
Chris Smith
a38b0d7108 Invite list: show divider 2023-06-01 16:57:05 +01:00
Chris Smith
2c0d593ca6 Outlined button tweaks
Force the height in InviteSummaryRow as compose defaults to a min
height of 40dp

Change the button text style to ignore font padding so the text
aligns properly
2023-06-01 16:48:27 +01:00
Chris Smith
b1824c04e5 Invite list: various layout tweaks
- Larger avatar
- Include the MXID in the inviter
- Show inviter avatar to the left instead of inline
  (This may be weird in some translations, but it's what design
   wants and is consistent with iOS)
- Pad the name/alias if the notification dot is present
2023-06-01 16:33:00 +01:00
Chris Smith
e10b6ca9dd Invite list: typography tweaks 2023-06-01 10:06:25 +01:00
bmarty
3daea29a82 Sync Strings from Localazy 2023-05-29 00:09:47 +00:00
Chris Smith
c74d0a5d6b Fix bad preview name for invite list 2023-05-24 11:12:14 +01:00
Chris Smith
1eac67bf25 Refactor search related functionality (#436)
Refactor search related functionality

This is a prelude to adding the feature of inviting users to
a room, getting everything in the right place and reusable.

What this does:

## User search refactor

Moves the (global) user search logic (dealing with MXIDs,
minimum lengths, debounces) into a `UserRepository`.

This now sits in a `usersearch` library, which will be
used by the create room flow and the new invite flow.

## SearchBar logic pull-up

Every place we use SearchBar, we're doing the same things
to style placeholders, show back/cancel buttons, etc.

We also have a results type that is duplicated for
basically every feature that uses the search bar.

I've pushed all this common functionality into the
SearchBar itself. This makes the component a bit less
general purpose, but saves a lot of repetition.

## Remove the userlist feature

Almost all the functionality of the userlist feature
is now exclusively used by the create room feature.
Room details uses its own version because the
requirements are different.

Components useful elsewhere (SelectedUsers and
SelectedUser) have gone to matrixui, everything else
has gone to createroom.

## Other bits and pieces

I've fixed everywhere that uses Scaffold to correctly
consume the WindowInsets if the contentPadding is
applied to the contents (which it universally is).
This was a change in the last version of Material3
(I guess previously Scaffold handled the consumption
for us). This fixes weird gaps above search bars.

Added overloads for the MatrixUserRow and
CheckedMatrixUserRow that take the name/subtitle/avatar
separately, so the invites list can pass arbitrary
text like "User has already been invited".

The `blockuser` package was for some reason not
under `impl` but alongside it, I've bumped it into
the right place.
2023-05-22 09:06:54 +00:00
Florian Renaud
bf690c70b4 Merge pull request #400 from vector-im/renovate/kotlin
Update kotlin to v1.7.0
2023-05-12 17:03:41 +02:00
Chris Smith
ebac9ef4b4 Fix a few FFI leaks (#405)
Fix a few FFI leaks

These are instances where we obtain an FFIObject and don't call
Close on it to release the underlying reference on the Rust side.

The worst instance here was leaking an object per room member
every time we refreshed the member list
2023-05-12 10:50:39 +00:00
Florian Renaud
c22d181d8c Remove useless OptIn in tests 2023-05-12 10:05:39 +02:00