Commit graph

46 commits

Author SHA1 Message Date
Marco Romano
a814c4a95a
TimelineItemPresenterFactories (#1609)
DI infrastructure to allow injection of presenters into the timeline.
Add an `@AssistedFactory` of type `TimelineItemPresenterFactory` to a `Presenter` class and bind this factory into the TimelineItemPresenterFactory map multi binding using:

```
@Binds
@IntoMap
@TimelineItemEventContentKey(MyTimelineItemContent::class)
```

A map multibinding of such factories will be available in the `LocalTimelineItemPresenterFactories` composition local for further use down the UI tree.
2023-10-19 15:57:34 +02:00
Benoit Marty
0c10432f9b
Merge pull request #1399 from vector-im/renovate/io.nlopez.compose.rules-detekt-0.x
Update dependency io.nlopez.compose.rules:detekt to v0.3.0
2023-09-21 09:30:56 +02:00
Benoit Marty
fb87c77b91 Rules has been renamed
- https://github.com/mrmans0n/compose-rules/releases/tag/v0.3.0
- https://github.com/mrmans0n/compose-rules/pull/100
2023-09-21 08:29:14 +02:00
Benoit Marty
8babab5da9 Detekt: Disable OptionalWhenBraces, even if deprecated and replaced by BracesOnWhenStatements. Cannot do what I want with BracesOnWhenStatements. 2023-09-20 17:21:18 +02:00
Benoit Marty
e7c330be95 Enable more detekt rules. 2023-07-26 12:12:37 +02:00
Benoit Marty
495d6020ad Enable detekt rules UseLet and fix existing issues. 2023-07-26 12:12:07 +02:00
Benoit Marty
b8281052b9 Enable detekt rules UseDataClass and fix existing issues. 2023-07-26 11:51:17 +02:00
Benoit Marty
b3cf0d2cf1 Enable detekt rules UnderscoresInNumericLiterals and fix existing issues. 2023-07-26 11:48:08 +02:00
Benoit Marty
0e219200b0 Enable detekt rules OptionalUnit and fix existing issues. 2023-07-26 11:43:48 +02:00
Benoit Marty
f7536a5450 Enable more detekt rules and remove unused extension. 2023-07-26 11:25:05 +02:00
Benoit Marty
1354ec76c9 Enable detekt rules DataClassShouldBeImmutable and fix existing issues. 2023-07-26 11:18:00 +02:00
Benoit Marty
19e81825ff Enable detekt rules AlsoCouldBeApply and fix existing issues. 2023-07-26 11:10:46 +02:00
Benoit Marty
e0255777c0 Enable detekt rules CascadingCallWrapping and fix existing issues. 2023-07-26 11:07:25 +02:00
Benoit Marty
17155a7426 Enable detekt rules SuspendFunSwallowedCancellation and SuspendFunWithCoroutineScopeReceiver. 2023-07-26 10:48:38 +02:00
Benoit Marty
bd0031445e Enable detekt rule TooGenericExceptionThrown and fix existing issue. 2023-07-26 10:40:41 +02:00
Benoit Marty
297d77af85 Enable detekt rule InstanceOfCheckForException. 2023-07-26 10:37:44 +02:00
Benoit Marty
7aa448c3bc Enable detekt rule ComplexCondition, LargeClass. 2023-07-26 10:34:39 +02:00
Benoit Marty
b5a5118160 Enable detekt rule ThrowingExceptionsWithoutMessageOrCause and fix existing issues. 2023-07-26 10:33:51 +02:00
Benoit Marty
9a6ed8dac6 Enable detekt rule UnnecessaryAbstractClass, LoopWithTooManyJumpStatements, EmptySecondaryConstructor. 2023-07-26 10:23:51 +02:00
Benoit Marty
5ae51095e3 Enable detekt rule ProtectedMemberInFinalClass. 2023-07-26 10:19:25 +02:00
Benoit Marty
73347deaaf Enable detekt rule UseCheckOrError and fix existing issues (and a potential crash on MapboxMap?). 2023-07-26 10:18:28 +02:00
Benoit Marty
3f372e5804 Enable detekt rule ImplicitDefaultLocale and fix existing issue. 2023-07-26 10:11:00 +02:00
Benoit Marty
6aa5239189 Enable detekt rule PreviewPublic and fix existing issues. 2023-07-26 10:08:39 +02:00
Benoit Marty
73ae59a3ca Enable more detekt rules 2023-07-20 18:08:37 +02:00
Benoit Marty
c75eabbcb0 Enable detekt rules UnnecessaryParentheses and cleanup the code. 2023-07-20 18:08:08 +02:00
Benoit Marty
2928073e22 Enable detekt rules UnusedImports and cleanup the code. 2023-07-20 18:00:23 +02:00
Benoit Marty
08a7287e8b Remove detekt rules about ViewModels. 2023-07-20 17:53:29 +02:00
Benoit Marty
e918d6affd Enable detekt rules TopLevelPropertyNaming and cleanup the code. 2023-07-20 17:52:48 +02:00
Benoit Marty
a8ed8b7a59 Enable detekt rules VariableNaming and cleanup the code. 2023-07-20 17:50:23 +02:00
Benoit Marty
86756dbc09 Enable detekt rules UnusedParameter and UnusedPrivateProperty and cleanup the code. 2023-07-20 17:48:56 +02:00
Benoit Marty
24ece8c454 Enable detekt rule UnusedPrivateMember and cleanup the code. 2023-07-20 17:44:14 +02:00
Marco Romano
004b86b05d
MapLibre compose wrapper library (#877)
Heavily inspired from https://github.com/googlemaps/android-maps-compose It doesn't aim to be a full featured library like android-maps-compose, it's been stripped down to only handle our use cases.

Related to:
https://github.com/vector-im/element-meta/issues/1674
https://github.com/vector-im/element-meta/issues/1682
2023-07-17 16:22:29 +02:00
Benoit Marty
e2f3f2966b Remove ElementColors. We should use semantics and material colors now. 2023-07-10 17:33:42 +02:00
Jorge Martin Espinosa
683b0b3594 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
Jorge Martin Espinosa
9251cbf536 [Message Actions] Report messages (#642)
* Add report messages feature

* Try to improve how snackbars are delivered

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2023-06-23 10:44:47 +02:00
renovate[bot]
29fcfcf68c Update dependency io.gitlab.arturbosch.detekt to v1.23.0 (#454)
* Update dependency io.gitlab.arturbosch.detekt to v1.23.0

* Disable new detekt rules for unused params

UnusedParameter and UnusedPrivateProperty are both potentially
useful but we currently break them a lot, for the most part
in places that haven't been fully implemented yet.

The unused params are reported as build warnings anyway, so
we're not missing much by disabling these for now.

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Chris Smith <csmith@lunarian.uk>
2023-05-30 11:18:51 +00:00
Jorge Martin Espinosa
ea454ff1c3 Add consumer proguard rules for SQLCipher (#138)
* Add consumer proguard rules for SQLCipher

* Add changelog

* Explain why these rules are necessary

Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>

* Try to switch to a supported version of Compose Rules to avoid dependency issues

---------

Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
2023-03-06 19:40:05 +01:00
Jorge Martin Espinosa
c87c0ea28c Refine sign in flow to match designs and iOS flow (#100)
* Fix dark theme

* First attempt at replicating iOS' UI & flows.

* Try to fix Maestro tests

* Add error dialogs and tests

* Remove unused modifiers

* Try to fix detekt issues

* Tidy up maestro login flow a bit

* Add `CompoundColorPalette` with some needed colors

* Fixes to designs

* Fix detekt issues

* More design fixes

* Some other minor design fixes

* Add changelog

* Minor tweaks.

* Remove legacy dark material theme as it's no longer needed.

* Move sliding sync 'learn more' url to constants object

* Remove unused focusManager

* Change how the displayed homeserver works

* Keep user input as homeserver if it's valid

* Remove `CompoundColorPalette`, try to fix issue when toggling dark mode.

* Add `@Stable` to the theme, adjust how it toggles in dark mode

* Remove unused strings

* Update screenshots

* Re-organize components in LoginRootScreen

* Bump min coverage to 55, max to 60

* Always replace the snapshots contents when running `recordPaparazzi`

* Fix dark theme preview of components using content colors

* Add `BackButton` component

* Handle errors with dialogs in a generic way

* Align our Dialog components with the designs, use them were needed

* Use a `MatrixHomeserverDetails` data class instead of just an URL.

* `AuthenticationService.getHomeserverDetails()` now returns a `StateFlow`.

Also, try to fix coverage issues in tests.
2023-03-06 09:30:16 +01:00
Benoit Marty
426005f298 Fix detekt issue, optimize import, fix color of preference category title 2023-02-03 13:43:00 +01:00
Benoit Marty
9ad43aee73 Fix licence template 2023-01-18 15:49:57 +01:00
Benoit Marty
603ecf6164 Let detekt check if the license is set on Kotlin files. 2022-12-22 14:17:35 +01:00
Benoit Marty
0644a5822f Code quality
Code quality
2022-12-21 15:32:53 +01:00
Benoit Marty
9c7fa85897 Adapt twitter rules. 2022-12-12 16:24:35 +01:00
Benoit Marty
6340d8640c Add twitter rules for Compose 2022-12-09 17:12:08 +01:00
Benoit Marty
c46ce58e0c Setup Detekt - specific rule for Composable function 2022-12-09 16:12:36 +01:00
Benoit Marty
77877e14dc Setup Detekt 2022-12-09 16:12:36 +01:00