Commit Graph

97 Commits

Author SHA1 Message Date
Jorge Martin Espinosa
c5a5810c05 Link Compound's TypographyTokens to ElementTheme. (#700)
* Link Compound's `TypographyTokens` to `ElementTheme`.

Also add some docs about when we should use each set of tokens.

* Renamed `LocalColors` to `LocalLegacyColors`.

Made both `LocalLegacyColors` and `LocalCompoundColors` internal. This means it will need to always be used through `ElementTheme.`

Also, removed any usages of `LocalColors.current` accross the project, they're now used through `ElementTheme.legacyColors`.
2023-06-28 08:53:20 +00:00
Benoit Marty
c7ec8bc9e9 Fix compilation issue after rebase 2023-06-27 19:49:14 +02:00
Benoit Marty
8cdcaba9e3 Move all density unit calculation to the same place. 2023-06-27 19:43:03 +02:00
Benoit Marty
192d32061d Improve preview by adding Divider, and improve rendering. 2023-06-27 19:43:03 +02:00
Benoit Marty
f1ef67e736 Improve rendering when only one line is displayed. 2023-06-27 19:43:03 +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
Jorge Martin Espinosa
02dc447624 [Compound] Integrate compound tokens (#586)
* Added tokens.

* Apply color to MaterialTheme, also add typography.

* Map colors to the right ones in the themes.

* Create and improve previews of some components

* More preview improvements

* Add `tertiary` and `onTertiary` colors, remove some unused ones.

* Fix usage of deleted color token

* Fix bug in Switch previews

* Create a separate `:libraries:theme` module to keep everything related to colors, typography and Compound in general.

* Fix `DatePickerPreview`

* Add missing Compound generated files by fixing their package name

* Move `ElementTheme` to the `:libraries:theme` module, make some variables internal.

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2023-06-27 16:15:40 +00:00
Benoit Marty
287328f7df More cleanup 2023-06-27 09:51:33 +02:00
Benoit Marty
4a8c49fa28 Use CommonStrings everywhere 2023-06-27 09:45:00 +02:00
Benoit Marty
12e54ac080 Lazy usage of OkHttpClient 2023-06-26 11:07:53 +02:00
Jorge Martin Espinosa
de7bbbd5cf [Message Actions] Forward messages (#635)
* Add forwarding messages base

* Make forwarding single-selection

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2023-06-22 13:27:59 +02:00
ganfra
b3e11d184a CanSendEvent default to true and branch refresh mechanism... 2023-06-21 17:43:08 +02:00
Benoit Marty
02c56df991 Extract getCanSendEvent to the matrixui module, rename to canSendEventAsState and use produceState. 2023-06-21 10:57:55 +02:00
ganfra
022e4645b4 Media: introduce a Kind.File so we don't use In-memory bytearray in timeline 2023-06-15 12:06:58 +02:00
Jorge Martin Espinosa
25c32cb1e8 [Message actions] New UI for replies (#545)
* Add 'reply to' UI to the message composer.

* Move the `BlurHashAsyncImage` to `:libraries:designsystem` as it is now used in several modules.

*  Create reusable `AttachmentThumbnail` and associated data classes and enums, it's now added to `:libraries:matrixui`.

* Re-use `AttachmentThumbnail` in a `ActionListView` and `TextComposer`.

* Add 'inReplyTo' models and UI.

* Add min size for images

* Create a separate layout for media items with no reply to info. Also, separate `Timeline__Row` components from `TimelineView`, as it was getting too large.

* Added `EqualWidthColumn` to use inside message bubbles. Also fixed some modifiers for media items replying to other messages.

* Disable `inReplyToClicked`.

* Remove unused resources and libraries.

* Remove any traces of `BlurHashAsyncImage` in `:features:messages`, since it was moved to the design system.

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2023-06-08 12:15:13 +02:00
Chris Smith
b6e45c976f Use member count instead of counting members (#530)
Use member count instead of counting members

For the room details screen, use the member count as supplied by
matrix instead of waiting for the entire member list to be
retrieved and then manually adding up all the relevant users.

This removes the loading state of the member count, relying on
a spinner on the member list itself if the user actually wants
to see the members. (The performance of that will be improved
separately on the rust side in the future)

Closes #505
2023-06-06 10:40:17 +00:00
Chris Smith
e3fb510af4 Typo and minor formatting 2023-06-05 10:23:39 +01:00
Chris Smith
ecf7e291b7 SelectedUsers: Remember the layout calculations 2023-06-02 15:19:43 +01:00
Chris Smith
8c3b01e9f2 Add a handle to the avatar bottom sheet 2023-06-02 14:24:16 +01:00
Chris Smith
83add736c5 User row tweaks
- Make the checkbox non-clickable (the parent handles the clicks,
  and this stops the m3 lib padding it out to be a sensible touch
  target)
- Align and spread the text properly
- Change the default avatar size to match designs
2023-06-02 11:57:43 +01:00
Chris Smith
3e2612dd9c Avatar actions: larger font 2023-06-01 16:55:23 +01:00
Chris Smith
6f7200c59a Merge remote-tracking branch 'origin/develop' into misc/cjs/create-join-design-feedback 2023-06-01 16:50:34 +01:00
Florian Renaud
04d4b6369a Update room properties from room details (#439)
-  Add the edit action in the room details
-  Add "Add topic" button in room details
-  Add the screen behind that action to edit some room properties: avatar, name, topic
   -  Handle the save button action
      - enable the button only if changes are detected
      - display a loader "updating room"
      - display an error dialog if any request has failed
- Check user has the right power level to change various attributes
   - "Add topic" is only shown if there's no topic and they are able to set on
   - Edit menu is only shown if they can change topic, name or avatar
   - On the edit page, any fields they can't change are uneditable

Co-authored-by: Chris Smith <csmith@lunarian.uk>
2023-06-01 15:10:29 +00:00
Chris Smith
fb147f78b0 Merge remote-tracking branch 'origin/develop' into misc/cjs/create-join-design-feedback 2023-06-01 13:26:27 +01:00
Jorge Martin Espinosa
72fcd1e946 Merge pull request #497 from vector-im/feature/jme/enable-gif-support
Enable gif support for Coil
2023-06-01 12:07:16 +02:00
Jorge Martin Espinosa
b50350aaa0 [Room details] Open room member details when clicking on user data in timeline (#482) 2023-06-01 12:03:27 +02:00
Chris Smith
f0a3981df5 Selected users: if scrollable, make last one peek
If there are enough selected users that they can't all be displayed,
add extra padding in between the users to ensure that the last
visible one is half visible to provide some scroll affordance.
2023-06-01 10:17:28 +01:00
Chris Smith
9515435102 Selected user: scale and align cross properly
IconButton makes assumptions about the size of icons, which
we're not abiding by here. That makes it semeingly impossible
to properly center our icon. Instead, rewrite it as a surface
to ensure it's laid out properly
2023-06-01 10:15:56 +01:00
Chris Smith
e8c4387bef Matrix user row: typography and alignment 2023-06-01 10:15:27 +01:00
Chris Smith
d6d273992d Checkable user row: fix uneven padding 2023-06-01 10:15:09 +01:00
Chris Smith
36d372e1eb Display a notice if Matrix ID isn't resolved (#461)
Display a notice if Matrix ID isn't resolved

If we can't get the profile of a user after an mxid was
searched for, show a warning under their ID to say the
invite probably won't be delivered.

Closes #424
2023-06-01 08:40:45 +00:00
Jorge Martín
91e3511cb0 Enable gif support for Coil 2023-05-31 16:46:58 +02:00
ganfra
c89d9dd8e6 Media: handle PR review remarks 2023-05-26 19:09:51 +02:00
ganfra
2c3fb8a549 Merge branch 'develop' into feature/fga/image_loading 2023-05-22 20:59:37 +02: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
ganfra
ac1531390e Media: fix encrypted media 2023-05-16 11:51:11 +02:00
ganfra
72dea2f817 Introduce MatrixMediaSource 2023-05-05 19:47:10 +02:00
ganfra
affb928801 Merge develop into feature/fga/image_loading 2023-05-05 12:51:00 +02:00
Chris Smith
5c935818c6 Move and refactor MatrixUser (#381)
Move and refactor MatrixUser

Instead of living in matrixui and having an AvatarData, this can
reside in the matrix module and just have the URL. An extension
method in matrixui can then provide the AvatarData when required.

This removes some small duplication, and pushes the UI-specific
information (i.e., what size of avatar is going to be rendered)
further down the stack. It also aligns the field names with those
used by the rust SDK (e.g. "displayName" instead of "userName").
2023-05-03 16:30:19 +00:00
ganfra
d55d5a801b Merge branch 'develop' into feature/fga/image_loading 2023-05-02 16:23:47 +02:00
ganfra
e73d92124e Update tests and avoid useless recomposition 2023-05-02 13:04:00 +02:00
ganfra
d7cd8a2915 RoomMembers: change the API again.. 2023-04-28 15:04:33 +02:00
ganfra
d64660237a Media: change the API 2023-04-27 12:06:01 +02:00
ganfra
f99a29ef6d MediaResolver: exposes Result instead of Nullable 2023-04-26 16:13:09 +02:00
ganfra
c9370315ad Some clean up 2023-04-25 11:17:05 +02:00
Jorge Martin Espinosa
afd58f1634 Update Gradle to 8.1 and AGP to v8.0 (#329)
* Update AGP to 8.0.0.

* Set JAVA_HOME to JDK17

* Update lint version.

* Use right JDK for dependency analysis, replace deprecated env var.

* Upgrade to Gradle 8.1.

* Remove `@Supress(DSL_SCOPE_VIOLATION)` as it's no longer needed.

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-17 08:49:52 +00:00
Florian Renaud
5364bbd2cb Update screenshots 2023-04-13 16:19:55 +02:00
Florian Renaud
97ade693f5 Add fake list of matrix users 2023-04-13 15:44:45 +02:00
Florian Renaud
0a926bd05a Navigate from people view to configuration view 2023-04-13 15:44:44 +02:00
Florian Renaud
546a795c21 Remove default onClick from MatrixUserRow 2023-03-23 11:46:56 +01:00