diff --git a/.github/ISSUE_TEMPLATE/release.yml b/.github/ISSUE_TEMPLATE/release.yml index f012900752..e663a49fdb 100644 --- a/.github/ISSUE_TEMPLATE/release.yml +++ b/.github/ISSUE_TEMPLATE/release.yml @@ -100,12 +100,20 @@ body: ##### Release on MavenCentral + - [ ] Checkout the branch `main` - [ ] Run the command `./gradlew publish --no-daemon --no-parallel`. You'll need some non-public element to do so + - [ ] Run the command `./gradlew closeAndReleaseRepository`. If it is working well, you can jump directly to the final step of this section. + + If `./gradlew closeAndReleaseRepository` fails (for instance, several repositories are waiting to be handled), you have to close and release the repository manually. Do the following steps: + - [ ] Connect to https://s01.oss.sonatype.org - [ ] Click on Staging Repositories and check the the files have been uploaded - [ ] Click on close - [ ] Wait (check Activity tab until step "Repository closed" is displayed) - [ ] Click on release. The staging repository will disappear + + Final step + - [ ] Check that the release is available in https://repo1.maven.org/maven2/org/matrix/android/matrix-android-sdk2/ (it can take a few minutes) ##### Release on GitHub diff --git a/CHANGES.md b/CHANGES.md index 17d3fed2a6..cf1716dea8 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,59 @@ +Changes in Element v1.4.26 (2022-06-30) +======================================= + +Features ✨ +---------- + - Use UnifiedPush and allows user to have push without FCM. ([#3448](https://github.com/vector-im/element-android/issues/3448)) + - Replace ffmpeg-kit with libopus and libopusenc. ([#6203](https://github.com/vector-im/element-android/issues/6203)) + - Improve lock screen implementation. ([#6217](https://github.com/vector-im/element-android/issues/6217)) + - Allow sharing text based content via android's share menu (eg .ics files) ([#6285](https://github.com/vector-im/element-android/issues/6285)) + - Promote live location labs flag ([#6350](https://github.com/vector-im/element-android/issues/6350)) + - [Location sharing] - Stop any active live before starting a new one ([#6364](https://github.com/vector-im/element-android/issues/6364)) + - Expose pusher profile tag in advanced settings ([#6369](https://github.com/vector-im/element-android/issues/6369)) + +Bugfixes 🐛 +---------- + - Fixes concurrent modification crash when signing out or launching the app ([#5821](https://github.com/vector-im/element-android/issues/5821)) + - Refactor - better naming, return native user id and not sip user id and create a dm with the native user instead of with the sip user. ([#6101](https://github.com/vector-im/element-android/issues/6101)) + - Fixed /upgraderoom command not doing anything ([#6154](https://github.com/vector-im/element-android/issues/6154)) + - Fixed crash when opening large images in the timeline ([#6290](https://github.com/vector-im/element-android/issues/6290)) + - [Location sharing] Fix crash when starting/stopping a live when offline ([#6315](https://github.com/vector-im/element-android/issues/6315)) + - Fix loop in timeline and simplify management of chunks and timeline events. ([#6318](https://github.com/vector-im/element-android/issues/6318)) + - Update design and behaviour on widget permission bottom sheet ([#6326](https://github.com/vector-im/element-android/issues/6326)) + - Fix | Some user verification requests couldn't be accepted/declined ([#6328](https://github.com/vector-im/element-android/issues/6328)) + - [Location sharing] Fix stop of a live not possible from another device ([#6349](https://github.com/vector-im/element-android/issues/6349)) + - Fix backslash escapes in formatted messages ([#6357](https://github.com/vector-im/element-android/issues/6357)) + - Fixes wrong error message when signing in with wrong credentials ([#6371](https://github.com/vector-im/element-android/issues/6371)) + - [Location Share] - Adding missing prefix "u=" for uncertainty in geo URI ([#6375](https://github.com/vector-im/element-android/issues/6375)) + +In development 🚧 +---------------- + - FTUE - Adds automatic homeserver selection when typing a full matrix id during registration or login ([#6162](https://github.com/vector-im/element-android/issues/6162)) + +Improved Documentation 📚 +------------------------ + - Update the PR process doc to come back to one reviewer with optional additional reviewers. ([#6396](https://github.com/vector-im/element-android/issues/6396)) + +SDK API changes ⚠️ +------------------ + - Group all location sharing related API into LocationSharingService ([#5864](https://github.com/vector-im/element-android/issues/5864)) + - Add support for MSC2457 - opting in or out of logging out all devices when changing password ([#6191](https://github.com/vector-im/element-android/issues/6191)) + - Create `QueryStateEventValue` to do query on `stateKey` for State Event. Also remove the default parameter values for those type. ([#6319](https://github.com/vector-im/element-android/issues/6319)) + +Other changes +------------- + - - Notify of the latest known location in LocationTracker to avoid multiple locations at start + - Debounce location updates + - Improve location providers access ([#5913](https://github.com/vector-im/element-android/issues/5913)) + - Add unit tests for LiveLocationAggregationProcessor code ([#6155](https://github.com/vector-im/element-android/issues/6155)) + - Making screenshots in bug reports opt in instead of opt out ([#6261](https://github.com/vector-im/element-android/issues/6261)) + - Setup [Flipper](https://fbflipper.com/) ([#6300](https://github.com/vector-im/element-android/issues/6300)) + - CreatePollViewModel unit tests ([#6320](https://github.com/vector-im/element-android/issues/6320)) + - Fix flaky test in voice recording feature. ([#6329](https://github.com/vector-im/element-android/issues/6329)) + - Poll view state unit tests ([#6366](https://github.com/vector-im/element-android/issues/6366)) + - Let LoadRoomMembersTask insert by chunk to release db. ([#6394](https://github.com/vector-im/element-android/issues/6394)) + + Changes in Element v1.4.25 (2022-06-27) ======================================= diff --git a/changelog.d/3448.feature b/changelog.d/3448.feature deleted file mode 100644 index 3f83f1bef5..0000000000 --- a/changelog.d/3448.feature +++ /dev/null @@ -1 +0,0 @@ -Use UnifiedPush and allows user to have push without FCM. diff --git a/changelog.d/5284.wip b/changelog.d/5284.wip new file mode 100644 index 0000000000..a296de24af --- /dev/null +++ b/changelog.d/5284.wip @@ -0,0 +1 @@ +FTUE - Adds support for resetting the password during the FTUE onboarding journey diff --git a/changelog.d/5821.bugfix b/changelog.d/5821.bugfix deleted file mode 100644 index 25d8fd2b46..0000000000 --- a/changelog.d/5821.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fixes concurrent modification crash when signing out or launching the app diff --git a/changelog.d/5864.sdk b/changelog.d/5864.sdk deleted file mode 100644 index b0a9d1c67d..0000000000 --- a/changelog.d/5864.sdk +++ /dev/null @@ -1 +0,0 @@ -Group all location sharing related API into LocationSharingService diff --git a/changelog.d/5913.misc b/changelog.d/5913.misc deleted file mode 100644 index 24be7194d5..0000000000 --- a/changelog.d/5913.misc +++ /dev/null @@ -1,3 +0,0 @@ -- Notify of the latest known location in LocationTracker to avoid multiple locations at start -- Debounce location updates -- Improve location providers access diff --git a/changelog.d/6101.bugfix b/changelog.d/6101.bugfix deleted file mode 100644 index 2d8da5327d..0000000000 --- a/changelog.d/6101.bugfix +++ /dev/null @@ -1 +0,0 @@ -Refactor - better naming, return native user id and not sip user id and create a dm with the native user instead of with the sip user. diff --git a/changelog.d/6154.bugfix b/changelog.d/6154.bugfix deleted file mode 100644 index 5c64eb2879..0000000000 --- a/changelog.d/6154.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fixed /upgraderoom command not doing anything diff --git a/changelog.d/6155.misc b/changelog.d/6155.misc deleted file mode 100644 index 044e21408e..0000000000 --- a/changelog.d/6155.misc +++ /dev/null @@ -1 +0,0 @@ -Add unit tests for LiveLocationAggregationProcessor code diff --git a/changelog.d/6162.wip b/changelog.d/6162.wip deleted file mode 100644 index 8b32a72571..0000000000 --- a/changelog.d/6162.wip +++ /dev/null @@ -1 +0,0 @@ -FTUE - Adds automatic homeserver selection when typing a full matrix id during registration or login diff --git a/changelog.d/6191.sdk b/changelog.d/6191.sdk deleted file mode 100644 index d7fcf1b40f..0000000000 --- a/changelog.d/6191.sdk +++ /dev/null @@ -1 +0,0 @@ -Add support for MSC2457 - opting in or out of logging out all devices when changing password diff --git a/changelog.d/6203.feature b/changelog.d/6203.feature deleted file mode 100644 index bbfddd4179..0000000000 --- a/changelog.d/6203.feature +++ /dev/null @@ -1 +0,0 @@ -Replace ffmpeg-kit with libopus and libopusenc. diff --git a/changelog.d/6217.feature b/changelog.d/6217.feature deleted file mode 100644 index 6a8a31790f..0000000000 --- a/changelog.d/6217.feature +++ /dev/null @@ -1 +0,0 @@ -Improve lock screen implementation. diff --git a/changelog.d/6261.misc b/changelog.d/6261.misc deleted file mode 100644 index 9ae8bf7b17..0000000000 --- a/changelog.d/6261.misc +++ /dev/null @@ -1 +0,0 @@ -Making screenshots in bug reports opt in instead of opt out diff --git a/changelog.d/6285.feature b/changelog.d/6285.feature deleted file mode 100644 index ce88c13d15..0000000000 --- a/changelog.d/6285.feature +++ /dev/null @@ -1 +0,0 @@ -Allow sharing text based content via android's share menu (eg .ics files) diff --git a/changelog.d/6288.bugfix b/changelog.d/6288.bugfix new file mode 100644 index 0000000000..fc01597ed8 --- /dev/null +++ b/changelog.d/6288.bugfix @@ -0,0 +1 @@ +Use stable endpoint for alias management instead of MSC2432. Contributed by Nico. diff --git a/changelog.d/6290.bugfix b/changelog.d/6290.bugfix deleted file mode 100644 index e5ee3e02a6..0000000000 --- a/changelog.d/6290.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fixed crash when opening large images in the timeline diff --git a/changelog.d/6300.misc b/changelog.d/6300.misc deleted file mode 100644 index 0ac762e595..0000000000 --- a/changelog.d/6300.misc +++ /dev/null @@ -1 +0,0 @@ -Setup [Flipper](https://fbflipper.com/) diff --git a/changelog.d/6315.bugfix b/changelog.d/6315.bugfix deleted file mode 100644 index 0b5eb6064d..0000000000 --- a/changelog.d/6315.bugfix +++ /dev/null @@ -1 +0,0 @@ -[Location sharing] Fix crash when starting/stopping a live when offline diff --git a/changelog.d/6318.bugfix b/changelog.d/6318.bugfix deleted file mode 100644 index 9425c9a258..0000000000 --- a/changelog.d/6318.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fix loop in timeline and simplify management of chunks and timeline events. diff --git a/changelog.d/6319.sdk b/changelog.d/6319.sdk deleted file mode 100644 index 3bf81c45b6..0000000000 --- a/changelog.d/6319.sdk +++ /dev/null @@ -1 +0,0 @@ -Create `QueryStateEventValue` to do query on `stateKey` for State Event. Also remove the default parameter values for those type. diff --git a/changelog.d/6320.misc b/changelog.d/6320.misc deleted file mode 100644 index 7cdd41f486..0000000000 --- a/changelog.d/6320.misc +++ /dev/null @@ -1 +0,0 @@ -CreatePollViewModel unit tests diff --git a/changelog.d/6326.bugfix b/changelog.d/6326.bugfix deleted file mode 100644 index c09dd8fec1..0000000000 --- a/changelog.d/6326.bugfix +++ /dev/null @@ -1 +0,0 @@ -Update design and behaviour on widget permission bottom sheet diff --git a/changelog.d/6328.bugfix b/changelog.d/6328.bugfix deleted file mode 100644 index 7a41996e57..0000000000 --- a/changelog.d/6328.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fix | Some user verification requests couldn't be accepted/declined diff --git a/changelog.d/6329.misc b/changelog.d/6329.misc deleted file mode 100644 index dd87c11f6e..0000000000 --- a/changelog.d/6329.misc +++ /dev/null @@ -1 +0,0 @@ -Fix flaky test in voice recording feature. diff --git a/changelog.d/6349.bugfix b/changelog.d/6349.bugfix deleted file mode 100644 index 70718248a7..0000000000 --- a/changelog.d/6349.bugfix +++ /dev/null @@ -1 +0,0 @@ -[Location sharing] Fix stop of a live not possible from another device diff --git a/changelog.d/6350.feature b/changelog.d/6350.feature deleted file mode 100644 index e0bc4ac28b..0000000000 --- a/changelog.d/6350.feature +++ /dev/null @@ -1 +0,0 @@ -Promote live location labs flag diff --git a/changelog.d/6357.bugfix b/changelog.d/6357.bugfix deleted file mode 100644 index 231c65030f..0000000000 --- a/changelog.d/6357.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fix backslash escapes in formatted messages diff --git a/changelog.d/6364.feature b/changelog.d/6364.feature deleted file mode 100644 index 207d6d141b..0000000000 --- a/changelog.d/6364.feature +++ /dev/null @@ -1 +0,0 @@ -[Location sharing] - Stop any active live before starting a new one diff --git a/changelog.d/6366.misc b/changelog.d/6366.misc deleted file mode 100644 index 5752b3d700..0000000000 --- a/changelog.d/6366.misc +++ /dev/null @@ -1 +0,0 @@ -Poll view state unit tests diff --git a/changelog.d/6369.feature b/changelog.d/6369.feature deleted file mode 100644 index 3c3e936dfd..0000000000 --- a/changelog.d/6369.feature +++ /dev/null @@ -1,2 +0,0 @@ - Expose pusher profile tag in advanced settings - \ No newline at end of file diff --git a/changelog.d/6371.bugfix b/changelog.d/6371.bugfix deleted file mode 100644 index 275ec1cd8f..0000000000 --- a/changelog.d/6371.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fixes wrong error message when signing in with wrong credentials diff --git a/changelog.d/6375.bugfix b/changelog.d/6375.bugfix deleted file mode 100644 index 769ed81e69..0000000000 --- a/changelog.d/6375.bugfix +++ /dev/null @@ -1 +0,0 @@ -[Location Share] - Adding missing prefix "u=" for uncertainty in geo URI diff --git a/changelog.d/6389.misc b/changelog.d/6389.misc new file mode 100644 index 0000000000..fcf9b42c47 --- /dev/null +++ b/changelog.d/6389.misc @@ -0,0 +1 @@ +Replacing Epoxy annotation layout id references with getDefaultLayoutId diff --git a/changelog.d/6392.misc b/changelog.d/6392.misc new file mode 100644 index 0000000000..c7b95917c3 --- /dev/null +++ b/changelog.d/6392.misc @@ -0,0 +1 @@ +Ensure `RealmList.clearWith()` extension is correctly used. diff --git a/changelog.d/6394.misc b/changelog.d/6394.misc deleted file mode 100644 index 16b4fbf616..0000000000 --- a/changelog.d/6394.misc +++ /dev/null @@ -1 +0,0 @@ -Let LoadRoomMembersTask insert by chunk to release db. diff --git a/changelog.d/6396.doc b/changelog.d/6396.doc deleted file mode 100644 index 9b876d74af..0000000000 --- a/changelog.d/6396.doc +++ /dev/null @@ -1 +0,0 @@ -Update the PR process doc to come back to one reviewer with optional additional reviewers. \ No newline at end of file diff --git a/changelog.d/6413.feature b/changelog.d/6413.feature new file mode 100644 index 0000000000..d1dba78fb9 --- /dev/null +++ b/changelog.d/6413.feature @@ -0,0 +1 @@ +Show a loader if all the Room Members are not yet loaded. diff --git a/changelog.d/6429.misc b/changelog.d/6429.misc new file mode 100644 index 0000000000..4c748f652c --- /dev/null +++ b/changelog.d/6429.misc @@ -0,0 +1 @@ +Add `android:hasFragileUserData="true"` in the manifest diff --git a/fastlane/metadata/android/cs-CZ/changelogs/40104180.txt b/fastlane/metadata/android/cs-CZ/changelogs/40104180.txt new file mode 100644 index 0000000000..578549ce6c --- /dev/null +++ b/fastlane/metadata/android/cs-CZ/changelogs/40104180.txt @@ -0,0 +1,2 @@ +Hlavní změny v této verzi: Opravy různých chyb a vylepšení stability. +Úplný seznam změn: https://github.com/vector-im/element-android/releases diff --git a/fastlane/metadata/android/cs-CZ/changelogs/40104190.txt b/fastlane/metadata/android/cs-CZ/changelogs/40104190.txt new file mode 100644 index 0000000000..578549ce6c --- /dev/null +++ b/fastlane/metadata/android/cs-CZ/changelogs/40104190.txt @@ -0,0 +1,2 @@ +Hlavní změny v této verzi: Opravy různých chyb a vylepšení stability. +Úplný seznam změn: https://github.com/vector-im/element-android/releases diff --git a/fastlane/metadata/android/cs-CZ/changelogs/40104200.txt b/fastlane/metadata/android/cs-CZ/changelogs/40104200.txt new file mode 100644 index 0000000000..578549ce6c --- /dev/null +++ b/fastlane/metadata/android/cs-CZ/changelogs/40104200.txt @@ -0,0 +1,2 @@ +Hlavní změny v této verzi: Opravy různých chyb a vylepšení stability. +Úplný seznam změn: https://github.com/vector-im/element-android/releases diff --git a/fastlane/metadata/android/en-US/changelogs/40104260.txt b/fastlane/metadata/android/en-US/changelogs/40104260.txt new file mode 100644 index 0000000000..8808866c5d --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/40104260.txt @@ -0,0 +1,2 @@ +Main changes in this version: Use UnifiedPush and allows user to have push without FCM. +Full changelog: https://github.com/vector-im/element-android/releases diff --git a/fastlane/metadata/android/et/changelogs/40104180.txt b/fastlane/metadata/android/et/changelogs/40104180.txt new file mode 100644 index 0000000000..1df5ac4176 --- /dev/null +++ b/fastlane/metadata/android/et/changelogs/40104180.txt @@ -0,0 +1,2 @@ +Põhilised muutused selles versioonis: erinevate vigade parandused ja stabiilsust edendavad kohendused. +Kogu ingliskeelne muudatuste logi: https://github.com/vector-im/element-android/releases diff --git a/fastlane/metadata/android/et/changelogs/40104190.txt b/fastlane/metadata/android/et/changelogs/40104190.txt new file mode 100644 index 0000000000..1df5ac4176 --- /dev/null +++ b/fastlane/metadata/android/et/changelogs/40104190.txt @@ -0,0 +1,2 @@ +Põhilised muutused selles versioonis: erinevate vigade parandused ja stabiilsust edendavad kohendused. +Kogu ingliskeelne muudatuste logi: https://github.com/vector-im/element-android/releases diff --git a/fastlane/metadata/android/et/changelogs/40104200.txt b/fastlane/metadata/android/et/changelogs/40104200.txt new file mode 100644 index 0000000000..1df5ac4176 --- /dev/null +++ b/fastlane/metadata/android/et/changelogs/40104200.txt @@ -0,0 +1,2 @@ +Põhilised muutused selles versioonis: erinevate vigade parandused ja stabiilsust edendavad kohendused. +Kogu ingliskeelne muudatuste logi: https://github.com/vector-im/element-android/releases diff --git a/fastlane/metadata/android/fa/changelogs/40104180.txt b/fastlane/metadata/android/fa/changelogs/40104180.txt new file mode 100644 index 0000000000..29efb95925 --- /dev/null +++ b/fastlane/metadata/android/fa/changelogs/40104180.txt @@ -0,0 +1,2 @@ +تغییرات عمده در این نگارش: رفع اشکال‌های مختلف و بهبودهای پایداری. +گزارش دگرگونی کامل: https://github.com/vector-im/element-android/releases diff --git a/fastlane/metadata/android/fa/changelogs/40104190.txt b/fastlane/metadata/android/fa/changelogs/40104190.txt new file mode 100644 index 0000000000..29efb95925 --- /dev/null +++ b/fastlane/metadata/android/fa/changelogs/40104190.txt @@ -0,0 +1,2 @@ +تغییرات عمده در این نگارش: رفع اشکال‌های مختلف و بهبودهای پایداری. +گزارش دگرگونی کامل: https://github.com/vector-im/element-android/releases diff --git a/fastlane/metadata/android/fa/changelogs/40104200.txt b/fastlane/metadata/android/fa/changelogs/40104200.txt new file mode 100644 index 0000000000..29efb95925 --- /dev/null +++ b/fastlane/metadata/android/fa/changelogs/40104200.txt @@ -0,0 +1,2 @@ +تغییرات عمده در این نگارش: رفع اشکال‌های مختلف و بهبودهای پایداری. +گزارش دگرگونی کامل: https://github.com/vector-im/element-android/releases diff --git a/fastlane/metadata/android/fr-FR/changelogs/40104180.txt b/fastlane/metadata/android/fr-FR/changelogs/40104180.txt new file mode 100644 index 0000000000..fe61fd021c --- /dev/null +++ b/fastlane/metadata/android/fr-FR/changelogs/40104180.txt @@ -0,0 +1,2 @@ +Principaux changements pour cette version : Plusieurs corrections de bogues et d’améliorations de stabilité. +Intégralité des changements : https://github.com/vector-im/element-android/releases diff --git a/fastlane/metadata/android/fr-FR/changelogs/40104190.txt b/fastlane/metadata/android/fr-FR/changelogs/40104190.txt new file mode 100644 index 0000000000..fe61fd021c --- /dev/null +++ b/fastlane/metadata/android/fr-FR/changelogs/40104190.txt @@ -0,0 +1,2 @@ +Principaux changements pour cette version : Plusieurs corrections de bogues et d’améliorations de stabilité. +Intégralité des changements : https://github.com/vector-im/element-android/releases diff --git a/fastlane/metadata/android/fr-FR/changelogs/40104200.txt b/fastlane/metadata/android/fr-FR/changelogs/40104200.txt new file mode 100644 index 0000000000..fe61fd021c --- /dev/null +++ b/fastlane/metadata/android/fr-FR/changelogs/40104200.txt @@ -0,0 +1,2 @@ +Principaux changements pour cette version : Plusieurs corrections de bogues et d’améliorations de stabilité. +Intégralité des changements : https://github.com/vector-im/element-android/releases diff --git a/fastlane/metadata/android/id/changelogs/40104180.txt b/fastlane/metadata/android/id/changelogs/40104180.txt new file mode 100644 index 0000000000..1017951d47 --- /dev/null +++ b/fastlane/metadata/android/id/changelogs/40104180.txt @@ -0,0 +1,2 @@ +Perubahan utama dalam versi ini: Banyak perbaikan kutu dan perbaikan stabilitas. +Catatan perubahan lanjutan: https://github.com/vector-im/element-android/releases diff --git a/fastlane/metadata/android/id/changelogs/40104190.txt b/fastlane/metadata/android/id/changelogs/40104190.txt new file mode 100644 index 0000000000..1017951d47 --- /dev/null +++ b/fastlane/metadata/android/id/changelogs/40104190.txt @@ -0,0 +1,2 @@ +Perubahan utama dalam versi ini: Banyak perbaikan kutu dan perbaikan stabilitas. +Catatan perubahan lanjutan: https://github.com/vector-im/element-android/releases diff --git a/fastlane/metadata/android/id/changelogs/40104200.txt b/fastlane/metadata/android/id/changelogs/40104200.txt new file mode 100644 index 0000000000..1017951d47 --- /dev/null +++ b/fastlane/metadata/android/id/changelogs/40104200.txt @@ -0,0 +1,2 @@ +Perubahan utama dalam versi ini: Banyak perbaikan kutu dan perbaikan stabilitas. +Catatan perubahan lanjutan: https://github.com/vector-im/element-android/releases diff --git a/fastlane/metadata/android/it-IT/changelogs/40104180.txt b/fastlane/metadata/android/it-IT/changelogs/40104180.txt new file mode 100644 index 0000000000..556a6fc7ea --- /dev/null +++ b/fastlane/metadata/android/it-IT/changelogs/40104180.txt @@ -0,0 +1,2 @@ +Modifiche principali in questa versione: varie correzioni di errori e miglioramenti della stabilità. +Cronologia completa: https://github.com/vector-im/element-android/releases diff --git a/fastlane/metadata/android/it-IT/changelogs/40104190.txt b/fastlane/metadata/android/it-IT/changelogs/40104190.txt new file mode 100644 index 0000000000..556a6fc7ea --- /dev/null +++ b/fastlane/metadata/android/it-IT/changelogs/40104190.txt @@ -0,0 +1,2 @@ +Modifiche principali in questa versione: varie correzioni di errori e miglioramenti della stabilità. +Cronologia completa: https://github.com/vector-im/element-android/releases diff --git a/fastlane/metadata/android/it-IT/changelogs/40104200.txt b/fastlane/metadata/android/it-IT/changelogs/40104200.txt new file mode 100644 index 0000000000..556a6fc7ea --- /dev/null +++ b/fastlane/metadata/android/it-IT/changelogs/40104200.txt @@ -0,0 +1,2 @@ +Modifiche principali in questa versione: varie correzioni di errori e miglioramenti della stabilità. +Cronologia completa: https://github.com/vector-im/element-android/releases diff --git a/fastlane/metadata/android/pt-BR/changelogs/40104180.txt b/fastlane/metadata/android/pt-BR/changelogs/40104180.txt new file mode 100644 index 0000000000..6e11e92579 --- /dev/null +++ b/fastlane/metadata/android/pt-BR/changelogs/40104180.txt @@ -0,0 +1,2 @@ +Principais mudanças nesta versão: Vários consertos de bugs e melhorias de estabilidade. +Changelog completo: https://github.com/vector-im/element-android/releases diff --git a/fastlane/metadata/android/pt-BR/changelogs/40104190.txt b/fastlane/metadata/android/pt-BR/changelogs/40104190.txt new file mode 100644 index 0000000000..6e11e92579 --- /dev/null +++ b/fastlane/metadata/android/pt-BR/changelogs/40104190.txt @@ -0,0 +1,2 @@ +Principais mudanças nesta versão: Vários consertos de bugs e melhorias de estabilidade. +Changelog completo: https://github.com/vector-im/element-android/releases diff --git a/fastlane/metadata/android/pt-BR/changelogs/40104200.txt b/fastlane/metadata/android/pt-BR/changelogs/40104200.txt new file mode 100644 index 0000000000..6e11e92579 --- /dev/null +++ b/fastlane/metadata/android/pt-BR/changelogs/40104200.txt @@ -0,0 +1,2 @@ +Principais mudanças nesta versão: Vários consertos de bugs e melhorias de estabilidade. +Changelog completo: https://github.com/vector-im/element-android/releases diff --git a/fastlane/metadata/android/sk/changelogs/40104180.txt b/fastlane/metadata/android/sk/changelogs/40104180.txt new file mode 100644 index 0000000000..50670f18c2 --- /dev/null +++ b/fastlane/metadata/android/sk/changelogs/40104180.txt @@ -0,0 +1,2 @@ +Hlavné zmeny v tejto verzii: Rôzne opravy chýb a vylepšenia stability. +Úplný zoznam zmien: https://github.com/vector-im/element-android/releases diff --git a/fastlane/metadata/android/sk/changelogs/40104190.txt b/fastlane/metadata/android/sk/changelogs/40104190.txt new file mode 100644 index 0000000000..50670f18c2 --- /dev/null +++ b/fastlane/metadata/android/sk/changelogs/40104190.txt @@ -0,0 +1,2 @@ +Hlavné zmeny v tejto verzii: Rôzne opravy chýb a vylepšenia stability. +Úplný zoznam zmien: https://github.com/vector-im/element-android/releases diff --git a/fastlane/metadata/android/sk/changelogs/40104200.txt b/fastlane/metadata/android/sk/changelogs/40104200.txt new file mode 100644 index 0000000000..50670f18c2 --- /dev/null +++ b/fastlane/metadata/android/sk/changelogs/40104200.txt @@ -0,0 +1,2 @@ +Hlavné zmeny v tejto verzii: Rôzne opravy chýb a vylepšenia stability. +Úplný zoznam zmien: https://github.com/vector-im/element-android/releases diff --git a/fastlane/metadata/android/sv-SE/changelogs/40104180.txt b/fastlane/metadata/android/sv-SE/changelogs/40104180.txt new file mode 100644 index 0000000000..d8db452b51 --- /dev/null +++ b/fastlane/metadata/android/sv-SE/changelogs/40104180.txt @@ -0,0 +1,2 @@ +Huvudsakliga ändringar i den här versionen: Diverse buggfixar och stabilitetsförbättringar. +Full ändringslogg: https://github.com/vector-im/element-android/releases diff --git a/fastlane/metadata/android/sv-SE/changelogs/40104190.txt b/fastlane/metadata/android/sv-SE/changelogs/40104190.txt new file mode 100644 index 0000000000..d8db452b51 --- /dev/null +++ b/fastlane/metadata/android/sv-SE/changelogs/40104190.txt @@ -0,0 +1,2 @@ +Huvudsakliga ändringar i den här versionen: Diverse buggfixar och stabilitetsförbättringar. +Full ändringslogg: https://github.com/vector-im/element-android/releases diff --git a/fastlane/metadata/android/sv-SE/changelogs/40104200.txt b/fastlane/metadata/android/sv-SE/changelogs/40104200.txt new file mode 100644 index 0000000000..d8db452b51 --- /dev/null +++ b/fastlane/metadata/android/sv-SE/changelogs/40104200.txt @@ -0,0 +1,2 @@ +Huvudsakliga ändringar i den här versionen: Diverse buggfixar och stabilitetsförbättringar. +Full ändringslogg: https://github.com/vector-im/element-android/releases diff --git a/fastlane/metadata/android/uk/changelogs/40104000.txt b/fastlane/metadata/android/uk/changelogs/40104000.txt index 6abfdcf929..b4203b0e3f 100644 --- a/fastlane/metadata/android/uk/changelogs/40104000.txt +++ b/fastlane/metadata/android/uk/changelogs/40104000.txt @@ -1,2 +1,2 @@ -Основні зміни в цій версії: Початкова реалізація тредів повідомлень. Повідомлення бульбашки. +Основні зміни в цій версії: Початкова реалізація гілок повідомлень. Повідомлення бульбашки. Вичерпний перелік змін: https://github.com/vector-im/element-android/releases/tag/v1.4.0 diff --git a/fastlane/metadata/android/uk/changelogs/40104060.txt b/fastlane/metadata/android/uk/changelogs/40104060.txt index 28f051724a..a5dac44be2 100644 --- a/fastlane/metadata/android/uk/changelogs/40104060.txt +++ b/fastlane/metadata/android/uk/changelogs/40104060.txt @@ -1,2 +1,2 @@ -Основні зміни в цій версії: Хронологія тредів працює наживо і швидше. Усунуто різні вади й поліпшено стабільність. +Основні зміни в цій версії: Хронологія гілок працює наживо і швидше. Усунуто різні вади й поліпшено стабільність. Вичерпний перелік змін: https://github.com/vector-im/element-android/releases/tag/v1.4.6 diff --git a/fastlane/metadata/android/uk/changelogs/40104080.txt b/fastlane/metadata/android/uk/changelogs/40104080.txt index e5f7e7b271..5155793561 100644 --- a/fastlane/metadata/android/uk/changelogs/40104080.txt +++ b/fastlane/metadata/android/uk/changelogs/40104080.txt @@ -1,2 +1,2 @@ -Основні зміни в цій версії: Хронологія тредів працює наживо і швидше. Усунуто різні вади й поліпшено стабільність. +Основні зміни в цій версії: Хронологія гілок працює наживо і швидше. Усунуто різні вади й поліпшено стабільність. Вичерпний перелік змін: https://github.com/vector-im/element-android/releases diff --git a/fastlane/metadata/android/uk/changelogs/40104180.txt b/fastlane/metadata/android/uk/changelogs/40104180.txt new file mode 100644 index 0000000000..252a57c9d9 --- /dev/null +++ b/fastlane/metadata/android/uk/changelogs/40104180.txt @@ -0,0 +1,2 @@ +Основні зміни в цій версії: Усунуто різні вади й поліпшено стабільність. +Вичерпний перелік змін: https://github.com/vector-im/element-android/releases diff --git a/fastlane/metadata/android/uk/changelogs/40104190.txt b/fastlane/metadata/android/uk/changelogs/40104190.txt new file mode 100644 index 0000000000..252a57c9d9 --- /dev/null +++ b/fastlane/metadata/android/uk/changelogs/40104190.txt @@ -0,0 +1,2 @@ +Основні зміни в цій версії: Усунуто різні вади й поліпшено стабільність. +Вичерпний перелік змін: https://github.com/vector-im/element-android/releases diff --git a/fastlane/metadata/android/uk/changelogs/40104200.txt b/fastlane/metadata/android/uk/changelogs/40104200.txt new file mode 100644 index 0000000000..252a57c9d9 --- /dev/null +++ b/fastlane/metadata/android/uk/changelogs/40104200.txt @@ -0,0 +1,2 @@ +Основні зміни в цій версії: Усунуто різні вади й поліпшено стабільність. +Вичерпний перелік змін: https://github.com/vector-im/element-android/releases diff --git a/fastlane/metadata/android/zh-TW/changelogs/40104180.txt b/fastlane/metadata/android/zh-TW/changelogs/40104180.txt new file mode 100644 index 0000000000..4bcca9a0b8 --- /dev/null +++ b/fastlane/metadata/android/zh-TW/changelogs/40104180.txt @@ -0,0 +1,2 @@ +此版本中的主要變動:多個臭蟲修復與穩定性改善。 +完整的變更紀錄:https://github.com/vector-im/element-android/releases diff --git a/fastlane/metadata/android/zh-TW/changelogs/40104190.txt b/fastlane/metadata/android/zh-TW/changelogs/40104190.txt new file mode 100644 index 0000000000..4bcca9a0b8 --- /dev/null +++ b/fastlane/metadata/android/zh-TW/changelogs/40104190.txt @@ -0,0 +1,2 @@ +此版本中的主要變動:多個臭蟲修復與穩定性改善。 +完整的變更紀錄:https://github.com/vector-im/element-android/releases diff --git a/fastlane/metadata/android/zh-TW/changelogs/40104200.txt b/fastlane/metadata/android/zh-TW/changelogs/40104200.txt new file mode 100644 index 0000000000..4bcca9a0b8 --- /dev/null +++ b/fastlane/metadata/android/zh-TW/changelogs/40104200.txt @@ -0,0 +1,2 @@ +此版本中的主要變動:多個臭蟲修復與穩定性改善。 +完整的變更紀錄:https://github.com/vector-im/element-android/releases diff --git a/library/jsonviewer/build.gradle b/library/jsonviewer/build.gradle index e1a3b0c9ee..ad472b0b54 100644 --- a/library/jsonviewer/build.gradle +++ b/library/jsonviewer/build.gradle @@ -2,7 +2,6 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-parcelize' apply plugin: 'kotlin-kapt' -apply plugin: 'com.jakewharton.butterknife' buildscript { repositories { @@ -15,9 +14,6 @@ buildscript { url 'https://repo1.maven.org/maven2' } } - dependencies { - classpath 'com.jakewharton:butterknife-gradle-plugin:10.2.3' - } } android { diff --git a/library/jsonviewer/src/main/java/org/billcarsonfr/jsonviewer/ValueItem.kt b/library/jsonviewer/src/main/java/org/billcarsonfr/jsonviewer/ValueItem.kt index 66dfcc5dc3..590df07f4d 100644 --- a/library/jsonviewer/src/main/java/org/billcarsonfr/jsonviewer/ValueItem.kt +++ b/library/jsonviewer/src/main/java/org/billcarsonfr/jsonviewer/ValueItem.kt @@ -29,7 +29,7 @@ import com.airbnb.epoxy.EpoxyModelClass import com.airbnb.epoxy.EpoxyModelWithHolder import im.vector.lib.core.utils.epoxy.charsequence.EpoxyCharSequence -@EpoxyModelClass(layout = R2.layout.item_jv_base_value) +@EpoxyModelClass internal abstract class ValueItem : EpoxyModelWithHolder() { @EpoxyAttribute @@ -44,6 +44,8 @@ internal abstract class ValueItem : EpoxyModelWithHolder() { @EpoxyAttribute(EpoxyAttribute.Option.DoNotHash) var itemClickListener: View.OnClickListener? = null + override fun getDefaultLayout() = R.layout.item_jv_base_value + override fun bind(holder: Holder) { super.bind(holder) holder.textView.text = text?.charSequence diff --git a/library/ui-styles/src/main/res/drawable/bg_waiting_for_email_verification.xml b/library/ui-styles/src/main/res/drawable/bg_gradient_ftue_breaker.xml similarity index 100% rename from library/ui-styles/src/main/res/drawable/bg_waiting_for_email_verification.xml rename to library/ui-styles/src/main/res/drawable/bg_gradient_ftue_breaker.xml diff --git a/matrix-sdk-android-flow/src/main/java/org/matrix/android/sdk/flow/FlowRoom.kt b/matrix-sdk-android-flow/src/main/java/org/matrix/android/sdk/flow/FlowRoom.kt index 7ac81b2d86..8be8e83569 100644 --- a/matrix-sdk-android-flow/src/main/java/org/matrix/android/sdk/flow/FlowRoom.kt +++ b/matrix-sdk-android-flow/src/main/java/org/matrix/android/sdk/flow/FlowRoom.kt @@ -53,6 +53,13 @@ class FlowRoom(private val room: Room) { } } + fun liveAreAllMembersLoaded(): Flow { + return room.membershipService().areAllMembersLoadedLive().asFlow() + .startWith(room.coroutineDispatchers.io) { + room.membershipService().areAllMembersLoaded() + } + } + fun liveAnnotationSummary(eventId: String): Flow> { return room.relationService().getEventAnnotationsSummaryLive(eventId).asFlow() .startWith(room.coroutineDispatchers.io) { diff --git a/matrix-sdk-android/build.gradle b/matrix-sdk-android/build.gradle index b7c4cacdde..ddd4cba1e0 100644 --- a/matrix-sdk-android/build.gradle +++ b/matrix-sdk-android/build.gradle @@ -17,7 +17,7 @@ buildscript { } } dependencies { - classpath "io.realm:realm-gradle-plugin:10.9.0" + classpath "io.realm:realm-gradle-plugin:10.11.0" } } @@ -60,7 +60,7 @@ android { // that the app's state is completely cleared between tests. testInstrumentationRunnerArguments clearPackageData: 'true' - buildConfigField "String", "SDK_VERSION", "\"1.4.26\"" + buildConfigField "String", "SDK_VERSION", "\"1.4.28\"" buildConfigField "String", "GIT_SDK_REVISION", "\"${gitRevision()}\"" buildConfigField "String", "GIT_SDK_REVISION_UNIX_DATE", "\"${gitRevisionUnixDate()}\"" diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/network/ApiPath.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/network/ApiPath.kt index baf33a59c5..f5e5628566 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/network/ApiPath.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/network/ApiPath.kt @@ -162,7 +162,7 @@ enum class ApiPath(val path: String, val method: String) { KICK_USER(NetworkConstants.URI_API_PREFIX_PATH_R0 + "rooms/{roomId}/kick", "POST"), REDACT_EVENT(NetworkConstants.URI_API_PREFIX_PATH_R0 + "rooms/{roomId}/redact/{eventId}/{txnId}", "PUT"), REPORT_CONTENT(NetworkConstants.URI_API_PREFIX_PATH_R0 + "rooms/{roomId}/report/{eventId}", "POST"), - GET_ALIASES(NetworkConstants.URI_API_PREFIX_PATH_UNSTABLE + "org.matrix.msc2432/rooms/{roomId}/aliases", "GET"), + GET_ALIASES(NetworkConstants.URI_API_PREFIX_PATH_R0 + "rooms/{roomId}/aliases", "GET"), SEND_TYPING_STATE(NetworkConstants.URI_API_PREFIX_PATH_R0 + "rooms/{roomId}/typing/{userId}", "PUT"), PUT_TAG(NetworkConstants.URI_API_PREFIX_PATH_R0 + "user/{userId}/rooms/{roomId}/tags/{tag}", "PUT"), DELETE_TAG(NetworkConstants.URI_API_PREFIX_PATH_R0 + "user/{userId}/rooms/{roomId}/tags/{tag}", "DELETE"), diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/members/MembershipService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/members/MembershipService.kt index e7ac69be74..144cfeb3b8 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/members/MembershipService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/members/MembershipService.kt @@ -30,6 +30,20 @@ interface MembershipService { */ suspend fun loadRoomMembersIfNeeded() + /** + * All the room members can be not loaded, for instance after an initial sync. + * All the members will be loaded when calling [loadRoomMembersIfNeeded], or when sending an encrypted + * event to the room. + * The fun let the app know if all the members have been loaded for this room. + * @return true if all the members are loaded, or false elsewhere. + */ + suspend fun areAllMembersLoaded(): Boolean + + /** + * Live version for [areAllMembersLoaded]. + */ + fun areAllMembersLoadedLive(): LiveData + /** * Return the roomMember with userId or null. * @param userId the userId param to look for diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/extensions/RealmExtensions.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/extensions/RealmExtensions.kt index 00cbe0aa85..c6ea2bc7bd 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/extensions/RealmExtensions.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/extensions/RealmExtensions.kt @@ -20,6 +20,7 @@ import io.realm.RealmList import io.realm.RealmObject import io.realm.RealmObjectSchema import org.matrix.android.sdk.internal.database.model.HomeServerCapabilitiesEntityFields +import org.matrix.android.sdk.internal.util.fatalError internal fun RealmObject.assertIsManaged() { check(isManaged) { "${javaClass.simpleName} entity should be managed to use this function" } @@ -27,10 +28,19 @@ internal fun RealmObject.assertIsManaged() { /** * Clear a RealmList by deleting all its items calling the provided lambda. + * The lambda is supposed to delete the item, which means that after this operation, the list will be empty. */ internal fun RealmList.clearWith(delete: (T) -> Unit) { - while (!isEmpty()) { - first()?.let { delete.invoke(it) } + map { item -> + // Create a lambda for all items of the list + { delete(item) } + }.forEach { lambda -> + // Then invoke all the lambda + lambda.invoke() + } + + if (isNotEmpty()) { + fatalError("`clearWith` MUST delete all elements of the RealmList") } } diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/RoomAPI.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/RoomAPI.kt index ac2880de69..9bcb7b8e4c 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/RoomAPI.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/RoomAPI.kt @@ -377,7 +377,7 @@ internal interface RoomAPI { * Get a list of aliases maintained by the local server for the given room. * Ref: https://matrix.org/docs/spec/client_server/r0.6.1#get-matrix-client-r0-rooms-roomid-aliases */ - @GET(NetworkConstants.URI_API_PREFIX_PATH_UNSTABLE + "org.matrix.msc2432/rooms/{roomId}/aliases") + @GET(NetworkConstants.URI_API_PREFIX_PATH_R0 + "rooms/{roomId}/aliases") suspend fun getAliases(@Path("roomId") roomId: String): GetAliasesResponse /** diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/RoomDataSource.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/RoomDataSource.kt new file mode 100644 index 0000000000..bcbc53f95e --- /dev/null +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/RoomDataSource.kt @@ -0,0 +1,55 @@ +/* + * Copyright 2022 The Matrix.org Foundation C.I.C. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.matrix.android.sdk.internal.session.room + +import androidx.lifecycle.LiveData +import androidx.lifecycle.Transformations +import com.zhuinden.monarchy.Monarchy +import io.realm.Realm +import org.matrix.android.sdk.api.extensions.orFalse +import org.matrix.android.sdk.internal.database.model.RoomEntity +import org.matrix.android.sdk.internal.database.model.RoomMembersLoadStatusType +import org.matrix.android.sdk.internal.database.query.where +import org.matrix.android.sdk.internal.di.SessionDatabase +import javax.inject.Inject + +internal class RoomDataSource @Inject constructor( + @SessionDatabase private val monarchy: Monarchy, +) { + fun getRoomMembersLoadStatus(roomId: String): RoomMembersLoadStatusType { + var result: RoomMembersLoadStatusType? + Realm.getInstance(monarchy.realmConfiguration).use { + result = RoomEntity.where(it, roomId).findFirst()?.membersLoadStatus + } + return result ?: RoomMembersLoadStatusType.NONE + } + + fun getRoomMembersLoadStatusLive(roomId: String): LiveData { + val liveData = monarchy.findAllMappedWithChanges( + { + RoomEntity.where(it, roomId) + }, + { + it.membersLoadStatus == RoomMembersLoadStatusType.LOADED + } + ) + + return Transformations.map(liveData) { results -> + results.firstOrNull().orFalse() + } + } +} diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/alias/GetRoomLocalAliasesTask.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/alias/GetRoomLocalAliasesTask.kt index 1ff4156ed3..62681c89d8 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/alias/GetRoomLocalAliasesTask.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/alias/GetRoomLocalAliasesTask.kt @@ -34,7 +34,6 @@ internal class DefaultGetRoomLocalAliasesTask @Inject constructor( ) : GetRoomLocalAliasesTask { override suspend fun execute(params: GetRoomLocalAliasesTask.Params): List { - // We do not check for "org.matrix.msc2432", so the API may be missing val response = executeRequest(globalErrorReceiver) { roomAPI.getAliases(roomId = params.roomId) } diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/membership/DefaultMembershipService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/membership/DefaultMembershipService.kt index ef89ca33a7..ec140e7b17 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/membership/DefaultMembershipService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/membership/DefaultMembershipService.kt @@ -31,10 +31,12 @@ import org.matrix.android.sdk.api.session.room.model.RoomMemberSummary import org.matrix.android.sdk.internal.database.mapper.asDomain import org.matrix.android.sdk.internal.database.model.RoomMemberSummaryEntity import org.matrix.android.sdk.internal.database.model.RoomMemberSummaryEntityFields +import org.matrix.android.sdk.internal.database.model.RoomMembersLoadStatusType import org.matrix.android.sdk.internal.di.SessionDatabase import org.matrix.android.sdk.internal.di.UserId import org.matrix.android.sdk.internal.query.QueryStringValueProcessor import org.matrix.android.sdk.internal.query.process +import org.matrix.android.sdk.internal.session.room.RoomDataSource import org.matrix.android.sdk.internal.session.room.membership.admin.MembershipAdminTask import org.matrix.android.sdk.internal.session.room.membership.joining.InviteTask import org.matrix.android.sdk.internal.session.room.membership.threepid.InviteThreePidTask @@ -47,6 +49,7 @@ internal class DefaultMembershipService @AssistedInject constructor( private val inviteTask: InviteTask, private val inviteThreePidTask: InviteThreePidTask, private val membershipAdminTask: MembershipAdminTask, + private val roomDataSource: RoomDataSource, @UserId private val userId: String, private val queryStringValueProcessor: QueryStringValueProcessor @@ -62,6 +65,15 @@ internal class DefaultMembershipService @AssistedInject constructor( loadRoomMembersTask.execute(params) } + override suspend fun areAllMembersLoaded(): Boolean { + val status = roomDataSource.getRoomMembersLoadStatus(roomId) + return status == RoomMembersLoadStatusType.LOADED + } + + override fun areAllMembersLoadedLive(): LiveData { + return roomDataSource.getRoomMembersLoadStatusLive(roomId) + } + override fun getRoomMember(userId: String): RoomMemberSummary? { val roomMemberEntity = monarchy.fetchCopied { RoomMemberHelper(it, roomId).getLastRoomMember(userId) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/membership/LoadRoomMembersTask.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/membership/LoadRoomMembersTask.kt index 7052eb23e2..c02049f40d 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/membership/LoadRoomMembersTask.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/membership/LoadRoomMembersTask.kt @@ -17,7 +17,6 @@ package org.matrix.android.sdk.internal.session.room.membership import com.zhuinden.monarchy.Monarchy -import io.realm.Realm import io.realm.kotlin.createObject import kotlinx.coroutines.TimeoutCancellationException import org.matrix.android.sdk.api.session.room.model.Membership @@ -38,6 +37,7 @@ import org.matrix.android.sdk.internal.di.SessionDatabase import org.matrix.android.sdk.internal.network.GlobalErrorReceiver import org.matrix.android.sdk.internal.network.executeRequest import org.matrix.android.sdk.internal.session.room.RoomAPI +import org.matrix.android.sdk.internal.session.room.RoomDataSource import org.matrix.android.sdk.internal.session.room.summary.RoomSummaryUpdater import org.matrix.android.sdk.internal.session.sync.SyncTokenStore import org.matrix.android.sdk.internal.task.Task @@ -58,6 +58,7 @@ internal interface LoadRoomMembersTask : Task internal class DefaultLoadRoomMembersTask @Inject constructor( private val roomAPI: RoomAPI, @SessionDatabase private val monarchy: Monarchy, + private val roomDataSource: RoomDataSource, private val syncTokenStore: SyncTokenStore, private val roomSummaryUpdater: RoomSummaryUpdater, private val roomMemberEventHandler: RoomMemberEventHandler, @@ -68,7 +69,7 @@ internal class DefaultLoadRoomMembersTask @Inject constructor( ) : LoadRoomMembersTask { override suspend fun execute(params: LoadRoomMembersTask.Params) { - when (getRoomMembersLoadStatus(params.roomId)) { + when (roomDataSource.getRoomMembersLoadStatus(params.roomId)) { RoomMembersLoadStatusType.NONE -> doRequest(params) RoomMembersLoadStatusType.LOADING -> waitPreviousRequestToFinish(params) RoomMembersLoadStatusType.LOADED -> Unit @@ -142,14 +143,6 @@ internal class DefaultLoadRoomMembersTask @Inject constructor( } } - private fun getRoomMembersLoadStatus(roomId: String): RoomMembersLoadStatusType { - var result: RoomMembersLoadStatusType? - Realm.getInstance(monarchy.realmConfiguration).use { - result = RoomEntity.where(it, roomId).findFirst()?.membersLoadStatus - } - return result ?: RoomMembersLoadStatusType.NONE - } - private suspend fun setRoomMembersLoadStatus(roomId: String, status: RoomMembersLoadStatusType) { monarchy.awaitTransaction { realm -> val roomEntity = RoomEntity.where(realm, roomId).findFirst() ?: realm.createObject(roomId) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/util/fatal.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/util/fatal.kt new file mode 100644 index 0000000000..323eee0b1c --- /dev/null +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/util/fatal.kt @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2022 The Matrix.org Foundation C.I.C. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.matrix.android.sdk.internal.util + +import org.matrix.android.sdk.BuildConfig +import timber.log.Timber + +/** + * Throws in debug, only log in production. + * As this method does not always throw, next statement should be a return. +*/ +internal fun fatalError(message: String) { + if (BuildConfig.DEBUG) { + error(message) + } else { + Timber.e(message) + } +} diff --git a/vector/build.gradle b/vector/build.gradle index 15b54a71d7..dd160f9574 100644 --- a/vector/build.gradle +++ b/vector/build.gradle @@ -35,7 +35,7 @@ ext.versionMinor = 4 // Note: even values are reserved for regular release, odd values for hotfix release. // When creating a hotfix, you should decrease the value, since the current value // is the value for the next regular release. -ext.versionPatch = 26 +ext.versionPatch = 28 static def getGitTimestamp() { def cmd = 'git show -s --format=%ct' diff --git a/vector/src/debug/java/im/vector/app/features/debug/features/BooleanFeatureItem.kt b/vector/src/debug/java/im/vector/app/features/debug/features/BooleanFeatureItem.kt index 8665081102..1e9b88c048 100644 --- a/vector/src/debug/java/im/vector/app/features/debug/features/BooleanFeatureItem.kt +++ b/vector/src/debug/java/im/vector/app/features/debug/features/BooleanFeatureItem.kt @@ -23,11 +23,12 @@ import android.widget.Spinner import android.widget.TextView import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass +import im.vector.app.R import im.vector.app.core.epoxy.VectorEpoxyHolder import im.vector.app.core.epoxy.VectorEpoxyModel -@EpoxyModelClass(layout = im.vector.app.R.layout.item_feature) -abstract class BooleanFeatureItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class BooleanFeatureItem : VectorEpoxyModel(R.layout.item_feature) { @EpoxyAttribute lateinit var feature: Feature.BooleanFeature diff --git a/vector/src/debug/java/im/vector/app/features/debug/features/EnumFeatureItem.kt b/vector/src/debug/java/im/vector/app/features/debug/features/EnumFeatureItem.kt index a06147c4f8..5231e591da 100644 --- a/vector/src/debug/java/im/vector/app/features/debug/features/EnumFeatureItem.kt +++ b/vector/src/debug/java/im/vector/app/features/debug/features/EnumFeatureItem.kt @@ -23,11 +23,12 @@ import android.widget.Spinner import android.widget.TextView import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass +import im.vector.app.R import im.vector.app.core.epoxy.VectorEpoxyHolder import im.vector.app.core.epoxy.VectorEpoxyModel -@EpoxyModelClass(layout = im.vector.app.R.layout.item_feature) -abstract class EnumFeatureItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class EnumFeatureItem : VectorEpoxyModel(R.layout.item_feature) { @EpoxyAttribute lateinit var feature: Feature.EnumFeature<*> diff --git a/vector/src/debug/java/im/vector/app/features/debug/sas/SasEmojiItem.kt b/vector/src/debug/java/im/vector/app/features/debug/sas/SasEmojiItem.kt index 9e0c013960..179ee35693 100644 --- a/vector/src/debug/java/im/vector/app/features/debug/sas/SasEmojiItem.kt +++ b/vector/src/debug/java/im/vector/app/features/debug/sas/SasEmojiItem.kt @@ -21,14 +21,15 @@ import android.widget.TextView import androidx.core.content.ContextCompat import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass +import im.vector.app.R import im.vector.app.core.epoxy.VectorEpoxyHolder import im.vector.app.core.epoxy.VectorEpoxyModel import me.gujun.android.span.image import me.gujun.android.span.span import org.matrix.android.sdk.api.session.crypto.verification.EmojiRepresentation -@EpoxyModelClass(layout = im.vector.app.R.layout.item_sas_emoji) -abstract class SasEmojiItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class SasEmojiItem : VectorEpoxyModel(R.layout.item_sas_emoji) { @EpoxyAttribute var index: Int = 0 @@ -51,9 +52,9 @@ abstract class SasEmojiItem : VectorEpoxyModel() { } class Holder : VectorEpoxyHolder() { - val indexView by bind(im.vector.app.R.id.sas_emoji_index) - val emojiView by bind(im.vector.app.R.id.sas_emoji) - val textView by bind(im.vector.app.R.id.sas_emoji_text) - val idView by bind(im.vector.app.R.id.sas_emoji_text_id) + val indexView by bind(R.id.sas_emoji_index) + val emojiView by bind(R.id.sas_emoji) + val textView by bind(R.id.sas_emoji_text) + val idView by bind(R.id.sas_emoji_text_id) } } diff --git a/vector/src/main/AndroidManifest.xml b/vector/src/main/AndroidManifest.xml index 1e7a40cef2..032e256bfa 100644 --- a/vector/src/main/AndroidManifest.xml +++ b/vector/src/main/AndroidManifest.xml @@ -77,6 +77,7 @@ @@ -413,9 +415,9 @@ + android:exported="true"> diff --git a/vector/src/main/java/im/vector/app/core/epoxy/BottomSheetDividerItem.kt b/vector/src/main/java/im/vector/app/core/epoxy/BottomSheetDividerItem.kt index 2d65f0ce0c..7cdbaab0b7 100644 --- a/vector/src/main/java/im/vector/app/core/epoxy/BottomSheetDividerItem.kt +++ b/vector/src/main/java/im/vector/app/core/epoxy/BottomSheetDividerItem.kt @@ -18,7 +18,7 @@ package im.vector.app.core.epoxy import com.airbnb.epoxy.EpoxyModelClass import im.vector.app.R -@EpoxyModelClass(layout = R.layout.item_divider_on_surface) -abstract class BottomSheetDividerItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class BottomSheetDividerItem : VectorEpoxyModel(R.layout.item_divider_on_surface) { class Holder : VectorEpoxyHolder() } diff --git a/vector/src/main/java/im/vector/app/core/epoxy/CheckBoxItem.kt b/vector/src/main/java/im/vector/app/core/epoxy/CheckBoxItem.kt index 2f32fafa9e..dc016c18ec 100644 --- a/vector/src/main/java/im/vector/app/core/epoxy/CheckBoxItem.kt +++ b/vector/src/main/java/im/vector/app/core/epoxy/CheckBoxItem.kt @@ -22,8 +22,8 @@ import com.airbnb.epoxy.EpoxyModelClass import com.google.android.material.checkbox.MaterialCheckBox import im.vector.app.R -@EpoxyModelClass(layout = R.layout.item_checkbox) -abstract class CheckBoxItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class CheckBoxItem : VectorEpoxyModel(R.layout.item_checkbox) { @EpoxyAttribute var checked: Boolean = false diff --git a/vector/src/main/java/im/vector/app/core/epoxy/DividerItem.kt b/vector/src/main/java/im/vector/app/core/epoxy/DividerItem.kt index 73568444b6..54fd9f6e0b 100644 --- a/vector/src/main/java/im/vector/app/core/epoxy/DividerItem.kt +++ b/vector/src/main/java/im/vector/app/core/epoxy/DividerItem.kt @@ -18,7 +18,7 @@ package im.vector.app.core.epoxy import com.airbnb.epoxy.EpoxyModelClass import im.vector.app.R -@EpoxyModelClass(layout = R.layout.item_divider) -abstract class DividerItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class DividerItem : VectorEpoxyModel(R.layout.item_divider) { class Holder : VectorEpoxyHolder() } diff --git a/vector/src/main/java/im/vector/app/core/epoxy/ErrorWithRetryItem.kt b/vector/src/main/java/im/vector/app/core/epoxy/ErrorWithRetryItem.kt index 8d2b2be6c2..4f0767c068 100644 --- a/vector/src/main/java/im/vector/app/core/epoxy/ErrorWithRetryItem.kt +++ b/vector/src/main/java/im/vector/app/core/epoxy/ErrorWithRetryItem.kt @@ -23,8 +23,8 @@ import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass import im.vector.app.R -@EpoxyModelClass(layout = R.layout.item_error_retry) -abstract class ErrorWithRetryItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class ErrorWithRetryItem : VectorEpoxyModel(R.layout.item_error_retry) { @EpoxyAttribute var text: String? = null diff --git a/vector/src/main/java/im/vector/app/core/epoxy/ExpandableTextItem.kt b/vector/src/main/java/im/vector/app/core/epoxy/ExpandableTextItem.kt index 218a22533a..07a4a2f4e1 100644 --- a/vector/src/main/java/im/vector/app/core/epoxy/ExpandableTextItem.kt +++ b/vector/src/main/java/im/vector/app/core/epoxy/ExpandableTextItem.kt @@ -28,8 +28,8 @@ import com.airbnb.epoxy.EpoxyModelClass import im.vector.app.R import im.vector.app.core.extensions.copyOnLongClick -@EpoxyModelClass(layout = R.layout.item_expandable_textview) -abstract class ExpandableTextItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class ExpandableTextItem : VectorEpoxyModel(R.layout.item_expandable_textview) { @EpoxyAttribute lateinit var content: String diff --git a/vector/src/main/java/im/vector/app/core/epoxy/HelpFooterItem.kt b/vector/src/main/java/im/vector/app/core/epoxy/HelpFooterItem.kt index bb39bd41d6..c3ab37d19d 100644 --- a/vector/src/main/java/im/vector/app/core/epoxy/HelpFooterItem.kt +++ b/vector/src/main/java/im/vector/app/core/epoxy/HelpFooterItem.kt @@ -21,8 +21,8 @@ import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass import im.vector.app.R -@EpoxyModelClass(layout = R.layout.item_help_footer) -abstract class HelpFooterItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class HelpFooterItem : VectorEpoxyModel(R.layout.item_help_footer) { @EpoxyAttribute var text: String? = null diff --git a/vector/src/main/java/im/vector/app/core/epoxy/LoadingItem.kt b/vector/src/main/java/im/vector/app/core/epoxy/LoadingItem.kt index 5cf87bbf78..63aea7dbaf 100644 --- a/vector/src/main/java/im/vector/app/core/epoxy/LoadingItem.kt +++ b/vector/src/main/java/im/vector/app/core/epoxy/LoadingItem.kt @@ -24,8 +24,8 @@ import com.airbnb.epoxy.EpoxyModelClass import im.vector.app.R import im.vector.app.core.extensions.setTextOrHide -@EpoxyModelClass(layout = R.layout.item_loading) -abstract class LoadingItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class LoadingItem : VectorEpoxyModel(R.layout.item_loading) { @EpoxyAttribute var loadingText: String? = null @EpoxyAttribute var showLoader: Boolean = true diff --git a/vector/src/main/java/im/vector/app/core/epoxy/NoResultItem.kt b/vector/src/main/java/im/vector/app/core/epoxy/NoResultItem.kt index d38ed93225..bddcbd0846 100644 --- a/vector/src/main/java/im/vector/app/core/epoxy/NoResultItem.kt +++ b/vector/src/main/java/im/vector/app/core/epoxy/NoResultItem.kt @@ -21,8 +21,8 @@ import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass import im.vector.app.R -@EpoxyModelClass(layout = R.layout.item_no_result) -abstract class NoResultItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class NoResultItem : VectorEpoxyModel(R.layout.item_no_result) { @EpoxyAttribute var text: String? = null diff --git a/vector/src/main/java/im/vector/app/core/epoxy/SquareLoadingItem.kt b/vector/src/main/java/im/vector/app/core/epoxy/SquareLoadingItem.kt index 7844a75dae..75ce203927 100644 --- a/vector/src/main/java/im/vector/app/core/epoxy/SquareLoadingItem.kt +++ b/vector/src/main/java/im/vector/app/core/epoxy/SquareLoadingItem.kt @@ -19,8 +19,8 @@ package im.vector.app.core.epoxy import com.airbnb.epoxy.EpoxyModelClass import im.vector.app.R -@EpoxyModelClass(layout = R.layout.item_loading_square) -abstract class SquareLoadingItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class SquareLoadingItem : VectorEpoxyModel(R.layout.item_loading_square) { class Holder : VectorEpoxyHolder() } diff --git a/vector/src/main/java/im/vector/app/core/epoxy/TimelineEmptyItem.kt b/vector/src/main/java/im/vector/app/core/epoxy/TimelineEmptyItem.kt index c51573bf21..a642981d92 100644 --- a/vector/src/main/java/im/vector/app/core/epoxy/TimelineEmptyItem.kt +++ b/vector/src/main/java/im/vector/app/core/epoxy/TimelineEmptyItem.kt @@ -22,8 +22,8 @@ import com.airbnb.epoxy.EpoxyModelClass import im.vector.app.R import im.vector.app.features.home.room.detail.timeline.item.ItemWithEvents -@EpoxyModelClass(layout = R.layout.item_timeline_empty) -abstract class TimelineEmptyItem : VectorEpoxyModel(), ItemWithEvents { +@EpoxyModelClass +abstract class TimelineEmptyItem : VectorEpoxyModel(R.layout.item_timeline_empty), ItemWithEvents { @EpoxyAttribute lateinit var eventId: String @EpoxyAttribute var notBlank: Boolean = false diff --git a/vector/src/main/java/im/vector/app/core/epoxy/VectorEpoxyModel.kt b/vector/src/main/java/im/vector/app/core/epoxy/VectorEpoxyModel.kt index 9bd16b09a3..66eca2569d 100644 --- a/vector/src/main/java/im/vector/app/core/epoxy/VectorEpoxyModel.kt +++ b/vector/src/main/java/im/vector/app/core/epoxy/VectorEpoxyModel.kt @@ -17,6 +17,7 @@ package im.vector.app.core.epoxy import androidx.annotation.CallSuper +import androidx.annotation.LayoutRes import com.airbnb.epoxy.EpoxyModelWithHolder import com.airbnb.epoxy.VisibilityState import kotlinx.coroutines.CoroutineScope @@ -27,12 +28,16 @@ import kotlinx.coroutines.cancelChildren /** * EpoxyModelWithHolder which can listen to visibility state change. */ -abstract class VectorEpoxyModel : EpoxyModelWithHolder() { +abstract class VectorEpoxyModel( + @LayoutRes private val layoutId: Int +) : EpoxyModelWithHolder() { protected val coroutineScope = CoroutineScope(SupervisorJob() + Dispatchers.Main) private var onModelVisibilityStateChangedListener: OnVisibilityStateChangedListener? = null + final override fun getDefaultLayout() = layoutId + @CallSuper override fun bind(holder: H) { super.bind(holder) diff --git a/vector/src/main/java/im/vector/app/core/epoxy/ZeroItem.kt b/vector/src/main/java/im/vector/app/core/epoxy/ZeroItem.kt index a65e37f96b..dbdb4ddbd9 100644 --- a/vector/src/main/java/im/vector/app/core/epoxy/ZeroItem.kt +++ b/vector/src/main/java/im/vector/app/core/epoxy/ZeroItem.kt @@ -23,8 +23,8 @@ import im.vector.app.R * Item of size (0, 0). * It can be useful to avoid automatic scroll of RecyclerView with Epoxy controller, when the first valuable item changes. */ -@EpoxyModelClass(layout = R.layout.item_zero) -abstract class ZeroItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class ZeroItem : VectorEpoxyModel(R.layout.item_zero) { class Holder : VectorEpoxyHolder() } diff --git a/vector/src/main/java/im/vector/app/core/epoxy/bottomsheet/BottomSheetActionItem.kt b/vector/src/main/java/im/vector/app/core/epoxy/bottomsheet/BottomSheetActionItem.kt index ed3d55fca9..0656726e7d 100644 --- a/vector/src/main/java/im/vector/app/core/epoxy/bottomsheet/BottomSheetActionItem.kt +++ b/vector/src/main/java/im/vector/app/core/epoxy/bottomsheet/BottomSheetActionItem.kt @@ -39,8 +39,8 @@ import im.vector.app.features.themes.ThemeUtils /** * A action for bottom sheet. */ -@EpoxyModelClass(layout = R.layout.item_bottom_sheet_action) -abstract class BottomSheetActionItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class BottomSheetActionItem : VectorEpoxyModel(R.layout.item_bottom_sheet_action) { @EpoxyAttribute @DrawableRes diff --git a/vector/src/main/java/im/vector/app/core/epoxy/bottomsheet/BottomSheetMessagePreviewItem.kt b/vector/src/main/java/im/vector/app/core/epoxy/bottomsheet/BottomSheetMessagePreviewItem.kt index b90956ad9e..bb1b0fbd7b 100644 --- a/vector/src/main/java/im/vector/app/core/epoxy/bottomsheet/BottomSheetMessagePreviewItem.kt +++ b/vector/src/main/java/im/vector/app/core/epoxy/bottomsheet/BottomSheetMessagePreviewItem.kt @@ -43,8 +43,8 @@ import org.matrix.android.sdk.api.util.MatrixItem /** * A message preview for bottom sheet. */ -@EpoxyModelClass(layout = R.layout.item_bottom_sheet_message_preview) -abstract class BottomSheetMessagePreviewItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class BottomSheetMessagePreviewItem : VectorEpoxyModel(R.layout.item_bottom_sheet_message_preview) { @EpoxyAttribute lateinit var avatarRenderer: AvatarRenderer diff --git a/vector/src/main/java/im/vector/app/core/epoxy/bottomsheet/BottomSheetQuickReactionsItem.kt b/vector/src/main/java/im/vector/app/core/epoxy/bottomsheet/BottomSheetQuickReactionsItem.kt index 3f6b23a85f..1b7c9b3409 100644 --- a/vector/src/main/java/im/vector/app/core/epoxy/bottomsheet/BottomSheetQuickReactionsItem.kt +++ b/vector/src/main/java/im/vector/app/core/epoxy/bottomsheet/BottomSheetQuickReactionsItem.kt @@ -29,8 +29,8 @@ import im.vector.app.core.epoxy.onClick /** * A quick reaction list for bottom sheet. */ -@EpoxyModelClass(layout = R.layout.item_bottom_sheet_quick_reaction) -abstract class BottomSheetQuickReactionsItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class BottomSheetQuickReactionsItem : VectorEpoxyModel(R.layout.item_bottom_sheet_quick_reaction) { @EpoxyAttribute lateinit var fontProvider: EmojiCompatFontProvider diff --git a/vector/src/main/java/im/vector/app/core/epoxy/bottomsheet/BottomSheetRadioActionItem.kt b/vector/src/main/java/im/vector/app/core/epoxy/bottomsheet/BottomSheetRadioActionItem.kt index 10bf92b7e7..2fe276fe01 100644 --- a/vector/src/main/java/im/vector/app/core/epoxy/bottomsheet/BottomSheetRadioActionItem.kt +++ b/vector/src/main/java/im/vector/app/core/epoxy/bottomsheet/BottomSheetRadioActionItem.kt @@ -33,8 +33,8 @@ import im.vector.app.core.extensions.setTextOrHide /** * A action for bottom sheet. */ -@EpoxyModelClass(layout = R.layout.item_bottom_sheet_radio) -abstract class BottomSheetRadioActionItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class BottomSheetRadioActionItem : VectorEpoxyModel(R.layout.item_bottom_sheet_radio) { @EpoxyAttribute var title: String? = null diff --git a/vector/src/main/java/im/vector/app/core/epoxy/bottomsheet/BottomSheetRoomPreviewItem.kt b/vector/src/main/java/im/vector/app/core/epoxy/bottomsheet/BottomSheetRoomPreviewItem.kt index 44e8f32cfd..c4e48335b6 100644 --- a/vector/src/main/java/im/vector/app/core/epoxy/bottomsheet/BottomSheetRoomPreviewItem.kt +++ b/vector/src/main/java/im/vector/app/core/epoxy/bottomsheet/BottomSheetRoomPreviewItem.kt @@ -39,8 +39,8 @@ import org.matrix.android.sdk.api.util.MatrixItem /** * A room preview for bottom sheet. */ -@EpoxyModelClass(layout = R.layout.item_bottom_sheet_room_preview) -abstract class BottomSheetRoomPreviewItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class BottomSheetRoomPreviewItem : VectorEpoxyModel(R.layout.item_bottom_sheet_room_preview) { @EpoxyAttribute lateinit var avatarRenderer: AvatarRenderer @EpoxyAttribute lateinit var matrixItem: MatrixItem diff --git a/vector/src/main/java/im/vector/app/core/epoxy/bottomsheet/BottomSheetSendStateItem.kt b/vector/src/main/java/im/vector/app/core/epoxy/bottomsheet/BottomSheetSendStateItem.kt index aa134ac7c4..4b3073f8f2 100644 --- a/vector/src/main/java/im/vector/app/core/epoxy/bottomsheet/BottomSheetSendStateItem.kt +++ b/vector/src/main/java/im/vector/app/core/epoxy/bottomsheet/BottomSheetSendStateItem.kt @@ -29,8 +29,8 @@ import im.vector.app.core.epoxy.VectorEpoxyModel /** * A send state for bottom sheet. */ -@EpoxyModelClass(layout = R.layout.item_bottom_sheet_message_status) -abstract class BottomSheetSendStateItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class BottomSheetSendStateItem : VectorEpoxyModel(R.layout.item_bottom_sheet_message_status) { @EpoxyAttribute var showProgress: Boolean = false diff --git a/vector/src/main/java/im/vector/app/core/epoxy/profiles/BaseProfileMatrixItem.kt b/vector/src/main/java/im/vector/app/core/epoxy/profiles/BaseProfileMatrixItem.kt index 956e1de92c..9c5ad49339 100644 --- a/vector/src/main/java/im/vector/app/core/epoxy/profiles/BaseProfileMatrixItem.kt +++ b/vector/src/main/java/im/vector/app/core/epoxy/profiles/BaseProfileMatrixItem.kt @@ -17,6 +17,7 @@ package im.vector.app.core.epoxy.profiles import androidx.annotation.CallSuper +import androidx.annotation.LayoutRes import androidx.core.view.isVisible import com.airbnb.epoxy.EpoxyAttribute import im.vector.app.core.epoxy.ClickListener @@ -28,7 +29,7 @@ import im.vector.app.features.home.AvatarRenderer import org.matrix.android.sdk.api.session.crypto.model.RoomEncryptionTrustLevel import org.matrix.android.sdk.api.util.MatrixItem -abstract class BaseProfileMatrixItem : VectorEpoxyModel() { +abstract class BaseProfileMatrixItem(@LayoutRes layoutId: Int) : VectorEpoxyModel(layoutId) { @EpoxyAttribute lateinit var avatarRenderer: AvatarRenderer @EpoxyAttribute lateinit var matrixItem: MatrixItem @EpoxyAttribute var editable: Boolean = true diff --git a/vector/src/main/java/im/vector/app/core/epoxy/profiles/ProfileActionItem.kt b/vector/src/main/java/im/vector/app/core/epoxy/profiles/ProfileActionItem.kt index 33e5172146..12e83ea80d 100644 --- a/vector/src/main/java/im/vector/app/core/epoxy/profiles/ProfileActionItem.kt +++ b/vector/src/main/java/im/vector/app/core/epoxy/profiles/ProfileActionItem.kt @@ -33,8 +33,8 @@ import im.vector.app.features.home.AvatarRenderer import im.vector.app.features.themes.ThemeUtils import org.matrix.android.sdk.api.util.MatrixItem -@EpoxyModelClass(layout = R.layout.item_profile_action) -abstract class ProfileActionItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class ProfileActionItem : VectorEpoxyModel(R.layout.item_profile_action) { @EpoxyAttribute lateinit var title: String diff --git a/vector/src/main/java/im/vector/app/core/epoxy/profiles/ProfileMatrixItem.kt b/vector/src/main/java/im/vector/app/core/epoxy/profiles/ProfileMatrixItem.kt index 90e81ceb26..7e89db24fa 100644 --- a/vector/src/main/java/im/vector/app/core/epoxy/profiles/ProfileMatrixItem.kt +++ b/vector/src/main/java/im/vector/app/core/epoxy/profiles/ProfileMatrixItem.kt @@ -26,8 +26,8 @@ import im.vector.app.core.epoxy.VectorEpoxyHolder import im.vector.app.core.ui.views.PresenceStateImageView import im.vector.app.core.ui.views.ShieldImageView -@EpoxyModelClass(layout = R.layout.item_profile_matrix_item) -abstract class ProfileMatrixItem : BaseProfileMatrixItem() { +@EpoxyModelClass +abstract class ProfileMatrixItem : BaseProfileMatrixItem(R.layout.item_profile_matrix_item) { open class Holder : VectorEpoxyHolder() { val titleView by bind(R.id.matrixItemTitle) diff --git a/vector/src/main/java/im/vector/app/core/epoxy/profiles/ProfileMatrixItemWithPowerLevel.kt b/vector/src/main/java/im/vector/app/core/epoxy/profiles/ProfileMatrixItemWithPowerLevel.kt index 453f402496..baf4605f04 100644 --- a/vector/src/main/java/im/vector/app/core/epoxy/profiles/ProfileMatrixItemWithPowerLevel.kt +++ b/vector/src/main/java/im/vector/app/core/epoxy/profiles/ProfileMatrixItemWithPowerLevel.kt @@ -20,10 +20,9 @@ package im.vector.app.core.epoxy.profiles import androidx.core.view.isVisible import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass -import im.vector.app.R import im.vector.app.core.extensions.setTextOrHide -@EpoxyModelClass(layout = R.layout.item_profile_matrix_item) +@EpoxyModelClass abstract class ProfileMatrixItemWithPowerLevel : ProfileMatrixItem() { @EpoxyAttribute var ignoredUser: Boolean = false diff --git a/vector/src/main/java/im/vector/app/core/epoxy/profiles/ProfileMatrixItemWithPowerLevelWithPresence.kt b/vector/src/main/java/im/vector/app/core/epoxy/profiles/ProfileMatrixItemWithPowerLevelWithPresence.kt index 923fa80b55..cdb9791c56 100644 --- a/vector/src/main/java/im/vector/app/core/epoxy/profiles/ProfileMatrixItemWithPowerLevelWithPresence.kt +++ b/vector/src/main/java/im/vector/app/core/epoxy/profiles/ProfileMatrixItemWithPowerLevelWithPresence.kt @@ -19,10 +19,9 @@ package im.vector.app.core.epoxy.profiles import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass -import im.vector.app.R import org.matrix.android.sdk.api.session.presence.model.UserPresence -@EpoxyModelClass(layout = R.layout.item_profile_matrix_item) +@EpoxyModelClass abstract class ProfileMatrixItemWithPowerLevelWithPresence : ProfileMatrixItemWithPowerLevel() { @EpoxyAttribute var showPresence: Boolean = true diff --git a/vector/src/main/java/im/vector/app/core/epoxy/profiles/ProfileMatrixItemWithProgress.kt b/vector/src/main/java/im/vector/app/core/epoxy/profiles/ProfileMatrixItemWithProgress.kt index 4966032dde..1b0274b32d 100644 --- a/vector/src/main/java/im/vector/app/core/epoxy/profiles/ProfileMatrixItemWithProgress.kt +++ b/vector/src/main/java/im/vector/app/core/epoxy/profiles/ProfileMatrixItemWithProgress.kt @@ -23,8 +23,8 @@ import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass import im.vector.app.R -@EpoxyModelClass(layout = R.layout.item_profile_matrix_item_progress) -abstract class ProfileMatrixItemWithProgress : BaseProfileMatrixItem() { +@EpoxyModelClass +abstract class ProfileMatrixItemWithProgress : BaseProfileMatrixItem(R.layout.item_profile_matrix_item_progress) { @EpoxyAttribute var inProgress: Boolean = true diff --git a/vector/src/main/java/im/vector/app/core/epoxy/profiles/ProfileSectionItem.kt b/vector/src/main/java/im/vector/app/core/epoxy/profiles/ProfileSectionItem.kt index b38342c057..f607537d54 100644 --- a/vector/src/main/java/im/vector/app/core/epoxy/profiles/ProfileSectionItem.kt +++ b/vector/src/main/java/im/vector/app/core/epoxy/profiles/ProfileSectionItem.kt @@ -23,8 +23,8 @@ import im.vector.app.R import im.vector.app.core.epoxy.VectorEpoxyHolder import im.vector.app.core.epoxy.VectorEpoxyModel -@EpoxyModelClass(layout = R.layout.item_profile_section) -abstract class ProfileSectionItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class ProfileSectionItem : VectorEpoxyModel(R.layout.item_profile_section) { @EpoxyAttribute lateinit var title: String diff --git a/vector/src/main/java/im/vector/app/core/epoxy/profiles/notifications/NotificationSettingsFooterItem.kt b/vector/src/main/java/im/vector/app/core/epoxy/profiles/notifications/NotificationSettingsFooterItem.kt index 4608f2b1ce..203a10a6fe 100644 --- a/vector/src/main/java/im/vector/app/core/epoxy/profiles/notifications/NotificationSettingsFooterItem.kt +++ b/vector/src/main/java/im/vector/app/core/epoxy/profiles/notifications/NotificationSettingsFooterItem.kt @@ -25,8 +25,8 @@ import im.vector.app.core.epoxy.VectorEpoxyHolder import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.extensions.setTextWithColoredPart -@EpoxyModelClass(layout = R.layout.item_notifications_footer) -abstract class NotificationSettingsFooterItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class NotificationSettingsFooterItem : VectorEpoxyModel(R.layout.item_notifications_footer) { @EpoxyAttribute var encrypted: Boolean = false diff --git a/vector/src/main/java/im/vector/app/core/epoxy/profiles/notifications/RadioButtonItem.kt b/vector/src/main/java/im/vector/app/core/epoxy/profiles/notifications/RadioButtonItem.kt index 128d34a6b0..b07ce5af4c 100644 --- a/vector/src/main/java/im/vector/app/core/epoxy/profiles/notifications/RadioButtonItem.kt +++ b/vector/src/main/java/im/vector/app/core/epoxy/profiles/notifications/RadioButtonItem.kt @@ -29,8 +29,8 @@ import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.epoxy.onClick import im.vector.app.core.extensions.setAttributeTintedImageResource -@EpoxyModelClass(layout = R.layout.item_radio) -abstract class RadioButtonItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class RadioButtonItem : VectorEpoxyModel(R.layout.item_radio) { @EpoxyAttribute var title: String? = null diff --git a/vector/src/main/java/im/vector/app/core/epoxy/profiles/notifications/TextHeaderItem.kt b/vector/src/main/java/im/vector/app/core/epoxy/profiles/notifications/TextHeaderItem.kt index 2dfe7be2e6..3302d02425 100644 --- a/vector/src/main/java/im/vector/app/core/epoxy/profiles/notifications/TextHeaderItem.kt +++ b/vector/src/main/java/im/vector/app/core/epoxy/profiles/notifications/TextHeaderItem.kt @@ -24,8 +24,8 @@ import im.vector.app.R import im.vector.app.core.epoxy.VectorEpoxyHolder import im.vector.app.core.epoxy.VectorEpoxyModel -@EpoxyModelClass(layout = R.layout.item_text_header) -abstract class TextHeaderItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class TextHeaderItem : VectorEpoxyModel(R.layout.item_text_header) { @EpoxyAttribute var text: String? = null diff --git a/vector/src/main/java/im/vector/app/core/extensions/TextInputLayout.kt b/vector/src/main/java/im/vector/app/core/extensions/TextInputLayout.kt index 41016365c0..40019c5d64 100644 --- a/vector/src/main/java/im/vector/app/core/extensions/TextInputLayout.kt +++ b/vector/src/main/java/im/vector/app/core/extensions/TextInputLayout.kt @@ -19,9 +19,13 @@ package im.vector.app.core.extensions import android.text.Editable import android.view.View import android.view.inputmethod.EditorInfo +import androidx.lifecycle.LifecycleOwner +import androidx.lifecycle.lifecycleScope import com.google.android.material.textfield.TextInputLayout import im.vector.app.core.platform.SimpleTextWatcher +import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.map +import kotlinx.coroutines.flow.onEach import reactivecircus.flowbinding.android.widget.textChanges fun TextInputLayout.editText() = this.editText!! @@ -37,11 +41,18 @@ fun TextInputLayout.content() = editText().text.toString() fun TextInputLayout.hasContent() = !editText().text.isNullOrEmpty() -fun TextInputLayout.associateContentStateWith(button: View) { +fun TextInputLayout.clearErrorOnChange(lifecycleOwner: LifecycleOwner) { + editText().textChanges() + .onEach { error = null } + .launchIn(lifecycleOwner.lifecycleScope) +} + +fun TextInputLayout.associateContentStateWith(button: View, enabledPredicate: (String) -> Boolean = { it.isNotEmpty() }) { + button.isEnabled = enabledPredicate(content()) editText().addTextChangedListener(object : SimpleTextWatcher() { override fun afterTextChanged(s: Editable) { val newContent = s.toString() - button.isEnabled = newContent.isNotEmpty() + button.isEnabled = enabledPredicate(newContent) } }) } diff --git a/vector/src/main/java/im/vector/app/core/ui/bottomsheet/BottomSheetTitleItem.kt b/vector/src/main/java/im/vector/app/core/ui/bottomsheet/BottomSheetTitleItem.kt index 27fb634480..bd1a2baac2 100644 --- a/vector/src/main/java/im/vector/app/core/ui/bottomsheet/BottomSheetTitleItem.kt +++ b/vector/src/main/java/im/vector/app/core/ui/bottomsheet/BottomSheetTitleItem.kt @@ -27,8 +27,8 @@ import im.vector.app.core.extensions.setTextOrHide /** * A title for bottom sheet, with an optional subtitle. It does not include the bottom separator. */ -@EpoxyModelClass(layout = R.layout.item_bottom_sheet_title) -abstract class BottomSheetTitleItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class BottomSheetTitleItem : VectorEpoxyModel(R.layout.item_bottom_sheet_title) { @EpoxyAttribute lateinit var title: String diff --git a/vector/src/main/java/im/vector/app/core/ui/list/ButtonPositiveDestructiveButtonBarItem.kt b/vector/src/main/java/im/vector/app/core/ui/list/ButtonPositiveDestructiveButtonBarItem.kt index 95c1a4457d..254458fcdc 100644 --- a/vector/src/main/java/im/vector/app/core/ui/list/ButtonPositiveDestructiveButtonBarItem.kt +++ b/vector/src/main/java/im/vector/app/core/ui/list/ButtonPositiveDestructiveButtonBarItem.kt @@ -28,8 +28,10 @@ import im.vector.lib.core.utils.epoxy.charsequence.EpoxyCharSequence /** * A generic button list item. */ -@EpoxyModelClass(layout = R.layout.item_positive_destrutive_buttons) -abstract class ButtonPositiveDestructiveButtonBarItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class ButtonPositiveDestructiveButtonBarItem : VectorEpoxyModel( + R.layout.item_positive_destrutive_buttons +) { @EpoxyAttribute var positiveText: EpoxyCharSequence? = null diff --git a/vector/src/main/java/im/vector/app/core/ui/list/GenericButtonItem.kt b/vector/src/main/java/im/vector/app/core/ui/list/GenericButtonItem.kt index d4838289a6..a3b6b40616 100644 --- a/vector/src/main/java/im/vector/app/core/ui/list/GenericButtonItem.kt +++ b/vector/src/main/java/im/vector/app/core/ui/list/GenericButtonItem.kt @@ -33,8 +33,8 @@ import im.vector.app.features.themes.ThemeUtils /** * A generic button list item. */ -@EpoxyModelClass(layout = R.layout.item_generic_button) -abstract class GenericButtonItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class GenericButtonItem : VectorEpoxyModel(R.layout.item_generic_button) { @EpoxyAttribute var text: String? = null diff --git a/vector/src/main/java/im/vector/app/core/ui/list/GenericEmptyWithActionItem.kt b/vector/src/main/java/im/vector/app/core/ui/list/GenericEmptyWithActionItem.kt index 4cc39af0a5..8ae45d3af1 100644 --- a/vector/src/main/java/im/vector/app/core/ui/list/GenericEmptyWithActionItem.kt +++ b/vector/src/main/java/im/vector/app/core/ui/list/GenericEmptyWithActionItem.kt @@ -35,8 +35,8 @@ import im.vector.app.core.extensions.setTextOrHide /** * A generic list item to display when there is no results, with an optional CTA. */ -@EpoxyModelClass(layout = R.layout.item_generic_empty_state) -abstract class GenericEmptyWithActionItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class GenericEmptyWithActionItem : VectorEpoxyModel(R.layout.item_generic_empty_state) { @EpoxyAttribute var title: String? = null diff --git a/vector/src/main/java/im/vector/app/core/ui/list/GenericFooterItem.kt b/vector/src/main/java/im/vector/app/core/ui/list/GenericFooterItem.kt index 6d7763cd48..a41ea0153c 100644 --- a/vector/src/main/java/im/vector/app/core/ui/list/GenericFooterItem.kt +++ b/vector/src/main/java/im/vector/app/core/ui/list/GenericFooterItem.kt @@ -35,8 +35,8 @@ import im.vector.lib.core.utils.epoxy.charsequence.EpoxyCharSequence * Can display an accessory on the right, that can be an image or an indeterminate progress. * If provided with an action, will display a button at the bottom of the list item. */ -@EpoxyModelClass(layout = R.layout.item_generic_footer) -abstract class GenericFooterItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class GenericFooterItem : VectorEpoxyModel(R.layout.item_generic_footer) { @EpoxyAttribute var text: EpoxyCharSequence? = null diff --git a/vector/src/main/java/im/vector/app/core/ui/list/GenericHeaderItem.kt b/vector/src/main/java/im/vector/app/core/ui/list/GenericHeaderItem.kt index b4b0211b91..2123b4c639 100644 --- a/vector/src/main/java/im/vector/app/core/ui/list/GenericHeaderItem.kt +++ b/vector/src/main/java/im/vector/app/core/ui/list/GenericHeaderItem.kt @@ -28,8 +28,8 @@ import im.vector.app.features.themes.ThemeUtils /** * A generic list item header left aligned with notice color. */ -@EpoxyModelClass(layout = R.layout.item_generic_header) -abstract class GenericHeaderItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class GenericHeaderItem : VectorEpoxyModel(R.layout.item_generic_header) { @EpoxyAttribute var text: String? = null diff --git a/vector/src/main/java/im/vector/app/core/ui/list/GenericItem.kt b/vector/src/main/java/im/vector/app/core/ui/list/GenericItem.kt index 7b00001e4c..e9c4ebe0ee 100644 --- a/vector/src/main/java/im/vector/app/core/ui/list/GenericItem.kt +++ b/vector/src/main/java/im/vector/app/core/ui/list/GenericItem.kt @@ -38,8 +38,8 @@ import im.vector.lib.core.utils.epoxy.charsequence.EpoxyCharSequence * Can display an accessory on the right, that can be an image or an indeterminate progress. * If provided with an action, will display a button at the bottom of the list item. */ -@EpoxyModelClass(layout = R.layout.item_generic_list) -abstract class GenericItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class GenericItem : VectorEpoxyModel(R.layout.item_generic_list) { @EpoxyAttribute var title: EpoxyCharSequence? = null diff --git a/vector/src/main/java/im/vector/app/core/ui/list/GenericLoaderItem.kt b/vector/src/main/java/im/vector/app/core/ui/list/GenericLoaderItem.kt index b458f10680..2077346442 100644 --- a/vector/src/main/java/im/vector/app/core/ui/list/GenericLoaderItem.kt +++ b/vector/src/main/java/im/vector/app/core/ui/list/GenericLoaderItem.kt @@ -24,8 +24,8 @@ import im.vector.app.core.epoxy.VectorEpoxyModel /** * A generic list item header left aligned with notice color. */ -@EpoxyModelClass(layout = R.layout.item_generic_loader) -abstract class GenericLoaderItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class GenericLoaderItem : VectorEpoxyModel(R.layout.item_generic_loader) { // Maybe/Later add some style configuration, SMALL/BIG ? diff --git a/vector/src/main/java/im/vector/app/core/ui/list/GenericPillItem.kt b/vector/src/main/java/im/vector/app/core/ui/list/GenericPillItem.kt index a51c1b70ed..2a321ac4b0 100644 --- a/vector/src/main/java/im/vector/app/core/ui/list/GenericPillItem.kt +++ b/vector/src/main/java/im/vector/app/core/ui/list/GenericPillItem.kt @@ -36,8 +36,8 @@ import im.vector.lib.core.utils.epoxy.charsequence.EpoxyCharSequence /** * A generic list item with a rounded corner background and an optional icon. */ -@EpoxyModelClass(layout = R.layout.item_generic_pill_footer) -abstract class GenericPillItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class GenericPillItem : VectorEpoxyModel(R.layout.item_generic_pill_footer) { @EpoxyAttribute var text: EpoxyCharSequence? = null diff --git a/vector/src/main/java/im/vector/app/core/ui/list/GenericPositiveButtonItem.kt b/vector/src/main/java/im/vector/app/core/ui/list/GenericPositiveButtonItem.kt index 753b085d99..948f9036a7 100644 --- a/vector/src/main/java/im/vector/app/core/ui/list/GenericPositiveButtonItem.kt +++ b/vector/src/main/java/im/vector/app/core/ui/list/GenericPositiveButtonItem.kt @@ -29,8 +29,8 @@ import im.vector.app.core.epoxy.onClick /** * A generic button list item. */ -@EpoxyModelClass(layout = R.layout.item_positive_button) -abstract class GenericPositiveButtonItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class GenericPositiveButtonItem : VectorEpoxyModel(R.layout.item_positive_button) { @EpoxyAttribute var text: String? = null diff --git a/vector/src/main/java/im/vector/app/core/ui/list/GenericProgressBarItem.kt b/vector/src/main/java/im/vector/app/core/ui/list/GenericProgressBarItem.kt index e392c0bdf2..8d2e55d198 100644 --- a/vector/src/main/java/im/vector/app/core/ui/list/GenericProgressBarItem.kt +++ b/vector/src/main/java/im/vector/app/core/ui/list/GenericProgressBarItem.kt @@ -25,8 +25,8 @@ import im.vector.app.core.epoxy.VectorEpoxyModel /** * A generic progress bar item. */ -@EpoxyModelClass(layout = R.layout.item_generic_progress) -abstract class GenericProgressBarItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class GenericProgressBarItem : VectorEpoxyModel(R.layout.item_generic_progress) { @EpoxyAttribute var progress: Int = 0 diff --git a/vector/src/main/java/im/vector/app/core/ui/list/GenericWithValueItem.kt b/vector/src/main/java/im/vector/app/core/ui/list/GenericWithValueItem.kt index e633b633a7..8b82bf4684 100644 --- a/vector/src/main/java/im/vector/app/core/ui/list/GenericWithValueItem.kt +++ b/vector/src/main/java/im/vector/app/core/ui/list/GenericWithValueItem.kt @@ -38,8 +38,8 @@ import im.vector.lib.core.utils.epoxy.charsequence.EpoxyCharSequence * Can display an accessory on the right, that can be an image or an indeterminate progress. * If provided with an action, will display a button at the bottom of the list item. */ -@EpoxyModelClass(layout = R.layout.item_generic_with_value) -abstract class GenericWithValueItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class GenericWithValueItem : VectorEpoxyModel(R.layout.item_generic_with_value) { @EpoxyAttribute var title: EpoxyCharSequence? = null diff --git a/vector/src/main/java/im/vector/app/core/ui/list/VerticalMarginItem.kt b/vector/src/main/java/im/vector/app/core/ui/list/VerticalMarginItem.kt index ec99c7c215..ffb152ecff 100644 --- a/vector/src/main/java/im/vector/app/core/ui/list/VerticalMarginItem.kt +++ b/vector/src/main/java/im/vector/app/core/ui/list/VerticalMarginItem.kt @@ -26,8 +26,8 @@ import im.vector.app.core.epoxy.VectorEpoxyModel /** * A generic item with empty space. */ -@EpoxyModelClass(layout = R.layout.item_vertical_margin) -abstract class VerticalMarginItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class VerticalMarginItem : VectorEpoxyModel(R.layout.item_vertical_margin) { @EpoxyAttribute var heightInPx: Int = 0 diff --git a/vector/src/main/java/im/vector/app/core/utils/ExternalApplicationsUtil.kt b/vector/src/main/java/im/vector/app/core/utils/ExternalApplicationsUtil.kt index 68fe488391..3a8ffac543 100644 --- a/vector/src/main/java/im/vector/app/core/utils/ExternalApplicationsUtil.kt +++ b/vector/src/main/java/im/vector/app/core/utils/ExternalApplicationsUtil.kt @@ -76,6 +76,8 @@ fun openUrlInExternalBrowser(context: Context, url: String?) { fun openUrlInExternalBrowser(context: Context, uri: Uri?) { uri?.let { val browserIntent = Intent(Intent.ACTION_VIEW, it).apply { + // Open activity on browser task and not on element task + flags = Intent.FLAG_ACTIVITY_NEW_TASK putExtra(Browser.EXTRA_APPLICATION_ID, context.packageName) putExtra(Browser.EXTRA_CREATE_NEW_TAB, true) } diff --git a/vector/src/main/java/im/vector/app/features/attachments/preview/AttachmentPreviewItems.kt b/vector/src/main/java/im/vector/app/features/attachments/preview/AttachmentPreviewItems.kt index ae18d2561d..0298b2da17 100644 --- a/vector/src/main/java/im/vector/app/features/attachments/preview/AttachmentPreviewItems.kt +++ b/vector/src/main/java/im/vector/app/features/attachments/preview/AttachmentPreviewItems.kt @@ -18,6 +18,7 @@ package im.vector.app.features.attachments.preview import android.view.View import android.widget.ImageView +import androidx.annotation.LayoutRes import androidx.core.view.isVisible import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass @@ -29,7 +30,7 @@ import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.platform.CheckableImageView import org.matrix.android.sdk.api.session.content.ContentAttachmentData -abstract class AttachmentPreviewItem : VectorEpoxyModel() { +abstract class AttachmentPreviewItem(@LayoutRes layoutId: Int) : VectorEpoxyModel(layoutId) { abstract val attachment: ContentAttachmentData @@ -52,8 +53,8 @@ abstract class AttachmentPreviewItem : VectorE } } -@EpoxyModelClass(layout = R.layout.item_attachment_miniature_preview) -abstract class AttachmentMiniaturePreviewItem : AttachmentPreviewItem() { +@EpoxyModelClass +abstract class AttachmentMiniaturePreviewItem : AttachmentPreviewItem(R.layout.item_attachment_miniature_preview) { @EpoxyAttribute override lateinit var attachment: ContentAttachmentData @@ -78,8 +79,8 @@ abstract class AttachmentMiniaturePreviewItem : AttachmentPreviewItem() { +@EpoxyModelClass +abstract class AttachmentBigPreviewItem : AttachmentPreviewItem(R.layout.item_attachment_big_preview) { @EpoxyAttribute override lateinit var attachment: ContentAttachmentData diff --git a/vector/src/main/java/im/vector/app/features/autocomplete/AutocompleteHeaderItem.kt b/vector/src/main/java/im/vector/app/features/autocomplete/AutocompleteHeaderItem.kt index f287104415..0f40ef761d 100644 --- a/vector/src/main/java/im/vector/app/features/autocomplete/AutocompleteHeaderItem.kt +++ b/vector/src/main/java/im/vector/app/features/autocomplete/AutocompleteHeaderItem.kt @@ -23,8 +23,8 @@ import im.vector.app.R import im.vector.app.core.epoxy.VectorEpoxyHolder import im.vector.app.core.epoxy.VectorEpoxyModel -@EpoxyModelClass(layout = R.layout.item_autocomplete_header_item) -abstract class AutocompleteHeaderItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class AutocompleteHeaderItem : VectorEpoxyModel(R.layout.item_autocomplete_header_item) { @EpoxyAttribute var title: String? = null diff --git a/vector/src/main/java/im/vector/app/features/autocomplete/AutocompleteMatrixItem.kt b/vector/src/main/java/im/vector/app/features/autocomplete/AutocompleteMatrixItem.kt index dba2661927..68668bcc6a 100644 --- a/vector/src/main/java/im/vector/app/features/autocomplete/AutocompleteMatrixItem.kt +++ b/vector/src/main/java/im/vector/app/features/autocomplete/AutocompleteMatrixItem.kt @@ -30,8 +30,8 @@ import im.vector.app.features.displayname.getBestName import im.vector.app.features.home.AvatarRenderer import org.matrix.android.sdk.api.util.MatrixItem -@EpoxyModelClass(layout = R.layout.item_autocomplete_matrix_item) -abstract class AutocompleteMatrixItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class AutocompleteMatrixItem : VectorEpoxyModel(R.layout.item_autocomplete_matrix_item) { @EpoxyAttribute lateinit var avatarRenderer: AvatarRenderer @EpoxyAttribute lateinit var matrixItem: MatrixItem diff --git a/vector/src/main/java/im/vector/app/features/autocomplete/command/AutocompleteCommandItem.kt b/vector/src/main/java/im/vector/app/features/autocomplete/command/AutocompleteCommandItem.kt index 2bd0cffbe6..78cf24f114 100644 --- a/vector/src/main/java/im/vector/app/features/autocomplete/command/AutocompleteCommandItem.kt +++ b/vector/src/main/java/im/vector/app/features/autocomplete/command/AutocompleteCommandItem.kt @@ -25,8 +25,8 @@ import im.vector.app.core.epoxy.VectorEpoxyHolder import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.epoxy.onClick -@EpoxyModelClass(layout = R.layout.item_autocomplete_command) -abstract class AutocompleteCommandItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class AutocompleteCommandItem : VectorEpoxyModel(R.layout.item_autocomplete_command) { @EpoxyAttribute var name: String? = null diff --git a/vector/src/main/java/im/vector/app/features/autocomplete/emoji/AutocompleteEmojiItem.kt b/vector/src/main/java/im/vector/app/features/autocomplete/emoji/AutocompleteEmojiItem.kt index 6c18eb1c52..da881467a2 100644 --- a/vector/src/main/java/im/vector/app/features/autocomplete/emoji/AutocompleteEmojiItem.kt +++ b/vector/src/main/java/im/vector/app/features/autocomplete/emoji/AutocompleteEmojiItem.kt @@ -28,8 +28,8 @@ import im.vector.app.core.epoxy.onClick import im.vector.app.core.extensions.setTextOrHide import im.vector.app.features.reactions.data.EmojiItem -@EpoxyModelClass(layout = R.layout.item_autocomplete_emoji) -abstract class AutocompleteEmojiItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class AutocompleteEmojiItem : VectorEpoxyModel(R.layout.item_autocomplete_emoji) { @EpoxyAttribute lateinit var emojiItem: EmojiItem diff --git a/vector/src/main/java/im/vector/app/features/autocomplete/emoji/AutocompleteMoreResultItem.kt b/vector/src/main/java/im/vector/app/features/autocomplete/emoji/AutocompleteMoreResultItem.kt index 6925b15c9a..be7bd1adc2 100644 --- a/vector/src/main/java/im/vector/app/features/autocomplete/emoji/AutocompleteMoreResultItem.kt +++ b/vector/src/main/java/im/vector/app/features/autocomplete/emoji/AutocompleteMoreResultItem.kt @@ -21,8 +21,8 @@ import im.vector.app.R import im.vector.app.core.epoxy.VectorEpoxyHolder import im.vector.app.core.epoxy.VectorEpoxyModel -@EpoxyModelClass(layout = R.layout.item_autocomplete_more_result) -abstract class AutocompleteMoreResultItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class AutocompleteMoreResultItem : VectorEpoxyModel(R.layout.item_autocomplete_more_result) { class Holder : VectorEpoxyHolder() } diff --git a/vector/src/main/java/im/vector/app/features/contactsbook/ContactDetailItem.kt b/vector/src/main/java/im/vector/app/features/contactsbook/ContactDetailItem.kt index fbf404b74d..434c2f5c44 100644 --- a/vector/src/main/java/im/vector/app/features/contactsbook/ContactDetailItem.kt +++ b/vector/src/main/java/im/vector/app/features/contactsbook/ContactDetailItem.kt @@ -26,8 +26,8 @@ import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.epoxy.onClick import im.vector.app.core.extensions.setTextOrHide -@EpoxyModelClass(layout = R.layout.item_contact_detail) -abstract class ContactDetailItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class ContactDetailItem : VectorEpoxyModel(R.layout.item_contact_detail) { @EpoxyAttribute lateinit var threePid: String @EpoxyAttribute var matrixId: String? = null diff --git a/vector/src/main/java/im/vector/app/features/contactsbook/ContactItem.kt b/vector/src/main/java/im/vector/app/features/contactsbook/ContactItem.kt index fd112f0948..cd5322c4f8 100644 --- a/vector/src/main/java/im/vector/app/features/contactsbook/ContactItem.kt +++ b/vector/src/main/java/im/vector/app/features/contactsbook/ContactItem.kt @@ -26,8 +26,8 @@ import im.vector.app.core.epoxy.VectorEpoxyHolder import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.features.home.AvatarRenderer -@EpoxyModelClass(layout = R.layout.item_contact_main) -abstract class ContactItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class ContactItem : VectorEpoxyModel(R.layout.item_contact_main) { @EpoxyAttribute lateinit var avatarRenderer: AvatarRenderer @EpoxyAttribute lateinit var mappedContact: MappedContact diff --git a/vector/src/main/java/im/vector/app/features/crypto/keysbackup/settings/KeysBackupSettingFooterItem.kt b/vector/src/main/java/im/vector/app/features/crypto/keysbackup/settings/KeysBackupSettingFooterItem.kt index 69551cac93..cbca0c99eb 100644 --- a/vector/src/main/java/im/vector/app/features/crypto/keysbackup/settings/KeysBackupSettingFooterItem.kt +++ b/vector/src/main/java/im/vector/app/features/crypto/keysbackup/settings/KeysBackupSettingFooterItem.kt @@ -27,8 +27,8 @@ import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.epoxy.onClick import im.vector.app.core.extensions.setTextOrHide -@EpoxyModelClass(layout = R.layout.item_keys_backup_settings_button_footer) -abstract class KeysBackupSettingFooterItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class KeysBackupSettingFooterItem : VectorEpoxyModel(R.layout.item_keys_backup_settings_button_footer) { @EpoxyAttribute var textButton1: String? = null diff --git a/vector/src/main/java/im/vector/app/features/crypto/verification/epoxy/BottomSheetSelfWaitItem.kt b/vector/src/main/java/im/vector/app/features/crypto/verification/epoxy/BottomSheetSelfWaitItem.kt index 205dd6a10a..1f4a9f254b 100644 --- a/vector/src/main/java/im/vector/app/features/crypto/verification/epoxy/BottomSheetSelfWaitItem.kt +++ b/vector/src/main/java/im/vector/app/features/crypto/verification/epoxy/BottomSheetSelfWaitItem.kt @@ -24,7 +24,7 @@ import im.vector.app.core.epoxy.VectorEpoxyModel /** * A action for bottom sheet. */ -@EpoxyModelClass(layout = R.layout.item_verification_wait) -abstract class BottomSheetSelfWaitItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class BottomSheetSelfWaitItem : VectorEpoxyModel(R.layout.item_verification_wait) { class Holder : VectorEpoxyHolder() } diff --git a/vector/src/main/java/im/vector/app/features/crypto/verification/epoxy/BottomSheetVerificationActionItem.kt b/vector/src/main/java/im/vector/app/features/crypto/verification/epoxy/BottomSheetVerificationActionItem.kt index 7dc7a31441..7a0d5ce69d 100644 --- a/vector/src/main/java/im/vector/app/features/crypto/verification/epoxy/BottomSheetVerificationActionItem.kt +++ b/vector/src/main/java/im/vector/app/features/crypto/verification/epoxy/BottomSheetVerificationActionItem.kt @@ -34,8 +34,8 @@ import im.vector.app.core.extensions.setTextOrHide /** * A action for bottom sheet. */ -@EpoxyModelClass(layout = R.layout.item_verification_action) -abstract class BottomSheetVerificationActionItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class BottomSheetVerificationActionItem : VectorEpoxyModel(R.layout.item_verification_action) { @EpoxyAttribute @DrawableRes diff --git a/vector/src/main/java/im/vector/app/features/crypto/verification/epoxy/BottomSheetVerificationBigImageItem.kt b/vector/src/main/java/im/vector/app/features/crypto/verification/epoxy/BottomSheetVerificationBigImageItem.kt index adf3e8f7e5..2fd88f7bca 100644 --- a/vector/src/main/java/im/vector/app/features/crypto/verification/epoxy/BottomSheetVerificationBigImageItem.kt +++ b/vector/src/main/java/im/vector/app/features/crypto/verification/epoxy/BottomSheetVerificationBigImageItem.kt @@ -27,8 +27,8 @@ import org.matrix.android.sdk.api.session.crypto.model.RoomEncryptionTrustLevel /** * A action for bottom sheet. */ -@EpoxyModelClass(layout = R.layout.item_verification_big_image) -abstract class BottomSheetVerificationBigImageItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class BottomSheetVerificationBigImageItem : VectorEpoxyModel(R.layout.item_verification_big_image) { @EpoxyAttribute lateinit var roomEncryptionTrustLevel: RoomEncryptionTrustLevel diff --git a/vector/src/main/java/im/vector/app/features/crypto/verification/epoxy/BottomSheetVerificationDecimalCodeItem.kt b/vector/src/main/java/im/vector/app/features/crypto/verification/epoxy/BottomSheetVerificationDecimalCodeItem.kt index c8afc88769..052ad3b4bc 100644 --- a/vector/src/main/java/im/vector/app/features/crypto/verification/epoxy/BottomSheetVerificationDecimalCodeItem.kt +++ b/vector/src/main/java/im/vector/app/features/crypto/verification/epoxy/BottomSheetVerificationDecimalCodeItem.kt @@ -26,8 +26,10 @@ import im.vector.app.core.epoxy.VectorEpoxyModel /** * A action for bottom sheet. */ -@EpoxyModelClass(layout = R.layout.item_verification_decimal_code) -abstract class BottomSheetVerificationDecimalCodeItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class BottomSheetVerificationDecimalCodeItem : VectorEpoxyModel( + R.layout.item_verification_decimal_code +) { @EpoxyAttribute var code: String = "" diff --git a/vector/src/main/java/im/vector/app/features/crypto/verification/epoxy/BottomSheetVerificationEmojisItem.kt b/vector/src/main/java/im/vector/app/features/crypto/verification/epoxy/BottomSheetVerificationEmojisItem.kt index e1b703e0fc..b591e27296 100644 --- a/vector/src/main/java/im/vector/app/features/crypto/verification/epoxy/BottomSheetVerificationEmojisItem.kt +++ b/vector/src/main/java/im/vector/app/features/crypto/verification/epoxy/BottomSheetVerificationEmojisItem.kt @@ -34,8 +34,8 @@ import org.matrix.android.sdk.api.session.crypto.verification.EmojiRepresentatio /** * A emoji list for bottom sheet. */ -@EpoxyModelClass(layout = R.layout.item_verification_emojis) -abstract class BottomSheetVerificationEmojisItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class BottomSheetVerificationEmojisItem : VectorEpoxyModel(R.layout.item_verification_emojis) { @EpoxyAttribute lateinit var emojiRepresentation0: EmojiRepresentation @EpoxyAttribute lateinit var emojiRepresentation1: EmojiRepresentation diff --git a/vector/src/main/java/im/vector/app/features/crypto/verification/epoxy/BottomSheetVerificationNoticeItem.kt b/vector/src/main/java/im/vector/app/features/crypto/verification/epoxy/BottomSheetVerificationNoticeItem.kt index ecd9989cdc..07f04b8ee2 100644 --- a/vector/src/main/java/im/vector/app/features/crypto/verification/epoxy/BottomSheetVerificationNoticeItem.kt +++ b/vector/src/main/java/im/vector/app/features/crypto/verification/epoxy/BottomSheetVerificationNoticeItem.kt @@ -27,8 +27,8 @@ import im.vector.lib.core.utils.epoxy.charsequence.EpoxyCharSequence /** * A action for bottom sheet. */ -@EpoxyModelClass(layout = R.layout.item_verification_notice) -abstract class BottomSheetVerificationNoticeItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class BottomSheetVerificationNoticeItem : VectorEpoxyModel(R.layout.item_verification_notice) { @EpoxyAttribute lateinit var notice: EpoxyCharSequence diff --git a/vector/src/main/java/im/vector/app/features/crypto/verification/epoxy/BottomSheetVerificationQrCodeItem.kt b/vector/src/main/java/im/vector/app/features/crypto/verification/epoxy/BottomSheetVerificationQrCodeItem.kt index 0041631986..8f20160108 100644 --- a/vector/src/main/java/im/vector/app/features/crypto/verification/epoxy/BottomSheetVerificationQrCodeItem.kt +++ b/vector/src/main/java/im/vector/app/features/crypto/verification/epoxy/BottomSheetVerificationQrCodeItem.kt @@ -26,8 +26,8 @@ import im.vector.app.core.ui.views.QrCodeImageView /** * An Epoxy item displaying a QR code. */ -@EpoxyModelClass(layout = R.layout.item_verification_qr_code) -abstract class BottomSheetVerificationQrCodeItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class BottomSheetVerificationQrCodeItem : VectorEpoxyModel(R.layout.item_verification_qr_code) { @EpoxyAttribute lateinit var data: String diff --git a/vector/src/main/java/im/vector/app/features/crypto/verification/epoxy/BottomSheetVerificationWaitingItem.kt b/vector/src/main/java/im/vector/app/features/crypto/verification/epoxy/BottomSheetVerificationWaitingItem.kt index 46a1dd04a8..8c784cc7ac 100644 --- a/vector/src/main/java/im/vector/app/features/crypto/verification/epoxy/BottomSheetVerificationWaitingItem.kt +++ b/vector/src/main/java/im/vector/app/features/crypto/verification/epoxy/BottomSheetVerificationWaitingItem.kt @@ -26,8 +26,8 @@ import im.vector.app.core.epoxy.VectorEpoxyModel /** * A action for bottom sheet. */ -@EpoxyModelClass(layout = R.layout.item_verification_waiting) -abstract class BottomSheetVerificationWaitingItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class BottomSheetVerificationWaitingItem : VectorEpoxyModel(R.layout.item_verification_waiting) { @EpoxyAttribute var title: String = "" diff --git a/vector/src/main/java/im/vector/app/features/discovery/DiscoveryPolicyItem.kt b/vector/src/main/java/im/vector/app/features/discovery/DiscoveryPolicyItem.kt index 4df4146d2f..ef8c43aab4 100644 --- a/vector/src/main/java/im/vector/app/features/discovery/DiscoveryPolicyItem.kt +++ b/vector/src/main/java/im/vector/app/features/discovery/DiscoveryPolicyItem.kt @@ -19,15 +19,15 @@ package im.vector.app.features.discovery import android.widget.TextView import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass -import com.airbnb.epoxy.EpoxyModelWithHolder import im.vector.app.R import im.vector.app.core.epoxy.ClickListener import im.vector.app.core.epoxy.VectorEpoxyHolder +import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.epoxy.onClick import im.vector.app.core.extensions.setTextOrHide -@EpoxyModelClass(layout = R.layout.item_discovery_policy) -abstract class DiscoveryPolicyItem : EpoxyModelWithHolder() { +@EpoxyModelClass +abstract class DiscoveryPolicyItem : VectorEpoxyModel(R.layout.item_discovery_policy) { @EpoxyAttribute var name: String? = null diff --git a/vector/src/main/java/im/vector/app/features/discovery/SettingsButtonItem.kt b/vector/src/main/java/im/vector/app/features/discovery/SettingsButtonItem.kt index c025779339..da432c43b1 100644 --- a/vector/src/main/java/im/vector/app/features/discovery/SettingsButtonItem.kt +++ b/vector/src/main/java/im/vector/app/features/discovery/SettingsButtonItem.kt @@ -19,17 +19,17 @@ import android.widget.Button import androidx.annotation.StringRes import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass -import com.airbnb.epoxy.EpoxyModelWithHolder import im.vector.app.R import im.vector.app.core.epoxy.ClickListener import im.vector.app.core.epoxy.VectorEpoxyHolder +import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.epoxy.attributes.ButtonStyle import im.vector.app.core.epoxy.onClick import im.vector.app.core.extensions.setTextOrHide import im.vector.app.core.resources.ColorProvider -@EpoxyModelClass(layout = R.layout.item_settings_button) -abstract class SettingsButtonItem : EpoxyModelWithHolder() { +@EpoxyModelClass +abstract class SettingsButtonItem : VectorEpoxyModel(R.layout.item_settings_button) { @EpoxyAttribute lateinit var colorProvider: ColorProvider diff --git a/vector/src/main/java/im/vector/app/features/discovery/SettingsCenteredImageItem.kt b/vector/src/main/java/im/vector/app/features/discovery/SettingsCenteredImageItem.kt index af79dd8bb5..c8dd9fe304 100644 --- a/vector/src/main/java/im/vector/app/features/discovery/SettingsCenteredImageItem.kt +++ b/vector/src/main/java/im/vector/app/features/discovery/SettingsCenteredImageItem.kt @@ -19,12 +19,12 @@ import android.widget.ImageView import androidx.annotation.DrawableRes import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass -import com.airbnb.epoxy.EpoxyModelWithHolder import im.vector.app.R import im.vector.app.core.epoxy.VectorEpoxyHolder +import im.vector.app.core.epoxy.VectorEpoxyModel -@EpoxyModelClass(layout = R.layout.item_settings_centered_image) -abstract class SettingsCenteredImageItem : EpoxyModelWithHolder() { +@EpoxyModelClass +abstract class SettingsCenteredImageItem : VectorEpoxyModel(R.layout.item_settings_centered_image) { @EpoxyAttribute @DrawableRes diff --git a/vector/src/main/java/im/vector/app/features/discovery/SettingsContinueCancelItem.kt b/vector/src/main/java/im/vector/app/features/discovery/SettingsContinueCancelItem.kt index 1f19523202..cbb8794636 100644 --- a/vector/src/main/java/im/vector/app/features/discovery/SettingsContinueCancelItem.kt +++ b/vector/src/main/java/im/vector/app/features/discovery/SettingsContinueCancelItem.kt @@ -18,14 +18,14 @@ package im.vector.app.features.discovery import android.widget.Button import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass -import com.airbnb.epoxy.EpoxyModelWithHolder import im.vector.app.R import im.vector.app.core.epoxy.ClickListener import im.vector.app.core.epoxy.VectorEpoxyHolder +import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.epoxy.onClick -@EpoxyModelClass(layout = R.layout.item_settings_continue_cancel) -abstract class SettingsContinueCancelItem : EpoxyModelWithHolder() { +@EpoxyModelClass +abstract class SettingsContinueCancelItem : VectorEpoxyModel(R.layout.item_settings_continue_cancel) { @EpoxyAttribute var continueText: String? = null diff --git a/vector/src/main/java/im/vector/app/features/discovery/SettingsEditTextItem.kt b/vector/src/main/java/im/vector/app/features/discovery/SettingsEditTextItem.kt index ad139309ac..ea2e51da24 100644 --- a/vector/src/main/java/im/vector/app/features/discovery/SettingsEditTextItem.kt +++ b/vector/src/main/java/im/vector/app/features/discovery/SettingsEditTextItem.kt @@ -22,15 +22,15 @@ import android.widget.TextView import androidx.core.widget.doOnTextChanged import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass -import com.airbnb.epoxy.EpoxyModelWithHolder import com.google.android.material.textfield.TextInputLayout import im.vector.app.R import im.vector.app.core.epoxy.VectorEpoxyHolder +import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.extensions.setTextOrHide import im.vector.app.core.extensions.showKeyboard -@EpoxyModelClass(layout = R.layout.item_settings_edit_text) -abstract class SettingsEditTextItem : EpoxyModelWithHolder() { +@EpoxyModelClass +abstract class SettingsEditTextItem : VectorEpoxyModel(R.layout.item_settings_edit_text) { @EpoxyAttribute var hint: String? = null @EpoxyAttribute var value: String? = null diff --git a/vector/src/main/java/im/vector/app/features/discovery/SettingsInfoItem.kt b/vector/src/main/java/im/vector/app/features/discovery/SettingsInfoItem.kt index ea5f044274..b4b1a112ba 100644 --- a/vector/src/main/java/im/vector/app/features/discovery/SettingsInfoItem.kt +++ b/vector/src/main/java/im/vector/app/features/discovery/SettingsInfoItem.kt @@ -20,15 +20,15 @@ import androidx.annotation.DrawableRes import androidx.annotation.StringRes import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass -import com.airbnb.epoxy.EpoxyModelWithHolder import im.vector.app.R import im.vector.app.core.epoxy.ClickListener import im.vector.app.core.epoxy.VectorEpoxyHolder +import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.epoxy.onClick import im.vector.app.core.extensions.setTextOrHide -@EpoxyModelClass(layout = R.layout.item_settings_helper_info) -abstract class SettingsInfoItem : EpoxyModelWithHolder() { +@EpoxyModelClass +abstract class SettingsInfoItem : VectorEpoxyModel(R.layout.item_settings_helper_info) { @EpoxyAttribute var helperText: String? = null diff --git a/vector/src/main/java/im/vector/app/features/discovery/SettingsInformationItem.kt b/vector/src/main/java/im/vector/app/features/discovery/SettingsInformationItem.kt index 71eab5115e..aa98cfbe69 100644 --- a/vector/src/main/java/im/vector/app/features/discovery/SettingsInformationItem.kt +++ b/vector/src/main/java/im/vector/app/features/discovery/SettingsInformationItem.kt @@ -19,12 +19,12 @@ import android.widget.TextView import androidx.annotation.ColorInt import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass -import com.airbnb.epoxy.EpoxyModelWithHolder import im.vector.app.R import im.vector.app.core.epoxy.VectorEpoxyHolder +import im.vector.app.core.epoxy.VectorEpoxyModel -@EpoxyModelClass(layout = R.layout.item_settings_information) -abstract class SettingsInformationItem : EpoxyModelWithHolder() { +@EpoxyModelClass +abstract class SettingsInformationItem : VectorEpoxyModel(R.layout.item_settings_information) { @EpoxyAttribute lateinit var message: String diff --git a/vector/src/main/java/im/vector/app/features/discovery/SettingsItem.kt b/vector/src/main/java/im/vector/app/features/discovery/SettingsItem.kt index 1a14b4c9f3..4d117067e6 100644 --- a/vector/src/main/java/im/vector/app/features/discovery/SettingsItem.kt +++ b/vector/src/main/java/im/vector/app/features/discovery/SettingsItem.kt @@ -20,16 +20,16 @@ import androidx.annotation.StringRes import androidx.core.view.isVisible import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass -import com.airbnb.epoxy.EpoxyModelWithHolder import com.google.android.material.switchmaterial.SwitchMaterial import im.vector.app.R import im.vector.app.core.epoxy.ClickListener import im.vector.app.core.epoxy.VectorEpoxyHolder +import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.epoxy.onClick import im.vector.app.core.extensions.setTextOrHide -@EpoxyModelClass(layout = R.layout.item_settings_simple_item) -abstract class SettingsItem : EpoxyModelWithHolder() { +@EpoxyModelClass +abstract class SettingsItem : VectorEpoxyModel(R.layout.item_settings_simple_item) { @EpoxyAttribute var title: String? = null diff --git a/vector/src/main/java/im/vector/app/features/discovery/SettingsProgressItem.kt b/vector/src/main/java/im/vector/app/features/discovery/SettingsProgressItem.kt index 8d62b37972..657ce9b10b 100644 --- a/vector/src/main/java/im/vector/app/features/discovery/SettingsProgressItem.kt +++ b/vector/src/main/java/im/vector/app/features/discovery/SettingsProgressItem.kt @@ -16,12 +16,12 @@ package im.vector.app.features.discovery import com.airbnb.epoxy.EpoxyModelClass -import com.airbnb.epoxy.EpoxyModelWithHolder import im.vector.app.R import im.vector.app.core.epoxy.VectorEpoxyHolder +import im.vector.app.core.epoxy.VectorEpoxyModel -@EpoxyModelClass(layout = R.layout.item_settings_progress) -abstract class SettingsProgressItem : EpoxyModelWithHolder() { +@EpoxyModelClass +abstract class SettingsProgressItem : VectorEpoxyModel(R.layout.item_settings_progress) { class Holder : VectorEpoxyHolder() } diff --git a/vector/src/main/java/im/vector/app/features/discovery/SettingsSectionTitleItem.kt b/vector/src/main/java/im/vector/app/features/discovery/SettingsSectionTitleItem.kt index fe97984c8b..7e3e156d58 100644 --- a/vector/src/main/java/im/vector/app/features/discovery/SettingsSectionTitleItem.kt +++ b/vector/src/main/java/im/vector/app/features/discovery/SettingsSectionTitleItem.kt @@ -19,13 +19,13 @@ import android.widget.TextView import androidx.annotation.StringRes import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass -import com.airbnb.epoxy.EpoxyModelWithHolder import im.vector.app.R import im.vector.app.core.epoxy.VectorEpoxyHolder +import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.extensions.setTextOrHide -@EpoxyModelClass(layout = R.layout.item_settings_section_title) -abstract class SettingsSectionTitleItem : EpoxyModelWithHolder() { +@EpoxyModelClass +abstract class SettingsSectionTitleItem : VectorEpoxyModel(R.layout.item_settings_section_title) { @EpoxyAttribute var title: String? = null diff --git a/vector/src/main/java/im/vector/app/features/discovery/SettingsTextButtonSingleLineItem.kt b/vector/src/main/java/im/vector/app/features/discovery/SettingsTextButtonSingleLineItem.kt index 192ee404fb..9810ae2400 100644 --- a/vector/src/main/java/im/vector/app/features/discovery/SettingsTextButtonSingleLineItem.kt +++ b/vector/src/main/java/im/vector/app/features/discovery/SettingsTextButtonSingleLineItem.kt @@ -25,11 +25,11 @@ import androidx.core.view.isInvisible import androidx.core.view.isVisible import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass -import com.airbnb.epoxy.EpoxyModelWithHolder import com.google.android.material.switchmaterial.SwitchMaterial import im.vector.app.R import im.vector.app.core.epoxy.ClickListener import im.vector.app.core.epoxy.VectorEpoxyHolder +import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.epoxy.attributes.ButtonStyle import im.vector.app.core.epoxy.attributes.ButtonType import im.vector.app.core.epoxy.attributes.IconMode @@ -39,8 +39,8 @@ import im.vector.app.core.resources.ColorProvider import im.vector.app.core.resources.StringProvider import im.vector.app.features.themes.ThemeUtils -@EpoxyModelClass(layout = R.layout.item_settings_button_single_line) -abstract class SettingsTextButtonSingleLineItem : EpoxyModelWithHolder() { +@EpoxyModelClass +abstract class SettingsTextButtonSingleLineItem : VectorEpoxyModel(R.layout.item_settings_button_single_line) { @EpoxyAttribute lateinit var colorProvider: ColorProvider diff --git a/vector/src/main/java/im/vector/app/features/form/FormAdvancedToggleItem.kt b/vector/src/main/java/im/vector/app/features/form/FormAdvancedToggleItem.kt index d50b429c97..6f2aa2086b 100644 --- a/vector/src/main/java/im/vector/app/features/form/FormAdvancedToggleItem.kt +++ b/vector/src/main/java/im/vector/app/features/form/FormAdvancedToggleItem.kt @@ -28,8 +28,8 @@ import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.epoxy.onClick import im.vector.app.features.themes.ThemeUtils -@EpoxyModelClass(layout = R.layout.item_form_advanced_toggle) -abstract class FormAdvancedToggleItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class FormAdvancedToggleItem : VectorEpoxyModel(R.layout.item_form_advanced_toggle) { @EpoxyAttribute lateinit var title: String @EpoxyAttribute var expanded: Boolean = false diff --git a/vector/src/main/java/im/vector/app/features/form/FormEditTextItem.kt b/vector/src/main/java/im/vector/app/features/form/FormEditTextItem.kt index c58b36fc88..9f32980874 100644 --- a/vector/src/main/java/im/vector/app/features/form/FormEditTextItem.kt +++ b/vector/src/main/java/im/vector/app/features/form/FormEditTextItem.kt @@ -34,8 +34,8 @@ import im.vector.app.core.epoxy.addTextChangedListenerOnce import im.vector.app.core.epoxy.setValueOnce import im.vector.app.core.platform.SimpleTextWatcher -@EpoxyModelClass(layout = R.layout.item_form_text_input) -abstract class FormEditTextItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class FormEditTextItem : VectorEpoxyModel(R.layout.item_form_text_input) { @EpoxyAttribute var hint: String? = null diff --git a/vector/src/main/java/im/vector/app/features/form/FormEditTextWithButtonItem.kt b/vector/src/main/java/im/vector/app/features/form/FormEditTextWithButtonItem.kt index dd059ec658..011446a020 100644 --- a/vector/src/main/java/im/vector/app/features/form/FormEditTextWithButtonItem.kt +++ b/vector/src/main/java/im/vector/app/features/form/FormEditTextWithButtonItem.kt @@ -32,8 +32,8 @@ import im.vector.app.core.epoxy.onClick import im.vector.app.core.epoxy.setValueOnce import im.vector.app.core.platform.SimpleTextWatcher -@EpoxyModelClass(layout = R.layout.item_form_text_input_with_button) -abstract class FormEditTextWithButtonItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class FormEditTextWithButtonItem : VectorEpoxyModel(R.layout.item_form_text_input_with_button) { @EpoxyAttribute var hint: String? = null diff --git a/vector/src/main/java/im/vector/app/features/form/FormEditTextWithDeleteItem.kt b/vector/src/main/java/im/vector/app/features/form/FormEditTextWithDeleteItem.kt index 637955a66c..64feca87f7 100644 --- a/vector/src/main/java/im/vector/app/features/form/FormEditTextWithDeleteItem.kt +++ b/vector/src/main/java/im/vector/app/features/form/FormEditTextWithDeleteItem.kt @@ -34,8 +34,8 @@ import im.vector.app.core.epoxy.onClick import im.vector.app.core.extensions.setTextIfDifferent import im.vector.app.core.platform.SimpleTextWatcher -@EpoxyModelClass(layout = R.layout.item_form_text_input_with_delete) -abstract class FormEditTextWithDeleteItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class FormEditTextWithDeleteItem : VectorEpoxyModel(R.layout.item_form_text_input_with_delete) { @EpoxyAttribute var hint: String? = null diff --git a/vector/src/main/java/im/vector/app/features/form/FormEditableAvatarItem.kt b/vector/src/main/java/im/vector/app/features/form/FormEditableAvatarItem.kt index b81a731260..75b9379903 100644 --- a/vector/src/main/java/im/vector/app/features/form/FormEditableAvatarItem.kt +++ b/vector/src/main/java/im/vector/app/features/form/FormEditableAvatarItem.kt @@ -21,18 +21,18 @@ import android.widget.ImageView import androidx.core.view.isVisible import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass -import com.airbnb.epoxy.EpoxyModelWithHolder import com.bumptech.glide.request.RequestOptions import im.vector.app.R import im.vector.app.core.epoxy.ClickListener import im.vector.app.core.epoxy.VectorEpoxyHolder +import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.epoxy.onClick import im.vector.app.core.glide.GlideApp import im.vector.app.features.home.AvatarRenderer import org.matrix.android.sdk.api.util.MatrixItem -@EpoxyModelClass(layout = R.layout.item_editable_avatar) -abstract class FormEditableAvatarItem : EpoxyModelWithHolder() { +@EpoxyModelClass +abstract class FormEditableAvatarItem : VectorEpoxyModel(R.layout.item_editable_avatar) { @EpoxyAttribute var avatarRenderer: AvatarRenderer? = null diff --git a/vector/src/main/java/im/vector/app/features/form/FormEditableSquareAvatarItem.kt b/vector/src/main/java/im/vector/app/features/form/FormEditableSquareAvatarItem.kt index a25050cad0..1533f8f22c 100644 --- a/vector/src/main/java/im/vector/app/features/form/FormEditableSquareAvatarItem.kt +++ b/vector/src/main/java/im/vector/app/features/form/FormEditableSquareAvatarItem.kt @@ -22,20 +22,20 @@ import android.widget.ImageView import androidx.core.view.isVisible import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass -import com.airbnb.epoxy.EpoxyModelWithHolder import com.bumptech.glide.load.MultiTransformation import com.bumptech.glide.load.resource.bitmap.CenterCrop import com.bumptech.glide.load.resource.bitmap.RoundedCorners import im.vector.app.R import im.vector.app.core.epoxy.ClickListener import im.vector.app.core.epoxy.VectorEpoxyHolder +import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.epoxy.onClick import im.vector.app.core.glide.GlideApp import im.vector.app.features.home.AvatarRenderer import org.matrix.android.sdk.api.util.MatrixItem -@EpoxyModelClass(layout = R.layout.item_editable_square_avatar) -abstract class FormEditableSquareAvatarItem : EpoxyModelWithHolder() { +@EpoxyModelClass +abstract class FormEditableSquareAvatarItem : VectorEpoxyModel(R.layout.item_editable_square_avatar) { @EpoxyAttribute var avatarRenderer: AvatarRenderer? = null diff --git a/vector/src/main/java/im/vector/app/features/form/FormMultiLineEditTextItem.kt b/vector/src/main/java/im/vector/app/features/form/FormMultiLineEditTextItem.kt index 0753248272..7080f6d001 100644 --- a/vector/src/main/java/im/vector/app/features/form/FormMultiLineEditTextItem.kt +++ b/vector/src/main/java/im/vector/app/features/form/FormMultiLineEditTextItem.kt @@ -30,8 +30,8 @@ import im.vector.app.core.epoxy.addTextChangedListenerOnce import im.vector.app.core.epoxy.setValueOnce import im.vector.app.core.platform.SimpleTextWatcher -@EpoxyModelClass(layout = R.layout.item_form_multiline_text_input) -abstract class FormMultiLineEditTextItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class FormMultiLineEditTextItem : VectorEpoxyModel(R.layout.item_form_multiline_text_input) { @EpoxyAttribute var hint: String? = null diff --git a/vector/src/main/java/im/vector/app/features/form/FormSubmitButtonItem.kt b/vector/src/main/java/im/vector/app/features/form/FormSubmitButtonItem.kt index 41e1bc95a7..d425111fec 100644 --- a/vector/src/main/java/im/vector/app/features/form/FormSubmitButtonItem.kt +++ b/vector/src/main/java/im/vector/app/features/form/FormSubmitButtonItem.kt @@ -19,15 +19,15 @@ import android.widget.Button import androidx.annotation.StringRes import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass -import com.airbnb.epoxy.EpoxyModelWithHolder import im.vector.app.R import im.vector.app.core.epoxy.ClickListener import im.vector.app.core.epoxy.VectorEpoxyHolder +import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.epoxy.onClick import im.vector.app.core.extensions.setTextOrHide -@EpoxyModelClass(layout = R.layout.item_form_submit_button) -abstract class FormSubmitButtonItem : EpoxyModelWithHolder() { +@EpoxyModelClass +abstract class FormSubmitButtonItem : VectorEpoxyModel(R.layout.item_form_submit_button) { @EpoxyAttribute var enabled: Boolean = true diff --git a/vector/src/main/java/im/vector/app/features/form/FormSwitchItem.kt b/vector/src/main/java/im/vector/app/features/form/FormSwitchItem.kt index 800a90135b..00d1738aaf 100644 --- a/vector/src/main/java/im/vector/app/features/form/FormSwitchItem.kt +++ b/vector/src/main/java/im/vector/app/features/form/FormSwitchItem.kt @@ -26,8 +26,8 @@ import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.epoxy.setValueOnce import im.vector.app.core.extensions.setTextOrHide -@EpoxyModelClass(layout = R.layout.item_form_switch) -abstract class FormSwitchItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class FormSwitchItem : VectorEpoxyModel(R.layout.item_form_switch) { @EpoxyAttribute var listener: ((Boolean) -> Unit)? = null diff --git a/vector/src/main/java/im/vector/app/features/grouplist/GroupSummaryItem.kt b/vector/src/main/java/im/vector/app/features/grouplist/GroupSummaryItem.kt index 4256e2d808..ce2b35b353 100644 --- a/vector/src/main/java/im/vector/app/features/grouplist/GroupSummaryItem.kt +++ b/vector/src/main/java/im/vector/app/features/grouplist/GroupSummaryItem.kt @@ -30,8 +30,8 @@ import im.vector.app.core.platform.CheckableConstraintLayout import im.vector.app.features.home.AvatarRenderer import org.matrix.android.sdk.api.util.MatrixItem -@EpoxyModelClass(layout = R.layout.item_group) -abstract class GroupSummaryItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class GroupSummaryItem : VectorEpoxyModel(R.layout.item_group) { @EpoxyAttribute lateinit var avatarRenderer: AvatarRenderer @EpoxyAttribute lateinit var matrixItem: MatrixItem diff --git a/vector/src/main/java/im/vector/app/features/grouplist/HomeSpaceSummaryItem.kt b/vector/src/main/java/im/vector/app/features/grouplist/HomeSpaceSummaryItem.kt index bd414c0c3f..816b9acb24 100644 --- a/vector/src/main/java/im/vector/app/features/grouplist/HomeSpaceSummaryItem.kt +++ b/vector/src/main/java/im/vector/app/features/grouplist/HomeSpaceSummaryItem.kt @@ -34,8 +34,8 @@ import im.vector.app.core.platform.CheckableConstraintLayout import im.vector.app.features.home.room.list.UnreadCounterBadgeView import im.vector.app.features.themes.ThemeUtils -@EpoxyModelClass(layout = R.layout.item_space) -abstract class HomeSpaceSummaryItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class HomeSpaceSummaryItem : VectorEpoxyModel(R.layout.item_space) { @EpoxyAttribute var selected: Boolean = false @EpoxyAttribute(EpoxyAttribute.Option.DoNotHash) var listener: ClickListener? = null diff --git a/vector/src/main/java/im/vector/app/features/home/room/breadcrumbs/BreadcrumbsItem.kt b/vector/src/main/java/im/vector/app/features/home/room/breadcrumbs/BreadcrumbsItem.kt index 52996c74de..cfc9b124d7 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/breadcrumbs/BreadcrumbsItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/breadcrumbs/BreadcrumbsItem.kt @@ -32,8 +32,8 @@ import im.vector.app.features.home.AvatarRenderer import im.vector.app.features.home.room.list.UnreadCounterBadgeView import org.matrix.android.sdk.api.util.MatrixItem -@EpoxyModelClass(layout = R.layout.item_breadcrumbs) -abstract class BreadcrumbsItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class BreadcrumbsItem : VectorEpoxyModel(R.layout.item_breadcrumbs) { @EpoxyAttribute var hasTypingUsers: Boolean = false @EpoxyAttribute lateinit var avatarRenderer: AvatarRenderer diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/readreceipts/DisplayReadReceiptItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/readreceipts/DisplayReadReceiptItem.kt index 9e3cbef1cc..a489c1ec66 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/readreceipts/DisplayReadReceiptItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/readreceipts/DisplayReadReceiptItem.kt @@ -21,17 +21,17 @@ import android.widget.TextView import androidx.core.view.isVisible import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass -import com.airbnb.epoxy.EpoxyModelWithHolder import im.vector.app.R import im.vector.app.core.epoxy.ClickListener import im.vector.app.core.epoxy.VectorEpoxyHolder +import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.epoxy.onClick import im.vector.app.features.displayname.getBestName import im.vector.app.features.home.AvatarRenderer import org.matrix.android.sdk.api.util.MatrixItem -@EpoxyModelClass(layout = R.layout.item_display_read_receipt) -abstract class DisplayReadReceiptItem : EpoxyModelWithHolder() { +@EpoxyModelClass +abstract class DisplayReadReceiptItem : VectorEpoxyModel(R.layout.item_display_read_receipt) { @EpoxyAttribute lateinit var matrixItem: MatrixItem @EpoxyAttribute var timestamp: String? = null diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/search/SearchResultItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/search/SearchResultItem.kt index d92dcdd3ef..60cbf1311a 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/search/SearchResultItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/search/SearchResultItem.kt @@ -34,8 +34,8 @@ import im.vector.lib.core.utils.epoxy.charsequence.EpoxyCharSequence import org.matrix.android.sdk.api.session.threads.ThreadDetails import org.matrix.android.sdk.api.util.MatrixItem -@EpoxyModelClass(layout = R.layout.item_search_result) -abstract class SearchResultItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class SearchResultItem : VectorEpoxyModel(R.layout.item_search_result) { @EpoxyAttribute lateinit var avatarRenderer: AvatarRenderer @EpoxyAttribute var formattedDate: String? = null diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/AbsBaseMessageItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/AbsBaseMessageItem.kt index e3471b22f8..5e23f4db16 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/AbsBaseMessageItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/AbsBaseMessageItem.kt @@ -23,6 +23,7 @@ import android.view.ViewGroup import android.widget.ImageView import android.widget.TextView import androidx.annotation.IdRes +import androidx.annotation.LayoutRes import androidx.appcompat.view.ContextThemeWrapper import androidx.core.content.ContextCompat.getDrawable import androidx.core.view.isVisible @@ -49,7 +50,7 @@ private const val MAX_REACTIONS_TO_SHOW = 8 * Manages associated click listeners and send status. * Should not be used as this, use a subclass. */ -abstract class AbsBaseMessageItem : BaseEventItem() { +abstract class AbsBaseMessageItem(@LayoutRes layoutId: Int) : BaseEventItem(layoutId) { abstract val baseAttributes: Attributes diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/AbsMessageItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/AbsMessageItem.kt index 24a148885f..8dba0117b5 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/AbsMessageItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/AbsMessageItem.kt @@ -24,6 +24,7 @@ import android.widget.ProgressBar import android.widget.RelativeLayout import android.widget.TextView import androidx.annotation.IdRes +import androidx.annotation.LayoutRes import androidx.constraintlayout.widget.ConstraintLayout import androidx.core.view.isVisible import androidx.core.view.updateLayoutParams @@ -42,7 +43,9 @@ import org.matrix.android.sdk.api.util.MatrixItem * Base timeline item that adds an optional information bar with the sender avatar, name, time, send state. * Adds associated click listeners (on avatar, displayname). */ -abstract class AbsMessageItem : AbsBaseMessageItem() { +abstract class AbsMessageItem( + @LayoutRes layoutId: Int = R.layout.item_timeline_event_base +) : AbsBaseMessageItem(layoutId) { override val baseAttributes: AbsBaseMessageItem.Attributes get() = attributes diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/AbsMessageLocationItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/AbsMessageLocationItem.kt index ee3a9f6746..b7790b8a30 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/AbsMessageLocationItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/AbsMessageLocationItem.kt @@ -20,6 +20,7 @@ import android.graphics.drawable.Drawable import android.widget.ImageView import android.widget.TextView import androidx.annotation.IdRes +import androidx.annotation.LayoutRes import androidx.core.view.isVisible import androidx.core.view.updateLayoutParams import com.airbnb.epoxy.EpoxyAttribute @@ -36,7 +37,9 @@ import im.vector.app.features.home.room.detail.timeline.helper.LocationPinProvid import im.vector.app.features.home.room.detail.timeline.style.TimelineMessageLayout import im.vector.app.features.home.room.detail.timeline.style.granularRoundedCorners -abstract class AbsMessageLocationItem : AbsMessageItem() { +abstract class AbsMessageLocationItem( + @LayoutRes layoutId: Int = R.layout.item_timeline_event_base +) : AbsMessageItem(layoutId) { @EpoxyAttribute var locationUrl: String? = null diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/BaseEventItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/BaseEventItem.kt index b72f492c8c..0a627ee500 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/BaseEventItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/BaseEventItem.kt @@ -20,6 +20,7 @@ import android.view.ViewStub import android.widget.RelativeLayout import androidx.annotation.CallSuper import androidx.annotation.IdRes +import androidx.annotation.LayoutRes import androidx.core.view.updateLayoutParams import com.airbnb.epoxy.EpoxyAttribute import im.vector.app.R @@ -30,7 +31,7 @@ import im.vector.app.core.platform.CheckableView /** * Children must override getViewType(). */ -abstract class BaseEventItem : VectorEpoxyModel(), ItemWithEvents { +abstract class BaseEventItem(@LayoutRes layoutId: Int) : VectorEpoxyModel(layoutId), ItemWithEvents { // To use for instance when opening a permalink with an eventId @EpoxyAttribute diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/BasedMergedItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/BasedMergedItem.kt index 4999036e9d..48d5c29879 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/BasedMergedItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/BasedMergedItem.kt @@ -19,11 +19,12 @@ package im.vector.app.features.home.room.detail.timeline.item import android.view.View import android.widget.TextView import androidx.annotation.IdRes +import androidx.annotation.LayoutRes import im.vector.app.R import im.vector.app.features.home.AvatarRenderer import org.matrix.android.sdk.api.util.MatrixItem -abstract class BasedMergedItem : BaseEventItem() { +abstract class BasedMergedItem(@LayoutRes layoutId: Int) : BaseEventItem(layoutId) { abstract val attributes: Attributes diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/BlankItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/BlankItem.kt index cf3e4a8328..bcb95f0414 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/BlankItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/BlankItem.kt @@ -20,7 +20,7 @@ import im.vector.app.R import im.vector.app.core.epoxy.VectorEpoxyHolder import im.vector.app.core.epoxy.VectorEpoxyModel -@EpoxyModelClass(layout = R.layout.item_timeline_event_blank_stub) -abstract class BlankItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class BlankItem : VectorEpoxyModel(R.layout.item_timeline_event_blank_stub) { class BlankHolder : VectorEpoxyHolder() } diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/CallTileTimelineItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/CallTileTimelineItem.kt index 228e0181d2..58d267fb0e 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/CallTileTimelineItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/CallTileTimelineItem.kt @@ -39,8 +39,8 @@ import im.vector.app.features.home.room.detail.timeline.MessageColorProvider import im.vector.app.features.home.room.detail.timeline.TimelineEventController import org.matrix.android.sdk.api.util.MatrixItem -@EpoxyModelClass(layout = R.layout.item_timeline_event_base_state) -abstract class CallTileTimelineItem : AbsBaseMessageItem() { +@EpoxyModelClass +abstract class CallTileTimelineItem : AbsBaseMessageItem(R.layout.item_timeline_event_base_state) { override val baseAttributes: AbsBaseMessageItem.Attributes get() = attributes diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/DaySeparatorItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/DaySeparatorItem.kt index 4c9664e612..d23081bcad 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/DaySeparatorItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/DaySeparatorItem.kt @@ -19,12 +19,12 @@ package im.vector.app.features.home.room.detail.timeline.item import android.widget.TextView import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass -import com.airbnb.epoxy.EpoxyModelWithHolder import im.vector.app.R import im.vector.app.core.epoxy.VectorEpoxyHolder +import im.vector.app.core.epoxy.VectorEpoxyModel -@EpoxyModelClass(layout = R.layout.item_timeline_event_day_separator) -abstract class DaySeparatorItem : EpoxyModelWithHolder() { +@EpoxyModelClass +abstract class DaySeparatorItem : VectorEpoxyModel(R.layout.item_timeline_event_day_separator) { @EpoxyAttribute lateinit var formattedDay: String diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/DefaultItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/DefaultItem.kt index 9d437754d0..9bc42dca28 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/DefaultItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/DefaultItem.kt @@ -24,8 +24,8 @@ import com.airbnb.epoxy.EpoxyModelClass import im.vector.app.R import im.vector.app.features.home.AvatarRenderer -@EpoxyModelClass(layout = R.layout.item_timeline_event_base_noinfo) -abstract class DefaultItem : BaseEventItem() { +@EpoxyModelClass +abstract class DefaultItem : BaseEventItem(R.layout.item_timeline_event_base_noinfo) { @EpoxyAttribute lateinit var attributes: Attributes diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MergedRoomCreationItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MergedRoomCreationItem.kt index cd60057379..6371440d1a 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MergedRoomCreationItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MergedRoomCreationItem.kt @@ -44,8 +44,8 @@ import org.matrix.android.sdk.api.session.room.model.RoomSummary import org.matrix.android.sdk.api.session.room.model.localecho.RoomLocalEcho import org.matrix.android.sdk.api.util.toMatrixItem -@EpoxyModelClass(layout = R.layout.item_timeline_event_base_noinfo) -abstract class MergedRoomCreationItem : BasedMergedItem() { +@EpoxyModelClass +abstract class MergedRoomCreationItem : BasedMergedItem(R.layout.item_timeline_event_base_noinfo) { @EpoxyAttribute override lateinit var attributes: Attributes diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MergedSimilarEventsItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MergedSimilarEventsItem.kt index f012ca6cdc..60d7eb4aba 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MergedSimilarEventsItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MergedSimilarEventsItem.kt @@ -27,8 +27,8 @@ import com.airbnb.epoxy.EpoxyModelClass import im.vector.app.R import im.vector.app.features.home.AvatarRenderer -@EpoxyModelClass(layout = R.layout.item_timeline_event_base_noinfo) -abstract class MergedSimilarEventsItem : BasedMergedItem() { +@EpoxyModelClass +abstract class MergedSimilarEventsItem : BasedMergedItem(R.layout.item_timeline_event_base_noinfo) { override fun getViewStubId() = STUB_ID diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageAudioItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageAudioItem.kt index a3c09960c9..7153c0f442 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageAudioItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageAudioItem.kt @@ -37,7 +37,7 @@ import im.vector.app.features.home.room.detail.timeline.helper.ContentUploadStat import im.vector.app.features.home.room.detail.timeline.style.TimelineMessageLayout import im.vector.app.features.themes.ThemeUtils -@EpoxyModelClass(layout = R.layout.item_timeline_event_base) +@EpoxyModelClass abstract class MessageAudioItem : AbsMessageItem() { @EpoxyAttribute diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageFileItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageFileItem.kt index 8a94f927f9..2224d9ac3b 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageFileItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageFileItem.kt @@ -34,7 +34,7 @@ import im.vector.app.features.home.room.detail.timeline.helper.ContentUploadStat import im.vector.app.features.home.room.detail.timeline.style.TimelineMessageLayout import im.vector.app.features.themes.ThemeUtils -@EpoxyModelClass(layout = R.layout.item_timeline_event_base) +@EpoxyModelClass abstract class MessageFileItem : AbsMessageItem() { @EpoxyAttribute diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageImageVideoItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageImageVideoItem.kt index f3ab0e838b..910776f5d7 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageImageVideoItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageImageVideoItem.kt @@ -36,7 +36,7 @@ import im.vector.app.features.home.room.detail.timeline.style.granularRoundedCor import im.vector.app.features.media.ImageContentRenderer import org.matrix.android.sdk.api.session.room.model.message.MessageType -@EpoxyModelClass(layout = R.layout.item_timeline_event_base) +@EpoxyModelClass abstract class MessageImageVideoItem : AbsMessageItem() { @EpoxyAttribute diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageLiveLocationInactiveItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageLiveLocationInactiveItem.kt index bb85316bf1..bc6e96b0ee 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageLiveLocationInactiveItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageLiveLocationInactiveItem.kt @@ -21,7 +21,7 @@ import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass import im.vector.app.R -@EpoxyModelClass(layout = R.layout.item_timeline_event_base) +@EpoxyModelClass abstract class MessageLiveLocationInactiveItem : AbsMessageItem(), LiveLocationShareStatusItem by DefaultLiveLocationShareStatusItem() { diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageLiveLocationItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageLiveLocationItem.kt index 795bd21cb2..84080eaad9 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageLiveLocationItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageLiveLocationItem.kt @@ -30,7 +30,7 @@ import im.vector.app.features.location.live.LocationLiveMessageBannerView import im.vector.app.features.location.live.LocationLiveMessageBannerViewState import org.threeten.bp.LocalDateTime -@EpoxyModelClass(layout = R.layout.item_timeline_event_base) +@EpoxyModelClass abstract class MessageLiveLocationItem : AbsMessageLocationItem() { @EpoxyAttribute diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageLiveLocationStartItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageLiveLocationStartItem.kt index 001774b579..a847c24f57 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageLiveLocationStartItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageLiveLocationStartItem.kt @@ -21,7 +21,7 @@ import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass import im.vector.app.R -@EpoxyModelClass(layout = R.layout.item_timeline_event_base) +@EpoxyModelClass abstract class MessageLiveLocationStartItem : AbsMessageItem(), LiveLocationShareStatusItem by DefaultLiveLocationShareStatusItem() { diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageLocationItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageLocationItem.kt index 37f728407b..b5f513fbe9 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageLocationItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageLocationItem.kt @@ -19,7 +19,7 @@ package im.vector.app.features.home.room.detail.timeline.item import com.airbnb.epoxy.EpoxyModelClass import im.vector.app.R -@EpoxyModelClass(layout = R.layout.item_timeline_event_base) +@EpoxyModelClass abstract class MessageLocationItem : AbsMessageLocationItem() { override fun getViewStubId() = STUB_ID diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageTextItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageTextItem.kt index bc9e4a7ff1..d63d29553d 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageTextItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageTextItem.kt @@ -37,7 +37,7 @@ import im.vector.lib.core.utils.epoxy.charsequence.EpoxyCharSequence import io.noties.markwon.MarkwonPlugin import org.matrix.android.sdk.api.extensions.orFalse -@EpoxyModelClass(layout = R.layout.item_timeline_event_base) +@EpoxyModelClass abstract class MessageTextItem : AbsMessageItem() { @EpoxyAttribute diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageVoiceItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageVoiceItem.kt index e8f1762963..e98d8115e6 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageVoiceItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageVoiceItem.kt @@ -37,7 +37,7 @@ import im.vector.app.features.home.room.detail.timeline.style.TimelineMessageLay import im.vector.app.features.themes.ThemeUtils import im.vector.app.features.voice.AudioWaveformView -@EpoxyModelClass(layout = R.layout.item_timeline_event_base) +@EpoxyModelClass abstract class MessageVoiceItem : AbsMessageItem() { interface WaveformTouchListener { diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/NoticeItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/NoticeItem.kt index 9d865e6dad..ad62249459 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/NoticeItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/NoticeItem.kt @@ -30,8 +30,8 @@ import im.vector.app.features.home.room.detail.timeline.TimelineEventController import im.vector.lib.core.utils.epoxy.charsequence.EpoxyCharSequence import org.matrix.android.sdk.api.session.crypto.model.RoomEncryptionTrustLevel -@EpoxyModelClass(layout = R.layout.item_timeline_event_base_noinfo) -abstract class NoticeItem : BaseEventItem() { +@EpoxyModelClass +abstract class NoticeItem : BaseEventItem(R.layout.item_timeline_event_base_noinfo) { @EpoxyAttribute lateinit var attributes: Attributes diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/PollItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/PollItem.kt index 273dd0299a..d00a66b225 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/PollItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/PollItem.kt @@ -26,7 +26,7 @@ import im.vector.app.features.home.room.detail.RoomDetailAction import im.vector.app.features.home.room.detail.timeline.TimelineEventController import im.vector.lib.core.utils.epoxy.charsequence.EpoxyCharSequence -@EpoxyModelClass(layout = R.layout.item_timeline_event_base) +@EpoxyModelClass abstract class PollItem : AbsMessageItem() { @EpoxyAttribute diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/ReadReceiptsItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/ReadReceiptsItem.kt index 4f29253264..658aef0649 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/ReadReceiptsItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/ReadReceiptsItem.kt @@ -19,16 +19,16 @@ package im.vector.app.features.home.room.detail.timeline.item import androidx.core.view.isVisible import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass -import com.airbnb.epoxy.EpoxyModelWithHolder import im.vector.app.R import im.vector.app.core.epoxy.ClickListener import im.vector.app.core.epoxy.VectorEpoxyHolder +import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.epoxy.onClick import im.vector.app.core.ui.views.ReadReceiptsView import im.vector.app.features.home.AvatarRenderer -@EpoxyModelClass(layout = R.layout.item_timeline_event_read_receipts) -abstract class ReadReceiptsItem : EpoxyModelWithHolder(), ItemWithEvents { +@EpoxyModelClass +abstract class ReadReceiptsItem : VectorEpoxyModel(R.layout.item_timeline_event_read_receipts), ItemWithEvents { @EpoxyAttribute lateinit var eventId: String @EpoxyAttribute lateinit var readReceipts: List diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/RedactedMessageItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/RedactedMessageItem.kt index 204bab2254..057a9bad0e 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/RedactedMessageItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/RedactedMessageItem.kt @@ -19,7 +19,7 @@ package im.vector.app.features.home.room.detail.timeline.item import com.airbnb.epoxy.EpoxyModelClass import im.vector.app.R -@EpoxyModelClass(layout = R.layout.item_timeline_event_base) +@EpoxyModelClass abstract class RedactedMessageItem : AbsMessageItem() { override fun getViewStubId() = STUB_ID diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/RoomCreateItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/RoomCreateItem.kt index a6d2bcc66d..394079ed5f 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/RoomCreateItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/RoomCreateItem.kt @@ -25,8 +25,8 @@ import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.lib.core.utils.epoxy.charsequence.EpoxyCharSequence import me.saket.bettermovementmethod.BetterLinkMovementMethod -@EpoxyModelClass(layout = R.layout.item_timeline_event_create) -abstract class RoomCreateItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class RoomCreateItem : VectorEpoxyModel(R.layout.item_timeline_event_create) { @EpoxyAttribute lateinit var text: EpoxyCharSequence diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/StatusTileTimelineItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/StatusTileTimelineItem.kt index e4c68a7a5b..c4dd4bedeb 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/StatusTileTimelineItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/StatusTileTimelineItem.kt @@ -31,8 +31,8 @@ import im.vector.app.features.home.AvatarRenderer import im.vector.app.features.home.room.detail.timeline.MessageColorProvider import im.vector.app.features.home.room.detail.timeline.TimelineEventController -@EpoxyModelClass(layout = R.layout.item_timeline_event_base_state) -abstract class StatusTileTimelineItem : AbsBaseMessageItem() { +@EpoxyModelClass +abstract class StatusTileTimelineItem : AbsBaseMessageItem(R.layout.item_timeline_event_base_state) { override val baseAttributes: AbsBaseMessageItem.Attributes get() = attributes diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/TimelineReadMarkerItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/TimelineReadMarkerItem.kt index 106f178216..700a8d6e2c 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/TimelineReadMarkerItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/TimelineReadMarkerItem.kt @@ -21,8 +21,8 @@ import im.vector.app.R import im.vector.app.core.epoxy.VectorEpoxyHolder import im.vector.app.core.epoxy.VectorEpoxyModel -@EpoxyModelClass(layout = R.layout.item_timeline_read_marker) -abstract class TimelineReadMarkerItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class TimelineReadMarkerItem : VectorEpoxyModel(R.layout.item_timeline_read_marker) { class Holder : VectorEpoxyHolder() } diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/VerificationRequestItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/VerificationRequestItem.kt index 395b5fa308..1abed2031d 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/VerificationRequestItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/VerificationRequestItem.kt @@ -39,8 +39,8 @@ import im.vector.app.features.home.room.detail.timeline.TimelineEventController import org.matrix.android.sdk.api.session.crypto.verification.VerificationService import org.matrix.android.sdk.api.session.crypto.verification.VerificationState -@EpoxyModelClass(layout = R.layout.item_timeline_event_base_state) -abstract class VerificationRequestItem : AbsBaseMessageItem() { +@EpoxyModelClass +abstract class VerificationRequestItem : AbsBaseMessageItem(R.layout.item_timeline_event_base_state) { override val baseAttributes: AbsBaseMessageItem.Attributes get() = attributes diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/WidgetTileTimelineItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/WidgetTileTimelineItem.kt index a3a84910f5..5a73a20aa3 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/WidgetTileTimelineItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/WidgetTileTimelineItem.kt @@ -32,8 +32,8 @@ import im.vector.app.features.home.AvatarRenderer import im.vector.app.features.home.room.detail.timeline.MessageColorProvider import im.vector.app.features.home.room.detail.timeline.TimelineEventController -@EpoxyModelClass(layout = R.layout.item_timeline_event_base_state) -abstract class WidgetTileTimelineItem : AbsBaseMessageItem() { +@EpoxyModelClass +abstract class WidgetTileTimelineItem : AbsBaseMessageItem(R.layout.item_timeline_event_base_state) { override val baseAttributes: AbsBaseMessageItem.Attributes get() = attributes diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/reactions/ReactionInfoSimpleItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/reactions/ReactionInfoSimpleItem.kt index 741cb1324f..b4501c3807 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/reactions/ReactionInfoSimpleItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/reactions/ReactionInfoSimpleItem.kt @@ -20,18 +20,18 @@ import android.widget.TextView import androidx.core.view.isVisible import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass -import com.airbnb.epoxy.EpoxyModelWithHolder import im.vector.app.R import im.vector.app.core.epoxy.ClickListener import im.vector.app.core.epoxy.VectorEpoxyHolder +import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.epoxy.onClick import im.vector.lib.core.utils.epoxy.charsequence.EpoxyCharSequence /** * Item displaying an emoji reaction (single line with emoji, author, time). */ -@EpoxyModelClass(layout = R.layout.item_simple_reaction_info) -abstract class ReactionInfoSimpleItem : EpoxyModelWithHolder() { +@EpoxyModelClass +abstract class ReactionInfoSimpleItem : VectorEpoxyModel(R.layout.item_simple_reaction_info) { @EpoxyAttribute lateinit var reactionKey: EpoxyCharSequence diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/widget/RoomWidgetItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/widget/RoomWidgetItem.kt index 4ffc81fc1e..210ce9cfca 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/widget/RoomWidgetItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/widget/RoomWidgetItem.kt @@ -22,17 +22,17 @@ import androidx.annotation.DrawableRes import androidx.core.view.isVisible import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass -import com.airbnb.epoxy.EpoxyModelWithHolder import im.vector.app.R import im.vector.app.core.epoxy.ClickListener import im.vector.app.core.epoxy.VectorEpoxyHolder +import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.epoxy.onClick import org.matrix.android.sdk.api.extensions.tryOrNull import org.matrix.android.sdk.api.session.widgets.model.Widget import java.net.URL -@EpoxyModelClass(layout = R.layout.item_room_widget) -abstract class RoomWidgetItem : EpoxyModelWithHolder() { +@EpoxyModelClass +abstract class RoomWidgetItem : VectorEpoxyModel(R.layout.item_room_widget) { @EpoxyAttribute lateinit var widget: Widget @EpoxyAttribute(EpoxyAttribute.Option.DoNotHash) var widgetClicked: ClickListener? = null diff --git a/vector/src/main/java/im/vector/app/features/home/room/filtered/FilteredRoomFooterItem.kt b/vector/src/main/java/im/vector/app/features/home/room/filtered/FilteredRoomFooterItem.kt index 4c163f2f56..7994240ec0 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/filtered/FilteredRoomFooterItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/filtered/FilteredRoomFooterItem.kt @@ -25,8 +25,8 @@ import im.vector.app.core.epoxy.VectorEpoxyHolder import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.epoxy.onClick -@EpoxyModelClass(layout = R.layout.item_room_filter_footer) -abstract class FilteredRoomFooterItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class FilteredRoomFooterItem : VectorEpoxyModel(R.layout.item_room_filter_footer) { @EpoxyAttribute var listener: Listener? = null diff --git a/vector/src/main/java/im/vector/app/features/home/room/list/RoomCategoryItem.kt b/vector/src/main/java/im/vector/app/features/home/room/list/RoomCategoryItem.kt index 6057072e41..a7804bd049 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/list/RoomCategoryItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/list/RoomCategoryItem.kt @@ -29,8 +29,8 @@ import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.epoxy.onClick import im.vector.app.features.themes.ThemeUtils -@EpoxyModelClass(layout = R.layout.item_room_category) -abstract class RoomCategoryItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class RoomCategoryItem : VectorEpoxyModel(R.layout.item_room_category) { @EpoxyAttribute lateinit var title: String @EpoxyAttribute var itemCount: Int = 0 diff --git a/vector/src/main/java/im/vector/app/features/home/room/list/RoomInvitationItem.kt b/vector/src/main/java/im/vector/app/features/home/room/list/RoomInvitationItem.kt index 28cc9a9bd0..581361addd 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/list/RoomInvitationItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/list/RoomInvitationItem.kt @@ -34,8 +34,8 @@ import im.vector.app.features.invite.InviteButtonStateBinder import org.matrix.android.sdk.api.session.room.members.ChangeMembershipState import org.matrix.android.sdk.api.util.MatrixItem -@EpoxyModelClass(layout = R.layout.item_room_invitation) -abstract class RoomInvitationItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class RoomInvitationItem : VectorEpoxyModel(R.layout.item_room_invitation) { @EpoxyAttribute lateinit var avatarRenderer: AvatarRenderer @EpoxyAttribute lateinit var matrixItem: MatrixItem diff --git a/vector/src/main/java/im/vector/app/features/home/room/list/RoomSummaryItem.kt b/vector/src/main/java/im/vector/app/features/home/room/list/RoomSummaryItem.kt index 046d90c512..8dc0ac0784 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/list/RoomSummaryItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/list/RoomSummaryItem.kt @@ -43,8 +43,8 @@ import org.matrix.android.sdk.api.session.crypto.model.RoomEncryptionTrustLevel import org.matrix.android.sdk.api.session.presence.model.UserPresence import org.matrix.android.sdk.api.util.MatrixItem -@EpoxyModelClass(layout = R.layout.item_room) -abstract class RoomSummaryItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class RoomSummaryItem : VectorEpoxyModel(R.layout.item_room) { @EpoxyAttribute lateinit var typingMessage: String diff --git a/vector/src/main/java/im/vector/app/features/home/room/list/RoomSummaryItemCentered.kt b/vector/src/main/java/im/vector/app/features/home/room/list/RoomSummaryItemCentered.kt index 8f2d949178..440df0952c 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/list/RoomSummaryItemCentered.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/list/RoomSummaryItemCentered.kt @@ -40,8 +40,8 @@ import org.matrix.android.sdk.api.session.crypto.model.RoomEncryptionTrustLevel import org.matrix.android.sdk.api.session.presence.model.UserPresence import org.matrix.android.sdk.api.util.MatrixItem -@EpoxyModelClass(layout = R.layout.item_room_centered) -abstract class RoomSummaryItemCentered : VectorEpoxyModel() { +@EpoxyModelClass +abstract class RoomSummaryItemCentered : VectorEpoxyModel(R.layout.item_room_centered) { @EpoxyAttribute lateinit var avatarRenderer: AvatarRenderer diff --git a/vector/src/main/java/im/vector/app/features/home/room/list/RoomSummaryItemPlaceHolder.kt b/vector/src/main/java/im/vector/app/features/home/room/list/RoomSummaryItemPlaceHolder.kt index 96d8f6418b..d4683f78a5 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/list/RoomSummaryItemPlaceHolder.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/list/RoomSummaryItemPlaceHolder.kt @@ -21,7 +21,7 @@ import im.vector.app.R import im.vector.app.core.epoxy.VectorEpoxyHolder import im.vector.app.core.epoxy.VectorEpoxyModel -@EpoxyModelClass(layout = R.layout.item_room_placeholder) -abstract class RoomSummaryItemPlaceHolder : VectorEpoxyModel() { +@EpoxyModelClass +abstract class RoomSummaryItemPlaceHolder : VectorEpoxyModel(R.layout.item_room_placeholder) { class Holder : VectorEpoxyHolder() } diff --git a/vector/src/main/java/im/vector/app/features/home/room/list/SpaceChildInfoItem.kt b/vector/src/main/java/im/vector/app/features/home/room/list/SpaceChildInfoItem.kt index a2cb905f1b..964a39fb0f 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/list/SpaceChildInfoItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/list/SpaceChildInfoItem.kt @@ -40,8 +40,8 @@ import me.gujun.android.span.image import me.gujun.android.span.span import org.matrix.android.sdk.api.util.MatrixItem -@EpoxyModelClass(layout = R.layout.item_explore_space_child) -abstract class SpaceChildInfoItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class SpaceChildInfoItem : VectorEpoxyModel(R.layout.item_explore_space_child) { @EpoxyAttribute lateinit var avatarRenderer: AvatarRenderer @EpoxyAttribute lateinit var matrixItem: MatrixItem diff --git a/vector/src/main/java/im/vector/app/features/home/room/list/SpaceDirectoryFilterNoResults.kt b/vector/src/main/java/im/vector/app/features/home/room/list/SpaceDirectoryFilterNoResults.kt index 1ae017c98c..6899b59f38 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/list/SpaceDirectoryFilterNoResults.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/list/SpaceDirectoryFilterNoResults.kt @@ -21,7 +21,7 @@ import im.vector.app.R import im.vector.app.core.epoxy.VectorEpoxyHolder import im.vector.app.core.epoxy.VectorEpoxyModel -@EpoxyModelClass(layout = R.layout.item_space_directory_filter_no_results) -abstract class SpaceDirectoryFilterNoResults : VectorEpoxyModel() { +@EpoxyModelClass +abstract class SpaceDirectoryFilterNoResults : VectorEpoxyModel(R.layout.item_space_directory_filter_no_results) { class Holder : VectorEpoxyHolder() } diff --git a/vector/src/main/java/im/vector/app/features/home/room/threads/list/model/ThreadListItem.kt b/vector/src/main/java/im/vector/app/features/home/room/threads/list/model/ThreadListItem.kt index d5a6b72a1b..6284a1a067 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/threads/list/model/ThreadListItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/threads/list/model/ThreadListItem.kt @@ -37,8 +37,8 @@ import im.vector.app.features.themes.ThemeUtils import org.matrix.android.sdk.api.session.threads.ThreadNotificationState import org.matrix.android.sdk.api.util.MatrixItem -@EpoxyModelClass(layout = R.layout.item_thread) -abstract class ThreadListItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class ThreadListItem : VectorEpoxyModel(R.layout.item_thread) { @EpoxyAttribute lateinit var avatarRenderer: AvatarRenderer @EpoxyAttribute lateinit var matrixItem: MatrixItem diff --git a/vector/src/main/java/im/vector/app/features/location/live/map/LiveLocationBottomSheetController.kt b/vector/src/main/java/im/vector/app/features/location/live/map/LiveLocationBottomSheetController.kt index c07104e72c..e8a6b22b7e 100644 --- a/vector/src/main/java/im/vector/app/features/location/live/map/LiveLocationBottomSheetController.kt +++ b/vector/src/main/java/im/vector/app/features/location/live/map/LiveLocationBottomSheetController.kt @@ -26,8 +26,6 @@ import im.vector.app.core.resources.StringProvider import im.vector.app.core.resources.toTimestamp import im.vector.app.core.time.Clock import im.vector.app.features.home.AvatarRenderer -import im.vector.app.features.location.live.map.bottomsheet.LiveLocationUserItem -import im.vector.app.features.location.live.map.bottomsheet.liveLocationUserItem import javax.inject.Inject class LiveLocationBottomSheetController @Inject constructor( diff --git a/vector/src/main/java/im/vector/app/features/location/live/map/LiveLocationUserItem.kt b/vector/src/main/java/im/vector/app/features/location/live/map/LiveLocationUserItem.kt index 336f688434..0a4742fafc 100644 --- a/vector/src/main/java/im/vector/app/features/location/live/map/LiveLocationUserItem.kt +++ b/vector/src/main/java/im/vector/app/features/location/live/map/LiveLocationUserItem.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package im.vector.app.features.location.live.map.bottomsheet +package im.vector.app.features.location.live.map import android.widget.Button import android.widget.ImageView @@ -34,8 +34,8 @@ import im.vector.lib.core.utils.timer.CountUpTimer import org.matrix.android.sdk.api.util.MatrixItem import org.threeten.bp.Duration -@EpoxyModelClass(layout = R.layout.item_live_location_users_bottom_sheet) -abstract class LiveLocationUserItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class LiveLocationUserItem : VectorEpoxyModel(R.layout.item_live_location_users_bottom_sheet) { interface Callback { fun onUserSelected(userId: String) diff --git a/vector/src/main/java/im/vector/app/features/login/terms/PolicyItem.kt b/vector/src/main/java/im/vector/app/features/login/terms/PolicyItem.kt index ff35f912cf..f35de49ecc 100644 --- a/vector/src/main/java/im/vector/app/features/login/terms/PolicyItem.kt +++ b/vector/src/main/java/im/vector/app/features/login/terms/PolicyItem.kt @@ -21,15 +21,15 @@ import android.widget.CompoundButton import android.widget.TextView import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass -import com.airbnb.epoxy.EpoxyModelWithHolder import im.vector.app.R import im.vector.app.core.epoxy.ClickListener import im.vector.app.core.epoxy.VectorEpoxyHolder +import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.epoxy.onClick import im.vector.app.core.extensions.setHorizontalPadding -@EpoxyModelClass(layout = R.layout.item_policy) -abstract class PolicyItem : EpoxyModelWithHolder() { +@EpoxyModelClass +abstract class PolicyItem : VectorEpoxyModel(R.layout.item_policy) { @EpoxyAttribute var checked: Boolean = false diff --git a/vector/src/main/java/im/vector/app/features/onboarding/OnboardingAction.kt b/vector/src/main/java/im/vector/app/features/onboarding/OnboardingAction.kt index b6a7550a58..96b0bc45d6 100644 --- a/vector/src/main/java/im/vector/app/features/onboarding/OnboardingAction.kt +++ b/vector/src/main/java/im/vector/app/features/onboarding/OnboardingAction.kt @@ -47,7 +47,9 @@ sealed interface OnboardingAction : VectorViewModelAction { data class LoginWithToken(val loginToken: String) : OnboardingAction data class WebLoginSuccess(val credentials: Credentials) : OnboardingAction data class InitWith(val loginConfig: LoginConfig?) : OnboardingAction - data class ResetPassword(val email: String, val newPassword: String) : OnboardingAction + data class ResetPassword(val email: String, val newPassword: String?) : OnboardingAction + data class ConfirmNewPassword(val newPassword: String, val signOutAllDevices: Boolean) : OnboardingAction + object ResendResetPassword : OnboardingAction object ResetPasswordMailConfirmed : OnboardingAction data class MaybeUpdateHomeserverFromMatrixId(val userId: String) : OnboardingAction diff --git a/vector/src/main/java/im/vector/app/features/onboarding/OnboardingViewEvents.kt b/vector/src/main/java/im/vector/app/features/onboarding/OnboardingViewEvents.kt index bf53a72cc3..ea6981a2b5 100644 --- a/vector/src/main/java/im/vector/app/features/onboarding/OnboardingViewEvents.kt +++ b/vector/src/main/java/im/vector/app/features/onboarding/OnboardingViewEvents.kt @@ -47,9 +47,11 @@ sealed class OnboardingViewEvents : VectorViewEvents { object OnHomeserverEdited : OnboardingViewEvents() data class OnSignModeSelected(val signMode: SignMode) : OnboardingViewEvents() object OnForgetPasswordClicked : OnboardingViewEvents() - object OnResetPasswordSendThreePidDone : OnboardingViewEvents() - object OnResetPasswordMailConfirmationSuccess : OnboardingViewEvents() - object OnResetPasswordMailConfirmationSuccessDone : OnboardingViewEvents() + + data class OnResetPasswordEmailConfirmationSent(val email: String) : OnboardingViewEvents() + object OpenResetPasswordComplete : OnboardingViewEvents() + object OnResetPasswordBreakerConfirmed : OnboardingViewEvents() + object OnResetPasswordComplete : OnboardingViewEvents() data class OnSendEmailSuccess(val email: String) : OnboardingViewEvents() data class OnSendMsisdnSuccess(val msisdn: String) : OnboardingViewEvents() diff --git a/vector/src/main/java/im/vector/app/features/onboarding/OnboardingViewModel.kt b/vector/src/main/java/im/vector/app/features/onboarding/OnboardingViewModel.kt index 38a72441e0..b5f5682be1 100644 --- a/vector/src/main/java/im/vector/app/features/onboarding/OnboardingViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/onboarding/OnboardingViewModel.kt @@ -149,6 +149,8 @@ class OnboardingViewModel @AssistedInject constructor( is OnboardingAction.LoginWithToken -> handleLoginWithToken(action) is OnboardingAction.WebLoginSuccess -> handleWebLoginSuccess(action) is OnboardingAction.ResetPassword -> handleResetPassword(action) + OnboardingAction.ResendResetPassword -> handleResendResetPassword() + is OnboardingAction.ConfirmNewPassword -> handleResetPasswordConfirmed(action) is OnboardingAction.ResetPasswordMailConfirmed -> handleResetPasswordMailConfirmed() is OnboardingAction.PostRegisterAction -> handleRegisterAction(action.registerAction) is OnboardingAction.ResetAction -> handleResetAction(action) @@ -439,25 +441,9 @@ class OnboardingViewModel @AssistedInject constructor( } private fun handleResetPassword(action: OnboardingAction.ResetPassword) { - val safeLoginWizard = loginWizard - setState { copy(isLoading = true) } - currentJob = viewModelScope.launch { - runCatching { safeLoginWizard.resetPassword(action.email) }.fold( - onSuccess = { - val state = awaitState() - setState { - copy( - isLoading = false, - resetState = createResetState(action, state.selectedHomeserver) - ) - } - _viewEvents.post(OnboardingViewEvents.OnResetPasswordSendThreePidDone) - }, - onFailure = { - setState { copy(isLoading = false) } - _viewEvents.post(OnboardingViewEvents.Failure(it)) - } - ) + startResetPasswordFlow(action.email) { + setState { copy(isLoading = false, resetState = createResetState(action, selectedHomeserver)) } + _viewEvents.post(OnboardingViewEvents.OnResetPasswordEmailConfirmationSent(action.email)) } } @@ -467,6 +453,41 @@ class OnboardingViewModel @AssistedInject constructor( supportsLogoutAllDevices = selectedHomeserverState.isLogoutDevicesSupported ) + private fun handleResendResetPassword() { + withState { state -> + val resetState = state.resetState + when (resetState.email) { + null -> _viewEvents.post(OnboardingViewEvents.Failure(IllegalStateException("Developer error - No reset email has been set"))) + else -> { + startResetPasswordFlow(resetState.email) { + setState { copy(isLoading = false) } + } + } + } + } + } + + private fun startResetPasswordFlow(email: String, onSuccess: suspend () -> Unit) { + val safeLoginWizard = loginWizard + setState { copy(isLoading = true) } + currentJob = viewModelScope.launch { + runCatching { safeLoginWizard.resetPassword(email) }.fold( + onSuccess = { onSuccess.invoke() }, + onFailure = { + setState { copy(isLoading = false) } + _viewEvents.post(OnboardingViewEvents.Failure(it)) + } + ) + } + } + + private fun handleResetPasswordConfirmed(action: OnboardingAction.ConfirmNewPassword) { + setState { copy(isLoading = true) } + currentJob = viewModelScope.launch { + confirmPasswordReset(action.newPassword, action.signOutAllDevices) + } + } + private fun handleResetPasswordMailConfirmed() { setState { copy(isLoading = true) } currentJob = viewModelScope.launch { @@ -476,27 +497,28 @@ class OnboardingViewModel @AssistedInject constructor( setState { copy(isLoading = false) } _viewEvents.post(OnboardingViewEvents.Failure(IllegalStateException("Developer error - No new password has been set"))) } - else -> { - runCatching { loginWizard.resetPasswordMailConfirmed(newPassword) }.fold( - onSuccess = { - setState { - copy( - isLoading = false, - resetState = ResetState() - ) - } - _viewEvents.post(OnboardingViewEvents.OnResetPasswordMailConfirmationSuccess) - }, - onFailure = { - setState { copy(isLoading = false) } - _viewEvents.post(OnboardingViewEvents.Failure(it)) - } - ) - } + else -> confirmPasswordReset(newPassword, logoutAllDevices = true) } } } + private suspend fun confirmPasswordReset(newPassword: String, logoutAllDevices: Boolean) { + runCatching { loginWizard.resetPasswordMailConfirmed(newPassword, logoutAllDevices = logoutAllDevices) }.fold( + onSuccess = { + setState { copy(isLoading = false, resetState = ResetState()) } + val nextEvent = when { + vectorFeatures.isOnboardingCombinedLoginEnabled() -> OnboardingViewEvents.OnResetPasswordComplete + else -> OnboardingViewEvents.OpenResetPasswordComplete + } + _viewEvents.post(nextEvent) + }, + onFailure = { + setState { copy(isLoading = false) } + _viewEvents.post(OnboardingViewEvents.Failure(it)) + } + ) + } + private fun handleDirectLogin(action: AuthenticateAction.LoginDirect, homeServerConnectionConfig: HomeServerConnectionConfig?) { setState { copy(isLoading = true) } currentJob = viewModelScope.launch { diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthCombinedLoginFragment.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthCombinedLoginFragment.kt index 205a604aab..d9086952da 100644 --- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthCombinedLoginFragment.kt +++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthCombinedLoginFragment.kt @@ -61,6 +61,7 @@ class FtueAuthCombinedLoginFragment @Inject constructor( views.editServerButton.debouncedClicks { viewModel.handle(OnboardingAction.PostViewEvent(OnboardingViewEvents.EditServerSelection)) } views.loginPasswordInput.setOnImeDoneListener { submit() } views.loginInput.setOnFocusLostListener { viewModel.handle(OnboardingAction.MaybeUpdateHomeserverFromMatrixId(views.loginInput.content())) } + views.loginForgotPassword.debouncedClicks { viewModel.handle(OnboardingAction.PostViewEvent(OnboardingViewEvents.OnForgetPasswordClicked)) } } private fun setupSubmitButton() { diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthCombinedServerSelectionFragment.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthCombinedServerSelectionFragment.kt index b689f40837..bc44a7dbdb 100644 --- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthCombinedServerSelectionFragment.kt +++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthCombinedServerSelectionFragment.kt @@ -21,8 +21,8 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.view.inputmethod.EditorInfo -import androidx.lifecycle.lifecycleScope import im.vector.app.R +import im.vector.app.core.extensions.clearErrorOnChange import im.vector.app.core.extensions.content import im.vector.app.core.extensions.editText import im.vector.app.core.extensions.realignPercentagesToParent @@ -34,10 +34,7 @@ import im.vector.app.databinding.FragmentFtueServerSelectionCombinedBinding import im.vector.app.features.onboarding.OnboardingAction import im.vector.app.features.onboarding.OnboardingViewEvents import im.vector.app.features.onboarding.OnboardingViewState -import kotlinx.coroutines.flow.launchIn -import kotlinx.coroutines.flow.onEach import org.matrix.android.sdk.api.failure.isHomeserverUnavailable -import reactivecircus.flowbinding.android.widget.textChanges import javax.inject.Inject class FtueAuthCombinedServerSelectionFragment @Inject constructor() : AbstractFtueAuthFragment() { @@ -66,9 +63,7 @@ class FtueAuthCombinedServerSelectionFragment @Inject constructor() : AbstractFt } views.chooseServerGetInTouch.debouncedClicks { openUrlInExternalBrowser(requireContext(), getString(R.string.ftue_ems_url)) } views.chooseServerSubmit.debouncedClicks { updateServerUrl() } - views.chooseServerInput.editText().textChanges() - .onEach { views.chooseServerInput.error = null } - .launchIn(viewLifecycleOwner.lifecycleScope) + views.chooseServerInput.clearErrorOnChange(viewLifecycleOwner) } private fun updateServerUrl() { diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthEmailEntryFragment.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthEmailEntryFragment.kt index ea376709f5..523d576120 100644 --- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthEmailEntryFragment.kt +++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthEmailEntryFragment.kt @@ -20,19 +20,15 @@ import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup -import androidx.lifecycle.lifecycleScope import im.vector.app.core.extensions.associateContentStateWith +import im.vector.app.core.extensions.clearErrorOnChange import im.vector.app.core.extensions.content -import im.vector.app.core.extensions.editText import im.vector.app.core.extensions.isEmail import im.vector.app.core.extensions.setOnImeDoneListener import im.vector.app.databinding.FragmentFtueEmailInputBinding import im.vector.app.features.onboarding.OnboardingAction import im.vector.app.features.onboarding.RegisterAction -import kotlinx.coroutines.flow.launchIn -import kotlinx.coroutines.flow.onEach import org.matrix.android.sdk.api.auth.registration.RegisterThreePid -import reactivecircus.flowbinding.android.widget.textChanges import javax.inject.Inject class FtueAuthEmailEntryFragment @Inject constructor() : AbstractFtueAuthFragment() { @@ -47,16 +43,10 @@ class FtueAuthEmailEntryFragment @Inject constructor() : AbstractFtueAuthFragmen } private fun setupViews() { - views.emailEntryInput.associateContentStateWith(button = views.emailEntrySubmit) + views.emailEntryInput.associateContentStateWith(button = views.emailEntrySubmit, enabledPredicate = { it.isEmail() }) views.emailEntryInput.setOnImeDoneListener { updateEmail() } + views.emailEntryInput.clearErrorOnChange(viewLifecycleOwner) views.emailEntrySubmit.debouncedClicks { updateEmail() } - - views.emailEntryInput.editText().textChanges() - .onEach { - views.emailEntryInput.error = null - views.emailEntrySubmit.isEnabled = it.isEmail() - } - .launchIn(viewLifecycleOwner.lifecycleScope) } private fun updateEmail() { diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthResetPasswordBreakerFragment.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthResetPasswordBreakerFragment.kt new file mode 100644 index 0000000000..41e24e96c2 --- /dev/null +++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthResetPasswordBreakerFragment.kt @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2022 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package im.vector.app.features.onboarding.ftueauth + +import android.os.Bundle +import android.os.Parcelable +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import com.airbnb.mvrx.args +import dagger.hilt.android.AndroidEntryPoint +import im.vector.app.R +import im.vector.app.core.utils.colorTerminatingFullStop +import im.vector.app.databinding.FragmentFtueResetPasswordBreakerBinding +import im.vector.app.features.onboarding.OnboardingAction +import im.vector.app.features.onboarding.OnboardingViewEvents +import im.vector.app.features.themes.ThemeProvider +import im.vector.app.features.themes.ThemeUtils +import kotlinx.parcelize.Parcelize +import javax.inject.Inject + +@Parcelize +data class FtueAuthResetPasswordBreakerArgument( + val email: String +) : Parcelable + +@AndroidEntryPoint +class FtueAuthResetPasswordBreakerFragment : AbstractFtueAuthFragment() { + + @Inject lateinit var themeProvider: ThemeProvider + private val params: FtueAuthResetPasswordBreakerArgument by args() + + override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentFtueResetPasswordBreakerBinding { + return FragmentFtueResetPasswordBreakerBinding.inflate(inflater, container, false) + } + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + setupUi() + } + + private fun setupUi() { + views.resetPasswordBreakerGradientContainer.setBackgroundResource(themeProvider.ftueBreakerBackground()) + views.resetPasswordBreakerTitle.text = getString(R.string.ftue_auth_reset_password_breaker_title) + .colorTerminatingFullStop(ThemeUtils.getColor(requireContext(), R.attr.colorSecondary)) + views.resetPasswordBreakerSubtitle.text = getString(R.string.ftue_auth_email_verification_subtitle, params.email) + views.resetPasswordBreakerResendEmail.debouncedClicks { viewModel.handle(OnboardingAction.ResendResetPassword) } + views.resetPasswordBreakerFooter.debouncedClicks { + viewModel.handle(OnboardingAction.PostViewEvent(OnboardingViewEvents.OnResetPasswordBreakerConfirmed)) + } + } + + override fun resetViewModel() { + viewModel.handle(OnboardingAction.ResetResetPassword) + } +} diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthResetPasswordEmailEntryFragment.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthResetPasswordEmailEntryFragment.kt new file mode 100644 index 0000000000..e8110569a2 --- /dev/null +++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthResetPasswordEmailEntryFragment.kt @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2022 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package im.vector.app.features.onboarding.ftueauth + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import dagger.hilt.android.AndroidEntryPoint +import im.vector.app.core.extensions.associateContentStateWith +import im.vector.app.core.extensions.clearErrorOnChange +import im.vector.app.core.extensions.content +import im.vector.app.core.extensions.isEmail +import im.vector.app.core.extensions.setOnImeDoneListener +import im.vector.app.databinding.FragmentFtueResetPasswordEmailInputBinding +import im.vector.app.features.onboarding.OnboardingAction + +@AndroidEntryPoint +class FtueAuthResetPasswordEmailEntryFragment : AbstractFtueAuthFragment() { + + override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentFtueResetPasswordEmailInputBinding { + return FragmentFtueResetPasswordEmailInputBinding.inflate(inflater, container, false) + } + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + setupViews() + } + + private fun setupViews() { + views.emailEntryInput.associateContentStateWith(button = views.emailEntrySubmit, enabledPredicate = { it.isEmail() }) + views.emailEntryInput.setOnImeDoneListener { startPasswordReset() } + views.emailEntryInput.clearErrorOnChange(viewLifecycleOwner) + views.emailEntrySubmit.debouncedClicks { startPasswordReset() } + } + + private fun startPasswordReset() { + val email = views.emailEntryInput.content() + viewModel.handle(OnboardingAction.ResetPassword(email = email, newPassword = null)) + } + + override fun onError(throwable: Throwable) { + views.emailEntryInput.error = errorFormatter.toHumanReadable(throwable) + } + + override fun resetViewModel() { + viewModel.handle(OnboardingAction.ResetResetPassword) + } +} diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthResetPasswordEntryFragment.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthResetPasswordEntryFragment.kt new file mode 100644 index 0000000000..6282fded61 --- /dev/null +++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthResetPasswordEntryFragment.kt @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2022 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package im.vector.app.features.onboarding.ftueauth + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import androidx.core.view.isVisible +import dagger.hilt.android.AndroidEntryPoint +import im.vector.app.core.extensions.associateContentStateWith +import im.vector.app.core.extensions.clearErrorOnChange +import im.vector.app.core.extensions.content +import im.vector.app.core.extensions.editText +import im.vector.app.core.extensions.hidePassword +import im.vector.app.core.extensions.setOnImeDoneListener +import im.vector.app.databinding.FragmentFtueResetPasswordInputBinding +import im.vector.app.features.onboarding.OnboardingAction +import im.vector.app.features.onboarding.OnboardingViewState + +@AndroidEntryPoint +class FtueAuthResetPasswordEntryFragment : AbstractFtueAuthFragment() { + + override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentFtueResetPasswordInputBinding { + return FragmentFtueResetPasswordInputBinding.inflate(inflater, container, false) + } + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + setupViews() + } + + private fun setupViews() { + views.newPasswordInput.associateContentStateWith(button = views.newPasswordSubmit) + views.newPasswordInput.setOnImeDoneListener { resetPassword() } + views.newPasswordInput.clearErrorOnChange(viewLifecycleOwner) + views.newPasswordSubmit.debouncedClicks { resetPassword() } + } + + private fun resetPassword() { + viewModel.handle( + OnboardingAction.ConfirmNewPassword( + newPassword = views.newPasswordInput.content(), + signOutAllDevices = views.entrySignOutAll.isChecked + ) + ) + } + + override fun onError(throwable: Throwable) { + views.newPasswordInput.error = errorFormatter.toHumanReadable(throwable) + } + + override fun updateWithState(state: OnboardingViewState) { + views.signedOutAllGroup.isVisible = state.resetState.supportsLogoutAllDevices + + if (state.isLoading) { + views.newPasswordInput.editText().hidePassword() + } + } + + override fun resetViewModel() { + viewModel.handle(OnboardingAction.ResetResetPassword) + } +} diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthResetPasswordSuccessFragment.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthResetPasswordSuccessFragment.kt index adc6e1b214..956566a587 100644 --- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthResetPasswordSuccessFragment.kt +++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthResetPasswordSuccessFragment.kt @@ -41,7 +41,7 @@ class FtueAuthResetPasswordSuccessFragment @Inject constructor() : AbstractFtueA } private fun submit() { - viewModel.handle(OnboardingAction.PostViewEvent(OnboardingViewEvents.OnResetPasswordMailConfirmationSuccessDone)) + viewModel.handle(OnboardingAction.PostViewEvent(OnboardingViewEvents.OnResetPasswordComplete)) } override fun resetViewModel() { diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthVariant.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthVariant.kt index fa37e2edce..2880b16156 100644 --- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthVariant.kt +++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthVariant.kt @@ -20,6 +20,7 @@ import android.content.Intent import android.os.Parcelable import android.view.View import android.view.ViewGroup +import android.widget.Toast import androidx.core.view.ViewCompat import androidx.core.view.children import androidx.core.view.isVisible @@ -29,7 +30,6 @@ import androidx.fragment.app.FragmentTransaction import com.airbnb.mvrx.withState import com.google.android.material.dialog.MaterialAlertDialogBuilder import im.vector.app.R -import im.vector.app.core.extensions.POP_BACK_STACK_EXCLUSIVE import im.vector.app.core.extensions.addFragment import im.vector.app.core.extensions.addFragmentToBackstack import im.vector.app.core.extensions.popBackstack @@ -162,30 +162,38 @@ class FtueAuthVariant( ) is OnboardingViewEvents.OnWebLoginError -> onWebLoginError(viewEvents) is OnboardingViewEvents.OnForgetPasswordClicked -> + when { + vectorFeatures.isOnboardingCombinedLoginEnabled() -> addLoginStageFragmentToBackstack(FtueAuthResetPasswordEmailEntryFragment::class.java) + else -> addLoginStageFragmentToBackstack(FtueAuthResetPasswordFragment::class.java) + } + is OnboardingViewEvents.OnResetPasswordEmailConfirmationSent -> { + supportFragmentManager.popBackStack(FRAGMENT_LOGIN_TAG, FragmentManager.POP_BACK_STACK_INCLUSIVE) + when { + vectorFeatures.isOnboardingCombinedLoginEnabled() -> addLoginStageFragmentToBackstack( + FtueAuthResetPasswordBreakerFragment::class.java, + FtueAuthResetPasswordBreakerArgument(viewEvents.email), + ) + else -> activity.addFragmentToBackstack( + views.loginFragmentContainer, + FtueAuthResetPasswordMailConfirmationFragment::class.java, + ) + } + } + OnboardingViewEvents.OnResetPasswordBreakerConfirmed -> { + supportFragmentManager.popBackStack(FRAGMENT_LOGIN_TAG, FragmentManager.POP_BACK_STACK_INCLUSIVE) activity.addFragmentToBackstack( views.loginFragmentContainer, - FtueAuthResetPasswordFragment::class.java, - option = commonOption - ) - is OnboardingViewEvents.OnResetPasswordSendThreePidDone -> { - supportFragmentManager.popBackStack(FRAGMENT_LOGIN_TAG, POP_BACK_STACK_EXCLUSIVE) - activity.addFragmentToBackstack( - views.loginFragmentContainer, - FtueAuthResetPasswordMailConfirmationFragment::class.java, + FtueAuthResetPasswordEntryFragment::class.java, option = commonOption ) } - is OnboardingViewEvents.OnResetPasswordMailConfirmationSuccess -> { - supportFragmentManager.popBackStack(FRAGMENT_LOGIN_TAG, POP_BACK_STACK_EXCLUSIVE) - activity.addFragmentToBackstack( - views.loginFragmentContainer, - FtueAuthResetPasswordSuccessFragment::class.java, - option = commonOption - ) + is OnboardingViewEvents.OpenResetPasswordComplete -> { + supportFragmentManager.popBackStack(FRAGMENT_LOGIN_TAG, FragmentManager.POP_BACK_STACK_INCLUSIVE) + addLoginStageFragmentToBackstack(FtueAuthResetPasswordSuccessFragment::class.java) } - is OnboardingViewEvents.OnResetPasswordMailConfirmationSuccessDone -> { - // Go back to the login fragment - supportFragmentManager.popBackStack(FRAGMENT_LOGIN_TAG, POP_BACK_STACK_EXCLUSIVE) + OnboardingViewEvents.OnResetPasswordComplete -> { + Toast.makeText(activity, R.string.ftue_auth_password_reset_confirmation, Toast.LENGTH_SHORT).show() + activity.popBackstack() } is OnboardingViewEvents.OnSendEmailSuccess -> { openWaitForEmailVerification(viewEvents.email) @@ -496,4 +504,14 @@ class FtueAuthVariant( option = commonOption ) } + + private fun addLoginStageFragmentToBackstack(fragmentClass: Class, params: Parcelable? = null) { + activity.addFragmentToBackstack( + views.loginFragmentContainer, + fragmentClass, + params, + tag = FRAGMENT_LOGIN_TAG, + option = commonOption + ) + } } diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthWaitForEmailFragment.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthWaitForEmailFragment.kt index 75090f2a55..4649c7c799 100644 --- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthWaitForEmailFragment.kt +++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthWaitForEmailFragment.kt @@ -58,12 +58,7 @@ class FtueAuthWaitForEmailFragment @Inject constructor( } private fun setupUi() { - views.emailVerificationGradientContainer.setBackgroundResource( - when (themeProvider.isLightTheme()) { - true -> R.drawable.bg_waiting_for_email_verification - false -> R.drawable.bg_color_background - } - ) + views.emailVerificationGradientContainer.setBackgroundResource(themeProvider.ftueBreakerBackground()) views.emailVerificationTitle.text = getString(R.string.ftue_auth_email_verification_title) .colorTerminatingFullStop(ThemeUtils.getColor(requireContext(), R.attr.colorSecondary)) views.emailVerificationSubtitle.text = getString(R.string.ftue_auth_email_verification_subtitle, params.email) diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueExtensions.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueExtensions.kt index 8d63fbf547..8deb10b7b8 100644 --- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueExtensions.kt +++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueExtensions.kt @@ -18,9 +18,11 @@ package im.vector.app.features.onboarding.ftueauth import android.widget.Button import com.google.android.material.textfield.TextInputLayout +import im.vector.app.R import im.vector.app.core.extensions.hasContentFlow import im.vector.app.features.login.SignMode import im.vector.app.features.onboarding.OnboardingAction +import im.vector.app.features.themes.ThemeProvider import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.onEach @@ -49,3 +51,8 @@ fun observeContentChangesAndResetErrors(username: TextInputLayout, password: Tex submit.isEnabled = it } } + +fun ThemeProvider.ftueBreakerBackground() = when (isLightTheme()) { + true -> R.drawable.bg_gradient_ftue_breaker + false -> R.drawable.bg_color_background +} diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/SplashCarouselItem.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/SplashCarouselItem.kt index dc56820424..24f8fc5f45 100644 --- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/SplashCarouselItem.kt +++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/SplashCarouselItem.kt @@ -24,8 +24,8 @@ import im.vector.app.R import im.vector.app.core.epoxy.VectorEpoxyHolder import im.vector.app.core.epoxy.VectorEpoxyModel -@EpoxyModelClass(layout = R.layout.item_splash_carousel) -abstract class SplashCarouselItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class SplashCarouselItem : VectorEpoxyModel(R.layout.item_splash_carousel) { @EpoxyAttribute lateinit var item: SplashCarouselState.Item diff --git a/vector/src/main/java/im/vector/app/features/poll/create/PollTypeSelectionItem.kt b/vector/src/main/java/im/vector/app/features/poll/create/PollTypeSelectionItem.kt index 8232e2ebb9..daa7f0e907 100644 --- a/vector/src/main/java/im/vector/app/features/poll/create/PollTypeSelectionItem.kt +++ b/vector/src/main/java/im/vector/app/features/poll/create/PollTypeSelectionItem.kt @@ -24,8 +24,8 @@ import im.vector.app.core.epoxy.VectorEpoxyHolder import im.vector.app.core.epoxy.VectorEpoxyModel import org.matrix.android.sdk.api.session.room.model.message.PollType -@EpoxyModelClass(layout = R.layout.item_poll_type_selection) -abstract class PollTypeSelectionItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class PollTypeSelectionItem : VectorEpoxyModel(R.layout.item_poll_type_selection) { @EpoxyAttribute var pollType: PollType = PollType.DISCLOSED_UNSTABLE diff --git a/vector/src/main/java/im/vector/app/features/reactions/EmojiSearchResultItem.kt b/vector/src/main/java/im/vector/app/features/reactions/EmojiSearchResultItem.kt index 32a8be9460..8fa897a2e0 100644 --- a/vector/src/main/java/im/vector/app/features/reactions/EmojiSearchResultItem.kt +++ b/vector/src/main/java/im/vector/app/features/reactions/EmojiSearchResultItem.kt @@ -19,16 +19,16 @@ import android.graphics.Typeface import android.widget.TextView import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass -import com.airbnb.epoxy.EpoxyModelWithHolder import im.vector.app.R import im.vector.app.core.epoxy.ClickListener import im.vector.app.core.epoxy.VectorEpoxyHolder +import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.epoxy.onClick import im.vector.app.core.extensions.setTextOrHide import im.vector.app.features.reactions.data.EmojiItem -@EpoxyModelClass(layout = R.layout.item_emoji_result) -abstract class EmojiSearchResultItem : EpoxyModelWithHolder() { +@EpoxyModelClass +abstract class EmojiSearchResultItem : VectorEpoxyModel(R.layout.item_emoji_result) { @EpoxyAttribute lateinit var emojiItem: EmojiItem diff --git a/vector/src/main/java/im/vector/app/features/roomdirectory/PublicRoomItem.kt b/vector/src/main/java/im/vector/app/features/roomdirectory/PublicRoomItem.kt index ff1bcb6c97..e542277d4c 100644 --- a/vector/src/main/java/im/vector/app/features/roomdirectory/PublicRoomItem.kt +++ b/vector/src/main/java/im/vector/app/features/roomdirectory/PublicRoomItem.kt @@ -31,8 +31,8 @@ import im.vector.app.core.platform.ButtonStateView import im.vector.app.features.home.AvatarRenderer import org.matrix.android.sdk.api.util.MatrixItem -@EpoxyModelClass(layout = R.layout.item_public_room) -abstract class PublicRoomItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class PublicRoomItem : VectorEpoxyModel(R.layout.item_public_room) { @EpoxyAttribute lateinit var avatarRenderer: AvatarRenderer diff --git a/vector/src/main/java/im/vector/app/features/roomdirectory/UnknownRoomItem.kt b/vector/src/main/java/im/vector/app/features/roomdirectory/UnknownRoomItem.kt index 1383aec54b..a22c5791a3 100644 --- a/vector/src/main/java/im/vector/app/features/roomdirectory/UnknownRoomItem.kt +++ b/vector/src/main/java/im/vector/app/features/roomdirectory/UnknownRoomItem.kt @@ -29,8 +29,8 @@ import im.vector.app.core.epoxy.onClick import im.vector.app.features.home.AvatarRenderer import org.matrix.android.sdk.api.util.MatrixItem -@EpoxyModelClass(layout = R.layout.item_unknown_room) -abstract class UnknownRoomItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class UnknownRoomItem : VectorEpoxyModel(R.layout.item_unknown_room) { @EpoxyAttribute lateinit var avatarRenderer: AvatarRenderer diff --git a/vector/src/main/java/im/vector/app/features/roomdirectory/picker/RoomDirectoryItem.kt b/vector/src/main/java/im/vector/app/features/roomdirectory/picker/RoomDirectoryItem.kt index e898bb2230..f9b77ba8f1 100644 --- a/vector/src/main/java/im/vector/app/features/roomdirectory/picker/RoomDirectoryItem.kt +++ b/vector/src/main/java/im/vector/app/features/roomdirectory/picker/RoomDirectoryItem.kt @@ -32,8 +32,8 @@ import im.vector.app.core.epoxy.onClick import im.vector.app.core.extensions.setTextOrHide import im.vector.app.core.glide.GlideApp -@EpoxyModelClass(layout = R.layout.item_room_directory) -abstract class RoomDirectoryItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class RoomDirectoryItem : VectorEpoxyModel(R.layout.item_room_directory) { @EpoxyAttribute var directoryAvatarUrl: String? = null diff --git a/vector/src/main/java/im/vector/app/features/roomdirectory/picker/RoomDirectoryServerItem.kt b/vector/src/main/java/im/vector/app/features/roomdirectory/picker/RoomDirectoryServerItem.kt index 572f732369..d65a35c200 100644 --- a/vector/src/main/java/im/vector/app/features/roomdirectory/picker/RoomDirectoryServerItem.kt +++ b/vector/src/main/java/im/vector/app/features/roomdirectory/picker/RoomDirectoryServerItem.kt @@ -28,8 +28,8 @@ import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.epoxy.onClick import im.vector.app.core.extensions.setTextOrHide -@EpoxyModelClass(layout = R.layout.item_room_directory_server) -abstract class RoomDirectoryServerItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class RoomDirectoryServerItem : VectorEpoxyModel(R.layout.item_room_directory_server) { @EpoxyAttribute var serverName: String? = null diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/members/RoomMemberListFragment.kt b/vector/src/main/java/im/vector/app/features/roomprofile/members/RoomMemberListFragment.kt index 951e3e1dcd..52a2339f13 100644 --- a/vector/src/main/java/im/vector/app/features/roomprofile/members/RoomMemberListFragment.kt +++ b/vector/src/main/java/im/vector/app/features/roomprofile/members/RoomMemberListFragment.kt @@ -21,6 +21,7 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.appcompat.widget.SearchView +import androidx.core.view.isGone import androidx.core.view.isVisible import androidx.recyclerview.widget.RecyclerView import com.airbnb.mvrx.args @@ -114,6 +115,7 @@ class RoomMemberListFragment @Inject constructor( } override fun invalidate() = withState(viewModel) { viewState -> + views.roomSettingGeneric.progressBar.isGone = viewState.areAllMembersLoaded roomMemberListController.setData(viewState) renderRoomSummary(viewState) views.inviteUsersButton.isVisible = viewState.actionsPermissions.canInvite diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/members/RoomMemberListViewModel.kt b/vector/src/main/java/im/vector/app/features/roomprofile/members/RoomMemberListViewModel.kt index 3e6fb7b9d1..915ce51d91 100644 --- a/vector/src/main/java/im/vector/app/features/roomprofile/members/RoomMemberListViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/roomprofile/members/RoomMemberListViewModel.kt @@ -28,6 +28,7 @@ import im.vector.app.core.platform.VectorViewModel import im.vector.app.features.powerlevel.PowerLevelsFlowFactory import kotlinx.coroutines.flow.catch import kotlinx.coroutines.flow.combine +import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.flatMapLatest import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.map @@ -66,6 +67,7 @@ class RoomMemberListViewModel @AssistedInject constructor( companion object : MavericksViewModelFactory by hiltMavericksViewModelFactory() private val room = session.getRoom(initialState.roomId)!! + private val roomFlow = room.flow() init { observeRoomMemberSummaries() @@ -82,8 +84,8 @@ class RoomMemberListViewModel @AssistedInject constructor( } combine( - room.flow().liveRoomMembers(roomMemberQueryParams), - room.flow() + roomFlow.liveRoomMembers(roomMemberQueryParams), + roomFlow .liveStateEvent(EventType.STATE_ROOM_POWER_LEVELS, QueryStringValue.IsEmpty) .mapOptional { it.content.toModel() } .unwrap() @@ -94,8 +96,19 @@ class RoomMemberListViewModel @AssistedInject constructor( copy(roomMemberSummaries = async) } + roomFlow.liveAreAllMembersLoaded() + .distinctUntilChanged() + .onEach { + setState { + copy( + areAllMembersLoaded = it + ) + } + } + .launchIn(viewModelScope) + if (room.roomCryptoService().isEncrypted()) { - room.flow().liveRoomMembers(roomMemberQueryParams) + roomFlow.liveRoomMembers(roomMemberQueryParams) .flatMapLatest { membersSummary -> session.cryptoService().getLiveCryptoDeviceInfo(membersSummary.map { it.userId }) .asFlow() @@ -138,7 +151,7 @@ class RoomMemberListViewModel @AssistedInject constructor( } private fun observeRoomSummary() { - room.flow().liveRoomSummary() + roomFlow.liveRoomSummary() .unwrap() .execute { async -> copy(roomSummary = async) @@ -146,7 +159,7 @@ class RoomMemberListViewModel @AssistedInject constructor( } private fun observeThirdPartyInvites() { - room.flow() + roomFlow .liveStateEvents(setOf(EventType.STATE_ROOM_THIRD_PARTY_INVITE), QueryStringValue.IsNotNull) .execute { async -> copy(threePidInvites = async) diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/members/RoomMemberListViewState.kt b/vector/src/main/java/im/vector/app/features/roomprofile/members/RoomMemberListViewState.kt index 47a89b523a..3cea47e60d 100644 --- a/vector/src/main/java/im/vector/app/features/roomprofile/members/RoomMemberListViewState.kt +++ b/vector/src/main/java/im/vector/app/features/roomprofile/members/RoomMemberListViewState.kt @@ -32,6 +32,7 @@ data class RoomMemberListViewState( val roomId: String, val roomSummary: Async = Uninitialized, val roomMemberSummaries: Async = Uninitialized, + val areAllMembersLoaded: Boolean = false, val ignoredUserIds: List = emptyList(), val filter: String = "", val threePidInvites: Async> = Uninitialized, diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/settings/joinrule/SpaceJoinRuleItem.kt b/vector/src/main/java/im/vector/app/features/roomprofile/settings/joinrule/SpaceJoinRuleItem.kt index 382ef1c545..eaba1a5fef 100644 --- a/vector/src/main/java/im/vector/app/features/roomprofile/settings/joinrule/SpaceJoinRuleItem.kt +++ b/vector/src/main/java/im/vector/app/features/roomprofile/settings/joinrule/SpaceJoinRuleItem.kt @@ -33,8 +33,8 @@ import im.vector.app.core.utils.DebouncedClickListener import im.vector.app.features.home.AvatarRenderer import org.matrix.android.sdk.api.util.MatrixItem -@EpoxyModelClass(layout = R.layout.item_bottom_sheet_joinrule_restricted) -abstract class SpaceJoinRuleItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class SpaceJoinRuleItem : VectorEpoxyModel(R.layout.item_bottom_sheet_joinrule_restricted) { @EpoxyAttribute var selected: Boolean = false diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/uploads/files/UploadsFileItem.kt b/vector/src/main/java/im/vector/app/features/roomprofile/uploads/files/UploadsFileItem.kt index 6b75209224..eeef076312 100644 --- a/vector/src/main/java/im/vector/app/features/roomprofile/uploads/files/UploadsFileItem.kt +++ b/vector/src/main/java/im/vector/app/features/roomprofile/uploads/files/UploadsFileItem.kt @@ -25,8 +25,8 @@ import im.vector.app.core.epoxy.VectorEpoxyHolder import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.extensions.setTextOrHide -@EpoxyModelClass(layout = R.layout.item_uploads_file) -abstract class UploadsFileItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class UploadsFileItem : VectorEpoxyModel(R.layout.item_uploads_file) { @EpoxyAttribute var title: String? = null @EpoxyAttribute var subtitle: String? = null diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/uploads/media/UploadsImageItem.kt b/vector/src/main/java/im/vector/app/features/roomprofile/uploads/media/UploadsImageItem.kt index c4ee807b06..12be88ffa6 100644 --- a/vector/src/main/java/im/vector/app/features/roomprofile/uploads/media/UploadsImageItem.kt +++ b/vector/src/main/java/im/vector/app/features/roomprofile/uploads/media/UploadsImageItem.kt @@ -27,8 +27,8 @@ import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.epoxy.onClick import im.vector.app.features.media.ImageContentRenderer -@EpoxyModelClass(layout = R.layout.item_uploads_image) -abstract class UploadsImageItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class UploadsImageItem : VectorEpoxyModel(R.layout.item_uploads_image) { @EpoxyAttribute lateinit var imageContentRenderer: ImageContentRenderer @EpoxyAttribute lateinit var data: ImageContentRenderer.Data diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/uploads/media/UploadsVideoItem.kt b/vector/src/main/java/im/vector/app/features/roomprofile/uploads/media/UploadsVideoItem.kt index e2f0d6eee9..fdc69f0d8f 100644 --- a/vector/src/main/java/im/vector/app/features/roomprofile/uploads/media/UploadsVideoItem.kt +++ b/vector/src/main/java/im/vector/app/features/roomprofile/uploads/media/UploadsVideoItem.kt @@ -28,8 +28,8 @@ import im.vector.app.core.epoxy.onClick import im.vector.app.features.media.ImageContentRenderer import im.vector.app.features.media.VideoContentRenderer -@EpoxyModelClass(layout = R.layout.item_uploads_video) -abstract class UploadsVideoItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class UploadsVideoItem : VectorEpoxyModel(R.layout.item_uploads_video) { @EpoxyAttribute lateinit var imageContentRenderer: ImageContentRenderer @EpoxyAttribute lateinit var data: VideoContentRenderer.Data diff --git a/vector/src/main/java/im/vector/app/features/settings/devices/DeviceItem.kt b/vector/src/main/java/im/vector/app/features/settings/devices/DeviceItem.kt index b0f6261424..6486b8a3ca 100644 --- a/vector/src/main/java/im/vector/app/features/settings/devices/DeviceItem.kt +++ b/vector/src/main/java/im/vector/app/features/settings/devices/DeviceItem.kt @@ -37,8 +37,8 @@ import org.matrix.android.sdk.api.session.crypto.model.DeviceInfo /** * A list item for Device. */ -@EpoxyModelClass(layout = R.layout.item_device) -abstract class DeviceItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class DeviceItem : VectorEpoxyModel(R.layout.item_device) { @EpoxyAttribute lateinit var deviceInfo: DeviceInfo diff --git a/vector/src/main/java/im/vector/app/features/settings/ignored/UserItem.kt b/vector/src/main/java/im/vector/app/features/settings/ignored/UserItem.kt index bb27a8be36..ec02148aca 100644 --- a/vector/src/main/java/im/vector/app/features/settings/ignored/UserItem.kt +++ b/vector/src/main/java/im/vector/app/features/settings/ignored/UserItem.kt @@ -32,8 +32,8 @@ import org.matrix.android.sdk.api.util.MatrixItem /** * A list item for User. */ -@EpoxyModelClass(layout = R.layout.item_user) -abstract class UserItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class UserItem : VectorEpoxyModel(R.layout.item_user) { @EpoxyAttribute lateinit var avatarRenderer: AvatarRenderer diff --git a/vector/src/main/java/im/vector/app/features/settings/locale/LocaleItem.kt b/vector/src/main/java/im/vector/app/features/settings/locale/LocaleItem.kt index c74fb7c5cf..2478ae4cea 100644 --- a/vector/src/main/java/im/vector/app/features/settings/locale/LocaleItem.kt +++ b/vector/src/main/java/im/vector/app/features/settings/locale/LocaleItem.kt @@ -26,8 +26,8 @@ import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.epoxy.onClick import im.vector.app.core.extensions.setTextOrHide -@EpoxyModelClass(layout = R.layout.item_locale) -abstract class LocaleItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class LocaleItem : VectorEpoxyModel(R.layout.item_locale) { @EpoxyAttribute var title: String? = null @EpoxyAttribute var subtitle: String? = null diff --git a/vector/src/main/java/im/vector/app/features/settings/push/PushGatewayItem.kt b/vector/src/main/java/im/vector/app/features/settings/push/PushGatewayItem.kt index 03eb581b7f..5ef6e02330 100644 --- a/vector/src/main/java/im/vector/app/features/settings/push/PushGatewayItem.kt +++ b/vector/src/main/java/im/vector/app/features/settings/push/PushGatewayItem.kt @@ -20,14 +20,14 @@ import android.view.View import android.widget.TextView import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass -import com.airbnb.epoxy.EpoxyModelWithHolder import im.vector.app.R import im.vector.app.core.epoxy.VectorEpoxyHolder +import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.extensions.setTextOrHide import org.matrix.android.sdk.api.session.pushers.Pusher -@EpoxyModelClass(layout = R.layout.item_pushgateway) -abstract class PushGatewayItem : EpoxyModelWithHolder() { +@EpoxyModelClass +abstract class PushGatewayItem : VectorEpoxyModel(R.layout.item_pushgateway) { @EpoxyAttribute lateinit var pusher: Pusher diff --git a/vector/src/main/java/im/vector/app/features/settings/push/PushRuleItem.kt b/vector/src/main/java/im/vector/app/features/settings/push/PushRuleItem.kt index d56562a7dd..5a1dd055bd 100644 --- a/vector/src/main/java/im/vector/app/features/settings/push/PushRuleItem.kt +++ b/vector/src/main/java/im/vector/app/features/settings/push/PushRuleItem.kt @@ -25,16 +25,16 @@ import androidx.core.view.isInvisible import androidx.core.view.isVisible import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass -import com.airbnb.epoxy.EpoxyModelWithHolder import im.vector.app.R import im.vector.app.core.epoxy.VectorEpoxyHolder +import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.features.notifications.toNotificationAction import im.vector.app.features.themes.ThemeUtils import org.matrix.android.sdk.api.session.pushrules.getActions import org.matrix.android.sdk.api.session.pushrules.rest.PushRule -@EpoxyModelClass(layout = R.layout.item_pushrule_raw) -abstract class PushRuleItem : EpoxyModelWithHolder() { +@EpoxyModelClass +abstract class PushRuleItem : VectorEpoxyModel(R.layout.item_pushrule_raw) { @EpoxyAttribute lateinit var pushRule: PushRule diff --git a/vector/src/main/java/im/vector/app/features/settings/threepids/ThreePidItem.kt b/vector/src/main/java/im/vector/app/features/settings/threepids/ThreePidItem.kt index 814651dd04..4027b0adf2 100644 --- a/vector/src/main/java/im/vector/app/features/settings/threepids/ThreePidItem.kt +++ b/vector/src/main/java/im/vector/app/features/settings/threepids/ThreePidItem.kt @@ -22,14 +22,14 @@ import androidx.annotation.DrawableRes import androidx.core.view.isVisible import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass -import com.airbnb.epoxy.EpoxyModelWithHolder import im.vector.app.R import im.vector.app.core.epoxy.ClickListener import im.vector.app.core.epoxy.VectorEpoxyHolder +import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.epoxy.onClick -@EpoxyModelClass(layout = R.layout.item_settings_three_pid) -abstract class ThreePidItem : EpoxyModelWithHolder() { +@EpoxyModelClass +abstract class ThreePidItem : VectorEpoxyModel(R.layout.item_settings_three_pid) { @EpoxyAttribute var title: String? = null diff --git a/vector/src/main/java/im/vector/app/features/signout/soft/epoxy/LoginCenterButtonItem.kt b/vector/src/main/java/im/vector/app/features/signout/soft/epoxy/LoginCenterButtonItem.kt index f3e6378a4b..60cf34c2c2 100644 --- a/vector/src/main/java/im/vector/app/features/signout/soft/epoxy/LoginCenterButtonItem.kt +++ b/vector/src/main/java/im/vector/app/features/signout/soft/epoxy/LoginCenterButtonItem.kt @@ -26,8 +26,8 @@ import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.epoxy.onClick import im.vector.app.core.extensions.setTextOrHide -@EpoxyModelClass(layout = R.layout.item_login_centered_button) -abstract class LoginCenterButtonItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class LoginCenterButtonItem : VectorEpoxyModel(R.layout.item_login_centered_button) { @EpoxyAttribute var text: String? = null @EpoxyAttribute(EpoxyAttribute.Option.DoNotHash) var listener: ClickListener? = null diff --git a/vector/src/main/java/im/vector/app/features/signout/soft/epoxy/LoginErrorWithRetryItem.kt b/vector/src/main/java/im/vector/app/features/signout/soft/epoxy/LoginErrorWithRetryItem.kt index 834fedb272..e190a41823 100644 --- a/vector/src/main/java/im/vector/app/features/signout/soft/epoxy/LoginErrorWithRetryItem.kt +++ b/vector/src/main/java/im/vector/app/features/signout/soft/epoxy/LoginErrorWithRetryItem.kt @@ -26,8 +26,8 @@ import im.vector.app.core.epoxy.VectorEpoxyHolder import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.epoxy.onClick -@EpoxyModelClass(layout = R.layout.item_login_error_retry) -abstract class LoginErrorWithRetryItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class LoginErrorWithRetryItem : VectorEpoxyModel(R.layout.item_login_error_retry) { @EpoxyAttribute var text: String? = null diff --git a/vector/src/main/java/im/vector/app/features/signout/soft/epoxy/LoginHeaderItem.kt b/vector/src/main/java/im/vector/app/features/signout/soft/epoxy/LoginHeaderItem.kt index 0ce50b9cdb..904835a9c5 100644 --- a/vector/src/main/java/im/vector/app/features/signout/soft/epoxy/LoginHeaderItem.kt +++ b/vector/src/main/java/im/vector/app/features/signout/soft/epoxy/LoginHeaderItem.kt @@ -21,7 +21,7 @@ import im.vector.app.R import im.vector.app.core.epoxy.VectorEpoxyHolder import im.vector.app.core.epoxy.VectorEpoxyModel -@EpoxyModelClass(layout = R.layout.item_login_header) -abstract class LoginHeaderItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class LoginHeaderItem : VectorEpoxyModel(R.layout.item_login_header) { class Holder : VectorEpoxyHolder() } diff --git a/vector/src/main/java/im/vector/app/features/signout/soft/epoxy/LoginPasswordFormItem.kt b/vector/src/main/java/im/vector/app/features/signout/soft/epoxy/LoginPasswordFormItem.kt index c032da7192..ac65e6f641 100644 --- a/vector/src/main/java/im/vector/app/features/signout/soft/epoxy/LoginPasswordFormItem.kt +++ b/vector/src/main/java/im/vector/app/features/signout/soft/epoxy/LoginPasswordFormItem.kt @@ -35,8 +35,8 @@ import im.vector.app.core.epoxy.setValueOnce import im.vector.app.core.platform.SimpleTextWatcher import im.vector.app.core.resources.StringProvider -@EpoxyModelClass(layout = R.layout.item_login_password_form) -abstract class LoginPasswordFormItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class LoginPasswordFormItem : VectorEpoxyModel(R.layout.item_login_password_form) { @EpoxyAttribute var passwordValue: String = "" @EpoxyAttribute var submitEnabled: Boolean = false diff --git a/vector/src/main/java/im/vector/app/features/signout/soft/epoxy/LoginRedButtonItem.kt b/vector/src/main/java/im/vector/app/features/signout/soft/epoxy/LoginRedButtonItem.kt index 981de3c962..3febdc20b6 100644 --- a/vector/src/main/java/im/vector/app/features/signout/soft/epoxy/LoginRedButtonItem.kt +++ b/vector/src/main/java/im/vector/app/features/signout/soft/epoxy/LoginRedButtonItem.kt @@ -26,8 +26,8 @@ import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.epoxy.onClick import im.vector.app.core.extensions.setTextOrHide -@EpoxyModelClass(layout = R.layout.item_login_red_button) -abstract class LoginRedButtonItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class LoginRedButtonItem : VectorEpoxyModel(R.layout.item_login_red_button) { @EpoxyAttribute var text: String? = null @EpoxyAttribute(EpoxyAttribute.Option.DoNotHash) var listener: ClickListener? = null diff --git a/vector/src/main/java/im/vector/app/features/signout/soft/epoxy/LoginTextItem.kt b/vector/src/main/java/im/vector/app/features/signout/soft/epoxy/LoginTextItem.kt index f2727379ab..b036b2d77a 100644 --- a/vector/src/main/java/im/vector/app/features/signout/soft/epoxy/LoginTextItem.kt +++ b/vector/src/main/java/im/vector/app/features/signout/soft/epoxy/LoginTextItem.kt @@ -24,8 +24,8 @@ import im.vector.app.core.epoxy.VectorEpoxyHolder import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.extensions.setTextOrHide -@EpoxyModelClass(layout = R.layout.item_login_text) -abstract class LoginTextItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class LoginTextItem : VectorEpoxyModel(R.layout.item_login_text) { @EpoxyAttribute var text: String? = null diff --git a/vector/src/main/java/im/vector/app/features/signout/soft/epoxy/LoginTitleItem.kt b/vector/src/main/java/im/vector/app/features/signout/soft/epoxy/LoginTitleItem.kt index dcb565b490..d2627590d8 100644 --- a/vector/src/main/java/im/vector/app/features/signout/soft/epoxy/LoginTitleItem.kt +++ b/vector/src/main/java/im/vector/app/features/signout/soft/epoxy/LoginTitleItem.kt @@ -24,8 +24,8 @@ import im.vector.app.core.epoxy.VectorEpoxyHolder import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.extensions.setTextOrHide -@EpoxyModelClass(layout = R.layout.item_login_title) -abstract class LoginTitleItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class LoginTitleItem : VectorEpoxyModel(R.layout.item_login_title) { @EpoxyAttribute var text: String? = null diff --git a/vector/src/main/java/im/vector/app/features/signout/soft/epoxy/LoginTitleSmallItem.kt b/vector/src/main/java/im/vector/app/features/signout/soft/epoxy/LoginTitleSmallItem.kt index 04f5ca0a78..796a271b28 100644 --- a/vector/src/main/java/im/vector/app/features/signout/soft/epoxy/LoginTitleSmallItem.kt +++ b/vector/src/main/java/im/vector/app/features/signout/soft/epoxy/LoginTitleSmallItem.kt @@ -24,8 +24,8 @@ import im.vector.app.core.epoxy.VectorEpoxyHolder import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.extensions.setTextOrHide -@EpoxyModelClass(layout = R.layout.item_login_title_small) -abstract class LoginTitleSmallItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class LoginTitleSmallItem : VectorEpoxyModel(R.layout.item_login_title_small) { @EpoxyAttribute var text: String? = null diff --git a/vector/src/main/java/im/vector/app/features/spaces/SpaceAddItem.kt b/vector/src/main/java/im/vector/app/features/spaces/SpaceAddItem.kt index f25de9fe99..02bb702fae 100644 --- a/vector/src/main/java/im/vector/app/features/spaces/SpaceAddItem.kt +++ b/vector/src/main/java/im/vector/app/features/spaces/SpaceAddItem.kt @@ -24,8 +24,8 @@ import im.vector.app.core.epoxy.VectorEpoxyHolder import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.epoxy.onClick -@EpoxyModelClass(layout = R.layout.item_space_add) -abstract class SpaceAddItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class SpaceAddItem : VectorEpoxyModel(R.layout.item_space_add) { @EpoxyAttribute(EpoxyAttribute.Option.DoNotHash) var listener: ClickListener? = null diff --git a/vector/src/main/java/im/vector/app/features/spaces/SpaceBetaHeaderItem.kt b/vector/src/main/java/im/vector/app/features/spaces/SpaceBetaHeaderItem.kt index 667f895d4d..8cf3766c73 100644 --- a/vector/src/main/java/im/vector/app/features/spaces/SpaceBetaHeaderItem.kt +++ b/vector/src/main/java/im/vector/app/features/spaces/SpaceBetaHeaderItem.kt @@ -21,7 +21,7 @@ import im.vector.app.R import im.vector.app.core.epoxy.VectorEpoxyHolder import im.vector.app.core.epoxy.VectorEpoxyModel -@EpoxyModelClass(layout = R.layout.item_space_beta_header) -abstract class SpaceBetaHeaderItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class SpaceBetaHeaderItem : VectorEpoxyModel(R.layout.item_space_beta_header) { class Holder : VectorEpoxyHolder() } diff --git a/vector/src/main/java/im/vector/app/features/spaces/SpaceSummaryItem.kt b/vector/src/main/java/im/vector/app/features/spaces/SpaceSummaryItem.kt index cc75fd5b2e..192c6c8781 100644 --- a/vector/src/main/java/im/vector/app/features/spaces/SpaceSummaryItem.kt +++ b/vector/src/main/java/im/vector/app/features/spaces/SpaceSummaryItem.kt @@ -36,8 +36,8 @@ import im.vector.app.features.home.AvatarRenderer import im.vector.app.features.home.room.list.UnreadCounterBadgeView import org.matrix.android.sdk.api.util.MatrixItem -@EpoxyModelClass(layout = R.layout.item_space) -abstract class SpaceSummaryItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class SpaceSummaryItem : VectorEpoxyModel(R.layout.item_space) { @EpoxyAttribute(EpoxyAttribute.Option.DoNotHash) lateinit var avatarRenderer: AvatarRenderer @EpoxyAttribute lateinit var matrixItem: MatrixItem diff --git a/vector/src/main/java/im/vector/app/features/spaces/SubSpaceSummaryItem.kt b/vector/src/main/java/im/vector/app/features/spaces/SubSpaceSummaryItem.kt index 201282b113..871605c9d8 100644 --- a/vector/src/main/java/im/vector/app/features/spaces/SubSpaceSummaryItem.kt +++ b/vector/src/main/java/im/vector/app/features/spaces/SubSpaceSummaryItem.kt @@ -34,8 +34,8 @@ import im.vector.app.features.home.AvatarRenderer import im.vector.app.features.home.room.list.UnreadCounterBadgeView import org.matrix.android.sdk.api.util.MatrixItem -@EpoxyModelClass(layout = R.layout.item_sub_space) -abstract class SubSpaceSummaryItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class SubSpaceSummaryItem : VectorEpoxyModel(R.layout.item_sub_space) { @EpoxyAttribute(EpoxyAttribute.Option.DoNotHash) lateinit var avatarRenderer: AvatarRenderer @EpoxyAttribute lateinit var matrixItem: MatrixItem diff --git a/vector/src/main/java/im/vector/app/features/spaces/manage/RoomManageSelectionItem.kt b/vector/src/main/java/im/vector/app/features/spaces/manage/RoomManageSelectionItem.kt index 21da4f0dfe..b1ccc1aa59 100644 --- a/vector/src/main/java/im/vector/app/features/spaces/manage/RoomManageSelectionItem.kt +++ b/vector/src/main/java/im/vector/app/features/spaces/manage/RoomManageSelectionItem.kt @@ -31,8 +31,8 @@ import im.vector.app.features.displayname.getBestName import im.vector.app.features.home.AvatarRenderer import org.matrix.android.sdk.api.util.MatrixItem -@EpoxyModelClass(layout = R.layout.item_room_to_manage_in_space) -abstract class RoomManageSelectionItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class RoomManageSelectionItem : VectorEpoxyModel(R.layout.item_room_to_manage_in_space) { @EpoxyAttribute lateinit var avatarRenderer: AvatarRenderer @EpoxyAttribute lateinit var matrixItem: MatrixItem diff --git a/vector/src/main/java/im/vector/app/features/spaces/manage/RoomSelectionItem.kt b/vector/src/main/java/im/vector/app/features/spaces/manage/RoomSelectionItem.kt index df736bebbb..9d101bdb5f 100644 --- a/vector/src/main/java/im/vector/app/features/spaces/manage/RoomSelectionItem.kt +++ b/vector/src/main/java/im/vector/app/features/spaces/manage/RoomSelectionItem.kt @@ -30,8 +30,8 @@ import im.vector.app.features.displayname.getBestName import im.vector.app.features.home.AvatarRenderer import org.matrix.android.sdk.api.util.MatrixItem -@EpoxyModelClass(layout = R.layout.item_room_to_add_in_space) -abstract class RoomSelectionItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class RoomSelectionItem : VectorEpoxyModel(R.layout.item_room_to_add_in_space) { @EpoxyAttribute lateinit var avatarRenderer: AvatarRenderer @EpoxyAttribute lateinit var matrixItem: MatrixItem diff --git a/vector/src/main/java/im/vector/app/features/spaces/manage/RoomSelectionPlaceHolderItem.kt b/vector/src/main/java/im/vector/app/features/spaces/manage/RoomSelectionPlaceHolderItem.kt index 7c116811b4..46aa655a8d 100644 --- a/vector/src/main/java/im/vector/app/features/spaces/manage/RoomSelectionPlaceHolderItem.kt +++ b/vector/src/main/java/im/vector/app/features/spaces/manage/RoomSelectionPlaceHolderItem.kt @@ -21,7 +21,7 @@ import im.vector.app.R import im.vector.app.core.epoxy.VectorEpoxyHolder import im.vector.app.core.epoxy.VectorEpoxyModel -@EpoxyModelClass(layout = R.layout.item_room_to_add_in_space_placeholder) -abstract class RoomSelectionPlaceHolderItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class RoomSelectionPlaceHolderItem : VectorEpoxyModel(R.layout.item_room_to_add_in_space_placeholder) { class Holder : VectorEpoxyHolder() } diff --git a/vector/src/main/java/im/vector/app/features/spaces/people/SpacePeopleFragment.kt b/vector/src/main/java/im/vector/app/features/spaces/people/SpacePeopleFragment.kt index 3f60166ba3..1181ccfa52 100644 --- a/vector/src/main/java/im/vector/app/features/spaces/people/SpacePeopleFragment.kt +++ b/vector/src/main/java/im/vector/app/features/spaces/people/SpacePeopleFragment.kt @@ -20,6 +20,7 @@ import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import androidx.core.view.isGone import androidx.lifecycle.lifecycleScope import com.airbnb.mvrx.Fail import com.airbnb.mvrx.Loading @@ -32,8 +33,6 @@ import im.vector.app.core.extensions.cleanup import im.vector.app.core.extensions.configureWith import im.vector.app.core.platform.OnBackPressed import im.vector.app.core.platform.VectorBaseFragment -import im.vector.app.core.resources.ColorProvider -import im.vector.app.core.resources.DrawableProvider import im.vector.app.databinding.FragmentRecyclerviewWithSearchBinding import im.vector.app.features.roomprofile.members.RoomMemberListAction import im.vector.app.features.roomprofile.members.RoomMemberListViewModel @@ -45,8 +44,6 @@ import reactivecircus.flowbinding.appcompat.queryTextChanges import javax.inject.Inject class SpacePeopleFragment @Inject constructor( - private val drawableProvider: DrawableProvider, - private val colorProvider: ColorProvider, private val epoxyController: SpacePeopleListController ) : VectorBaseFragment(), OnBackPressed, SpacePeopleListController.InteractionListener { @@ -64,6 +61,7 @@ class SpacePeopleFragment @Inject constructor( } override fun invalidate() = withState(membersViewModel) { memberListState -> + views.progressBar.isGone = memberListState.areAllMembersLoaded val memberCount = (memberListState.roomSummary.invoke()?.otherMemberIds?.size ?: 0) + 1 toolbar?.subtitle = resources.getQuantityString(R.plurals.room_title_members, memberCount, memberCount) diff --git a/vector/src/main/java/im/vector/app/features/spaces/preview/RoomChildItem.kt b/vector/src/main/java/im/vector/app/features/spaces/preview/RoomChildItem.kt index bf28618c6c..263cc3ef1d 100644 --- a/vector/src/main/java/im/vector/app/features/spaces/preview/RoomChildItem.kt +++ b/vector/src/main/java/im/vector/app/features/spaces/preview/RoomChildItem.kt @@ -27,8 +27,8 @@ import im.vector.app.core.extensions.setTextOrHide import im.vector.app.features.home.AvatarRenderer import org.matrix.android.sdk.api.util.MatrixItem -@EpoxyModelClass(layout = R.layout.item_space_roomchild) -abstract class RoomChildItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class RoomChildItem : VectorEpoxyModel(R.layout.item_space_roomchild) { @EpoxyAttribute lateinit var roomId: String diff --git a/vector/src/main/java/im/vector/app/features/spaces/preview/SpaceTopSummaryItem.kt b/vector/src/main/java/im/vector/app/features/spaces/preview/SpaceTopSummaryItem.kt index c357fb14b3..eee37a585f 100644 --- a/vector/src/main/java/im/vector/app/features/spaces/preview/SpaceTopSummaryItem.kt +++ b/vector/src/main/java/im/vector/app/features/spaces/preview/SpaceTopSummaryItem.kt @@ -24,8 +24,8 @@ import im.vector.app.core.epoxy.VectorEpoxyHolder import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.extensions.setTextOrHide -@EpoxyModelClass(layout = R.layout.item_space_top_summary) -abstract class SpaceTopSummaryItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class SpaceTopSummaryItem : VectorEpoxyModel(R.layout.item_space_top_summary) { @EpoxyAttribute var topic: String? = null diff --git a/vector/src/main/java/im/vector/app/features/spaces/preview/SubSpaceItem.kt b/vector/src/main/java/im/vector/app/features/spaces/preview/SubSpaceItem.kt index 1856edb61f..b1837be9c6 100644 --- a/vector/src/main/java/im/vector/app/features/spaces/preview/SubSpaceItem.kt +++ b/vector/src/main/java/im/vector/app/features/spaces/preview/SubSpaceItem.kt @@ -26,8 +26,8 @@ import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.features.home.AvatarRenderer import org.matrix.android.sdk.api.util.MatrixItem -@EpoxyModelClass(layout = R.layout.item_space_subspace) -abstract class SubSpaceItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class SubSpaceItem : VectorEpoxyModel(R.layout.item_space_subspace) { @EpoxyAttribute lateinit var roomId: String diff --git a/vector/src/main/java/im/vector/app/features/terms/TermItem.kt b/vector/src/main/java/im/vector/app/features/terms/TermItem.kt index b292c5b119..125139a8ca 100644 --- a/vector/src/main/java/im/vector/app/features/terms/TermItem.kt +++ b/vector/src/main/java/im/vector/app/features/terms/TermItem.kt @@ -21,14 +21,14 @@ import android.widget.CompoundButton import android.widget.TextView import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass -import com.airbnb.epoxy.EpoxyModelWithHolder import im.vector.app.R import im.vector.app.core.epoxy.ClickListener import im.vector.app.core.epoxy.VectorEpoxyHolder +import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.epoxy.onClick -@EpoxyModelClass(layout = R.layout.item_tos) -abstract class TermItem : EpoxyModelWithHolder() { +@EpoxyModelClass +abstract class TermItem : VectorEpoxyModel(R.layout.item_tos) { @EpoxyAttribute var checked: Boolean = false diff --git a/vector/src/main/java/im/vector/app/features/userdirectory/ActionItem.kt b/vector/src/main/java/im/vector/app/features/userdirectory/ActionItem.kt index a4c71c8cb9..fcf117ba88 100644 --- a/vector/src/main/java/im/vector/app/features/userdirectory/ActionItem.kt +++ b/vector/src/main/java/im/vector/app/features/userdirectory/ActionItem.kt @@ -28,8 +28,8 @@ import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.epoxy.onClick import im.vector.app.core.extensions.setTextOrHide -@EpoxyModelClass(layout = R.layout.item_contact_action) -abstract class ActionItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class ActionItem : VectorEpoxyModel(R.layout.item_contact_action) { @EpoxyAttribute var title: String? = null @EpoxyAttribute @DrawableRes var actionIconRes: Int? = null diff --git a/vector/src/main/java/im/vector/app/features/userdirectory/ContactDetailItem.kt b/vector/src/main/java/im/vector/app/features/userdirectory/ContactDetailItem.kt index 8d2e80d4db..3fffb1ec31 100644 --- a/vector/src/main/java/im/vector/app/features/userdirectory/ContactDetailItem.kt +++ b/vector/src/main/java/im/vector/app/features/userdirectory/ContactDetailItem.kt @@ -26,8 +26,8 @@ import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.epoxy.onClick import im.vector.app.core.extensions.setTextOrHide -@EpoxyModelClass(layout = R.layout.item_contact_detail) -abstract class ContactDetailItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class ContactDetailItem : VectorEpoxyModel(R.layout.item_contact_detail) { @EpoxyAttribute lateinit var threePid: String @EpoxyAttribute var matrixId: String? = null diff --git a/vector/src/main/java/im/vector/app/features/userdirectory/ContactItem.kt b/vector/src/main/java/im/vector/app/features/userdirectory/ContactItem.kt index d9f424d961..ea5101d413 100644 --- a/vector/src/main/java/im/vector/app/features/userdirectory/ContactItem.kt +++ b/vector/src/main/java/im/vector/app/features/userdirectory/ContactItem.kt @@ -26,8 +26,8 @@ import im.vector.app.core.epoxy.VectorEpoxyHolder import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.features.home.AvatarRenderer -@EpoxyModelClass(layout = R.layout.item_contact_main) -abstract class ContactItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class ContactItem : VectorEpoxyModel(R.layout.item_contact_main) { @EpoxyAttribute lateinit var avatarRenderer: AvatarRenderer @EpoxyAttribute lateinit var mappedContact: MappedContact diff --git a/vector/src/main/java/im/vector/app/features/userdirectory/InviteByEmailItem.kt b/vector/src/main/java/im/vector/app/features/userdirectory/InviteByEmailItem.kt index 2258239bde..eaeec35791 100644 --- a/vector/src/main/java/im/vector/app/features/userdirectory/InviteByEmailItem.kt +++ b/vector/src/main/java/im/vector/app/features/userdirectory/InviteByEmailItem.kt @@ -27,8 +27,8 @@ import im.vector.app.core.epoxy.VectorEpoxyHolder import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.features.home.AvatarRenderer -@EpoxyModelClass(layout = R.layout.item_invite_by_mail) -abstract class InviteByEmailItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class InviteByEmailItem : VectorEpoxyModel(R.layout.item_invite_by_mail) { @EpoxyAttribute lateinit var avatarRenderer: AvatarRenderer @EpoxyAttribute lateinit var foundItem: ThreePidUser diff --git a/vector/src/main/java/im/vector/app/features/userdirectory/UserDirectoryLetterHeaderItem.kt b/vector/src/main/java/im/vector/app/features/userdirectory/UserDirectoryLetterHeaderItem.kt index 63f68a1f8b..78de9d7925 100644 --- a/vector/src/main/java/im/vector/app/features/userdirectory/UserDirectoryLetterHeaderItem.kt +++ b/vector/src/main/java/im/vector/app/features/userdirectory/UserDirectoryLetterHeaderItem.kt @@ -23,8 +23,8 @@ import im.vector.app.R import im.vector.app.core.epoxy.VectorEpoxyHolder import im.vector.app.core.epoxy.VectorEpoxyModel -@EpoxyModelClass(layout = R.layout.item_user_directory_letter_header) -abstract class UserDirectoryLetterHeaderItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class UserDirectoryLetterHeaderItem : VectorEpoxyModel(R.layout.item_user_directory_letter_header) { @EpoxyAttribute var letter: String = "" diff --git a/vector/src/main/java/im/vector/app/features/userdirectory/UserDirectoryUserItem.kt b/vector/src/main/java/im/vector/app/features/userdirectory/UserDirectoryUserItem.kt index 5138e5694c..5dac059efc 100644 --- a/vector/src/main/java/im/vector/app/features/userdirectory/UserDirectoryUserItem.kt +++ b/vector/src/main/java/im/vector/app/features/userdirectory/UserDirectoryUserItem.kt @@ -31,8 +31,8 @@ import im.vector.app.features.home.AvatarRenderer import im.vector.app.features.themes.ThemeUtils import org.matrix.android.sdk.api.util.MatrixItem -@EpoxyModelClass(layout = R.layout.item_known_user) -abstract class UserDirectoryUserItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class UserDirectoryUserItem : VectorEpoxyModel(R.layout.item_known_user) { @EpoxyAttribute lateinit var avatarRenderer: AvatarRenderer @EpoxyAttribute lateinit var matrixItem: MatrixItem diff --git a/vector/src/main/java/im/vector/app/features/userdirectory/UserListHeaderItem.kt b/vector/src/main/java/im/vector/app/features/userdirectory/UserListHeaderItem.kt index 82fa4a4d6f..bdc2a385e8 100644 --- a/vector/src/main/java/im/vector/app/features/userdirectory/UserListHeaderItem.kt +++ b/vector/src/main/java/im/vector/app/features/userdirectory/UserListHeaderItem.kt @@ -23,8 +23,8 @@ import im.vector.app.R import im.vector.app.core.epoxy.VectorEpoxyHolder import im.vector.app.core.epoxy.VectorEpoxyModel -@EpoxyModelClass(layout = R.layout.item_user_list_header) -abstract class UserListHeaderItem : VectorEpoxyModel() { +@EpoxyModelClass +abstract class UserListHeaderItem : VectorEpoxyModel(R.layout.item_user_list_header) { @EpoxyAttribute var header: String = "" diff --git a/vector/src/main/res/drawable/ic_new_password.xml b/vector/src/main/res/drawable/ic_new_password.xml new file mode 100644 index 0000000000..b6171642c8 --- /dev/null +++ b/vector/src/main/res/drawable/ic_new_password.xml @@ -0,0 +1,10 @@ + + + diff --git a/vector/src/main/res/layout/fragment_ftue_combined_login.xml b/vector/src/main/res/layout/fragment_ftue_combined_login.xml index 8037f207fc..d50fdb6394 100644 --- a/vector/src/main/res/layout/fragment_ftue_combined_login.xml +++ b/vector/src/main/res/layout/fragment_ftue_combined_login.xml @@ -170,7 +170,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:hint="@string/login_signup_password_hint" - app:layout_constraintBottom_toTopOf="@id/actionSpacing" + app:layout_constraintBottom_toTopOf="@id/loginForgotPassword" app:layout_constraintEnd_toEndOf="@id/loginGutterEnd" app:layout_constraintStart_toStartOf="@id/loginGutterStart" app:layout_constraintTop_toBottomOf="@id/entrySpacing"> @@ -184,13 +184,27 @@ +