diff --git a/.gitattributes b/.gitattributes index 0542767effc..20621422848 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,2 @@ **/snapshots/**/*.png filter=lfs diff=lfs merge=lfs -text +**/docs/images-lfs/*.png filter=lfs diff=lfs merge=lfs -text diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f50c8f2a899..d83826f9f1c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,6 +13,7 @@ * [Kotlin](#kotlin) * [Changelog](#changelog) * [Code quality](#code-quality) + * [detekt](#detekt) * [ktlint](#ktlint) * [knit](#knit) * [lint](#lint) @@ -50,7 +51,7 @@ Note: please make sure that the configuration is `app` and not `samples.minimal` ## Strings -The strings of the project are managed externally using [https://localazy.com](https://localazy.com) and shared with ElementX iOS. +The strings of the project are managed externally using [https://localazy.com](https://localazy.com) and shared with Element X iOS. ### I want to add new strings to the project @@ -60,14 +61,12 @@ Please follow the naming rules for the key. More details in [the dedicated secti ### I want to help translating Element -Please note that the Localazy project is not open yet for external contributions. - To help translating, please go to [https://localazy.com/p/element](https://localazy.com/p/element). -- If you want to fix an issue with an English string, please open an issue on the github project of ElementX (Android or iOS). Only the core team can modify or add English strings. +- If you want to fix an issue with an English string, please open an issue on the github project of Element X (Android or iOS). Only the core team can modify or add English strings. - If you want to fix an issue in other languages, or add a missing translation, or even add a new language, please go to [https://localazy.com/p/element](https://localazy.com/p/element). -More informations can be found [in this README.md](./tools/localazy/README.md). +More information can be found [in this README.md](./tools/localazy/README.md). ## I want to submit a PR to fix an issue @@ -101,11 +100,17 @@ See https://github.com/twisted/towncrier#news-fragments if you need more details Make sure the following commands execute without any error:
-./gradlew check
+./tools/quality/check.sh
 
Some separate commands can also be run, see below. +#### detekt + +
+./gradlew detekt
+
+ #### ktlint
@@ -153,7 +158,7 @@ Make sure the following commands execute without any error:
 
 ### Tests
 
-Element X is currently supported on Android Lollipop (API 21+): please test your change on an Android device (or Android emulator) running with API 21. Many issues can happen (including crashes) on older devices.
+Element X is currently supported on Android Marshmallow (API 23+): please test your change on an Android device (or Android emulator) running with API 23. Many issues can happen (including crashes) on older devices.
 Also, if possible, please test your change on a real device. Testing on Android emulator may not be sufficient.
 
 You should consider adding Unit tests with your PR, and also integration tests (AndroidTest). Please refer to [this document](./docs/integration_tests.md) to install and run the integration test environment.
@@ -166,7 +171,18 @@ For instance, when updating the image `src` of an ImageView, please also conside
 
 ### Jetpack Compose
 
-When adding or editing `@Composable`, make sure that you create a `@Preview` function, with suffix `Preview`. This will also create a UI test automatically.
+When adding or editing `@Composable`, make sure that you create an internal function annotated with `@DayNightPreviews`, with a name suffixed by `Preview`, and having `ElementPreview` as the root composable.
+
+Example:
+```kotlin
+@DayNightPreviews
+@Composable
+internal fun PinIconPreview() = ElementPreview {
+    PinIcon()
+}
+```
+
+This will allow to preview the composable in both light and dark mode in Android Studio. This will also automatically add UI tests. The GitHub action [Record screenshots](https://github.com/vector-im/element-x-android/actions/workflows/recordScreenshots.yml) has to be run to record the new screenshots. The PR reviewer can trigger this for you if you're not part of the core team. 
 
 ### Authors
 
diff --git a/README.md b/README.md
index e31acf87b87..f24efcd8281 100644
--- a/README.md
+++ b/README.md
@@ -3,14 +3,18 @@
 [![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=vector-im_element-x-android&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=vector-im_element-x-android)
 [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=vector-im_element-x-android&metric=bugs)](https://sonarcloud.io/summary/new_code?id=vector-im_element-x-android)
 [![codecov](https://codecov.io/github/vector-im/element-x-android/branch/develop/graph/badge.svg?token=ecwvia7amV)](https://codecov.io/github/vector-im/element-x-android)
-[![Element Android Matrix room #element-android:matrix.org](https://img.shields.io/matrix/element-android:matrix.org.svg?label=%23element-android:matrix.org&logo=matrix&server_fqdn=matrix.org)](https://matrix.to/#/#element-android:matrix.org)
-[![Weblate](https://translate.element.io/widgets/element-android/-/svg-badge.svg)](https://translate.element.io/engage/element-android/?utm_source=widget)
+[![Element X_Android Matrix room #element-x-android:matrix.org](https://img.shields.io/matrix/element-x-android:matrix.org.svg?label=%23element-x-android:matrix.org&logo=matrix&server_fqdn=matrix.org)](https://matrix.to/#/#element-x-android:matrix.org)
+[![Localazy](https://img.shields.io/endpoint?url=https%3A%2F%2Fconnect.localazy.com%2Fstatus%2Felement%2Fdata%3Fcontent%3Dall%26title%3Dlocalazy%26logo%3Dtrue)](https://localazy.com/p/element)
 
-# element-x-android
+# Element X Android
 
-ElementX Android is a [Matrix](https://matrix.org/) Android Client provided by [Element](https://element.io/). This app is currently in a pre-alpha release stage with only basic functionality.
+Element X Android is a [Matrix](https://matrix.org/) Android Client provided by [element.io](https://element.io/). This app is currently in a pre-alpha release stage with only basic functionalities.
 
-The application is a total rewrite of [Element-Android](https://github.com/vector-im/element-android) using the [Matrix Rust SDK](https://github.com/matrix-org/matrix-rust-sdk) underneath and targeting devices running Android 6+. The UI layer is written using Jetpack compose.
+The application is a total rewrite of [Element-Android](https://github.com/vector-im/element-android) using the [Matrix Rust SDK](https://github.com/matrix-org/matrix-rust-sdk) underneath and targeting devices running Android 6+. The UI layer is written using [Jetpack Compose](https://developer.android.com/jetpack/compose), and the navigation is managed using [Appyx](https://github.com/bumble-tech/appyx).
+
+Learn more about why we are building Element X in our blog post: [https://element.io/blog/element-x-experience-the-future-of-element/](https://element.io/blog/element-x-experience-the-future-of-element/).
+
+## Table of contents
 
 
 
@@ -28,24 +32,41 @@ The application is a total rewrite of [Element-Android](https://github.com/vecto
 
 Here are some early screenshots of the application:
 
-|||||
+
+
+|||||
 |-|-|-|-|
+|||||
 
 ## Rust SDK
 
-ElementX leverages the [Matrix Rust SDK](https://github.com/matrix-org/matrix-rust-sdk) through an FFI layer that the final client can directly import and use.
+Element X leverages the [Matrix Rust SDK](https://github.com/matrix-org/matrix-rust-sdk) through an FFI layer that the final client can directly import and use.
 
 We're doing this as a way to share code between platforms and while we've seen promising results it's still in the experimental stage and bound to change.
 
 ## Status
 
-This project is in work in progress. The app does not cover yet all functionalities we expect.
+This project is in work in progress. The app does not cover yet all functionalities we expect. The list of supported features can be found in [this issue](https://github.com/vector-im/element-x-android/issues/911).
 
 ## Contributing
 
-Please see our [contribution guide](CONTRIBUTING.md).
+Want to get actively involved in the project? You're more than welcome! A good way to start is to check the issues that are labelled with the [good first issue](https://github.com/vector-im/element-x-android/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) label. Let us know by commenting the issue that you're starting working on it.
+
+But first make sure to read our [contribution guide](CONTRIBUTING.md) first.
 
-Come chat with the community in the dedicated Matrix [room](https://matrix.to/#/#element-android:matrix.org).
+You can also come chat with the community in the Matrix [room](https://matrix.to/#/#element-x-android:matrix.org) dedicated to the project.
 
 ## Build instructions
 
@@ -54,9 +75,9 @@ Makes sure to select the `app` configuration when building (as we also have samp
 
 ## Support
 
-When you are experiencing an issue on ElementX Android, please first search in [GitHub issues](https://github.com/vector-im/element-x-android/issues)
-and then in [#element-android:matrix.org](https://matrix.to/#/#element-android:matrix.org).
-If after your research you still have a question, ask at [#element-android:matrix.org](https://matrix.to/#/#element-android:matrix.org). Otherwise feel free to create a GitHub issue if you encounter a bug or a crash, by explaining clearly in detail what happened. You can also perform bug reporting (Rageshake) from the Element application by shaking your phone or going to the application settings. This is especially recommended when you encounter a crash.
+When you are experiencing an issue on Element X Android, please first search in [GitHub issues](https://github.com/vector-im/element-x-android/issues)
+and then in [#element-x-android:matrix.org](https://matrix.to/#/#element-x-android:matrix.org).
+If after your research you still have a question, ask at [#element-x-android:matrix.org](https://matrix.to/#/#element-x-android:matrix.org). Otherwise feel free to create a GitHub issue if you encounter a bug or a crash, by explaining clearly in detail what happened. You can also perform bug reporting from the application settings. This is especially recommended when you encounter a crash.
 
 ## Copyright & License
 
diff --git a/docs/_developer_onboarding.md b/docs/_developer_onboarding.md
index 91981375778..ad5882abae7 100644
--- a/docs/_developer_onboarding.md
+++ b/docs/_developer_onboarding.md
@@ -313,7 +313,7 @@ suffix `Presenter`,states MUST have a suffix `State`, etc. Also we want to have
 
 ### Push
 
-**Note** Firebase Push is not yet implemented on the project.
+**Note** Firebase is implemented, but Unified Push is not yet fully implemented on the project, so this is not possible to choose this push provider in the app at the moment.
 
 Please see the dedicated [documentation](notifications.md) for more details.
 
@@ -342,8 +342,7 @@ We have 3 tests frameworks in place, and this should be sufficient to guarantee
   file [TemplateView.kt](../features/template/src/main/kotlin/io/element/android/features/template/TemplateView.kt). We create PreviewProvider to provide
   different states. See for instance the
   file [TemplateStateProvider.kt](../features/template/src/main/kotlin/io/element/android/features/template/TemplateStateProvider.kt)
-    - Tests on presenter with [Molecule](https://github.com/cashapp/molecule) and [Turbine](https://github.com/cashapp/turbine). See in the template the
-      class [TemplatePresenterTests](../features/template/src/test/kotlin/io/element/android/features/template/TemplatePresenterTests.kt).
+- Tests on presenter with [Molecule](https://github.com/cashapp/molecule) and [Turbine](https://github.com/cashapp/turbine). See in the template the class [TemplatePresenterTests](../features/template/src/test/kotlin/io/element/android/features/template/TemplatePresenterTests.kt).
 
 **Note** For now we want to avoid using class mocking (with library such as *mockk*), because this should be not necessary. We prefer to create Fake
 implementation of our interfaces. Mocking can be used to mock Android framework classes though, such as `Bitmap` for instance.
diff --git a/docs/images-lfs/screen_1_dark.png b/docs/images-lfs/screen_1_dark.png
new file mode 100644
index 00000000000..8bdcd59305d
--- /dev/null
+++ b/docs/images-lfs/screen_1_dark.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4515f7589c422197a82672cdc3e64814ccca9a9a022b806facee44dd67d51ff2
+size 1116864
diff --git a/docs/images-lfs/screen_1_light.png b/docs/images-lfs/screen_1_light.png
new file mode 100644
index 00000000000..8eba38af827
--- /dev/null
+++ b/docs/images-lfs/screen_1_light.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2afb667a8b679f4395c28407b014f074e8b74745f6ecdd6ad699a6650cee2bc7
+size 771160
diff --git a/docs/images-lfs/screen_2_dark.png b/docs/images-lfs/screen_2_dark.png
new file mode 100644
index 00000000000..9a0102940f0
--- /dev/null
+++ b/docs/images-lfs/screen_2_dark.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:910f9ab58a197a16b1295cd6b65d406ebfff1298c9c128a326edf1ec834d7fa7
+size 332936
diff --git a/docs/images-lfs/screen_2_light.png b/docs/images-lfs/screen_2_light.png
new file mode 100644
index 00000000000..1dd3106e5c6
--- /dev/null
+++ b/docs/images-lfs/screen_2_light.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f7b80b9124c5c04c9db3824b68ab35883d41d05918abd415f7565f87d2713cfa
+size 338455
diff --git a/docs/images-lfs/screen_3_dark.png b/docs/images-lfs/screen_3_dark.png
new file mode 100644
index 00000000000..ccc17333e7e
--- /dev/null
+++ b/docs/images-lfs/screen_3_dark.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:dadff79ae955ab1da5c0a0567960fc567526ad0d8d2ea418d8adacf3a7a400cc
+size 243201
diff --git a/docs/images-lfs/screen_3_light.png b/docs/images-lfs/screen_3_light.png
new file mode 100644
index 00000000000..2116f1dc4ce
--- /dev/null
+++ b/docs/images-lfs/screen_3_light.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e2f328b3e8bf2ebe4abc4c130e28f6fc2351f5ac339be0819e5fddb657f4a560
+size 246731
diff --git a/docs/images-lfs/screen_4_dark.png b/docs/images-lfs/screen_4_dark.png
new file mode 100644
index 00000000000..5bd122a9eab
--- /dev/null
+++ b/docs/images-lfs/screen_4_dark.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:519fb54f0070833b2a4671e1f0fc7b2ec60930d69b592b8a760f52a73dc4fe38
+size 132247
diff --git a/docs/images-lfs/screen_4_light.png b/docs/images-lfs/screen_4_light.png
new file mode 100644
index 00000000000..ee82f3be0a8
--- /dev/null
+++ b/docs/images-lfs/screen_4_light.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f683a228d7168c75d6f42c353c1a0e169cb22cb8fa6696e9e3ffeb80854b2441
+size 131610
diff --git a/docs/images/screen1.png b/docs/images/screen1.png
deleted file mode 100644
index 9f9d7747ff3..00000000000
Binary files a/docs/images/screen1.png and /dev/null differ
diff --git a/docs/images/screen2.png b/docs/images/screen2.png
deleted file mode 100644
index a5733003d6f..00000000000
Binary files a/docs/images/screen2.png and /dev/null differ
diff --git a/docs/images/screen3.png b/docs/images/screen3.png
deleted file mode 100644
index 3edb49d0865..00000000000
Binary files a/docs/images/screen3.png and /dev/null differ
diff --git a/docs/images/screen4.png b/docs/images/screen4.png
deleted file mode 100644
index 53da801a1b2..00000000000
Binary files a/docs/images/screen4.png and /dev/null differ
diff --git a/tools/localazy/README.md b/tools/localazy/README.md
index c1ad1d0ee0d..b0b5c7e9807 100644
--- a/tools/localazy/README.md
+++ b/tools/localazy/README.md
@@ -16,6 +16,8 @@ Localazy is used to host the source strings and their translations.
 
 ## Localazy project
 
+[![Localazy](https://img.shields.io/endpoint?url=https%3A%2F%2Fconnect.localazy.com%2Fstatus%2Felement%2Fdata%3Fcontent%3Dall%26title%3Dlocalazy%26logo%3Dtrue)](https://localazy.com/p/element)
+
 To add new strings, or to translate existing strings, go the the Localazy project: [https://localazy.com/p/element](https://localazy.com/p/element). Please follow the key naming rules (see below).
 
 Never edit manually the files `localazy.xml` or `translations.xml`!.