Commit Graph

37 Commits

Author SHA1 Message Date
Benoit Marty
7c190883e8 Rename file to match the class it contains. 2023-09-21 15:24:26 +02:00
Benoit Marty
ffcac2a0da Move open system setting to the PermissionsPresenter 2023-09-21 14:20:41 +02:00
Benoit Marty
9b72992d51 Create FakePermissionsPresenterFactory, to reduce boilerplate. 2023-09-21 12:54:15 +02:00
Benoit Marty
6d41542bd0 Add strings for permission dialogs in Localazy 2023-09-21 12:07:09 +02:00
Benoit Marty
378d3ff9ab Open app settings from the permission dialog. 2023-09-21 11:37:59 +02:00
Benoit Marty
676b2cc66b Rename Event for clarity 2023-09-21 11:29:29 +02:00
Benoit Marty
a43e82e2ff Fix behavior of DefaultPermissionsPresenter. Do not show dialog immediately. 2023-09-21 11:27:30 +02:00
Benoit Marty
da61b8970a Request Camera permission before launching the external Camera app (#1395) 2023-09-21 10:54:02 +02:00
Benoit Marty
e326e49e4c Use DayNightPreview 2023-09-19 11:49:12 +02:00
Marco Romano
b860bd30bd GRemove the @JvmField annotation whenever using WarmUpRule. 2023-09-13 15:19:26 +02:00
jonnyandrew
11c1fca92e [Rich text editor] Integrate rich text editor library (#1172)
* Integrate rich text editor

* Also increase swapfile size in test CI

Fixes issue where screenshot tests are terminated due to lack of CI
resources.

See https://github.com/actions/runner-images/discussions/7188#discussioncomment-6750749

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2023-09-07 15:21:29 +00:00
jonnyandrew
301e49c3a3 Reduce test flakiness by warming up molecule tests (#1226) 2023-09-06 10:08:21 +00:00
Jorge Martin Espinosa
ee3d3ae213 Replace notification permission dialog with a screen (#1223)
* Replace notification permission dialog with a screen

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2023-09-05 18:58:05 +02:00
Benoit Marty
da446dad55 Remove the log, was causing a crash.
kotlin.reflect.jvm.internal.KotlinReflectionInternalError: Function 'handleEvents' (JVM signature: present$handleEvents(Landroidx/compose/runtime/MutableState;Lkotlin/jvm/internal/Ref$ObjectRef;Lio/element/android/libraries/permissions/api/PermissionsEvents;)V) not resolved in class kotlin.jvm.internal.Intrinsics$Kotlin: no members found
    at kotlin.reflect.jvm.internal.KDeclarationContainerImpl.findFunctionDescriptor(KDeclarationContainerImpl.kt:131)
    at kotlin.reflect.jvm.internal.KFunctionImpl$descriptor$2.invoke(KFunctionImpl.kt:56)
    at kotlin.reflect.jvm.internal.KFunctionImpl$descriptor$2.invoke(KFunctionImpl.kt:55)
    at kotlin.reflect.jvm.internal.ReflectProperties$LazySoftVal.invoke(ReflectProperties.java:93)
    at kotlin.reflect.jvm.internal.ReflectProperties$Val.getValue(ReflectProperties.java:32)
    at kotlin.reflect.jvm.internal.KFunctionImpl.getDescriptor(KFunctionImpl.kt:55)
    at kotlin.reflect.jvm.internal.KFunctionImpl.toString(KFunctionImpl.kt:185)
    at kotlin.jvm.internal.FunctionReference.toString(FunctionReference.java:130)
    at java.lang.String.valueOf(String.java:4092)
    at java.lang.StringBuilder.append(StringBuilder.java:179)
    at io.element.android.libraries.permissions.api.PermissionsState.toString
    at java.lang.String.valueOf(String.java:4092)
    at java.lang.StringBuilder.append(StringBuilder.java:179)
    at io.element.android.libraries.permissions.impl.DefaultPermissionsPresenter.present(DefaultPermissionsPresenter.kt:128)
2023-08-31 17:41:00 +02:00
Benoit Marty
52853101d9 migrate object to data object (#1135) 2023-08-24 09:32:44 +02:00
Benoit Marty
996574f2c6 Enable detekt rule PreviewPublic and fix existing issues. 2023-07-26 10:08:39 +02:00
Benoit Marty
ac1d355f65 Cleanup: there are no androidTest on those modules. 2023-07-24 12:41:02 +02:00
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
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
Benoit Marty
4cb9843415 Now that the composer as been removed, we do not need element resource module anymore. 2023-06-27 13:34:55 +02:00
Florian Renaud
c22d181d8c Remove useless OptIn in tests 2023-05-12 10:05:39 +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
Benoit Marty
bf63db458c Log: create and use a loggerTag 2023-04-12 09:41:22 +02:00
Benoit Marty
0cf2bfea0e Fix bad log. 2023-04-12 09:41:22 +02:00
Benoit Marty
7aca1d6bd5 Let this module generate screenshot preview. 2023-04-12 09:41:22 +02:00
Benoit Marty
5fc7870e47 Add more state for more previews. 2023-04-12 09:41:22 +02:00
Benoit Marty
68fb2bd2eb if -> when 2023-04-12 09:41:22 +02:00
Benoit Marty
ca54e11b97 Fix ktlint issue. 2023-04-07 10:38:47 +02:00
Benoit Marty
b56ab86ef1 Fix wildcard import 2023-04-05 18:14:32 +02:00
Benoit Marty
df492cfd0e Fix lint warnings. 2023-04-05 16:59:17 +02:00
Benoit Marty
2ac74ba40f Comment unused code. 2023-04-05 16:59:17 +02:00
Benoit Marty
84e4e0f1a9 Add test for NoopPermissionsPresenter and remove the unused factory. 2023-04-05 16:59:17 +02:00
Benoit Marty
581ec6a1af Use presenter factory 2023-04-05 16:31:09 +02:00
Benoit Marty
b911229f53 Create noop version for the minimal sample and test. 2023-04-05 16:27:17 +02:00
Benoit Marty
dfc759685d Be able to test PermissionsPresenterTest. Create interface to abstract Accompanist implementation 2023-04-05 16:25:27 +02:00
Benoit Marty
500d4801a7 Add permission modules 2023-04-05 16:25:27 +02:00