Skip to content

Commit aca5d3f

Browse files
committed
Merge branch 'release/TODO_RELEASE_NAME' into main
2 parents aa42746 + 1238f31 commit aca5d3f

File tree

749 files changed

+9204
-3461
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

749 files changed

+9204
-3461
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
**/snapshots/**/*.png filter=lfs diff=lfs merge=lfs -text

.github/workflows/tests.yml

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
# Enrich gradle.properties for CI/CD
99
env:
1010
GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx3072m -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError" -Dkotlin.daemon.jvm.options="-Xmx2560m" -Dkotlin.incremental=false
11-
CI_GRADLE_ARG_PROPERTIES: --stacktrace -PpreDexEnable=false --max-workers 2 --no-daemon
11+
CI_GRADLE_ARG_PROPERTIES: --stacktrace -PpreDexEnable=false --max-workers 4 --no-daemon
1212

1313
jobs:
1414
tests:
@@ -24,12 +24,29 @@ jobs:
2424
steps:
2525
- uses: actions/checkout@v3
2626
with:
27+
lfs: true
2728
fetch-depth: 0
2829
- uses: actions/setup-java@v3
2930
with:
3031
distribution: 'adopt'
3132
java-version: '11'
3233
- uses: gradle/gradle-build-action@v2
34+
with:
35+
cache-read-only: ${{ github.ref != 'refs/heads/develop' }}
36+
gradle-home-cache-cleanup: ${{ github.ref == 'refs/heads/develop' }}
37+
38+
- name: Run screenshot tests
39+
run: ./gradlew verifyScreenshots $CI_GRADLE_ARG_PROPERTIES
40+
41+
- name: Archive Screenshot Results on Error
42+
if: failure()
43+
uses: actions/upload-artifact@v3
44+
with:
45+
name: screenshot-results
46+
path: |
47+
**/out/failures/
48+
**/build/reports/tests/*UnitTest/
49+
3350
- uses: actions/setup-python@v4
3451
with:
3552
python-version: 3.8
@@ -40,34 +57,14 @@ jobs:
4057
disableRateLimiting: true
4158
public_baseurl: "http://10.0.2.2:8080/"
4259

43-
- name: AVD cache
44-
uses: actions/cache@v3
45-
id: avd-cache
46-
with:
47-
path: |
48-
~/.android/avd/*
49-
~/.android/adb*
50-
key: avd-${{ matrix.api-level }}
51-
52-
- name: create AVD and generate snapshot for caching
53-
if: steps.avd-cache.outputs.cache-hit != 'true'
54-
uses: reactivecircus/android-emulator-runner@v2
55-
with:
56-
api-level: ${{ matrix.api-level }}
57-
arch: x86
58-
profile: Nexus 5X
59-
force-avd-creation: true # Is set to false in the doc https://github.com/ReactiveCircus/android-emulator-runner
60-
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
61-
disable-animations: true
62-
script: echo "Generated AVD snapshot for caching."
63-
6460
- name: Run all the codecoverage tests at once
6561
uses: reactivecircus/android-emulator-runner@v2
6662
# continue-on-error: true
6763
with:
6864
api-level: ${{ matrix.api-level }}
6965
arch: x86
7066
profile: Nexus 5X
67+
target: playstore
7168
force-avd-creation: false
7269
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
7370
disable-animations: true

.github/workflows/validate-lfs.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Validate Git LFS
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
name: Validate
9+
steps:
10+
- uses: actions/checkout@v3
11+
with:
12+
lfs: 'true'
13+
14+
- run: |
15+
./tools/validate_lfs.sh

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@
2222
/package.json
2323
/yarn.lock
2424
/node_modules
25+
**/out/failures

CONTRIBUTING.md

