Commit graph

57 commits

Author SHA1 Message Date
Benoit Marty
d2c7cb6020 Use generated Showkase.getBrowserIntent to avoid errors. 2023-08-17 18:09:09 +02:00
Jorge Martin Espinosa
0324719606
Upgrade compose-material3 to 1.2.0-alpha05 version (#1011)
Co-authored-by: ElementBot <benoitm+elementbot@element.io>

Also upgrade compileSdk to 34.
2023-08-17 14:20:54 +02:00
Florian Renaud
41d0d21c80
Add feature flag for polls (#1064)
* Handle poll events from the sdk

* Render started poll event in the timeline

* Create poll module

* Check poll kind before revealing the results

* Check if user has voted before revealing the results

* Add active poll previews

* Minor cleanup

* Update todos

* Fix CI

* Remove hardcoded string

* Update preview

* changelog file

* Update screenshots

* Use CommonPlurals

* Set poll root view as selectableGroup

* Improve poll result rendering

* Update screenshots

* Add missing showkase processor

* Update screenshots

* Add feature flag for polls

* Add supporting text in PreferenceCheckbox

* Render poll events if feature flag is enabled

* changelog

* Update screenshots

* Fix tests

* Move feature flag check to poll factory

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2023-08-16 15:14:38 +00:00
Jorge Martin Espinosa
9e1ff513e4
[Compound] Implement Snackbars based on designs (#1054)
* Make `InternalButton` internal instead of private so it can be customised.

Also, change the `ButtonColors.contentColor` for text buttons to `LocalContentColor.current` by default.

* Add temporary color for Snackbar action label

* Implement `Snackbar` component based on Compound

* Propagate changes to all other components

* Use right Preview annotation config

* Move `ButtonVisuals` to their own file

* Update screenshots

* Make previews internal

* Update screenshots

* Set a custom token for contentColor in AppBars

* Change 'Label' to 'Action' in the previews

* Add changelog

* Update screenshots

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2023-08-16 10:38:28 +00:00
Benoit Marty
6aa5239189 Enable detekt rule PreviewPublic and fix existing issues. 2023-07-26 10:08:39 +02:00
Benoit Marty
030afe56b3 Fix typo 2023-07-21 21:40:08 +02:00
Benoit Marty
32c8fdae99 Add a way to crash this app on demand. Useful to test Crash detection, and analytics report, etc. 2023-07-21 20:55:04 +02:00
Benoit Marty
82258f12ba Ensure the application react correctly if analytics is disabled at compilation time. 2023-07-21 19:19:17 +02:00
Benoit Marty
e918d6affd Enable detekt rules TopLevelPropertyNaming and cleanup the code. 2023-07-20 17:52:48 +02:00
renovate[bot]
156bf08b7a
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
Benoit Marty
7207afebcc When clearing cache, also reset some data store in prefs/datastore. 2023-07-18 01:35:12 +02:00
ganfra
2b679710d2 Rework a bit MatrixClientHolder and reintroduce cacheIndex... 2023-07-17 18:34:50 +02:00
Benoit Marty
6eab2ea694 Fix test. 2023-07-07 16:22:42 +02:00
Benoit Marty
cd469e67bd Fix Snackbar colors. 2023-07-07 15:39:43 +02:00
Benoit Marty
af323d8636 Show Snackbar once the verification is finish in the correct screen (#812) 2023-07-07 15:34:15 +02:00
ganfra
fc7bdafbcb Nodes: rework RootFlowNode with cache service 2023-07-06 18:08:29 +02:00
Marco Romano
ca695ca077 Revert "Auto generate dark mode previews and screenshots (#776)" (#784)
This reverts commit fd467c2451.
2023-07-05 15:47:53 +02:00
Marco Romano
fd467c2451 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
Benoit Marty
4f1d352969 Remove dead code. 2023-07-03 17:09:04 +02:00
Benoit Marty
73b1ffd7d0 Replace CurrentUserProvider by an extension on MatrixClient. 2023-07-03 17:09:04 +02:00
Benoit Marty
2c8fdf0dad Use correct icon. 2023-07-03 17:09:04 +02:00
Benoit Marty
0ea811269b Fix modifier issue. 2023-07-03 17:09:04 +02:00
Benoit Marty
3e1d6e529c Fix test. 2023-07-03 17:09:04 +02:00
Benoit Marty
34f4078d5f Move BuildMeta fake to common test module. 2023-07-03 17:09:04 +02:00
Benoit Marty
e81d9c1ac9 Add application version to the setting screen. 2023-07-03 17:09:04 +02:00
Benoit Marty
6a2170f059 Disable rageshake by default. Can be enabled in the developed settings, but this is not available in the release version. 2023-07-03 17:09:04 +02:00
Benoit Marty
d0cf400146 Add "Complete verification" item in the root setting screen. 2023-07-03 17:09:04 +02:00
Benoit Marty
6c5c050ba3 Add quick test. 2023-07-03 17:09:04 +02:00
Benoit Marty
d7cf3c091a Open legals URL 2023-07-03 17:09:04 +02:00
Benoit Marty
b6f977c032 Change hierarchy of settings. 2023-07-03 17:09:04 +02:00
Benoit Marty
e1b528e861 Show current user in the settings and extract code in CurrentUserProvider. 2023-07-03 17:09:04 +02:00
Benoit Marty
54b5097c52 Update some setting screens. 2023-07-03 17:09:04 +02:00
Benoit Marty
c33a08b602 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
Marco Romano
316d57d1b6 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
Benoit Marty
dfa1adb9c1 More cleanup 2023-06-27 09:51:33 +02:00
Benoit Marty
798da50454 Use CommonStrings everywhere 2023-06-27 09:45:00 +02:00
Benoit Marty
36910abca4 Move FileSizeFormatter to module :libraries:androidutils 2023-06-26 11:14:53 +02:00
Benoit Marty
b6920afb7f Move cache management to a dedicated class and in the setting module, for clarity. 2023-06-26 11:07:53 +02:00
Benoit Marty
145cd410c7 Idx -> Index 2023-06-26 11:07:53 +02:00
Benoit Marty
5b4069d9f4 Use operator invoke. 2023-06-26 11:07:53 +02:00
Benoit Marty
8f0834afd5 Fix compilation issue in Fake class. 2023-06-26 11:07:53 +02:00
Benoit Marty
fb9568258f Clear cache: clear Coil and OkHttpClient cache. 2023-06-26 11:07:53 +02:00
Benoit Marty
979ebe4adb Close the client before deleting data, and ensure the app is restarted, using a cache Index. 2023-06-26 11:07:22 +02:00
Benoit Marty
573de1c168 Improve rendering of cache size (and fix compilation issue) 2023-06-26 11:07:22 +02:00
Benoit Marty
2a7d252a4e Display cache size in the developer settings (#643) 2023-06-26 11:06:36 +02:00
Benoit Marty
f014f0a3ae Add clear cache action in the developer settings (#643) 2023-06-26 11:06:36 +02:00
Yoan Pintas
f534ecda96 Init analytics modules (#350) 2023-06-05 13:11:34 +00:00
Florian Renaud
719dd20555 Remove useless OptIn in tests 2023-05-12 10:05:39 +02:00
Benoit Marty
4d7ec3916b Re-order parameters. 2023-05-05 11:49:27 +02:00
Benoit Marty
e89fcdcc94 Avoid using hard-coded key, use ShowkaseBrowserActivity.getIntent() instead. 2023-05-04 17:31:08 +02:00