Lines changed: 60 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,42 @@
1-
# Contributing code to Matrix
1+
# Contributing to Element Android
2+
3+
<!--- TOC -->
4+
5+
* [Contributing code to Matrix](#contributing-code-to-matrix)
6+
* [Android Studio settings](#android-studio-settings)
7+
* [Template](#template)
8+
* [Compilation](#compilation)
9+
* [I want to help translating Element](#i-want-to-help-translating-element)
10+
* [I want to submit a PR to fix an issue](#i-want-to-submit-a-pr-to-fix-an-issue)
11+
* [Kotlin](#kotlin)
12+
* [Changelog](#changelog)
13+
* [Code quality](#code-quality)
14+
* [Internal tool](#internal-tool)
15+
* [ktlint](#ktlint)
16+
* [lint](#lint)
17+
* [Unit tests](#unit-tests)
18+
* [Tests](#tests)
19+
* [Internationalisation](#internationalisation)
20+
* [Adding new string](#adding-new-string)
21+
* [Plurals](#plurals)
22+
* [Editing existing strings](#editing-existing-strings)
23+
* [Removing existing strings](#removing-existing-strings)
24+
* [Renaming string ids](#renaming-string-ids)
25+
* [Reordering strings](#reordering-strings)
26+
* [Accessibility](#accessibility)
27+
* [Layout](#layout)
28+
* [Authors](#authors)
29+
* [Thanks](#thanks)
30+
31+
<!--- END -->
32+
33+
## Contributing code to Matrix
234

335
Please read https://github.com/matrix-org/synapse/blob/master/CONTRIBUTING.md
436

537
Element Android support can be found in this room: [![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).
638

7-
# Specific rules for Matrix Android projects
39+
The rest of the document contains specific rules for Matrix Android projects
840

941
## Android Studio settings
1042

@@ -120,17 +152,21 @@ You should consider adding Unit tests with your PR, and also integration tests (
120152

121153
Translations are handled using an external tool: [Weblate](https://translate.element.io/projects/element-android/)
122154

123-
As a general rule, please never edit or add or remove translations to the project in a Pull Request. It can lead to merge conflict if the translations are also modified in Weblate side.
155+
**As a general rule, please never edit or add or remove translations to the project in a Pull Request**. It can lead to merge conflict if the translations are also modified in Weblate side. Pull Request containing change(s) on the translation files cannot be merged.
124156

125157
#### Adding new string
126158

127-
When adding new string resources, please only add new entries in the file `value/strings.xml`. Translations will be added later by the community of translators using Weblate.
159+
When adding new string resources, please only add new entries in the file `values/strings.xml` ([this file](./library/ui-strings/src/main/res/values/strings.xml)). Translations will be added later by the community of translators using Weblate.
128160

129-
The file `value/strings.xml` must only contain American English (U. S. English) values, as this is the default language of the Android operating system. So for instance, please use "color" instead of "colour". Element Android will still use the language set on the system by the user, like any other Android applications which provide translations. The system language can be any other English language variants, or any other languages. Note that this is also possible to override the system language using the Element Android in-app language settings.
161+
The file `values/strings.xml` must only contain American English (U. S. English) values, as this is the default language of the Android operating system. So for instance, please use "color" instead of "colour". Element Android will still use the language set on the system by the user, like any other Android applications which provide translations. The system language can be any other English language variants, or any other languages. Note that this is also possible to override the system language using the Element Android in-app language settings.
130162

131-
New strings can be added anywhere in the file `value/strings.xml`, not necessarily at the end of the file. Generally, it's even better to add the new strings in some dedicated section per feature, and not at the end of the file, to avoid merge conflict between 2 PR adding strings at the end of the same file.
163+
New strings can be added anywhere in the file `values/strings.xml`, not necessarily at the end of the file. Generally, it's even better to add the new strings in some dedicated section per feature, and not at the end of the file, to avoid merge conflict between 2 PR adding strings at the end of the same file.
132164

133-
Do not hesitate to use plurals when appropriate.
165+
##### Plurals
166+
167+
Please use `plurals` resources when appropriate, and note that some languages have specific rules for `plurals`, so even if the string will always be at the plural form for English, please always create a `plurals` resource.
168+
169+
Specific plural forms can be found [here](https://unicode-org.github.io/cldr-staging/charts/37/supplemental/language_plural_rules.html).
134170

135171
#### Editing existing strings
136172

@@ -150,6 +186,23 @@ And add `tools:ignore="UnusedResources"` to the string, to let lint ignore that
150186

151187
The string will be removed during the next sync with Weblate.
152188

189+
#### Renaming string ids
190+
191+
This is possible to rename ids of the String resources, but since translation files cannot be edited, add TODO in the main strings.xml file above the strings you want to rename.
192+
193+
```xml
194+
<!-- TODO Rename id to put_new_id_here -->
195+
<string name="current_id">Hello Matrix world!</string>
196+
```
197+
198+
The string id(s) will be renamed during the next Weblate sync.
199+
200+
#### Reordering strings
201+
202+
To group strings per feature, or for any other reasons, it is possible to reorder string resources, but only in the [main strings.xml file](./library/ui-strings/src/main/res/values/strings.xml). ). We do not mind about ordering in the translation files, and anyway this is forbidden to edit manually the translation files.
203+
204+
It is also possible to add empty lines between string resources, and to add XML comments. Please note that the XML comment just above a String resource will also appear on Weblate and be visible to the translators.
205+
153206
### Accessibility
154207

155208
Please consider accessibility as an important point. As a minimum requirement, in layout XML files please use attributes such as `android:contentDescription` and `android:importantForAccessibility`, and test with a screen reader if it's working well. You can add new string resources, dedicated to accessibility, in this case, please prefix theirs id with `a11y_`.

0 commit comments

Comments
 (0)