diff --git a/.github/ISSUE_TEMPLATE/release.yml b/.github/ISSUE_TEMPLATE/release.yml
index b063c93530..b28dbbde69 100644
--- a/.github/ISSUE_TEMPLATE/release.yml
+++ b/.github/ISSUE_TEMPLATE/release.yml
@@ -21,6 +21,8 @@ body:
- [ ] While Weblate is locked, and after the PR from Weblate has been merged, handle all the TODOs in the main `strings.xml` file
- [ ] Run the script `./tools/release/pushPlayStoreMetaData.sh`. You can check in the GooglePlay console the Activity log to check the effect.
+ - [ ] Ensure all [the required PRs](https://github.com/vector-im/element-android/pulls?q=is%3Aopen+is%3Apr+label%3AZ-NextRelease) have been merged
+
### Do the release
- [ ] Make sure `develop` and `main` are up to date (git pull)
diff --git a/.github/workflows/danger.yml b/.github/workflows/danger.yml
index d36f2d0765..8a892b9b15 100644
--- a/.github/workflows/danger.yml
+++ b/.github/workflows/danger.yml
@@ -11,7 +11,7 @@ jobs:
- run: |
npm install --save-dev @babel/plugin-transform-flow-strip-types
- name: Danger
- uses: danger/danger-js@11.1.1
+ uses: danger/danger-js@11.1.2
with:
args: "--dangerfile tools/danger/dangerfile.js"
env:
diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml
index 544d9081f8..70669596bb 100644
--- a/.github/workflows/quality.yml
+++ b/.github/workflows/quality.yml
@@ -66,7 +66,7 @@ jobs:
yarn add danger-plugin-lint-report --dev
- name: Danger lint
if: always()
- uses: danger/danger-js@11.1.1
+ uses: danger/danger-js@11.1.2
with:
args: "--dangerfile tools/danger/dangerfile-lint.js"
env:
diff --git a/CHANGES.md b/CHANGES.md
index 829b1a0caa..4615ec8ff0 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -1,3 +1,51 @@
+Changes in Element v1.4.34 (2022-08-23)
+=======================================
+
+Features ✨
+----------
+ - [Notification] - Handle creation of notification for live location and poll start ([#6746](https://github.com/vector-im/element-android/issues/6746))
+
+Bugfixes 🐛
+----------
+ - Fixes onboarding requiring matrix.org to be accessible on the first step, the server can now be manually changed ([#6718](https://github.com/vector-im/element-android/issues/6718))
+ - Fixing sign in/up for homeservers that rely on the SSO fallback url ([#6827](https://github.com/vector-im/element-android/issues/6827))
+ - Fixes uncaught exceptions in the SyncWorker to cause the worker to become stuck in the failure state ([#6836](https://github.com/vector-im/element-android/issues/6836))
+ - Fixes onboarding captcha crashing when no WebView is available by showing an error with information instead ([#6855](https://github.com/vector-im/element-android/issues/6855))
+ - Removes ability to continue registration after the app has been destroyed, fixes the next steps crashing due to missing information from the previous steps ([#6860](https://github.com/vector-im/element-android/issues/6860))
+ - Fixes crash when exiting the login or registration entry screens whilst they're loading ([#6861](https://github.com/vector-im/element-android/issues/6861))
+ - Fixes server selection being unable to trust certificates ([#6864](https://github.com/vector-im/element-android/issues/6864))
+ - Ensure SyncThread is started when the app is launched after a Push has been received. ([#6884](https://github.com/vector-im/element-android/issues/6884))
+ - Fixes missing firebase notifications after logging in when UnifiedPush distributor is installed ([#6891](https://github.com/vector-im/element-android/issues/6891))
+
+In development 🚧
+----------------
+ - Create DM room only on first message - Trigger the flow when the "Direct Message" action is selected from the room member details screen ([#5525](https://github.com/vector-im/element-android/issues/5525))
+ - added filter tabs for new App layout's Home screen ([#6505](https://github.com/vector-im/element-android/issues/6505))
+ - [App Layout] added dialog to configure app layout ([#6506](https://github.com/vector-im/element-android/issues/6506))
+ - Adds space list bottom sheet for new app layout ([#6749](https://github.com/vector-im/element-android/issues/6749))
+ - [App Layout] Dialpad moved from bottom navigation tab to a separate activity accessed via home screen context menu ([#6787](https://github.com/vector-im/element-android/issues/6787))
+ - Makes toolbar switch title based on space in New App Layout ([#6795](https://github.com/vector-im/element-android/issues/6795))
+ - [Devices management] Add a feature flag and empty screen for future new layout ([#6798](https://github.com/vector-im/element-android/issues/6798))
+ - Adds new chat bottom sheet as the click action of the main FAB in the new app layout ([#6801](https://github.com/vector-im/element-android/issues/6801))
+ - [Devices management] Other sessions section in new layout ([#6806](https://github.com/vector-im/element-android/issues/6806))
+ - [New Layout] Adds space settings accessible through clicking the toolbar ([#6859](https://github.com/vector-im/element-android/issues/6859))
+ - Adds New App Layout FABs (hidden behind feature flag) ([#6693](https://github.com/vector-im/element-android/issues/6693))
+
+SDK API changes ⚠️
+------------------
+ - Rename `DebugService.logDbUsageInfo` (resp. `Session.logDbUsageInfo`) to `DebugService.getDbUsageInfo` (resp. `Session.getDbUsageInfo`) and return a String instead of logging. The caller may want to log the String. ([#6884](https://github.com/vector-im/element-android/issues/6884))
+
+Other changes
+-------------
+ - Removes the Login2 proof of concept - replaced by the FTUE changes ([#5974](https://github.com/vector-im/element-android/issues/5974))
+ - Enable auto-capitalization for Room creation Title field ([#6645](https://github.com/vector-im/element-android/issues/6645))
+ - Decouples the variant logic from the vector module ([#6783](https://github.com/vector-im/element-android/issues/6783))
+ - Add a developer setting to enable LeakCanary at runtime ([#6786](https://github.com/vector-im/element-android/issues/6786))
+ - [Create Room] Reduce some boilerplate with room state event contents ([#6799](https://github.com/vector-im/element-android/issues/6799))
+ - [Call] Memory leak after a call ([#6808](https://github.com/vector-im/element-android/issues/6808))
+ - Fix some string template ([#6843](https://github.com/vector-im/element-android/issues/6843))
+
+
Changes in Element v1.4.32 (2022-08-10)
=======================================
diff --git a/build.gradle b/build.gradle
index 38cbc3af0f..aa8a3e2c4c 100644
--- a/build.gradle
+++ b/build.gradle
@@ -29,7 +29,7 @@ buildscript {
classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:3.4.0.2513'
classpath 'com.google.android.gms:oss-licenses-plugin:0.10.5'
classpath "com.likethesalad.android:stem-plugin:2.1.1"
- classpath 'org.owasp:dependency-check-gradle:7.1.1'
+ classpath 'org.owasp:dependency-check-gradle:7.1.2'
classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.7.10"
classpath "org.jetbrains.kotlinx:kotlinx-knit:0.4.0"
// NOTE: Do not place your application dependencies here; they belong
diff --git a/changelog.d/5525.wip b/changelog.d/5525.wip
deleted file mode 100644
index 9ddfbab9a3..0000000000
--- a/changelog.d/5525.wip
+++ /dev/null
@@ -1 +0,0 @@
-Create DM room only on first message - Trigger the flow when the "Direct Message" action is selected from the room member details screen
diff --git a/changelog.d/5974.misc b/changelog.d/5974.misc
deleted file mode 100644
index d2ddef6f1d..0000000000
--- a/changelog.d/5974.misc
+++ /dev/null
@@ -1 +0,0 @@
-Removes the Login2 proof of concept - replaced by the FTUE changes
diff --git a/changelog.d/6505.wip b/changelog.d/6505.wip
deleted file mode 100644
index 1109c5fff1..0000000000
--- a/changelog.d/6505.wip
+++ /dev/null
@@ -1 +0,0 @@
-added filter tabs for new App layout's Home screen
diff --git a/changelog.d/6506.wip b/changelog.d/6506.wip
deleted file mode 100644
index 344c0bca2f..0000000000
--- a/changelog.d/6506.wip
+++ /dev/null
@@ -1 +0,0 @@
-[App Layout] added dialog to configure app layout
diff --git a/changelog.d/6645.misc b/changelog.d/6645.misc
deleted file mode 100644
index b24655879d..0000000000
--- a/changelog.d/6645.misc
+++ /dev/null
@@ -1 +0,0 @@
-Enable auto-capitalization for Room creation Title field
diff --git a/changelog.d/6693.feature b/changelog.d/6693.feature
deleted file mode 100644
index 5e905766a9..0000000000
--- a/changelog.d/6693.feature
+++ /dev/null
@@ -1 +0,0 @@
-Adds New App Layout FABs (hidden behind feature flag)
diff --git a/changelog.d/6746.feature b/changelog.d/6746.feature
deleted file mode 100644
index 7869e7f57a..0000000000
--- a/changelog.d/6746.feature
+++ /dev/null
@@ -1 +0,0 @@
-[Notification] - Handle creation of notification for live location and poll start
diff --git a/changelog.d/6749.wip b/changelog.d/6749.wip
deleted file mode 100644
index d7fac1efc1..0000000000
--- a/changelog.d/6749.wip
+++ /dev/null
@@ -1 +0,0 @@
-Adds space list bottom sheet for new app layout
diff --git a/changelog.d/6783.misc b/changelog.d/6783.misc
deleted file mode 100644
index d1095c1203..0000000000
--- a/changelog.d/6783.misc
+++ /dev/null
@@ -1 +0,0 @@
-Decouples the variant logic from the vector module
diff --git a/changelog.d/6786.misc b/changelog.d/6786.misc
deleted file mode 100644
index a916336ae4..0000000000
--- a/changelog.d/6786.misc
+++ /dev/null
@@ -1 +0,0 @@
-Add a developer setting to enable LeakCanary at runtime
diff --git a/changelog.d/6787.wip b/changelog.d/6787.wip
deleted file mode 100644
index ace2b04d9e..0000000000
--- a/changelog.d/6787.wip
+++ /dev/null
@@ -1 +0,0 @@
-[App Layout] Dialpad moved from bottom navigation tab to a separate activity accessed via home screen context menu
diff --git a/changelog.d/6795.wip b/changelog.d/6795.wip
deleted file mode 100644
index da525a2c67..0000000000
--- a/changelog.d/6795.wip
+++ /dev/null
@@ -1 +0,0 @@
-Makes toolbar switch title based on space in New App Layout
diff --git a/changelog.d/6798.wip b/changelog.d/6798.wip
deleted file mode 100644
index a16270666b..0000000000
--- a/changelog.d/6798.wip
+++ /dev/null
@@ -1 +0,0 @@
-[Devices management] Add a feature flag and empty screen for future new layout
diff --git a/changelog.d/6799.misc b/changelog.d/6799.misc
deleted file mode 100644
index b756c2c07b..0000000000
--- a/changelog.d/6799.misc
+++ /dev/null
@@ -1 +0,0 @@
-[Create Room] Reduce some boilerplate with room state event contents
diff --git a/changelog.d/6801.wip b/changelog.d/6801.wip
deleted file mode 100644
index bb3bc9d7a1..0000000000
--- a/changelog.d/6801.wip
+++ /dev/null
@@ -1 +0,0 @@
-Adds new chat bottom sheet as the click action of the main FAB in the new app layout
diff --git a/changelog.d/6806.wip b/changelog.d/6806.wip
deleted file mode 100644
index 9b00139c62..0000000000
--- a/changelog.d/6806.wip
+++ /dev/null
@@ -1 +0,0 @@
-[Devices management] Other sessions section in new layout
diff --git a/changelog.d/6808.misc b/changelog.d/6808.misc
deleted file mode 100644
index 06eeff862b..0000000000
--- a/changelog.d/6808.misc
+++ /dev/null
@@ -1 +0,0 @@
-[Call] Memory leak after a call
diff --git a/changelog.d/6827.bugfix b/changelog.d/6827.bugfix
deleted file mode 100644
index 2c3e130aa3..0000000000
--- a/changelog.d/6827.bugfix
+++ /dev/null
@@ -1 +0,0 @@
-Fixing sign in/up for homeservers that rely on the SSO fallback url
diff --git a/changelog.d/6836.bugfix b/changelog.d/6836.bugfix
deleted file mode 100644
index 6fbcc35001..0000000000
--- a/changelog.d/6836.bugfix
+++ /dev/null
@@ -1 +0,0 @@
-Fixes uncaught exceptions in the SyncWorker to cause the worker to become stuck in the failure state
diff --git a/changelog.d/6843.misc b/changelog.d/6843.misc
deleted file mode 100644
index 5382e27082..0000000000
--- a/changelog.d/6843.misc
+++ /dev/null
@@ -1 +0,0 @@
-Fix some string template
diff --git a/changelog.d/6855.bugfix b/changelog.d/6855.bugfix
deleted file mode 100644
index 63a62de986..0000000000
--- a/changelog.d/6855.bugfix
+++ /dev/null
@@ -1 +0,0 @@
-Fixes onboarding captcha crashing when no WebView is available by showing an error with information instead
diff --git a/changelog.d/6859.wip b/changelog.d/6859.wip
deleted file mode 100644
index 02fc3616cd..0000000000
--- a/changelog.d/6859.wip
+++ /dev/null
@@ -1 +0,0 @@
-[New Layout] Adds space settings accessible through clicking the toolbar
diff --git a/changelog.d/6860.bugfix b/changelog.d/6860.bugfix
deleted file mode 100644
index 22e287c0b3..0000000000
--- a/changelog.d/6860.bugfix
+++ /dev/null
@@ -1 +0,0 @@
-Removes ability to continue registration after the app has been destroyed, fixes the next steps crashing due to missing information from the previous steps
diff --git a/changelog.d/6861.bugfix b/changelog.d/6861.bugfix
deleted file mode 100644
index 508325acc6..0000000000
--- a/changelog.d/6861.bugfix
+++ /dev/null
@@ -1 +0,0 @@
-Fixes crash when exiting the login or registration entry screens whilst they're loading
diff --git a/changelog.d/6864.bugfix b/changelog.d/6864.bugfix
deleted file mode 100644
index 6db3d7c074..0000000000
--- a/changelog.d/6864.bugfix
+++ /dev/null
@@ -1 +0,0 @@
-Fixes server selection being unable to trust certificates
diff --git a/changelog.d/6884.bugfix b/changelog.d/6884.bugfix
deleted file mode 100644
index 6c6b286688..0000000000
--- a/changelog.d/6884.bugfix
+++ /dev/null
@@ -1 +0,0 @@
-Ensure SyncThread is started when the app is launched after a Push has been received.
diff --git a/changelog.d/6884.sdk b/changelog.d/6884.sdk
deleted file mode 100644
index 0de43420f0..0000000000
--- a/changelog.d/6884.sdk
+++ /dev/null
@@ -1 +0,0 @@
-Rename `DebugService.logDbUsageInfo` (resp. `Session.logDbUsageInfo`) to `DebugService.getDbUsageInfo` (resp. `Session.getDbUsageInfo`) and return a String instead of logging. The caller may want to log the String.
diff --git a/changelog.d/6891.bugfix b/changelog.d/6891.bugfix
deleted file mode 100644
index b6b46e1d93..0000000000
--- a/changelog.d/6891.bugfix
+++ /dev/null
@@ -1 +0,0 @@
-Fixes missing firebase notifications after logging in when UnifiedPush distributor is installed
diff --git a/changelog.d/6894.misc b/changelog.d/6894.misc
new file mode 100644
index 0000000000..abb1a69a71
--- /dev/null
+++ b/changelog.d/6894.misc
@@ -0,0 +1 @@
+Remove FragmentModule and the Fragment factory. No need to Inject the constructor on your Fragment, just add @AndroidEntryPoint annotation and @Inject class members.
diff --git a/dependencies.gradle b/dependencies.gradle
index 5083dd4556..80dc203740 100644
--- a/dependencies.gradle
+++ b/dependencies.gradle
@@ -22,7 +22,7 @@ def markwon = "4.6.2"
def moshi = "1.13.0"
def lifecycle = "2.5.1"
def flowBinding = "1.2.0"
-def flipper = "0.157.0"
+def flipper = "0.161.0"
def epoxy = "4.6.2"
def mavericks = "2.7.0"
def glide = "4.13.2"
diff --git a/docs/hilt_migration.md b/docs/hilt_migration.md
index 50021e9792..0556cf85dc 100644
--- a/docs/hilt_migration.md
+++ b/docs/hilt_migration.md
@@ -7,8 +7,8 @@ Hilt is built on top of Dagger 2 and simplify usage by removing needs to create
When you create a new feature, you should have the following:
Annotate your Activity with @AndroidEntryPoint
+Annotate your Fragment with @AndroidEntryPoint
If you have a BottomSheetFragment => Annotate it with @AndroidEntryPoint
-Otherwise => Add your Fragment to the FragmentModule
Add your ViewModel.Factory to the MavericksViewModelModule
Makes sure your ViewModel as the following code:
diff --git a/fastlane/metadata/android/cs-CZ/changelogs/40104300.txt b/fastlane/metadata/android/cs-CZ/changelogs/40104300.txt
new file mode 100644
index 0000000000..e74d892209
--- /dev/null
+++ b/fastlane/metadata/android/cs-CZ/changelogs/40104300.txt
@@ -0,0 +1,2 @@
+Hlavní změny v této verzi: Umožňuje vylepšené přihlašování a registraci.
+Úplný seznam změn: https://github.com/vector-im/element-android/releases
diff --git a/fastlane/metadata/android/cs-CZ/changelogs/40104310.txt b/fastlane/metadata/android/cs-CZ/changelogs/40104310.txt
new file mode 100644
index 0000000000..e74d892209
--- /dev/null
+++ b/fastlane/metadata/android/cs-CZ/changelogs/40104310.txt
@@ -0,0 +1,2 @@
+Hlavní změny v této verzi: Umožňuje vylepšené přihlašování a registraci.
+Úplný seznam změn: https://github.com/vector-im/element-android/releases
diff --git a/fastlane/metadata/android/en-US/changelogs/40104340.txt b/fastlane/metadata/android/en-US/changelogs/40104340.txt
new file mode 100644
index 0000000000..61db61727a
--- /dev/null
+++ b/fastlane/metadata/android/en-US/changelogs/40104340.txt
@@ -0,0 +1,2 @@
+Main changes in this version: Various bug fixes and stability improvements.
+Full changelog: https://github.com/vector-im/element-android/releases
diff --git a/fastlane/metadata/android/et/changelogs/40104300.txt b/fastlane/metadata/android/et/changelogs/40104300.txt
new file mode 100644
index 0000000000..e01c9b4329
--- /dev/null
+++ b/fastlane/metadata/android/et/changelogs/40104300.txt
@@ -0,0 +1,2 @@
+Põhilised muutused selles versioonis: senisest parem liitumise ja sisselogimise töövoog.
+Kogu ingliskeelne muudatuste logi: https://github.com/vector-im/element-android/releases
diff --git a/fastlane/metadata/android/et/changelogs/40104310.txt b/fastlane/metadata/android/et/changelogs/40104310.txt
new file mode 100644
index 0000000000..e01c9b4329
--- /dev/null
+++ b/fastlane/metadata/android/et/changelogs/40104310.txt
@@ -0,0 +1,2 @@
+Põhilised muutused selles versioonis: senisest parem liitumise ja sisselogimise töövoog.
+Kogu ingliskeelne muudatuste logi: https://github.com/vector-im/element-android/releases
diff --git a/fastlane/metadata/android/fa/changelogs/40104300.txt b/fastlane/metadata/android/fa/changelogs/40104300.txt
new file mode 100644
index 0000000000..7a0e87b263
--- /dev/null
+++ b/fastlane/metadata/android/fa/changelogs/40104300.txt
@@ -0,0 +1,2 @@
+تغییرات عمده در این نگارش: به کار انداختن ورود بهبود یافته و سفرهای ورود.
+گزارش دگرگونی کامل: https://github.com/vector-im/element-android/releases
diff --git a/fastlane/metadata/android/fa/changelogs/40104310.txt b/fastlane/metadata/android/fa/changelogs/40104310.txt
new file mode 100644
index 0000000000..7a0e87b263
--- /dev/null
+++ b/fastlane/metadata/android/fa/changelogs/40104310.txt
@@ -0,0 +1,2 @@
+تغییرات عمده در این نگارش: به کار انداختن ورود بهبود یافته و سفرهای ورود.
+گزارش دگرگونی کامل: https://github.com/vector-im/element-android/releases
diff --git a/fastlane/metadata/android/fr-FR/changelogs/40104300.txt b/fastlane/metadata/android/fr-FR/changelogs/40104300.txt
new file mode 100644
index 0000000000..328e66aaa0
--- /dev/null
+++ b/fastlane/metadata/android/fr-FR/changelogs/40104300.txt
@@ -0,0 +1,2 @@
+Principaux changements pour cette version : Activation de l’authentification et du parcours d’inscription améliorés.
+Intégralité des changements : https://github.com/vector-im/element-android/releases
diff --git a/fastlane/metadata/android/fr-FR/changelogs/40104310.txt b/fastlane/metadata/android/fr-FR/changelogs/40104310.txt
new file mode 100644
index 0000000000..328e66aaa0
--- /dev/null
+++ b/fastlane/metadata/android/fr-FR/changelogs/40104310.txt
@@ -0,0 +1,2 @@
+Principaux changements pour cette version : Activation de l’authentification et du parcours d’inscription améliorés.
+Intégralité des changements : https://github.com/vector-im/element-android/releases
diff --git a/fastlane/metadata/android/gl/changelogs/40104160.txt b/fastlane/metadata/android/gl-ES/changelogs/40104160.txt
similarity index 100%
rename from fastlane/metadata/android/gl/changelogs/40104160.txt
rename to fastlane/metadata/android/gl-ES/changelogs/40104160.txt
diff --git a/fastlane/metadata/android/gl/changelogs/40104180.txt b/fastlane/metadata/android/gl-ES/changelogs/40104180.txt
similarity index 100%
rename from fastlane/metadata/android/gl/changelogs/40104180.txt
rename to fastlane/metadata/android/gl-ES/changelogs/40104180.txt
diff --git a/fastlane/metadata/android/gl/changelogs/40104190.txt b/fastlane/metadata/android/gl-ES/changelogs/40104190.txt
similarity index 100%
rename from fastlane/metadata/android/gl/changelogs/40104190.txt
rename to fastlane/metadata/android/gl-ES/changelogs/40104190.txt
diff --git a/fastlane/metadata/android/gl/changelogs/40104200.txt b/fastlane/metadata/android/gl-ES/changelogs/40104200.txt
similarity index 100%
rename from fastlane/metadata/android/gl/changelogs/40104200.txt
rename to fastlane/metadata/android/gl-ES/changelogs/40104200.txt
diff --git a/fastlane/metadata/android/gl/changelogs/40104220.txt b/fastlane/metadata/android/gl-ES/changelogs/40104220.txt
similarity index 100%
rename from fastlane/metadata/android/gl/changelogs/40104220.txt
rename to fastlane/metadata/android/gl-ES/changelogs/40104220.txt
diff --git a/fastlane/metadata/android/gl/changelogs/40104230.txt b/fastlane/metadata/android/gl-ES/changelogs/40104230.txt
similarity index 100%
rename from fastlane/metadata/android/gl/changelogs/40104230.txt
rename to fastlane/metadata/android/gl-ES/changelogs/40104230.txt
diff --git a/fastlane/metadata/android/gl/changelogs/40104240.txt b/fastlane/metadata/android/gl-ES/changelogs/40104240.txt
similarity index 100%
rename from fastlane/metadata/android/gl/changelogs/40104240.txt
rename to fastlane/metadata/android/gl-ES/changelogs/40104240.txt
diff --git a/fastlane/metadata/android/gl/changelogs/40104250.txt b/fastlane/metadata/android/gl-ES/changelogs/40104250.txt
similarity index 100%
rename from fastlane/metadata/android/gl/changelogs/40104250.txt
rename to fastlane/metadata/android/gl-ES/changelogs/40104250.txt
diff --git a/fastlane/metadata/android/gl/changelogs/40104260.txt b/fastlane/metadata/android/gl-ES/changelogs/40104260.txt
similarity index 100%
rename from fastlane/metadata/android/gl/changelogs/40104260.txt
rename to fastlane/metadata/android/gl-ES/changelogs/40104260.txt
diff --git a/fastlane/metadata/android/gl/changelogs/40104270.txt b/fastlane/metadata/android/gl-ES/changelogs/40104270.txt
similarity index 100%
rename from fastlane/metadata/android/gl/changelogs/40104270.txt
rename to fastlane/metadata/android/gl-ES/changelogs/40104270.txt
diff --git a/fastlane/metadata/android/gl/full_description.txt b/fastlane/metadata/android/gl-ES/full_description.txt
similarity index 100%
rename from fastlane/metadata/android/gl/full_description.txt
rename to fastlane/metadata/android/gl-ES/full_description.txt
diff --git a/fastlane/metadata/android/gl/short_description.txt b/fastlane/metadata/android/gl-ES/short_description.txt
similarity index 100%
rename from fastlane/metadata/android/gl/short_description.txt
rename to fastlane/metadata/android/gl-ES/short_description.txt
diff --git a/fastlane/metadata/android/gl/title.txt b/fastlane/metadata/android/gl-ES/title.txt
similarity index 100%
rename from fastlane/metadata/android/gl/title.txt
rename to fastlane/metadata/android/gl-ES/title.txt
diff --git a/fastlane/metadata/android/id/changelogs/40104300.txt b/fastlane/metadata/android/id/changelogs/40104300.txt
new file mode 100644
index 0000000000..3d8d13e23d
--- /dev/null
+++ b/fastlane/metadata/android/id/changelogs/40104300.txt
@@ -0,0 +1,2 @@
+Perubahan utama dalam versi ini: Mengaktifkan perjalanan masuk dan keluar yang diperbaiki.
+Catatan perubahan lanjutan: https://github.com/vector-im/element-android/releases
diff --git a/fastlane/metadata/android/id/changelogs/40104310.txt b/fastlane/metadata/android/id/changelogs/40104310.txt
new file mode 100644
index 0000000000..3d8d13e23d
--- /dev/null
+++ b/fastlane/metadata/android/id/changelogs/40104310.txt
@@ -0,0 +1,2 @@
+Perubahan utama dalam versi ini: Mengaktifkan perjalanan masuk dan keluar yang diperbaiki.
+Catatan perubahan lanjutan: https://github.com/vector-im/element-android/releases
diff --git a/fastlane/metadata/android/id/full_description.txt b/fastlane/metadata/android/id/full_description.txt
index d3bed0bf6b..20d805c582 100644
--- a/fastlane/metadata/android/id/full_description.txt
+++ b/fastlane/metadata/android/id/full_description.txt
@@ -1,42 +1,42 @@
-Element adalah perpesanan yang aman dan aplikasi kolaborasi tim produktivitas yang ideal untuk obrolan grup saat bekerja jarak jauh. Aplikasi perpesanan ini menggunakan enkripsi ujung-ke-ujung untuk memberikan konferensi video, pembagian file, dan panggilan suara yang aman.
+Element adalah perpesanan yang aman dan aplikasi kolaborasi tim produktivitas yang ideal untuk obrolan grup saat bekerja jarak jauh. Aplikasi perpesanan ini menggunakan enkripsi ujung-ke-ujung untuk menyediakan konferensi video, pembagian berkas, dan panggilan suara yang aman.
-Fitur Element termasuk
-- Alat komunikasi online yang canggih
+Fitur Element termasuk:
+- Alat komunikasi daring yang canggih
- Pesan-pesan yang dienkripsi sepenuhnya untuk memungkinkan komunikasi perusahaan yang lebih aman, bahkan untuk pekerja jarak jauh
-- Obrolan terdesentralisasi berdasarkan kerangka Matrix yang sumber terbuka
-- Pembagian file aman dengan data terenkripsi saat mengelola proyek
+- Obrolan terdesentralisasi berdasarkan kerangka kerja Matrix yang sumber terbuka
+- Pembagian berkas aman dengan data terenkripsi saat mengelola proyek
- Obrolan video dengan VoIP dan pembagian layar
-- Integrasi yang mudah dengan alat kolaborasi online favorit Anda, alat manajemen proyek, layanan VoIP dan aplikasi perpesanan tim lainnya
+- Integrasi yang mudah dengan alat kolaborasi daring favorit Anda, alat pengelola proyek, layanan VoIP dan aplikasi perpesanan tim lainnya
-Element benar-benar berbeda dari aplikasi perpesanan dan aplikasi kolaborasi lainnya. Element beroperasi pada Matrix, jaringan terbuka untuk pengiriman pesan yang aman dan komunikasi terdesentralisasi.
+Element benar-benar berbeda dari aplikasi perpesanan dan aplikasi kolaborasi lainnya. Element beroperasi pada Matrix, jaringan terbuka untuk pengiriman pesan yang aman dan komunikasi yang terdesentralisasi.
Perpesanan dengan privasi dan enkripsi
-Element melindungi Anda dari iklan yang tidak diinginkan, penambangan data dan taman berdinding. Element juga mengamankan semua data Anda, komunikasi video dan suara satu-ke-satu dengan enkripsi ujung-ke-ujung dan verifikasi perangkat menggunakan penandatanganan silang.
+Element melindungi Anda dari iklan yang tidak diinginkan, penambangan data, dan taman berdinding. Element juga mengamankan semua data Anda, komunikasi video dan suara satu-ke-satu dengan enkripsi ujung-ke-ujung, dan verifikasi perangkat menggunakan penandatanganan silang.
-Element memberikan Anda kendali atas privasi Anda sambil memungkinkan Anda untuk berkomunikasi dengan siapa saja secara aman di jaringan Matrix, atau alat kolaborasi bisnis lainnya dengan mengintegrasikan aplikasi-aplikasi seperti Slack.
+Element memberikan Anda kendali atas privasi Anda sambil memungkinkan Anda untuk berkomunikasi dengan siapa saja secara aman di jaringan Matrix, atau alat kolaborasi bisnis lainnya dengan mengintegrasikan aplikasi seperti Slack.
-Element dapat dihost sendiri
-Untuk memungkinkan lebih banyak kendali atas data dan pesan-pesan sensitif Anda, Element dapat dihost sendiri atau Anda dapat memilih host berbasis Matrix, standar untuk komunikasi terdesentralisasi sumber terbuka. Element memberi Anda privasi, kepatuhan keamanan, dan fleksibilitas integrasi.
+Element dapat di-host sendiri
+Untuk memungkinkan lebih banyak kendali atas data dan pesan-pesan sensitif Anda, Element dapat dilayani sendiri atau Anda dapat memilih layanan berbasis Matrix, standar untuk komunikasi terdesentralisasi sumber terbuka. Element memberikan Anda privasi, kepatuhan keamanan, dan fleksibilitas integrasi.
Miliki data Anda
Anda memutuskan di mana untuk menyimpan data dan pesan-pesan Anda, tanpa risiko penambangan data atau akses dari pihak ketiga.
Element menempatkan Anda dalam kendali dengan cara yang berbeda:
-1. Dapatkan akun gratis pada server publik matrix.org yang dihost oleh pengembang Matrix, atau memilih dari ribuan server publik yang dihost oleh sukarelawan
-2. Host sendiri akun Anda dengan menjalankan server pada infrastruktur IT Anda sendiri
+1. Dapatkan akun gratis pada server publik matrix.org yang dilayani oleh pengembang Matrix, atau memilih dari ribuan server publik yang dilayani oleh sukarelawan
+2. Layani akun Anda sendiri dengan menjalankan server pada infrastruktur IT Anda sendiri
3. Daftar untuk akun di server khusus dengan berlangganan platform hosting Layanan Matrix Element
Perpesanan dan kolaborasi terbuka
-Anda dapat mengobrol dengan siapa saja di jaringan Matrix, jika mereka menggunakan Element, aplikasi Matrix lain atau bahkan menggunakan aplikasi perpesanan yang berbeda.
+Anda dapat mengobrol dengan siapa saja di jaringan Matrix, jika mereka menggunakan Element, aplikasi Matrix lain, atau bahkan menggunakan aplikasi perpesanan yang berbeda.
Sangat aman
-Enkripsi ujung-ke-ujung yang nyata (hanya mereka yang dalam obrolan dapat mendekripsi pesan), dan verifikasi perangkat menggunakan penandatanganan silang.
+Enkripsi ujung-ke-ujung yang nyata (hanya mereka yang di dalam obrolan dapat mendekripsikan pesan), dan verifikasi perangkat menggunakan penandatanganan silang.
Komunikasi dan integrasi lengkap
-Perpesanan, panggilan suara dan video, pembagian file, pembagian layar dan banyak integrasi bot dan widget. Buat ruangan dan komunitas, tetap terhubung dan selesaikan hal-hal penting.
+Perpesanan, panggilan suara dan video, pembagian berkas, pembagian layar dan banyak integrasi bot dan widget. Buat ruangan dan komunitas, tetap terhubung, dan selesaikan hal-hal penting.
Ambil di mana Anda tinggalkan
-Tetap terhubung di mana Anda berada, dengan riwayat pesan yang disinkronkan di semua perangkat Anda dan web di https://app.element.io
+Tetap terhubung di mana Anda berada, dengan riwayat pesan yang disinkronkan pada semua perangkat Anda dan pada web di https://app.element.io
Sumber terbuka
-Element Android adalah proyek sumber terbuka, dihost oleh GitHub. Silakan laporkan masalah yang Anda temukan, atau membuat kontribusi ke pengembangannya di https://github.com/vector-im/element-android
+Element Android adalah proyek sumber terbuka, dilayani oleh GitHub. Silakan laporkan masalah yang Anda temukan, atau membuat kontribusi ke pengembangannya di https://github.com/vector-im/element-android
diff --git a/fastlane/metadata/android/it-IT/changelogs/40104300.txt b/fastlane/metadata/android/it-IT/changelogs/40104300.txt
new file mode 100644
index 0000000000..40d9618137
--- /dev/null
+++ b/fastlane/metadata/android/it-IT/changelogs/40104300.txt
@@ -0,0 +1,2 @@
+Modifiche principali in questa versione: introduce i percorsi migliorati di accesso e registrazione.
+Cronologia completa: https://github.com/vector-im/element-android/releases
diff --git a/fastlane/metadata/android/it-IT/changelogs/40104310.txt b/fastlane/metadata/android/it-IT/changelogs/40104310.txt
new file mode 100644
index 0000000000..40d9618137
--- /dev/null
+++ b/fastlane/metadata/android/it-IT/changelogs/40104310.txt
@@ -0,0 +1,2 @@
+Modifiche principali in questa versione: introduce i percorsi migliorati di accesso e registrazione.
+Cronologia completa: https://github.com/vector-im/element-android/releases
diff --git a/fastlane/metadata/android/pt-BR/changelogs/40104300.txt b/fastlane/metadata/android/pt-BR/changelogs/40104300.txt
new file mode 100644
index 0000000000..5f1aaf4b3d
--- /dev/null
+++ b/fastlane/metadata/android/pt-BR/changelogs/40104300.txt
@@ -0,0 +1,2 @@
+Principais mudanças nesta versão: Habilita as jornadas melhoradas de sign in e sign up.
+Changelog completo: https://github.com/vector-im/element-android/releases
diff --git a/fastlane/metadata/android/pt-BR/changelogs/40104310.txt b/fastlane/metadata/android/pt-BR/changelogs/40104310.txt
new file mode 100644
index 0000000000..5f1aaf4b3d
--- /dev/null
+++ b/fastlane/metadata/android/pt-BR/changelogs/40104310.txt
@@ -0,0 +1,2 @@
+Principais mudanças nesta versão: Habilita as jornadas melhoradas de sign in e sign up.
+Changelog completo: https://github.com/vector-im/element-android/releases
diff --git a/fastlane/metadata/android/sk/changelogs/40104300.txt b/fastlane/metadata/android/sk/changelogs/40104300.txt
new file mode 100644
index 0000000000..dd0f554532
--- /dev/null
+++ b/fastlane/metadata/android/sk/changelogs/40104300.txt
@@ -0,0 +1,2 @@
+Hlavné zmeny v tejto verzii: Umožňuje vylepšené postupy prihlasovania a registrácie.
+Úplný zoznam zmien: https://github.com/vector-im/element-android/releases
diff --git a/fastlane/metadata/android/sk/changelogs/40104310.txt b/fastlane/metadata/android/sk/changelogs/40104310.txt
new file mode 100644
index 0000000000..dd0f554532
--- /dev/null
+++ b/fastlane/metadata/android/sk/changelogs/40104310.txt
@@ -0,0 +1,2 @@
+Hlavné zmeny v tejto verzii: Umožňuje vylepšené postupy prihlasovania a registrácie.
+Úplný zoznam zmien: https://github.com/vector-im/element-android/releases
diff --git a/fastlane/metadata/android/uk/changelogs/40104300.txt b/fastlane/metadata/android/uk/changelogs/40104300.txt
new file mode 100644
index 0000000000..727508a0cc
--- /dev/null
+++ b/fastlane/metadata/android/uk/changelogs/40104300.txt
@@ -0,0 +1,2 @@
+Основні зміни в цій версії: Поліпшені вхід і реєстрація.
+Перелік усіх змін: https://github.com/vector-im/element-android/releases
diff --git a/fastlane/metadata/android/uk/changelogs/40104310.txt b/fastlane/metadata/android/uk/changelogs/40104310.txt
new file mode 100644
index 0000000000..727508a0cc
--- /dev/null
+++ b/fastlane/metadata/android/uk/changelogs/40104310.txt
@@ -0,0 +1,2 @@
+Основні зміни в цій версії: Поліпшені вхід і реєстрація.
+Перелік усіх змін: https://github.com/vector-im/element-android/releases
diff --git a/fastlane/metadata/android/zh-TW/changelogs/40104300.txt b/fastlane/metadata/android/zh-TW/changelogs/40104300.txt
new file mode 100644
index 0000000000..3055389b2b
--- /dev/null
+++ b/fastlane/metadata/android/zh-TW/changelogs/40104300.txt
@@ -0,0 +1,2 @@
+此版本中的主要變動:啟用改善的登入與註冊流程。
+完整的變更紀錄:https://github.com/vector-im/element-android/releases
diff --git a/fastlane/metadata/android/zh-TW/changelogs/40104310.txt b/fastlane/metadata/android/zh-TW/changelogs/40104310.txt
new file mode 100644
index 0000000000..3055389b2b
--- /dev/null
+++ b/fastlane/metadata/android/zh-TW/changelogs/40104310.txt
@@ -0,0 +1,2 @@
+此版本中的主要變動:啟用改善的登入與註冊流程。
+完整的變更紀錄:https://github.com/vector-im/element-android/releases
diff --git a/matrix-sdk-android/build.gradle b/matrix-sdk-android/build.gradle
index aa8731da2a..fcd1e7d622 100644
--- a/matrix-sdk-android/build.gradle
+++ b/matrix-sdk-android/build.gradle
@@ -60,7 +60,7 @@ android {
// that the app's state is completely cleared between tests.
testInstrumentationRunnerArguments clearPackageData: 'true'
- buildConfigField "String", "SDK_VERSION", "\"1.4.34\""
+ buildConfigField "String", "SDK_VERSION", "\"1.4.36\""
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/failure/Extensions.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/failure/Extensions.kt
index 429d346a1b..5b41ddaaec 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/failure/Extensions.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/failure/Extensions.kt
@@ -89,6 +89,8 @@ fun Throwable.isInvalidUIAAuth() = this is Failure.ServerError &&
fun Throwable.isHomeserverUnavailable() = this is Failure.NetworkConnection &&
this.ioException is UnknownHostException
+fun Throwable.isHomeserverConnectionError() = this is Failure.NetworkConnection
+
fun Throwable.isMissingEmailVerification() = this is Failure.ServerError &&
error.code == MatrixError.M_UNAUTHORIZED &&
error.message == "Unable to get validated threepid"
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/RealmCompactOnLaunch.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/RealmCompactOnLaunch.kt
new file mode 100644
index 0000000000..1efb2541a7
--- /dev/null
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/RealmCompactOnLaunch.kt
@@ -0,0 +1,28 @@
+/*
+ * 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.database
+
+import io.realm.DefaultCompactOnLaunchCallback
+
+class RealmCompactOnLaunch : DefaultCompactOnLaunchCallback() {
+ /**
+ * Forces all RealmCompactOnLaunch instances to be equal.
+ * Avoids Realm throwing when multiple instances of this class are used.
+ */
+ override fun equals(other: Any?) = other is RealmCompactOnLaunch
+ override fun hashCode() = 0x1000
+}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/SessionRealmConfigurationFactory.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/SessionRealmConfigurationFactory.kt
index 5a0fd74bc0..16a55c22ac 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/SessionRealmConfigurationFactory.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/SessionRealmConfigurationFactory.kt
@@ -64,7 +64,7 @@ internal class SessionRealmConfigurationFactory @Inject constructor(
}
val realmConfiguration = RealmConfiguration.Builder()
- .compactOnLaunch()
+ .compactOnLaunch(RealmCompactOnLaunch())
.directory(directory)
.name(REALM_NAME)
.apply {
diff --git a/tools/release/pushPlayStoreMetaData.sh b/tools/release/pushPlayStoreMetaData.sh
index 5c2f69cb7b..2d8fd9b36a 100755
--- a/tools/release/pushPlayStoreMetaData.sh
+++ b/tools/release/pushPlayStoreMetaData.sh
@@ -28,7 +28,6 @@ mv ./fastlane/metadata/android/fy ./fastlane_tmp
mv ./fastlane/metadata/android/ga ./fastlane_tmp
mv ./fastlane/metadata/android/kab ./fastlane_tmp
mv ./fastlane/metadata/android/nb ./fastlane_tmp
-mv ./fastlane/metadata/android/gl ./fastlane_tmp
# Fastlane / PlayStore require longDescription and shortDescription file to be set, so copy the default
# one for languages where they are missing
diff --git a/tools/templates/ElementFeature/root/src/app_package/Fragment.kt.ftl b/tools/templates/ElementFeature/root/src/app_package/Fragment.kt.ftl
index 0f01b347c0..133faa6821 100644
--- a/tools/templates/ElementFeature/root/src/app_package/Fragment.kt.ftl
+++ b/tools/templates/ElementFeature/root/src/app_package/Fragment.kt.ftl
@@ -18,10 +18,10 @@ import javax.inject.Inject
data class ${fragmentArgsClass}() : Parcelable
#if>
-//TODO add this fragment into FragmentModule
-class ${fragmentClass} @Inject constructor(
- private val viewModelFactory: ${viewModelClass}.Factory
-) : VectorBaseFragment(), ${viewModelClass}.Factory by viewModelFactory {
+@AndroidEntryPoint
+class ${fragmentClass}() :
+ VectorBaseFragment(),
+ ${viewModelClass}.Factory by viewModelFactory {
<#if createFragmentArgs>
private val fragmentArgs: ${fragmentArgsClass} by args()
diff --git a/vector/build.gradle b/vector/build.gradle
index 7296262019..83d322946b 100644
--- a/vector/build.gradle
+++ b/vector/build.gradle
@@ -37,7 +37,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 = 34
+ext.versionPatch = 36
static def getGitTimestamp() {
def cmd = 'git show -s --format=%ct'
diff --git a/vector/src/debug/java/im/vector/app/features/debug/leak/DebugMemoryLeaksFragment.kt b/vector/src/debug/java/im/vector/app/features/debug/leak/DebugMemoryLeaksFragment.kt
index d3e70e26e6..2abf6487e2 100644
--- a/vector/src/debug/java/im/vector/app/features/debug/leak/DebugMemoryLeaksFragment.kt
+++ b/vector/src/debug/java/im/vector/app/features/debug/leak/DebugMemoryLeaksFragment.kt
@@ -28,7 +28,8 @@ import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.databinding.FragmentDebugMemoryLeaksBinding
@AndroidEntryPoint
-class DebugMemoryLeaksFragment : VectorBaseFragment() {
+class DebugMemoryLeaksFragment :
+ VectorBaseFragment() {
private val viewModel: DebugMemoryLeaksViewModel by fragmentViewModel()
diff --git a/vector/src/main/java/im/vector/app/core/di/ActiveSessionHolder.kt b/vector/src/main/java/im/vector/app/core/di/ActiveSessionHolder.kt
index bb2ca97aad..3f0507305a 100644
--- a/vector/src/main/java/im/vector/app/core/di/ActiveSessionHolder.kt
+++ b/vector/src/main/java/im/vector/app/core/di/ActiveSessionHolder.kt
@@ -70,7 +70,7 @@ class ActiveSessionHolder @Inject constructor(
suspend fun clearActiveSession() {
// Do some cleanup first
- getSafeActiveSession()?.let {
+ getSafeActiveSession(startSync = false)?.let {
Timber.w("clearActiveSession of ${it.myUserId}")
it.callSignalingService().removeCallListener(callManager)
it.removeListener(sessionListener)
@@ -91,8 +91,8 @@ class ActiveSessionHolder @Inject constructor(
return activeSessionReference.get() != null || authenticationService.hasAuthenticatedSessions()
}
- fun getSafeActiveSession(): Session? {
- return runBlocking { getOrInitializeSession(startSync = true) }
+ fun getSafeActiveSession(startSync: Boolean = true): Session? {
+ return runBlocking { getOrInitializeSession(startSync = startSync) }
}
fun getActiveSession(): Session {
diff --git a/vector/src/main/java/im/vector/app/core/di/ActivityEntryPoint.kt b/vector/src/main/java/im/vector/app/core/di/ActivityEntryPoint.kt
index c5f7317ebe..4b8b23489b 100644
--- a/vector/src/main/java/im/vector/app/core/di/ActivityEntryPoint.kt
+++ b/vector/src/main/java/im/vector/app/core/di/ActivityEntryPoint.kt
@@ -16,7 +16,6 @@
package im.vector.app.core.di
-import androidx.fragment.app.FragmentFactory
import androidx.lifecycle.ViewModelProvider
import dagger.hilt.EntryPoint
import dagger.hilt.InstallIn
@@ -25,6 +24,5 @@ import dagger.hilt.android.components.ActivityComponent
@InstallIn(ActivityComponent::class)
@EntryPoint
interface ActivityEntryPoint {
- fun fragmentFactory(): FragmentFactory
fun viewModelFactory(): ViewModelProvider.Factory
}
diff --git a/vector/src/main/java/im/vector/app/core/di/FragmentKey.kt b/vector/src/main/java/im/vector/app/core/di/FragmentKey.kt
deleted file mode 100644
index bc2dc40a15..0000000000
--- a/vector/src/main/java/im/vector/app/core/di/FragmentKey.kt
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright 2019 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.core.di
-
-import androidx.fragment.app.Fragment
-import dagger.MapKey
-import kotlin.reflect.KClass
-
-@Target(AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER)
-@Retention(AnnotationRetention.RUNTIME)
-@MapKey
-annotation class FragmentKey(val value: KClass)
diff --git a/vector/src/main/java/im/vector/app/core/di/FragmentModule.kt b/vector/src/main/java/im/vector/app/core/di/FragmentModule.kt
deleted file mode 100644
index 22e1c99ab2..0000000000
--- a/vector/src/main/java/im/vector/app/core/di/FragmentModule.kt
+++ /dev/null
@@ -1,954 +0,0 @@
-/*
- * Copyright 2019 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.core.di
-
-import androidx.fragment.app.Fragment
-import androidx.fragment.app.FragmentFactory
-import dagger.Binds
-import dagger.Module
-import dagger.hilt.InstallIn
-import dagger.hilt.android.components.ActivityComponent
-import dagger.multibindings.IntoMap
-import im.vector.app.features.analytics.ui.consent.AnalyticsOptInFragment
-import im.vector.app.features.attachments.preview.AttachmentsPreviewFragment
-import im.vector.app.features.contactsbook.ContactsBookFragment
-import im.vector.app.features.crypto.keysbackup.settings.KeysBackupSettingsFragment
-import im.vector.app.features.crypto.quads.SharedSecuredStorageKeyFragment
-import im.vector.app.features.crypto.quads.SharedSecuredStoragePassphraseFragment
-import im.vector.app.features.crypto.quads.SharedSecuredStorageResetAllFragment
-import im.vector.app.features.crypto.recover.BootstrapConclusionFragment
-import im.vector.app.features.crypto.recover.BootstrapConfirmPassphraseFragment
-import im.vector.app.features.crypto.recover.BootstrapEnterPassphraseFragment
-import im.vector.app.features.crypto.recover.BootstrapMigrateBackupFragment
-import im.vector.app.features.crypto.recover.BootstrapReAuthFragment
-import im.vector.app.features.crypto.recover.BootstrapSaveRecoveryKeyFragment
-import im.vector.app.features.crypto.recover.BootstrapSetupRecoveryKeyFragment
-import im.vector.app.features.crypto.recover.BootstrapWaitingFragment
-import im.vector.app.features.crypto.verification.QuadSLoadingFragment
-import im.vector.app.features.crypto.verification.cancel.VerificationCancelFragment
-import im.vector.app.features.crypto.verification.cancel.VerificationNotMeFragment
-import im.vector.app.features.crypto.verification.choose.VerificationChooseMethodFragment
-import im.vector.app.features.crypto.verification.conclusion.VerificationConclusionFragment
-import im.vector.app.features.crypto.verification.emoji.VerificationEmojiCodeFragment
-import im.vector.app.features.crypto.verification.qrconfirmation.VerificationQRWaitingFragment
-import im.vector.app.features.crypto.verification.qrconfirmation.VerificationQrScannedByOtherFragment
-import im.vector.app.features.crypto.verification.request.VerificationRequestFragment
-import im.vector.app.features.devtools.RoomDevToolEditFragment
-import im.vector.app.features.devtools.RoomDevToolFragment
-import im.vector.app.features.devtools.RoomDevToolSendFormFragment
-import im.vector.app.features.devtools.RoomDevToolStateEventListFragment
-import im.vector.app.features.discovery.DiscoverySettingsFragment
-import im.vector.app.features.discovery.change.SetIdentityServerFragment
-import im.vector.app.features.home.HomeDetailFragment
-import im.vector.app.features.home.HomeDrawerFragment
-import im.vector.app.features.home.LoadingFragment
-import im.vector.app.features.home.NewHomeDetailFragment
-import im.vector.app.features.home.room.breadcrumbs.BreadcrumbsFragment
-import im.vector.app.features.home.room.detail.TimelineFragment
-import im.vector.app.features.home.room.detail.search.SearchFragment
-import im.vector.app.features.home.room.list.RoomListFragment
-import im.vector.app.features.home.room.list.home.HomeRoomListFragment
-import im.vector.app.features.home.room.list.home.NewChatBottomSheet
-import im.vector.app.features.home.room.threads.list.views.ThreadListFragment
-import im.vector.app.features.location.LocationSharingFragment
-import im.vector.app.features.location.preview.LocationPreviewFragment
-import im.vector.app.features.login.LoginCaptchaFragment
-import im.vector.app.features.login.LoginFragment
-import im.vector.app.features.login.LoginGenericTextInputFormFragment
-import im.vector.app.features.login.LoginResetPasswordFragment
-import im.vector.app.features.login.LoginResetPasswordMailConfirmationFragment
-import im.vector.app.features.login.LoginResetPasswordSuccessFragment
-import im.vector.app.features.login.LoginServerSelectionFragment
-import im.vector.app.features.login.LoginServerUrlFormFragment
-import im.vector.app.features.login.LoginSignUpSignInSelectionFragment
-import im.vector.app.features.login.LoginSplashFragment
-import im.vector.app.features.login.LoginWaitForEmailFragment
-import im.vector.app.features.login.LoginWebFragment
-import im.vector.app.features.login.terms.LoginTermsFragment
-import im.vector.app.features.matrixto.MatrixToRoomSpaceFragment
-import im.vector.app.features.matrixto.MatrixToUserFragment
-import im.vector.app.features.onboarding.ftueauth.FtueAuthAccountCreatedFragment
-import im.vector.app.features.onboarding.ftueauth.FtueAuthCaptchaFragment
-import im.vector.app.features.onboarding.ftueauth.FtueAuthChooseDisplayNameFragment
-import im.vector.app.features.onboarding.ftueauth.FtueAuthChooseProfilePictureFragment
-import im.vector.app.features.onboarding.ftueauth.FtueAuthCombinedLoginFragment
-import im.vector.app.features.onboarding.ftueauth.FtueAuthCombinedRegisterFragment
-import im.vector.app.features.onboarding.ftueauth.FtueAuthCombinedServerSelectionFragment
-import im.vector.app.features.onboarding.ftueauth.FtueAuthEmailEntryFragment
-import im.vector.app.features.onboarding.ftueauth.FtueAuthGenericTextInputFormFragment
-import im.vector.app.features.onboarding.ftueauth.FtueAuthLegacyStyleCaptchaFragment
-import im.vector.app.features.onboarding.ftueauth.FtueAuthLegacyWaitForEmailFragment
-import im.vector.app.features.onboarding.ftueauth.FtueAuthLoginFragment
-import im.vector.app.features.onboarding.ftueauth.FtueAuthPersonalizationCompleteFragment
-import im.vector.app.features.onboarding.ftueauth.FtueAuthPhoneConfirmationFragment
-import im.vector.app.features.onboarding.ftueauth.FtueAuthPhoneEntryFragment
-import im.vector.app.features.onboarding.ftueauth.FtueAuthResetPasswordFragment
-import im.vector.app.features.onboarding.ftueauth.FtueAuthResetPasswordMailConfirmationFragment
-import im.vector.app.features.onboarding.ftueauth.FtueAuthResetPasswordSuccessFragment
-import im.vector.app.features.onboarding.ftueauth.FtueAuthServerSelectionFragment
-import im.vector.app.features.onboarding.ftueauth.FtueAuthSignUpSignInSelectionFragment
-import im.vector.app.features.onboarding.ftueauth.FtueAuthSplashCarouselFragment
-import im.vector.app.features.onboarding.ftueauth.FtueAuthSplashFragment
-import im.vector.app.features.onboarding.ftueauth.FtueAuthUseCaseFragment
-import im.vector.app.features.onboarding.ftueauth.FtueAuthWaitForEmailFragment
-import im.vector.app.features.onboarding.ftueauth.FtueAuthWebFragment
-import im.vector.app.features.onboarding.ftueauth.terms.FtueAuthLegacyStyleTermsFragment
-import im.vector.app.features.onboarding.ftueauth.terms.FtueAuthTermsFragment
-import im.vector.app.features.pin.PinFragment
-import im.vector.app.features.poll.create.CreatePollFragment
-import im.vector.app.features.qrcode.QrCodeScannerFragment
-import im.vector.app.features.reactions.EmojiChooserFragment
-import im.vector.app.features.reactions.EmojiSearchResultFragment
-import im.vector.app.features.roomdirectory.PublicRoomsFragment
-import im.vector.app.features.roomdirectory.createroom.CreateRoomFragment
-import im.vector.app.features.roomdirectory.picker.RoomDirectoryPickerFragment
-import im.vector.app.features.roomdirectory.roompreview.RoomPreviewNoPreviewFragment
-import im.vector.app.features.roommemberprofile.RoomMemberProfileFragment
-import im.vector.app.features.roommemberprofile.devices.DeviceListFragment
-import im.vector.app.features.roommemberprofile.devices.DeviceTrustInfoActionFragment
-import im.vector.app.features.roomprofile.RoomProfileFragment
-import im.vector.app.features.roomprofile.alias.RoomAliasFragment
-import im.vector.app.features.roomprofile.banned.RoomBannedMemberListFragment
-import im.vector.app.features.roomprofile.members.RoomMemberListFragment
-import im.vector.app.features.roomprofile.notifications.RoomNotificationSettingsFragment
-import im.vector.app.features.roomprofile.permissions.RoomPermissionsFragment
-import im.vector.app.features.roomprofile.settings.RoomSettingsFragment
-import im.vector.app.features.roomprofile.settings.joinrule.RoomJoinRuleFragment
-import im.vector.app.features.roomprofile.settings.joinrule.advanced.RoomJoinRuleChooseRestrictedFragment
-import im.vector.app.features.roomprofile.uploads.RoomUploadsFragment
-import im.vector.app.features.roomprofile.uploads.files.RoomUploadsFilesFragment
-import im.vector.app.features.roomprofile.uploads.media.RoomUploadsMediaFragment
-import im.vector.app.features.settings.VectorSettingsGeneralFragment
-import im.vector.app.features.settings.VectorSettingsHelpAboutFragment
-import im.vector.app.features.settings.VectorSettingsLabsFragment
-import im.vector.app.features.settings.VectorSettingsPinFragment
-import im.vector.app.features.settings.VectorSettingsPreferencesFragment
-import im.vector.app.features.settings.VectorSettingsSecurityPrivacyFragment
-import im.vector.app.features.settings.account.deactivation.DeactivateAccountFragment
-import im.vector.app.features.settings.crosssigning.CrossSigningSettingsFragment
-import im.vector.app.features.settings.devices.VectorSettingsDevicesFragment
-import im.vector.app.features.settings.devtools.AccountDataFragment
-import im.vector.app.features.settings.devtools.GossipingEventsPaperTrailFragment
-import im.vector.app.features.settings.devtools.IncomingKeyRequestListFragment
-import im.vector.app.features.settings.devtools.KeyRequestsFragment
-import im.vector.app.features.settings.devtools.OutgoingKeyRequestListFragment
-import im.vector.app.features.settings.font.FontScaleSettingFragment
-import im.vector.app.features.settings.homeserver.HomeserverSettingsFragment
-import im.vector.app.features.settings.ignored.VectorSettingsIgnoredUsersFragment
-import im.vector.app.features.settings.legals.LegalsFragment
-import im.vector.app.features.settings.locale.LocalePickerFragment
-import im.vector.app.features.settings.notifications.VectorSettingsAdvancedNotificationPreferenceFragment
-import im.vector.app.features.settings.notifications.VectorSettingsNotificationPreferenceFragment
-import im.vector.app.features.settings.notifications.VectorSettingsNotificationsTroubleshootFragment
-import im.vector.app.features.settings.push.PushGatewaysFragment
-import im.vector.app.features.settings.push.PushRulesFragment
-import im.vector.app.features.settings.threepids.ThreePidsSettingsFragment
-import im.vector.app.features.share.IncomingShareFragment
-import im.vector.app.features.signout.soft.SoftLogoutFragment
-import im.vector.app.features.spaces.SpaceListFragment
-import im.vector.app.features.spaces.create.ChoosePrivateSpaceTypeFragment
-import im.vector.app.features.spaces.create.ChooseSpaceTypeFragment
-import im.vector.app.features.spaces.create.CreateSpaceAdd3pidInvitesFragment
-import im.vector.app.features.spaces.create.CreateSpaceDefaultRoomsFragment
-import im.vector.app.features.spaces.create.CreateSpaceDetailsFragment
-import im.vector.app.features.spaces.explore.SpaceDirectoryFragment
-import im.vector.app.features.spaces.leave.SpaceLeaveAdvancedFragment
-import im.vector.app.features.spaces.manage.SpaceAddRoomFragment
-import im.vector.app.features.spaces.manage.SpaceManageRoomsFragment
-import im.vector.app.features.spaces.manage.SpaceSettingsFragment
-import im.vector.app.features.spaces.people.SpacePeopleFragment
-import im.vector.app.features.spaces.preview.SpacePreviewFragment
-import im.vector.app.features.terms.ReviewTermsFragment
-import im.vector.app.features.usercode.ShowUserCodeFragment
-import im.vector.app.features.userdirectory.UserListFragment
-import im.vector.app.features.widgets.WidgetFragment
-
-@InstallIn(ActivityComponent::class)
-@Module
-interface FragmentModule {
- /**
- * Fragments with @IntoMap will be injected by this factory.
- */
- @Binds
- fun bindFragmentFactory(factory: VectorFragmentFactory): FragmentFactory
-
- @Binds
- @IntoMap
- @FragmentKey(RoomListFragment::class)
- fun bindRoomListFragment(fragment: RoomListFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(NewChatBottomSheet::class)
- fun bindNewChatBottomSheetFragment(fragment: NewChatBottomSheet): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(LocalePickerFragment::class)
- fun bindLocalePickerFragment(fragment: LocalePickerFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(SpaceListFragment::class)
- fun bindSpaceListFragment(fragment: SpaceListFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(TimelineFragment::class)
- fun bindTimelineFragment(fragment: TimelineFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(RoomDirectoryPickerFragment::class)
- fun bindRoomDirectoryPickerFragment(fragment: RoomDirectoryPickerFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(CreateRoomFragment::class)
- fun bindCreateRoomFragment(fragment: CreateRoomFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(RoomPreviewNoPreviewFragment::class)
- fun bindRoomPreviewNoPreviewFragment(fragment: RoomPreviewNoPreviewFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(KeysBackupSettingsFragment::class)
- fun bindKeysBackupSettingsFragment(fragment: KeysBackupSettingsFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(LoadingFragment::class)
- fun bindLoadingFragment(fragment: LoadingFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(HomeDrawerFragment::class)
- fun bindHomeDrawerFragment(fragment: HomeDrawerFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(HomeDetailFragment::class)
- fun bindHomeDetailFragment(fragment: HomeDetailFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(NewHomeDetailFragment::class)
- fun bindNewHomeDetailFragment(fragment: NewHomeDetailFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(EmojiSearchResultFragment::class)
- fun bindEmojiSearchResultFragment(fragment: EmojiSearchResultFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(LoginFragment::class)
- fun bindLoginFragment(fragment: LoginFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(LoginCaptchaFragment::class)
- fun bindLoginCaptchaFragment(fragment: LoginCaptchaFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(LoginTermsFragment::class)
- fun bindLoginTermsFragment(fragment: LoginTermsFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(LoginServerUrlFormFragment::class)
- fun bindLoginServerUrlFormFragment(fragment: LoginServerUrlFormFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(LoginResetPasswordMailConfirmationFragment::class)
- fun bindLoginResetPasswordMailConfirmationFragment(fragment: LoginResetPasswordMailConfirmationFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(LoginResetPasswordFragment::class)
- fun bindLoginResetPasswordFragment(fragment: LoginResetPasswordFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(LoginResetPasswordSuccessFragment::class)
- fun bindLoginResetPasswordSuccessFragment(fragment: LoginResetPasswordSuccessFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(LoginServerSelectionFragment::class)
- fun bindLoginServerSelectionFragment(fragment: LoginServerSelectionFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(LoginSignUpSignInSelectionFragment::class)
- fun bindLoginSignUpSignInSelectionFragment(fragment: LoginSignUpSignInSelectionFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(LoginSplashFragment::class)
- fun bindLoginSplashFragment(fragment: LoginSplashFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(LoginWebFragment::class)
- fun bindLoginWebFragment(fragment: LoginWebFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(LoginGenericTextInputFormFragment::class)
- fun bindLoginGenericTextInputFormFragment(fragment: LoginGenericTextInputFormFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(LoginWaitForEmailFragment::class)
- fun bindLoginWaitForEmailFragment(fragment: LoginWaitForEmailFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(FtueAuthLegacyStyleCaptchaFragment::class)
- fun bindFtueAuthLegacyStyleCaptchaFragment(fragment: FtueAuthLegacyStyleCaptchaFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(FtueAuthCaptchaFragment::class)
- fun bindFtueAuthCaptchaFragment(fragment: FtueAuthCaptchaFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(FtueAuthGenericTextInputFormFragment::class)
- fun bindFtueAuthGenericTextInputFormFragment(fragment: FtueAuthGenericTextInputFormFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(FtueAuthLoginFragment::class)
- fun bindFtueAuthLoginFragment(fragment: FtueAuthLoginFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(FtueAuthResetPasswordFragment::class)
- fun bindFtueAuthResetPasswordFragment(fragment: FtueAuthResetPasswordFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(FtueAuthResetPasswordMailConfirmationFragment::class)
- fun bindFtueAuthResetPasswordMailConfirmationFragment(fragment: FtueAuthResetPasswordMailConfirmationFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(FtueAuthResetPasswordSuccessFragment::class)
- fun bindFtueAuthResetPasswordSuccessFragment(fragment: FtueAuthResetPasswordSuccessFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(FtueAuthServerSelectionFragment::class)
- fun bindFtueAuthServerSelectionFragment(fragment: FtueAuthServerSelectionFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(FtueAuthSignUpSignInSelectionFragment::class)
- fun bindFtueAuthSignUpSignInSelectionFragment(fragment: FtueAuthSignUpSignInSelectionFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(FtueAuthSplashFragment::class)
- fun bindFtueAuthSplashFragment(fragment: FtueAuthSplashFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(FtueAuthSplashCarouselFragment::class)
- fun bindFtueAuthSplashCarouselFragment(fragment: FtueAuthSplashCarouselFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(FtueAuthUseCaseFragment::class)
- fun bindFtueAuthUseCaseFragment(fragment: FtueAuthUseCaseFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(FtueAuthWaitForEmailFragment::class)
- fun bindFtueAuthWaitForEmailFragment(fragment: FtueAuthWaitForEmailFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(FtueAuthLegacyWaitForEmailFragment::class)
- fun bindFtueAuthLegacyWaitForEmailFragment(fragment: FtueAuthLegacyWaitForEmailFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(FtueAuthWebFragment::class)
- fun bindFtueAuthWebFragment(fragment: FtueAuthWebFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(FtueAuthLegacyStyleTermsFragment::class)
- fun bindFtueAuthLegacyStyleTermsFragment(fragment: FtueAuthLegacyStyleTermsFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(FtueAuthTermsFragment::class)
- fun bindFtueAuthTermsFragment(fragment: FtueAuthTermsFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(FtueAuthAccountCreatedFragment::class)
- fun bindFtueAuthAccountCreatedFragment(fragment: FtueAuthAccountCreatedFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(FtueAuthEmailEntryFragment::class)
- fun bindFtueAuthEmailEntryFragment(fragment: FtueAuthEmailEntryFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(FtueAuthPhoneEntryFragment::class)
- fun bindFtueAuthPhoneEntryFragment(fragment: FtueAuthPhoneEntryFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(FtueAuthPhoneConfirmationFragment::class)
- fun bindFtueAuthPhoneConfirmationFragment(fragment: FtueAuthPhoneConfirmationFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(FtueAuthChooseDisplayNameFragment::class)
- fun bindFtueAuthChooseDisplayNameFragment(fragment: FtueAuthChooseDisplayNameFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(FtueAuthChooseProfilePictureFragment::class)
- fun bindFtueAuthChooseProfilePictureFragment(fragment: FtueAuthChooseProfilePictureFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(FtueAuthPersonalizationCompleteFragment::class)
- fun bindFtueAuthPersonalizationCompleteFragment(fragment: FtueAuthPersonalizationCompleteFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(FtueAuthCombinedLoginFragment::class)
- fun bindFtueAuthCombinedLoginFragment(fragment: FtueAuthCombinedLoginFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(FtueAuthCombinedRegisterFragment::class)
- fun bindFtueAuthCombinedRegisterFragment(fragment: FtueAuthCombinedRegisterFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(FtueAuthCombinedServerSelectionFragment::class)
- fun bindFtueAuthCombinedServerSelectionFragment(fragment: FtueAuthCombinedServerSelectionFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(UserListFragment::class)
- fun bindUserListFragment(fragment: UserListFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(PushGatewaysFragment::class)
- fun bindPushGatewaysFragment(fragment: PushGatewaysFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(VectorSettingsNotificationsTroubleshootFragment::class)
- fun bindVectorSettingsNotificationsTroubleshootFragment(fragment: VectorSettingsNotificationsTroubleshootFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(VectorSettingsAdvancedNotificationPreferenceFragment::class)
- fun bindVectorSettingsAdvancedNotificationPreferenceFragment(fragment: VectorSettingsAdvancedNotificationPreferenceFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(VectorSettingsNotificationPreferenceFragment::class)
- fun bindVectorSettingsNotificationPreferenceFragment(fragment: VectorSettingsNotificationPreferenceFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(VectorSettingsLabsFragment::class)
- fun bindVectorSettingsLabsFragment(fragment: VectorSettingsLabsFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(HomeserverSettingsFragment::class)
- fun bindHomeserverSettingsFragment(fragment: HomeserverSettingsFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(FontScaleSettingFragment::class)
- fun bindFontScaleSettingFragment(fragment: FontScaleSettingFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(VectorSettingsPinFragment::class)
- fun bindVectorSettingsPinFragment(fragment: VectorSettingsPinFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(VectorSettingsGeneralFragment::class)
- fun bindVectorSettingsGeneralFragment(fragment: VectorSettingsGeneralFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(PushRulesFragment::class)
- fun bindPushRulesFragment(fragment: PushRulesFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(VectorSettingsPreferencesFragment::class)
- fun bindVectorSettingsPreferencesFragment(fragment: VectorSettingsPreferencesFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(VectorSettingsSecurityPrivacyFragment::class)
- fun bindVectorSettingsSecurityPrivacyFragment(fragment: VectorSettingsSecurityPrivacyFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(VectorSettingsHelpAboutFragment::class)
- fun bindVectorSettingsHelpAboutFragment(fragment: VectorSettingsHelpAboutFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(VectorSettingsIgnoredUsersFragment::class)
- fun bindVectorSettingsIgnoredUsersFragment(fragment: VectorSettingsIgnoredUsersFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(VectorSettingsDevicesFragment::class)
- fun bindVectorSettingsDevicesFragment(fragment: VectorSettingsDevicesFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(ThreePidsSettingsFragment::class)
- fun bindThreePidsSettingsFragment(fragment: ThreePidsSettingsFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(PublicRoomsFragment::class)
- fun bindPublicRoomsFragment(fragment: PublicRoomsFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(RoomProfileFragment::class)
- fun bindRoomProfileFragment(fragment: RoomProfileFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(RoomMemberListFragment::class)
- fun bindRoomMemberListFragment(fragment: RoomMemberListFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(RoomUploadsFragment::class)
- fun bindRoomUploadsFragment(fragment: RoomUploadsFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(RoomUploadsMediaFragment::class)
- fun bindRoomUploadsMediaFragment(fragment: RoomUploadsMediaFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(RoomUploadsFilesFragment::class)
- fun bindRoomUploadsFilesFragment(fragment: RoomUploadsFilesFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(RoomSettingsFragment::class)
- fun bindRoomSettingsFragment(fragment: RoomSettingsFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(RoomAliasFragment::class)
- fun bindRoomAliasFragment(fragment: RoomAliasFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(RoomPermissionsFragment::class)
- fun bindRoomPermissionsFragment(fragment: RoomPermissionsFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(RoomMemberProfileFragment::class)
- fun bindRoomMemberProfileFragment(fragment: RoomMemberProfileFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(BreadcrumbsFragment::class)
- fun bindBreadcrumbsFragment(fragment: BreadcrumbsFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(AnalyticsOptInFragment::class)
- fun bindAnalyticsOptInFragment(fragment: AnalyticsOptInFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(EmojiChooserFragment::class)
- fun bindEmojiChooserFragment(fragment: EmojiChooserFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(SoftLogoutFragment::class)
- fun bindSoftLogoutFragment(fragment: SoftLogoutFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(VerificationRequestFragment::class)
- fun bindVerificationRequestFragment(fragment: VerificationRequestFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(VerificationChooseMethodFragment::class)
- fun bindVerificationChooseMethodFragment(fragment: VerificationChooseMethodFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(VerificationEmojiCodeFragment::class)
- fun bindVerificationEmojiCodeFragment(fragment: VerificationEmojiCodeFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(VerificationQrScannedByOtherFragment::class)
- fun bindVerificationQrScannedByOtherFragment(fragment: VerificationQrScannedByOtherFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(VerificationQRWaitingFragment::class)
- fun bindVerificationQRWaitingFragment(fragment: VerificationQRWaitingFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(VerificationConclusionFragment::class)
- fun bindVerificationConclusionFragment(fragment: VerificationConclusionFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(VerificationCancelFragment::class)
- fun bindVerificationCancelFragment(fragment: VerificationCancelFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(QuadSLoadingFragment::class)
- fun bindQuadSLoadingFragment(fragment: QuadSLoadingFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(VerificationNotMeFragment::class)
- fun bindVerificationNotMeFragment(fragment: VerificationNotMeFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(QrCodeScannerFragment::class)
- fun bindQrCodeScannerFragment(fragment: QrCodeScannerFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(DeviceListFragment::class)
- fun bindDeviceListFragment(fragment: DeviceListFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(DeviceTrustInfoActionFragment::class)
- fun bindDeviceTrustInfoActionFragment(fragment: DeviceTrustInfoActionFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(CrossSigningSettingsFragment::class)
- fun bindCrossSigningSettingsFragment(fragment: CrossSigningSettingsFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(AttachmentsPreviewFragment::class)
- fun bindAttachmentsPreviewFragment(fragment: AttachmentsPreviewFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(IncomingShareFragment::class)
- fun bindIncomingShareFragment(fragment: IncomingShareFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(AccountDataFragment::class)
- fun bindAccountDataFragment(fragment: AccountDataFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(OutgoingKeyRequestListFragment::class)
- fun bindOutgoingKeyRequestListFragment(fragment: OutgoingKeyRequestListFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(IncomingKeyRequestListFragment::class)
- fun bindIncomingKeyRequestListFragment(fragment: IncomingKeyRequestListFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(KeyRequestsFragment::class)
- fun bindKeyRequestsFragment(fragment: KeyRequestsFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(GossipingEventsPaperTrailFragment::class)
- fun bindGossipingEventsPaperTrailFragment(fragment: GossipingEventsPaperTrailFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(BootstrapEnterPassphraseFragment::class)
- fun bindBootstrapEnterPassphraseFragment(fragment: BootstrapEnterPassphraseFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(BootstrapConfirmPassphraseFragment::class)
- fun bindBootstrapConfirmPassphraseFragment(fragment: BootstrapConfirmPassphraseFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(BootstrapWaitingFragment::class)
- fun bindBootstrapWaitingFragment(fragment: BootstrapWaitingFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(BootstrapSetupRecoveryKeyFragment::class)
- fun bindBootstrapSetupRecoveryKeyFragment(fragment: BootstrapSetupRecoveryKeyFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(BootstrapSaveRecoveryKeyFragment::class)
- fun bindBootstrapSaveRecoveryKeyFragment(fragment: BootstrapSaveRecoveryKeyFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(BootstrapConclusionFragment::class)
- fun bindBootstrapConclusionFragment(fragment: BootstrapConclusionFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(BootstrapReAuthFragment::class)
- fun bindBootstrapReAuthFragment(fragment: BootstrapReAuthFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(BootstrapMigrateBackupFragment::class)
- fun bindBootstrapMigrateBackupFragment(fragment: BootstrapMigrateBackupFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(DeactivateAccountFragment::class)
- fun bindDeactivateAccountFragment(fragment: DeactivateAccountFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(SharedSecuredStoragePassphraseFragment::class)
- fun bindSharedSecuredStoragePassphraseFragment(fragment: SharedSecuredStoragePassphraseFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(SharedSecuredStorageKeyFragment::class)
- fun bindSharedSecuredStorageKeyFragment(fragment: SharedSecuredStorageKeyFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(SharedSecuredStorageResetAllFragment::class)
- fun bindSharedSecuredStorageResetAllFragment(fragment: SharedSecuredStorageResetAllFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(SetIdentityServerFragment::class)
- fun bindSetIdentityServerFragment(fragment: SetIdentityServerFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(DiscoverySettingsFragment::class)
- fun bindDiscoverySettingsFragment(fragment: DiscoverySettingsFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(LegalsFragment::class)
- fun bindLegalsFragment(fragment: LegalsFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(ReviewTermsFragment::class)
- fun bindReviewTermsFragment(fragment: ReviewTermsFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(WidgetFragment::class)
- fun bindWidgetFragment(fragment: WidgetFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(ContactsBookFragment::class)
- fun bindPhoneBookFragment(fragment: ContactsBookFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(PinFragment::class)
- fun bindPinFragment(fragment: PinFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(RoomBannedMemberListFragment::class)
- fun bindRoomBannedMemberListFragment(fragment: RoomBannedMemberListFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(RoomNotificationSettingsFragment::class)
- fun bindRoomNotificationSettingsFragment(fragment: RoomNotificationSettingsFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(SearchFragment::class)
- fun bindSearchFragment(fragment: SearchFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(ShowUserCodeFragment::class)
- fun bindShowUserCodeFragment(fragment: ShowUserCodeFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(RoomDevToolFragment::class)
- fun bindRoomDevToolFragment(fragment: RoomDevToolFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(RoomDevToolStateEventListFragment::class)
- fun bindRoomDevToolStateEventListFragment(fragment: RoomDevToolStateEventListFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(RoomDevToolEditFragment::class)
- fun bindRoomDevToolEditFragment(fragment: RoomDevToolEditFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(RoomDevToolSendFormFragment::class)
- fun bindRoomDevToolSendFormFragment(fragment: RoomDevToolSendFormFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(SpacePreviewFragment::class)
- fun bindSpacePreviewFragment(fragment: SpacePreviewFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(ChooseSpaceTypeFragment::class)
- fun bindChooseSpaceTypeFragment(fragment: ChooseSpaceTypeFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(CreateSpaceDetailsFragment::class)
- fun bindCreateSpaceDetailsFragment(fragment: CreateSpaceDetailsFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(CreateSpaceDefaultRoomsFragment::class)
- fun bindCreateSpaceDefaultRoomsFragment(fragment: CreateSpaceDefaultRoomsFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(MatrixToUserFragment::class)
- fun bindMatrixToUserFragment(fragment: MatrixToUserFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(MatrixToRoomSpaceFragment::class)
- fun bindMatrixToRoomSpaceFragment(fragment: MatrixToRoomSpaceFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(SpaceDirectoryFragment::class)
- fun bindSpaceDirectoryFragment(fragment: SpaceDirectoryFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(ChoosePrivateSpaceTypeFragment::class)
- fun bindChoosePrivateSpaceTypeFragment(fragment: ChoosePrivateSpaceTypeFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(CreateSpaceAdd3pidInvitesFragment::class)
- fun bindCreateSpaceAdd3pidInvitesFragment(fragment: CreateSpaceAdd3pidInvitesFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(SpaceAddRoomFragment::class)
- fun bindSpaceAddRoomFragment(fragment: SpaceAddRoomFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(SpacePeopleFragment::class)
- fun bindSpacePeopleFragment(fragment: SpacePeopleFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(SpaceSettingsFragment::class)
- fun bindSpaceSettingsFragment(fragment: SpaceSettingsFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(SpaceManageRoomsFragment::class)
- fun bindSpaceManageRoomsFragment(fragment: SpaceManageRoomsFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(RoomJoinRuleFragment::class)
- fun bindRoomJoinRuleFragment(fragment: RoomJoinRuleFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(RoomJoinRuleChooseRestrictedFragment::class)
- fun bindRoomJoinRuleChooseRestrictedFragment(fragment: RoomJoinRuleChooseRestrictedFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(SpaceLeaveAdvancedFragment::class)
- fun bindSpaceLeaveAdvancedFragment(fragment: SpaceLeaveAdvancedFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(ThreadListFragment::class)
- fun bindThreadListFragment(fragment: ThreadListFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(CreatePollFragment::class)
- fun bindCreatePollFragment(fragment: CreatePollFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(LocationSharingFragment::class)
- fun bindLocationSharingFragment(fragment: LocationSharingFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(LocationPreviewFragment::class)
- fun bindLocationPreviewFragment(fragment: LocationPreviewFragment): Fragment
-
- @Binds
- @IntoMap
- @FragmentKey(HomeRoomListFragment::class)
- fun binHomeRoomListFragment(fragment: HomeRoomListFragment): Fragment
-}
diff --git a/vector/src/main/java/im/vector/app/core/di/VectorFragmentFactory.kt b/vector/src/main/java/im/vector/app/core/di/VectorFragmentFactory.kt
deleted file mode 100644
index f761d99114..0000000000
--- a/vector/src/main/java/im/vector/app/core/di/VectorFragmentFactory.kt
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2019 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.core.di
-
-import androidx.fragment.app.Fragment
-import androidx.fragment.app.FragmentFactory
-import timber.log.Timber
-import javax.inject.Inject
-import javax.inject.Provider
-
-/**
- * FragmentFactory which uses Dagger to create the instances.
- */
-class VectorFragmentFactory @Inject constructor(
- private val creators: @JvmSuppressWildcards Map, Provider>
-) : FragmentFactory() {
-
- override fun instantiate(classLoader: ClassLoader, className: String): Fragment {
- val fragmentClass = loadFragmentClass(classLoader, className)
- val creator: Provider? = creators[fragmentClass]
- return if (creator == null) {
- Timber.v("Unknown model class: $className, fallback to default instance")
- super.instantiate(classLoader, className)
- } else {
- creator.get()
- }
- }
-}
diff --git a/vector/src/main/java/im/vector/app/core/dialogs/GalleryOrCameraDialogHelperFactory.kt b/vector/src/main/java/im/vector/app/core/dialogs/GalleryOrCameraDialogHelperFactory.kt
new file mode 100644
index 0000000000..0e8dc1d0d1
--- /dev/null
+++ b/vector/src/main/java/im/vector/app/core/dialogs/GalleryOrCameraDialogHelperFactory.kt
@@ -0,0 +1,34 @@
+/*
+ * 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.core.dialogs
+
+import androidx.fragment.app.Fragment
+import im.vector.app.core.resources.ColorProvider
+import im.vector.app.core.time.Clock
+import javax.inject.Inject
+
+/**
+ * Factory for [GalleryOrCameraDialogHelper].
+ */
+class GalleryOrCameraDialogHelperFactory @Inject constructor(
+ private val colorProvider: ColorProvider,
+ private val clock: Clock,
+) {
+ fun create(fragment: Fragment): GalleryOrCameraDialogHelper {
+ return GalleryOrCameraDialogHelper(fragment, colorProvider, clock)
+ }
+}
diff --git a/vector/src/main/java/im/vector/app/core/platform/VectorBaseActivity.kt b/vector/src/main/java/im/vector/app/core/platform/VectorBaseActivity.kt
index 24a65e1071..4e7b174772 100644
--- a/vector/src/main/java/im/vector/app/core/platform/VectorBaseActivity.kt
+++ b/vector/src/main/java/im/vector/app/core/platform/VectorBaseActivity.kt
@@ -21,7 +21,6 @@ import android.app.Activity
import android.content.Context
import android.os.Build
import android.os.Bundle
-import android.os.Parcelable
import android.view.Menu
import android.view.MenuInflater
import android.view.MenuItem
@@ -39,8 +38,6 @@ import androidx.core.content.ContextCompat
import androidx.core.util.Consumer
import androidx.core.view.MenuProvider
import androidx.core.view.isVisible
-import androidx.fragment.app.Fragment
-import androidx.fragment.app.FragmentFactory
import androidx.fragment.app.FragmentManager
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.ViewModelProvider
@@ -67,7 +64,6 @@ import im.vector.app.core.extensions.registerStartForActivityResult
import im.vector.app.core.extensions.restart
import im.vector.app.core.extensions.setTextOrHide
import im.vector.app.core.extensions.singletonEntryPoint
-import im.vector.app.core.extensions.toMvRxBundle
import im.vector.app.core.resources.BuildMeta
import im.vector.app.core.utils.AndroidSystemSettingsProvider
import im.vector.app.core.utils.ToolbarConfig
@@ -169,7 +165,6 @@ abstract class VectorBaseActivity : AppCompatActivity(), Maver
lateinit var navigator: Navigator
private set
- private lateinit var fragmentFactory: FragmentFactory
private lateinit var activeSessionHolder: ActiveSessionHolder
private lateinit var vectorPreferences: VectorPreferences
@@ -210,8 +205,6 @@ abstract class VectorBaseActivity : AppCompatActivity(), Maver
val singletonEntryPoint = singletonEntryPoint()
val activityEntryPoint = EntryPointAccessors.fromActivity(this, ActivityEntryPoint::class.java)
ThemeUtils.setActivityTheme(this, getOtherThemes())
- fragmentFactory = activityEntryPoint.fragmentFactory()
- supportFragmentManager.fragmentFactory = fragmentFactory
viewModelFactory = activityEntryPoint.viewModelFactory()
super.onCreate(savedInstanceState)
addOnMultiWindowModeChangedListener(onMultiWindowModeChangedListener)
@@ -464,12 +457,6 @@ abstract class VectorBaseActivity : AppCompatActivity(), Maver
bugReporter.inMultiWindowMode = it.isInMultiWindowMode
}
- protected fun createFragment(fragmentClass: Class, argsParcelable: Parcelable? = null): Fragment {
- return fragmentFactory.instantiate(classLoader, fragmentClass.name).apply {
- arguments = argsParcelable?.toMvRxBundle()
- }
- }
-
/* ==========================================================================================
* PRIVATE METHODS
* ========================================================================================== */
diff --git a/vector/src/main/java/im/vector/app/core/platform/VectorBaseFragment.kt b/vector/src/main/java/im/vector/app/core/platform/VectorBaseFragment.kt
index 340c906a6d..8fe2d33f6a 100644
--- a/vector/src/main/java/im/vector/app/core/platform/VectorBaseFragment.kt
+++ b/vector/src/main/java/im/vector/app/core/platform/VectorBaseFragment.kt
@@ -123,7 +123,6 @@ abstract class VectorBaseFragment : Fragment(), MavericksView
analyticsTracker = singletonEntryPoint.analyticsTracker()
unrecognizedCertificateDialog = singletonEntryPoint.unrecognizedCertificateDialog()
viewModelFactory = activityEntryPoint.viewModelFactory()
- childFragmentManager.fragmentFactory = activityEntryPoint.fragmentFactory()
super.onAttach(context)
}
diff --git a/vector/src/main/java/im/vector/app/features/MainActivity.kt b/vector/src/main/java/im/vector/app/features/MainActivity.kt
index 14fae80325..e1e7764f19 100644
--- a/vector/src/main/java/im/vector/app/features/MainActivity.kt
+++ b/vector/src/main/java/im/vector/app/features/MainActivity.kt
@@ -38,6 +38,7 @@ import im.vector.app.core.platform.VectorBaseActivity
import im.vector.app.core.utils.deleteAllFiles
import im.vector.app.databinding.ActivityMainBinding
import im.vector.app.features.analytics.VectorAnalytics
+import im.vector.app.features.analytics.plan.ViewRoom
import im.vector.app.features.home.HomeActivity
import im.vector.app.features.home.ShortcutsHandler
import im.vector.app.features.notifications.NotificationDrawerManager
@@ -186,8 +187,7 @@ class MainActivity : VectorBaseActivity(), UnlockedActivity
} else if (intent.action == ACTION_ROOM_DETAILS_FROM_SHORTCUT) {
val roomId = intent.getStringExtra(EXTRA_ROOM_ID)
if (roomId?.isNotEmpty() == true) {
- // TODO Add a trigger Shortcut to the analytics.
- navigator.openRoom(this, roomId)
+ navigator.openRoom(this, roomId, trigger = ViewRoom.Trigger.Shortcut)
}
finish()
} else {
diff --git a/vector/src/main/java/im/vector/app/features/analytics/plan/Interaction.kt b/vector/src/main/java/im/vector/app/features/analytics/plan/Interaction.kt
index deb9088259..6336faa74c 100644
--- a/vector/src/main/java/im/vector/app/features/analytics/plan/Interaction.kt
+++ b/vector/src/main/java/im/vector/app/features/analytics/plan/Interaction.kt
@@ -117,6 +117,12 @@ data class Interaction(
*/
WebLeftPanelExploreRoomsButton,
+ /**
+ * User clicked on the avatar uploader in the profile settings of
+ * Element Web/Desktop.
+ */
+ WebProfileSettingsAvatarUploadButton,
+
/**
* User interacted with pin to sidebar checkboxes in the quick settings
* menu of Element Web/Desktop.
@@ -279,6 +285,18 @@ data class Interaction(
*/
WebRoomListRoomsSublistPlusMenuExploreRoomsItem,
+ /**
+ * User clicked on the button to return to the user onboarding list in
+ * the room list in Element Web/Desktop.
+ */
+ WebRoomListUserOnboardingButton,
+
+ /**
+ * User clicked on the button to close the user onboarding button in the
+ * room list in Element Web/Desktop.
+ */
+ WebRoomListUserOnboardingIgnoreButton,
+
/**
* User interacted with leave action in the general tab of the room
* settings dialog in Element Web/Desktop.
@@ -349,6 +367,36 @@ data class Interaction(
* Web/Desktop.
*/
WebUserMenuThemeToggleButton,
+
+ /**
+ * User clicked on the send DM CTA in the header of the new user
+ * onboarding page in Element Web/Desktop.
+ */
+ WebUserOnboardingHeaderSendDm,
+
+ /**
+ * User clicked on the action of the download apps task on the new user
+ * onboarding page in Element Web/Desktop.
+ */
+ WebUserOnboardingTaskDownloadApps,
+
+ /**
+ * User clicked on the action of the enable notifications task on the
+ * new user onboarding page in Element Web/Desktop.
+ */
+ WebUserOnboardingTaskEnableNotifications,
+
+ /**
+ * User clicked on the action of the find people task on the new user
+ * onboarding page in Element Web/Desktop.
+ */
+ WebUserOnboardingTaskSendDm,
+
+ /**
+ * User clicked on the action of the your profile task on the new user
+ * onboarding page in Element Web/Desktop.
+ */
+ WebUserOnboardingTaskSetupProfile,
}
enum class InteractionType {
diff --git a/vector/src/main/java/im/vector/app/features/analytics/plan/PermissionChanged.kt b/vector/src/main/java/im/vector/app/features/analytics/plan/PermissionChanged.kt
new file mode 100644
index 0000000000..9f463a4107
--- /dev/null
+++ b/vector/src/main/java/im/vector/app/features/analytics/plan/PermissionChanged.kt
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2021 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.analytics.plan
+
+import im.vector.app.features.analytics.itf.VectorAnalyticsEvent
+
+// GENERATED FILE, DO NOT EDIT. FOR MORE INFORMATION VISIT
+// https://github.com/matrix-org/matrix-analytics-events/
+
+/**
+ * Triggered when the user changes a permission status.
+ */
+data class PermissionChanged(
+ /**
+ * Whether the permission has been granted by the user.
+ */
+ val granted: Boolean,
+ /**
+ * The name of the permission.
+ */
+ val permission: Permission,
+) : VectorAnalyticsEvent {
+
+ enum class Permission {
+ /**
+ * Permissions related to sending notifications have changed.
+ */
+ Notification,
+ }
+
+ override fun getName() = "PermissionChanged"
+
+ override fun getProperties(): Map? {
+ return mutableMapOf().apply {
+ put("granted", granted)
+ put("permission", permission.name)
+ }.takeIf { it.isNotEmpty() }
+ }
+}
diff --git a/vector/src/main/java/im/vector/app/features/analytics/plan/ViewRoom.kt b/vector/src/main/java/im/vector/app/features/analytics/plan/ViewRoom.kt
index d2f30eec9b..f6a724304b 100644
--- a/vector/src/main/java/im/vector/app/features/analytics/plan/ViewRoom.kt
+++ b/vector/src/main/java/im/vector/app/features/analytics/plan/ViewRoom.kt
@@ -152,6 +152,11 @@ data class ViewRoom(
*/
RoomList,
+ /**
+ * Room accessed via a shortcut.
+ */
+ Shortcut,
+
/**
* Room accessed via a slash command in Element Web/Desktop like /goto.
*/
diff --git a/vector/src/main/java/im/vector/app/features/analytics/ui/consent/AnalyticsOptInFragment.kt b/vector/src/main/java/im/vector/app/features/analytics/ui/consent/AnalyticsOptInFragment.kt
index a5bafa2ee6..fbeeab9ec3 100644
--- a/vector/src/main/java/im/vector/app/features/analytics/ui/consent/AnalyticsOptInFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/analytics/ui/consent/AnalyticsOptInFragment.kt
@@ -21,6 +21,7 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.airbnb.mvrx.activityViewModel
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.setTextWithColoredPart
import im.vector.app.core.platform.OnBackPressed
@@ -30,9 +31,12 @@ import im.vector.app.databinding.FragmentAnalyticsOptinBinding
import im.vector.app.features.analytics.AnalyticsConfig
import javax.inject.Inject
-class AnalyticsOptInFragment @Inject constructor(
- private val analyticsConfig: AnalyticsConfig,
-) : VectorBaseFragment(), OnBackPressed {
+@AndroidEntryPoint
+class AnalyticsOptInFragment :
+ VectorBaseFragment(),
+ OnBackPressed {
+
+ @Inject lateinit var analyticsConfig: AnalyticsConfig
// Share the view model with the Activity so that the Activity
// can decide what to do when the data has been saved
diff --git a/vector/src/main/java/im/vector/app/features/attachments/preview/AttachmentsPreviewFragment.kt b/vector/src/main/java/im/vector/app/features/attachments/preview/AttachmentsPreviewFragment.kt
index c3a4ae7df2..47b19a435e 100644
--- a/vector/src/main/java/im/vector/app/features/attachments/preview/AttachmentsPreviewFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/attachments/preview/AttachmentsPreviewFragment.kt
@@ -39,6 +39,7 @@ import com.airbnb.mvrx.args
import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState
import com.yalantis.ucrop.UCrop
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.insertBeforeLast
@@ -63,15 +64,17 @@ data class AttachmentsPreviewArgs(
val attachments: List
) : Parcelable
-class AttachmentsPreviewFragment @Inject constructor(
- private val attachmentMiniaturePreviewController: AttachmentMiniaturePreviewController,
- private val attachmentBigPreviewController: AttachmentBigPreviewController,
- private val colorProvider: ColorProvider,
- private val clock: Clock,
-) : VectorBaseFragment(),
+@AndroidEntryPoint
+class AttachmentsPreviewFragment :
+ VectorBaseFragment(),
AttachmentMiniaturePreviewController.Callback,
VectorMenuProvider {
+ @Inject lateinit var attachmentMiniaturePreviewController: AttachmentMiniaturePreviewController
+ @Inject lateinit var attachmentBigPreviewController: AttachmentBigPreviewController
+ @Inject lateinit var colorProvider: ColorProvider
+ @Inject lateinit var clock: Clock
+
private val fragmentArgs: AttachmentsPreviewArgs by args()
private val viewModel: AttachmentsPreviewViewModel by fragmentViewModel()
diff --git a/vector/src/main/java/im/vector/app/features/contactsbook/ContactsBookFragment.kt b/vector/src/main/java/im/vector/app/features/contactsbook/ContactsBookFragment.kt
index 8cd7f2de45..4677dce7d6 100644
--- a/vector/src/main/java/im/vector/app/features/contactsbook/ContactsBookFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/contactsbook/ContactsBookFragment.kt
@@ -24,6 +24,7 @@ import androidx.core.view.isVisible
import androidx.lifecycle.lifecycleScope
import com.airbnb.mvrx.activityViewModel
import com.airbnb.mvrx.withState
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith
import im.vector.app.core.extensions.hideKeyboard
@@ -44,9 +45,12 @@ import reactivecircus.flowbinding.android.widget.checkedChanges
import reactivecircus.flowbinding.android.widget.textChanges
import javax.inject.Inject
-class ContactsBookFragment @Inject constructor(
- private val contactsBookController: ContactsBookController
-) : VectorBaseFragment(), ContactsBookController.Callback {
+@AndroidEntryPoint
+class ContactsBookFragment :
+ VectorBaseFragment(),
+ ContactsBookController.Callback {
+
+ @Inject lateinit var contactsBookController: ContactsBookController
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentContactsBookBinding {
return FragmentContactsBookBinding.inflate(inflater, container, false)
diff --git a/vector/src/main/java/im/vector/app/features/crypto/keysbackup/restore/KeysBackupRestoreFromKeyFragment.kt b/vector/src/main/java/im/vector/app/features/crypto/keysbackup/restore/KeysBackupRestoreFromKeyFragment.kt
index 42605a850b..9a3d37eed7 100644
--- a/vector/src/main/java/im/vector/app/features/crypto/keysbackup/restore/KeysBackupRestoreFromKeyFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/crypto/keysbackup/restore/KeysBackupRestoreFromKeyFragment.kt
@@ -22,15 +22,16 @@ import android.view.View
import android.view.ViewGroup
import android.view.inputmethod.EditorInfo
import androidx.core.widget.doOnTextChanged
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.registerStartForActivityResult
import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.core.utils.startImportTextFromFileIntent
import im.vector.app.databinding.FragmentKeysBackupRestoreFromKeyBinding
import org.matrix.android.sdk.api.extensions.tryOrNull
-import javax.inject.Inject
-class KeysBackupRestoreFromKeyFragment @Inject constructor() :
+@AndroidEntryPoint
+class KeysBackupRestoreFromKeyFragment :
VectorBaseFragment() {
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentKeysBackupRestoreFromKeyBinding {
diff --git a/vector/src/main/java/im/vector/app/features/crypto/keysbackup/restore/KeysBackupRestoreFromPassphraseFragment.kt b/vector/src/main/java/im/vector/app/features/crypto/keysbackup/restore/KeysBackupRestoreFromPassphraseFragment.kt
index 631bc9ff4f..cf98bc7e4d 100644
--- a/vector/src/main/java/im/vector/app/features/crypto/keysbackup/restore/KeysBackupRestoreFromPassphraseFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/crypto/keysbackup/restore/KeysBackupRestoreFromPassphraseFragment.kt
@@ -24,12 +24,14 @@ import android.view.ViewGroup
import android.view.inputmethod.EditorInfo
import androidx.core.text.set
import androidx.core.widget.doOnTextChanged
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.databinding.FragmentKeysBackupRestoreFromPassphraseBinding
-import javax.inject.Inject
-class KeysBackupRestoreFromPassphraseFragment @Inject constructor() : VectorBaseFragment() {
+@AndroidEntryPoint
+class KeysBackupRestoreFromPassphraseFragment :
+ VectorBaseFragment() {
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentKeysBackupRestoreFromPassphraseBinding {
return FragmentKeysBackupRestoreFromPassphraseBinding.inflate(inflater, container, false)
diff --git a/vector/src/main/java/im/vector/app/features/crypto/keysbackup/restore/KeysBackupRestoreSuccessFragment.kt b/vector/src/main/java/im/vector/app/features/crypto/keysbackup/restore/KeysBackupRestoreSuccessFragment.kt
index d26c1e2134..4a1bc49e27 100644
--- a/vector/src/main/java/im/vector/app/features/crypto/keysbackup/restore/KeysBackupRestoreSuccessFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/crypto/keysbackup/restore/KeysBackupRestoreSuccessFragment.kt
@@ -20,13 +20,15 @@ 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.R
import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.core.utils.LiveEvent
import im.vector.app.databinding.FragmentKeysBackupRestoreSuccessBinding
-import javax.inject.Inject
-class KeysBackupRestoreSuccessFragment @Inject constructor() : VectorBaseFragment() {
+@AndroidEntryPoint
+class KeysBackupRestoreSuccessFragment :
+ VectorBaseFragment() {
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentKeysBackupRestoreSuccessBinding {
return FragmentKeysBackupRestoreSuccessBinding.inflate(inflater, container, false)
diff --git a/vector/src/main/java/im/vector/app/features/crypto/keysbackup/settings/KeysBackupSettingsFragment.kt b/vector/src/main/java/im/vector/app/features/crypto/keysbackup/settings/KeysBackupSettingsFragment.kt
index edc44fa796..c0001501d5 100644
--- a/vector/src/main/java/im/vector/app/features/crypto/keysbackup/settings/KeysBackupSettingsFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/crypto/keysbackup/settings/KeysBackupSettingsFragment.kt
@@ -22,6 +22,7 @@ import android.view.ViewGroup
import com.airbnb.mvrx.activityViewModel
import com.airbnb.mvrx.withState
import com.google.android.material.dialog.MaterialAlertDialogBuilder
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith
@@ -30,10 +31,13 @@ import im.vector.app.databinding.FragmentKeysBackupSettingsBinding
import im.vector.app.features.crypto.keysbackup.restore.KeysBackupRestoreActivity
import javax.inject.Inject
-class KeysBackupSettingsFragment @Inject constructor(private val keysBackupSettingsRecyclerViewController: KeysBackupSettingsRecyclerViewController) :
+@AndroidEntryPoint
+class KeysBackupSettingsFragment :
VectorBaseFragment(),
KeysBackupSettingsRecyclerViewController.Listener {
+ @Inject lateinit var keysBackupSettingsRecyclerViewController: KeysBackupSettingsRecyclerViewController
+
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentKeysBackupSettingsBinding {
return FragmentKeysBackupSettingsBinding.inflate(inflater, container, false)
}
diff --git a/vector/src/main/java/im/vector/app/features/crypto/keysbackup/setup/KeysBackupSetupStep1Fragment.kt b/vector/src/main/java/im/vector/app/features/crypto/keysbackup/setup/KeysBackupSetupStep1Fragment.kt
index 7d8feba942..9b8386c741 100644
--- a/vector/src/main/java/im/vector/app/features/crypto/keysbackup/setup/KeysBackupSetupStep1Fragment.kt
+++ b/vector/src/main/java/im/vector/app/features/crypto/keysbackup/setup/KeysBackupSetupStep1Fragment.kt
@@ -20,12 +20,14 @@ 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.platform.VectorBaseFragment
import im.vector.app.core.utils.LiveEvent
import im.vector.app.databinding.FragmentKeysBackupSetupStep1Binding
-import javax.inject.Inject
-class KeysBackupSetupStep1Fragment @Inject constructor() : VectorBaseFragment() {
+@AndroidEntryPoint
+class KeysBackupSetupStep1Fragment :
+ VectorBaseFragment() {
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentKeysBackupSetupStep1Binding {
return FragmentKeysBackupSetupStep1Binding.inflate(inflater, container, false)
diff --git a/vector/src/main/java/im/vector/app/features/crypto/keysbackup/setup/KeysBackupSetupStep2Fragment.kt b/vector/src/main/java/im/vector/app/features/crypto/keysbackup/setup/KeysBackupSetupStep2Fragment.kt
index 706076dae0..cf92afcc2e 100644
--- a/vector/src/main/java/im/vector/app/features/crypto/keysbackup/setup/KeysBackupSetupStep2Fragment.kt
+++ b/vector/src/main/java/im/vector/app/features/crypto/keysbackup/setup/KeysBackupSetupStep2Fragment.kt
@@ -24,6 +24,7 @@ import androidx.core.widget.doOnTextChanged
import androidx.lifecycle.viewModelScope
import androidx.transition.TransitionManager
import com.nulabinc.zxcvbn.Zxcvbn
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.hidePassword
import im.vector.app.core.platform.VectorBaseFragment
@@ -31,9 +32,10 @@ import im.vector.app.databinding.FragmentKeysBackupSetupStep2Binding
import im.vector.app.features.settings.VectorLocale
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
-import javax.inject.Inject
-class KeysBackupSetupStep2Fragment @Inject constructor() : VectorBaseFragment() {
+@AndroidEntryPoint
+class KeysBackupSetupStep2Fragment :
+ VectorBaseFragment() {
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentKeysBackupSetupStep2Binding {
return FragmentKeysBackupSetupStep2Binding.inflate(inflater, container, false)
diff --git a/vector/src/main/java/im/vector/app/features/crypto/keysbackup/setup/KeysBackupSetupStep3Fragment.kt b/vector/src/main/java/im/vector/app/features/crypto/keysbackup/setup/KeysBackupSetupStep3Fragment.kt
index 41ff8af04b..7e0fb7e417 100644
--- a/vector/src/main/java/im/vector/app/features/crypto/keysbackup/setup/KeysBackupSetupStep3Fragment.kt
+++ b/vector/src/main/java/im/vector/app/features/crypto/keysbackup/setup/KeysBackupSetupStep3Fragment.kt
@@ -28,6 +28,7 @@ import androidx.lifecycle.lifecycleScope
import arrow.core.Try
import com.google.android.material.bottomsheet.BottomSheetDialog
import com.google.android.material.dialog.MaterialAlertDialogBuilder
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.registerStartForActivityResult
import im.vector.app.core.extensions.safeOpenOutputStream
@@ -44,9 +45,10 @@ import java.io.IOException
import java.text.SimpleDateFormat
import java.util.Date
import java.util.Locale
-import javax.inject.Inject
-class KeysBackupSetupStep3Fragment @Inject constructor() : VectorBaseFragment() {
+@AndroidEntryPoint
+class KeysBackupSetupStep3Fragment :
+ VectorBaseFragment() {
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentKeysBackupSetupStep3Binding {
return FragmentKeysBackupSetupStep3Binding.inflate(inflater, container, false)
diff --git a/vector/src/main/java/im/vector/app/features/crypto/quads/SharedSecuredStorageKeyFragment.kt b/vector/src/main/java/im/vector/app/features/crypto/quads/SharedSecuredStorageKeyFragment.kt
index 5a7aba65a5..efb24ebea7 100644
--- a/vector/src/main/java/im/vector/app/features/crypto/quads/SharedSecuredStorageKeyFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/crypto/quads/SharedSecuredStorageKeyFragment.kt
@@ -24,6 +24,7 @@ import android.view.ViewGroup
import android.view.inputmethod.EditorInfo
import androidx.lifecycle.lifecycleScope
import com.airbnb.mvrx.activityViewModel
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.registerStartForActivityResult
import im.vector.app.core.platform.VectorBaseFragment
@@ -35,9 +36,10 @@ import kotlinx.coroutines.flow.onEach
import org.matrix.android.sdk.api.extensions.tryOrNull
import reactivecircus.flowbinding.android.widget.editorActionEvents
import reactivecircus.flowbinding.android.widget.textChanges
-import javax.inject.Inject
-class SharedSecuredStorageKeyFragment @Inject constructor() : VectorBaseFragment() {
+@AndroidEntryPoint
+class SharedSecuredStorageKeyFragment :
+ VectorBaseFragment() {
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentSsssAccessFromKeyBinding {
return FragmentSsssAccessFromKeyBinding.inflate(inflater, container, false)
diff --git a/vector/src/main/java/im/vector/app/features/crypto/quads/SharedSecuredStoragePassphraseFragment.kt b/vector/src/main/java/im/vector/app/features/crypto/quads/SharedSecuredStoragePassphraseFragment.kt
index 5af5480573..877e4aa164 100644
--- a/vector/src/main/java/im/vector/app/features/crypto/quads/SharedSecuredStoragePassphraseFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/crypto/quads/SharedSecuredStoragePassphraseFragment.kt
@@ -24,20 +24,19 @@ import android.view.inputmethod.EditorInfo
import androidx.core.text.toSpannable
import androidx.lifecycle.lifecycleScope
import com.airbnb.mvrx.activityViewModel
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.platform.VectorBaseFragment
-import im.vector.app.core.resources.ColorProvider
import im.vector.app.databinding.FragmentSsssAccessFromPassphraseBinding
import im.vector.lib.core.utils.flow.throttleFirst
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import reactivecircus.flowbinding.android.widget.editorActionEvents
import reactivecircus.flowbinding.android.widget.textChanges
-import javax.inject.Inject
-class SharedSecuredStoragePassphraseFragment @Inject constructor(
- private val colorProvider: ColorProvider
-) : VectorBaseFragment() {
+@AndroidEntryPoint
+class SharedSecuredStoragePassphraseFragment :
+ VectorBaseFragment() {
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentSsssAccessFromPassphraseBinding {
return FragmentSsssAccessFromPassphraseBinding.inflate(inflater, container, false)
diff --git a/vector/src/main/java/im/vector/app/features/crypto/quads/SharedSecuredStorageResetAllFragment.kt b/vector/src/main/java/im/vector/app/features/crypto/quads/SharedSecuredStorageResetAllFragment.kt
index c0d0aa8e76..66344107a4 100644
--- a/vector/src/main/java/im/vector/app/features/crypto/quads/SharedSecuredStorageResetAllFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/crypto/quads/SharedSecuredStorageResetAllFragment.kt
@@ -22,14 +22,15 @@ import android.view.View
import android.view.ViewGroup
import com.airbnb.mvrx.activityViewModel
import com.airbnb.mvrx.withState
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.setTextOrHide
import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.databinding.FragmentSsssResetAllBinding
import im.vector.app.features.roommemberprofile.devices.DeviceListBottomSheet
-import javax.inject.Inject
-class SharedSecuredStorageResetAllFragment @Inject constructor() :
+@AndroidEntryPoint
+class SharedSecuredStorageResetAllFragment :
VectorBaseFragment() {
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentSsssResetAllBinding {
diff --git a/vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapConclusionFragment.kt b/vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapConclusionFragment.kt
index 555f2d7c1c..22ecd3dafd 100644
--- a/vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapConclusionFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapConclusionFragment.kt
@@ -23,6 +23,7 @@ import android.view.ViewGroup
import androidx.core.text.toSpannable
import com.airbnb.mvrx.parentFragmentViewModel
import com.airbnb.mvrx.withState
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.core.resources.ColorProvider
@@ -30,9 +31,11 @@ import im.vector.app.core.utils.colorizeMatchingText
import im.vector.app.databinding.FragmentBootstrapConclusionBinding
import javax.inject.Inject
-class BootstrapConclusionFragment @Inject constructor(
- private val colorProvider: ColorProvider
-) : VectorBaseFragment() {
+@AndroidEntryPoint
+class BootstrapConclusionFragment :
+ VectorBaseFragment() {
+
+ @Inject lateinit var colorProvider: ColorProvider
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentBootstrapConclusionBinding {
return FragmentBootstrapConclusionBinding.inflate(inflater, container, false)
diff --git a/vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapConfirmPassphraseFragment.kt b/vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapConfirmPassphraseFragment.kt
index 3c8137d087..285721ee75 100644
--- a/vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapConfirmPassphraseFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapConfirmPassphraseFragment.kt
@@ -25,6 +25,7 @@ import androidx.core.view.isGone
import androidx.lifecycle.lifecycleScope
import com.airbnb.mvrx.parentFragmentViewModel
import com.airbnb.mvrx.withState
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.hideKeyboard
import im.vector.app.core.platform.VectorBaseFragment
@@ -34,9 +35,9 @@ import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import reactivecircus.flowbinding.android.widget.editorActionEvents
import reactivecircus.flowbinding.android.widget.textChanges
-import javax.inject.Inject
-class BootstrapConfirmPassphraseFragment @Inject constructor() :
+@AndroidEntryPoint
+class BootstrapConfirmPassphraseFragment :
VectorBaseFragment() {
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentBootstrapEnterPassphraseBinding {
diff --git a/vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapEnterPassphraseFragment.kt b/vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapEnterPassphraseFragment.kt
index ff6d109b3c..43cc25f195 100644
--- a/vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapEnterPassphraseFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapEnterPassphraseFragment.kt
@@ -24,6 +24,7 @@ import android.view.inputmethod.EditorInfo
import androidx.lifecycle.lifecycleScope
import com.airbnb.mvrx.parentFragmentViewModel
import com.airbnb.mvrx.withState
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.databinding.FragmentBootstrapEnterPassphraseBinding
@@ -33,9 +34,9 @@ import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import reactivecircus.flowbinding.android.widget.editorActionEvents
import reactivecircus.flowbinding.android.widget.textChanges
-import javax.inject.Inject
-class BootstrapEnterPassphraseFragment @Inject constructor() :
+@AndroidEntryPoint
+class BootstrapEnterPassphraseFragment :
VectorBaseFragment() {
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentBootstrapEnterPassphraseBinding {
diff --git a/vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapMigrateBackupFragment.kt b/vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapMigrateBackupFragment.kt
index 2c0ccec9fb..2802c872ee 100644
--- a/vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapMigrateBackupFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapMigrateBackupFragment.kt
@@ -30,6 +30,7 @@ import androidx.core.view.isVisible
import androidx.lifecycle.lifecycleScope
import com.airbnb.mvrx.parentFragmentViewModel
import com.airbnb.mvrx.withState
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.hideKeyboard
import im.vector.app.core.extensions.registerStartForActivityResult
@@ -47,9 +48,11 @@ import reactivecircus.flowbinding.android.widget.editorActionEvents
import reactivecircus.flowbinding.android.widget.textChanges
import javax.inject.Inject
-class BootstrapMigrateBackupFragment @Inject constructor(
- private val colorProvider: ColorProvider
-) : VectorBaseFragment() {
+@AndroidEntryPoint
+class BootstrapMigrateBackupFragment :
+ VectorBaseFragment() {
+
+ @Inject lateinit var colorProvider: ColorProvider
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentBootstrapMigrateBackupBinding {
return FragmentBootstrapMigrateBackupBinding.inflate(inflater, container, false)
diff --git a/vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapReAuthFragment.kt b/vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapReAuthFragment.kt
index c46ccbf08e..d5e60631a5 100644
--- a/vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapReAuthFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapReAuthFragment.kt
@@ -23,15 +23,14 @@ import android.view.ViewGroup
import androidx.core.view.isVisible
import com.airbnb.mvrx.parentFragmentViewModel
import com.airbnb.mvrx.withState
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.core.extensions.setTextOrHide
import im.vector.app.core.platform.VectorBaseFragment
-import im.vector.app.core.resources.ColorProvider
import im.vector.app.databinding.FragmentBootstrapReauthBinding
-import javax.inject.Inject
-class BootstrapReAuthFragment @Inject constructor(
- private val colorProvider: ColorProvider
-) : VectorBaseFragment() {
+@AndroidEntryPoint
+class BootstrapReAuthFragment :
+ VectorBaseFragment() {
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentBootstrapReauthBinding {
return FragmentBootstrapReauthBinding.inflate(inflater, container, false)
diff --git a/vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapSaveRecoveryKeyFragment.kt b/vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapSaveRecoveryKeyFragment.kt
index db24807c1b..21d68dfe99 100644
--- a/vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapSaveRecoveryKeyFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapSaveRecoveryKeyFragment.kt
@@ -27,21 +27,20 @@ import androidx.core.view.isVisible
import androidx.lifecycle.lifecycleScope
import com.airbnb.mvrx.parentFragmentViewModel
import com.airbnb.mvrx.withState
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.registerStartForActivityResult
import im.vector.app.core.extensions.safeOpenOutputStream
import im.vector.app.core.platform.VectorBaseFragment
-import im.vector.app.core.resources.ColorProvider
import im.vector.app.core.utils.startSharePlainTextIntent
import im.vector.app.core.utils.toast
import im.vector.app.databinding.FragmentBootstrapSaveKeyBinding
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
-import javax.inject.Inject
-class BootstrapSaveRecoveryKeyFragment @Inject constructor(
- private val colorProvider: ColorProvider
-) : VectorBaseFragment() {
+@AndroidEntryPoint
+class BootstrapSaveRecoveryKeyFragment :
+ VectorBaseFragment() {
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentBootstrapSaveKeyBinding {
return FragmentBootstrapSaveKeyBinding.inflate(inflater, container, false)
diff --git a/vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapSetupRecoveryKeyFragment.kt b/vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapSetupRecoveryKeyFragment.kt
index 3d078a82ed..b03cbe87a8 100644
--- a/vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapSetupRecoveryKeyFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapSetupRecoveryKeyFragment.kt
@@ -23,13 +23,14 @@ import android.view.ViewGroup
import androidx.core.view.isVisible
import com.airbnb.mvrx.parentFragmentViewModel
import com.airbnb.mvrx.withState
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.databinding.FragmentBootstrapSetupRecoveryBinding
import im.vector.app.features.raw.wellknown.SecureBackupMethod
-import javax.inject.Inject
-class BootstrapSetupRecoveryKeyFragment @Inject constructor() :
+@AndroidEntryPoint
+class BootstrapSetupRecoveryKeyFragment :
VectorBaseFragment() {
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentBootstrapSetupRecoveryBinding {
diff --git a/vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapWaitingFragment.kt b/vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapWaitingFragment.kt
index e0965e69f9..310bb5ac37 100644
--- a/vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapWaitingFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapWaitingFragment.kt
@@ -21,11 +21,12 @@ import android.view.ViewGroup
import androidx.core.view.isVisible
import com.airbnb.mvrx.parentFragmentViewModel
import com.airbnb.mvrx.withState
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.databinding.FragmentBootstrapWaitingBinding
-import javax.inject.Inject
-class BootstrapWaitingFragment @Inject constructor() :
+@AndroidEntryPoint
+class BootstrapWaitingFragment :
VectorBaseFragment() {
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentBootstrapWaitingBinding {
diff --git a/vector/src/main/java/im/vector/app/features/crypto/verification/QuadSLoadingFragment.kt b/vector/src/main/java/im/vector/app/features/crypto/verification/QuadSLoadingFragment.kt
index 366348120b..5b6902df98 100644
--- a/vector/src/main/java/im/vector/app/features/crypto/verification/QuadSLoadingFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/crypto/verification/QuadSLoadingFragment.kt
@@ -18,11 +18,13 @@ package im.vector.app.features.crypto.verification
import android.view.LayoutInflater
import android.view.ViewGroup
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.databinding.FragmentProgressBinding
-import javax.inject.Inject
-class QuadSLoadingFragment @Inject constructor() : VectorBaseFragment() {
+@AndroidEntryPoint
+class QuadSLoadingFragment :
+ VectorBaseFragment() {
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentProgressBinding {
return FragmentProgressBinding.inflate(inflater, container, false)
}
diff --git a/vector/src/main/java/im/vector/app/features/crypto/verification/cancel/VerificationCancelFragment.kt b/vector/src/main/java/im/vector/app/features/crypto/verification/cancel/VerificationCancelFragment.kt
index 62bab05e42..c972f7834d 100644
--- a/vector/src/main/java/im/vector/app/features/crypto/verification/cancel/VerificationCancelFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/crypto/verification/cancel/VerificationCancelFragment.kt
@@ -22,6 +22,7 @@ import android.view.View
import android.view.ViewGroup
import com.airbnb.mvrx.parentFragmentViewModel
import com.airbnb.mvrx.withState
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith
import im.vector.app.core.platform.VectorBaseFragment
@@ -29,11 +30,13 @@ import im.vector.app.databinding.BottomSheetVerificationChildFragmentBinding
import im.vector.app.features.crypto.verification.VerificationBottomSheetViewModel
import javax.inject.Inject
-class VerificationCancelFragment @Inject constructor(
- val controller: VerificationCancelController
-) : VectorBaseFragment(),
+@AndroidEntryPoint
+class VerificationCancelFragment :
+ VectorBaseFragment(),
VerificationCancelController.Listener {
+ @Inject lateinit var controller: VerificationCancelController
+
private val viewModel by parentFragmentViewModel(VerificationBottomSheetViewModel::class)
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): BottomSheetVerificationChildFragmentBinding {
diff --git a/vector/src/main/java/im/vector/app/features/crypto/verification/cancel/VerificationNotMeFragment.kt b/vector/src/main/java/im/vector/app/features/crypto/verification/cancel/VerificationNotMeFragment.kt
index 635a56a6c1..05632bdfc3 100644
--- a/vector/src/main/java/im/vector/app/features/crypto/verification/cancel/VerificationNotMeFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/crypto/verification/cancel/VerificationNotMeFragment.kt
@@ -22,6 +22,7 @@ import android.view.View
import android.view.ViewGroup
import com.airbnb.mvrx.parentFragmentViewModel
import com.airbnb.mvrx.withState
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith
import im.vector.app.core.platform.VectorBaseFragment
@@ -29,11 +30,13 @@ import im.vector.app.databinding.BottomSheetVerificationChildFragmentBinding
import im.vector.app.features.crypto.verification.VerificationBottomSheetViewModel
import javax.inject.Inject
-class VerificationNotMeFragment @Inject constructor(
- val controller: VerificationNotMeController
-) : VectorBaseFragment(),
+@AndroidEntryPoint
+class VerificationNotMeFragment :
+ VectorBaseFragment(),
VerificationNotMeController.Listener {
+ @Inject lateinit var controller: VerificationNotMeController
+
private val viewModel by parentFragmentViewModel(VerificationBottomSheetViewModel::class)
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): BottomSheetVerificationChildFragmentBinding {
diff --git a/vector/src/main/java/im/vector/app/features/crypto/verification/choose/VerificationChooseMethodFragment.kt b/vector/src/main/java/im/vector/app/features/crypto/verification/choose/VerificationChooseMethodFragment.kt
index 3d3766f430..45f7908446 100644
--- a/vector/src/main/java/im/vector/app/features/crypto/verification/choose/VerificationChooseMethodFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/crypto/verification/choose/VerificationChooseMethodFragment.kt
@@ -23,6 +23,7 @@ import android.view.ViewGroup
import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.parentFragmentViewModel
import com.airbnb.mvrx.withState
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith
@@ -39,11 +40,12 @@ import im.vector.app.features.qrcode.QrCodeScannerActivity
import timber.log.Timber
import javax.inject.Inject
-class VerificationChooseMethodFragment @Inject constructor(
- val controller: VerificationChooseMethodController
-) : VectorBaseFragment(),
+@AndroidEntryPoint
+class VerificationChooseMethodFragment :
+ VectorBaseFragment(),
VerificationChooseMethodController.Listener {
+ @Inject lateinit var controller: VerificationChooseMethodController
private val viewModel by fragmentViewModel(VerificationChooseMethodViewModel::class)
private val sharedViewModel by parentFragmentViewModel(VerificationBottomSheetViewModel::class)
diff --git a/vector/src/main/java/im/vector/app/features/crypto/verification/conclusion/VerificationConclusionFragment.kt b/vector/src/main/java/im/vector/app/features/crypto/verification/conclusion/VerificationConclusionFragment.kt
index 85b90e6004..dd559e8a1b 100644
--- a/vector/src/main/java/im/vector/app/features/crypto/verification/conclusion/VerificationConclusionFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/crypto/verification/conclusion/VerificationConclusionFragment.kt
@@ -23,6 +23,7 @@ import android.view.ViewGroup
import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.parentFragmentViewModel
import com.airbnb.mvrx.withState
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith
import im.vector.app.core.platform.VectorBaseFragment
@@ -32,11 +33,13 @@ import im.vector.app.features.crypto.verification.VerificationBottomSheetViewMod
import kotlinx.parcelize.Parcelize
import javax.inject.Inject
-class VerificationConclusionFragment @Inject constructor(
- val controller: VerificationConclusionController
-) : VectorBaseFragment(),
+@AndroidEntryPoint
+class VerificationConclusionFragment :
+ VectorBaseFragment(),
VerificationConclusionController.Listener {
+ @Inject lateinit var controller: VerificationConclusionController
+
@Parcelize
data class Args(
val isSuccessFull: Boolean,
diff --git a/vector/src/main/java/im/vector/app/features/crypto/verification/emoji/VerificationEmojiCodeFragment.kt b/vector/src/main/java/im/vector/app/features/crypto/verification/emoji/VerificationEmojiCodeFragment.kt
index 3f4eaf8ac9..1e1a8d0710 100644
--- a/vector/src/main/java/im/vector/app/features/crypto/verification/emoji/VerificationEmojiCodeFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/crypto/verification/emoji/VerificationEmojiCodeFragment.kt
@@ -22,6 +22,7 @@ import android.view.ViewGroup
import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.parentFragmentViewModel
import com.airbnb.mvrx.withState
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith
import im.vector.app.core.platform.VectorBaseFragment
@@ -30,11 +31,13 @@ import im.vector.app.features.crypto.verification.VerificationAction
import im.vector.app.features.crypto.verification.VerificationBottomSheetViewModel
import javax.inject.Inject
-class VerificationEmojiCodeFragment @Inject constructor(
- val controller: VerificationEmojiCodeController
-) : VectorBaseFragment(),
+@AndroidEntryPoint
+class VerificationEmojiCodeFragment :
+ VectorBaseFragment(),
VerificationEmojiCodeController.Listener {
+ @Inject lateinit var controller: VerificationEmojiCodeController
+
private val viewModel by fragmentViewModel(VerificationEmojiCodeViewModel::class)
private val sharedViewModel by parentFragmentViewModel(VerificationBottomSheetViewModel::class)
diff --git a/vector/src/main/java/im/vector/app/features/crypto/verification/qrconfirmation/VerificationQRWaitingFragment.kt b/vector/src/main/java/im/vector/app/features/crypto/verification/qrconfirmation/VerificationQRWaitingFragment.kt
index 441885dd10..e5402424d0 100644
--- a/vector/src/main/java/im/vector/app/features/crypto/verification/qrconfirmation/VerificationQRWaitingFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/crypto/verification/qrconfirmation/VerificationQRWaitingFragment.kt
@@ -22,6 +22,7 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.airbnb.mvrx.Mavericks
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith
import im.vector.app.core.platform.VectorBaseFragment
@@ -29,9 +30,11 @@ import im.vector.app.databinding.BottomSheetVerificationChildFragmentBinding
import kotlinx.parcelize.Parcelize
import javax.inject.Inject
-class VerificationQRWaitingFragment @Inject constructor(
- val controller: VerificationQRWaitingController
-) : VectorBaseFragment() {
+@AndroidEntryPoint
+class VerificationQRWaitingFragment :
+ VectorBaseFragment() {
+
+ @Inject lateinit var controller: VerificationQRWaitingController
@Parcelize
data class Args(
diff --git a/vector/src/main/java/im/vector/app/features/crypto/verification/qrconfirmation/VerificationQrScannedByOtherFragment.kt b/vector/src/main/java/im/vector/app/features/crypto/verification/qrconfirmation/VerificationQrScannedByOtherFragment.kt
index 9e77506e3b..0fdbd03174 100644
--- a/vector/src/main/java/im/vector/app/features/crypto/verification/qrconfirmation/VerificationQrScannedByOtherFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/crypto/verification/qrconfirmation/VerificationQrScannedByOtherFragment.kt
@@ -21,6 +21,7 @@ import android.view.View
import android.view.ViewGroup
import com.airbnb.mvrx.parentFragmentViewModel
import com.airbnb.mvrx.withState
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith
import im.vector.app.core.platform.VectorBaseFragment
@@ -29,11 +30,13 @@ import im.vector.app.features.crypto.verification.VerificationAction
import im.vector.app.features.crypto.verification.VerificationBottomSheetViewModel
import javax.inject.Inject
-class VerificationQrScannedByOtherFragment @Inject constructor(
- val controller: VerificationQrScannedByOtherController
-) : VectorBaseFragment(),
+@AndroidEntryPoint
+class VerificationQrScannedByOtherFragment :
+ VectorBaseFragment(),
VerificationQrScannedByOtherController.Listener {
+ @Inject lateinit var controller: VerificationQrScannedByOtherController
+
private val sharedViewModel by parentFragmentViewModel(VerificationBottomSheetViewModel::class)
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): BottomSheetVerificationChildFragmentBinding {
diff --git a/vector/src/main/java/im/vector/app/features/crypto/verification/request/VerificationRequestFragment.kt b/vector/src/main/java/im/vector/app/features/crypto/verification/request/VerificationRequestFragment.kt
index 238249683f..6887451a76 100644
--- a/vector/src/main/java/im/vector/app/features/crypto/verification/request/VerificationRequestFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/crypto/verification/request/VerificationRequestFragment.kt
@@ -21,6 +21,7 @@ import android.view.View
import android.view.ViewGroup
import com.airbnb.mvrx.parentFragmentViewModel
import com.airbnb.mvrx.withState
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith
import im.vector.app.core.platform.VectorBaseFragment
@@ -29,11 +30,13 @@ import im.vector.app.features.crypto.verification.VerificationAction
import im.vector.app.features.crypto.verification.VerificationBottomSheetViewModel
import javax.inject.Inject
-class VerificationRequestFragment @Inject constructor(
- val controller: VerificationRequestController
-) : VectorBaseFragment(),
+@AndroidEntryPoint
+class VerificationRequestFragment :
+ VectorBaseFragment(),
VerificationRequestController.Listener {
+ @Inject lateinit var controller: VerificationRequestController
+
private val viewModel by parentFragmentViewModel(VerificationBottomSheetViewModel::class)
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): BottomSheetVerificationChildFragmentBinding {
diff --git a/vector/src/main/java/im/vector/app/features/devtools/RoomDevToolActivity.kt b/vector/src/main/java/im/vector/app/features/devtools/RoomDevToolActivity.kt
index 774460eb1f..011deb612f 100644
--- a/vector/src/main/java/im/vector/app/features/devtools/RoomDevToolActivity.kt
+++ b/vector/src/main/java/im/vector/app/features/devtools/RoomDevToolActivity.kt
@@ -109,15 +109,15 @@ class RoomDevToolActivity :
}
RoomDevToolViewState.Mode.StateEventList,
RoomDevToolViewState.Mode.StateEventListByType -> {
- val frag = createFragment(RoomDevToolStateEventListFragment::class.java)
+ val frag = RoomDevToolStateEventListFragment()
navigateTo(frag)
}
RoomDevToolViewState.Mode.EditEventContent -> {
- val frag = createFragment(RoomDevToolEditFragment::class.java)
+ val frag = RoomDevToolEditFragment()
navigateTo(frag)
}
is RoomDevToolViewState.Mode.SendEventForm -> {
- val frag = createFragment(RoomDevToolSendFormFragment::class.java)
+ val frag = RoomDevToolSendFormFragment()
navigateTo(frag)
}
}
diff --git a/vector/src/main/java/im/vector/app/features/devtools/RoomDevToolEditFragment.kt b/vector/src/main/java/im/vector/app/features/devtools/RoomDevToolEditFragment.kt
index 1b6fbb7359..3bbb43013d 100644
--- a/vector/src/main/java/im/vector/app/features/devtools/RoomDevToolEditFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/devtools/RoomDevToolEditFragment.kt
@@ -23,15 +23,16 @@ import android.view.ViewGroup
import androidx.lifecycle.lifecycleScope
import com.airbnb.mvrx.activityViewModel
import com.airbnb.mvrx.withState
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.core.extensions.hideKeyboard
import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.databinding.FragmentDevtoolsEditorBinding
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import reactivecircus.flowbinding.android.widget.textChanges
-import javax.inject.Inject
-class RoomDevToolEditFragment @Inject constructor() :
+@AndroidEntryPoint
+class RoomDevToolEditFragment :
VectorBaseFragment() {
private val sharedViewModel: RoomDevToolViewModel by activityViewModel()
diff --git a/vector/src/main/java/im/vector/app/features/devtools/RoomDevToolFragment.kt b/vector/src/main/java/im/vector/app/features/devtools/RoomDevToolFragment.kt
index 0e1a2418b8..0ebbf7d8bf 100644
--- a/vector/src/main/java/im/vector/app/features/devtools/RoomDevToolFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/devtools/RoomDevToolFragment.kt
@@ -21,6 +21,7 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.airbnb.mvrx.activityViewModel
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith
@@ -28,11 +29,13 @@ import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.databinding.FragmentGenericRecyclerBinding
import javax.inject.Inject
-class RoomDevToolFragment @Inject constructor(
- private val epoxyController: RoomDevToolRootController
-) : VectorBaseFragment(),
+@AndroidEntryPoint
+class RoomDevToolFragment :
+ VectorBaseFragment(),
DevToolsInteractionListener {
+ @Inject lateinit var epoxyController: RoomDevToolRootController
+
private val sharedViewModel: RoomDevToolViewModel by activityViewModel()
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentGenericRecyclerBinding {
diff --git a/vector/src/main/java/im/vector/app/features/devtools/RoomDevToolSendFormFragment.kt b/vector/src/main/java/im/vector/app/features/devtools/RoomDevToolSendFormFragment.kt
index 6b7dea7d53..3ec49e25f6 100644
--- a/vector/src/main/java/im/vector/app/features/devtools/RoomDevToolSendFormFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/devtools/RoomDevToolSendFormFragment.kt
@@ -22,15 +22,19 @@ import android.view.View
import android.view.ViewGroup
import com.airbnb.mvrx.activityViewModel
import com.airbnb.mvrx.withState
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith
import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.databinding.FragmentGenericRecyclerBinding
import javax.inject.Inject
-class RoomDevToolSendFormFragment @Inject constructor(
- private val epoxyController: RoomDevToolSendFormController
-) : VectorBaseFragment(), DevToolsInteractionListener {
+@AndroidEntryPoint
+class RoomDevToolSendFormFragment :
+ VectorBaseFragment(),
+ DevToolsInteractionListener {
+
+ @Inject lateinit var epoxyController: RoomDevToolSendFormController
val sharedViewModel: RoomDevToolViewModel by activityViewModel()
diff --git a/vector/src/main/java/im/vector/app/features/devtools/RoomDevToolStateEventListFragment.kt b/vector/src/main/java/im/vector/app/features/devtools/RoomDevToolStateEventListFragment.kt
index 728fb62d66..dfc74e7e74 100644
--- a/vector/src/main/java/im/vector/app/features/devtools/RoomDevToolStateEventListFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/devtools/RoomDevToolStateEventListFragment.kt
@@ -22,6 +22,7 @@ import android.view.View
import android.view.ViewGroup
import com.airbnb.mvrx.activityViewModel
import com.airbnb.mvrx.withState
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith
@@ -29,9 +30,12 @@ import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.databinding.FragmentGenericRecyclerBinding
import javax.inject.Inject
-class RoomDevToolStateEventListFragment @Inject constructor(
- private val epoxyController: RoomStateListController
-) : VectorBaseFragment(), DevToolsInteractionListener {
+@AndroidEntryPoint
+class RoomDevToolStateEventListFragment :
+ VectorBaseFragment(),
+ DevToolsInteractionListener {
+
+ @Inject lateinit var epoxyController: RoomStateListController
val sharedViewModel: RoomDevToolViewModel by activityViewModel()
diff --git a/vector/src/main/java/im/vector/app/features/discovery/DiscoverySettingsFragment.kt b/vector/src/main/java/im/vector/app/features/discovery/DiscoverySettingsFragment.kt
index 285d0f728f..8c801bdf89 100644
--- a/vector/src/main/java/im/vector/app/features/discovery/DiscoverySettingsFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/discovery/DiscoverySettingsFragment.kt
@@ -25,6 +25,7 @@ import com.airbnb.mvrx.args
import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState
import com.google.android.material.dialog.MaterialAlertDialogBuilder
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith
@@ -43,11 +44,13 @@ import org.matrix.android.sdk.api.session.identity.ThreePid
import org.matrix.android.sdk.api.session.terms.TermsService
import javax.inject.Inject
-class DiscoverySettingsFragment @Inject constructor(
- private val controller: DiscoverySettingsController
-) : VectorBaseFragment(),
+@AndroidEntryPoint
+class DiscoverySettingsFragment :
+ VectorBaseFragment(),
DiscoverySettingsController.Listener {
+ @Inject lateinit var controller: DiscoverySettingsController
+
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentGenericRecyclerBinding {
return FragmentGenericRecyclerBinding.inflate(inflater, container, false)
}
diff --git a/vector/src/main/java/im/vector/app/features/discovery/change/SetIdentityServerFragment.kt b/vector/src/main/java/im/vector/app/features/discovery/change/SetIdentityServerFragment.kt
index ee36345418..f8499219aa 100644
--- a/vector/src/main/java/im/vector/app/features/discovery/change/SetIdentityServerFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/discovery/change/SetIdentityServerFragment.kt
@@ -28,6 +28,7 @@ import androidx.lifecycle.lifecycleScope
import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState
import com.google.android.material.dialog.MaterialAlertDialogBuilder
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.registerStartForActivityResult
import im.vector.app.core.extensions.toReducedUrl
@@ -42,9 +43,11 @@ import org.matrix.android.sdk.api.session.terms.TermsService
import reactivecircus.flowbinding.android.widget.textChanges
import javax.inject.Inject
-class SetIdentityServerFragment @Inject constructor(
- val colorProvider: ColorProvider
-) : VectorBaseFragment() {
+@AndroidEntryPoint
+class SetIdentityServerFragment :
+ VectorBaseFragment() {
+
+ @Inject lateinit var colorProvider: ColorProvider
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentSetIdentityServerBinding {
return FragmentSetIdentityServerBinding.inflate(inflater, container, false)
diff --git a/vector/src/main/java/im/vector/app/features/home/HomeDetailFragment.kt b/vector/src/main/java/im/vector/app/features/home/HomeDetailFragment.kt
index e4a572e2a0..990cca489c 100644
--- a/vector/src/main/java/im/vector/app/features/home/HomeDetailFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/home/HomeDetailFragment.kt
@@ -28,6 +28,7 @@ import com.airbnb.mvrx.activityViewModel
import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState
import com.google.android.material.badge.BadgeDrawable
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.SpaceStateHandler
import im.vector.app.core.extensions.commitTransaction
@@ -60,19 +61,21 @@ import org.matrix.android.sdk.api.session.crypto.model.DeviceInfo
import org.matrix.android.sdk.api.session.room.model.RoomSummary
import javax.inject.Inject
-class HomeDetailFragment @Inject constructor(
- private val avatarRenderer: AvatarRenderer,
- private val colorProvider: ColorProvider,
- private val alertManager: PopupAlertManager,
- private val callManager: WebRtcCallManager,
- private val vectorPreferences: VectorPreferences,
- private val spaceStateHandler: SpaceStateHandler,
-) : VectorBaseFragment(),
+@AndroidEntryPoint
+class HomeDetailFragment :
+ VectorBaseFragment(),
KeysBackupBanner.Delegate,
CurrentCallsView.Callback,
OnBackPressed,
VectorMenuProvider {
+ @Inject lateinit var avatarRenderer: AvatarRenderer
+ @Inject lateinit var colorProvider: ColorProvider
+ @Inject lateinit var alertManager: PopupAlertManager
+ @Inject lateinit var callManager: WebRtcCallManager
+ @Inject lateinit var vectorPreferences: VectorPreferences
+ @Inject lateinit var spaceStateHandler: SpaceStateHandler
+
private val viewModel: HomeDetailViewModel by fragmentViewModel()
private val unknownDeviceDetectorSharedViewModel: UnknownDeviceDetectorSharedViewModel by activityViewModel()
private val unreadMessagesSharedViewModel: UnreadMessagesSharedViewModel by activityViewModel()
diff --git a/vector/src/main/java/im/vector/app/features/home/HomeDrawerFragment.kt b/vector/src/main/java/im/vector/app/features/home/HomeDrawerFragment.kt
index c10027cc3f..106fbc7281 100644
--- a/vector/src/main/java/im/vector/app/features/home/HomeDrawerFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/home/HomeDrawerFragment.kt
@@ -23,6 +23,7 @@ import android.view.ViewGroup
import androidx.core.app.ActivityOptionsCompat
import androidx.core.view.ViewCompat
import androidx.core.view.isVisible
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.observeK
import im.vector.app.core.extensions.replaceChildFragment
@@ -40,12 +41,14 @@ import org.matrix.android.sdk.api.session.Session
import org.matrix.android.sdk.api.util.toMatrixItem
import javax.inject.Inject
-class HomeDrawerFragment @Inject constructor(
- private val session: Session,
- private val vectorPreferences: VectorPreferences,
- private val avatarRenderer: AvatarRenderer,
- private val buildMeta: BuildMeta,
-) : VectorBaseFragment() {
+@AndroidEntryPoint
+class HomeDrawerFragment :
+ VectorBaseFragment() {
+
+ @Inject lateinit var session: Session
+ @Inject lateinit var vectorPreferences: VectorPreferences
+ @Inject lateinit var avatarRenderer: AvatarRenderer
+ @Inject lateinit var buildMeta: BuildMeta
private lateinit var sharedActionViewModel: HomeSharedActionViewModel
diff --git a/vector/src/main/java/im/vector/app/features/home/LoadingFragment.kt b/vector/src/main/java/im/vector/app/features/home/LoadingFragment.kt
index 47cfd1c28f..c5e33abf34 100644
--- a/vector/src/main/java/im/vector/app/features/home/LoadingFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/home/LoadingFragment.kt
@@ -21,11 +21,12 @@ 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.platform.VectorBaseFragment
import im.vector.app.databinding.FragmentLoadingBinding
-import javax.inject.Inject
-class LoadingFragment @Inject constructor() : VectorBaseFragment() {
+@AndroidEntryPoint
+class LoadingFragment : VectorBaseFragment() {
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentLoadingBinding {
return FragmentLoadingBinding.inflate(inflater, container, false)
diff --git a/vector/src/main/java/im/vector/app/features/home/NewHomeDetailFragment.kt b/vector/src/main/java/im/vector/app/features/home/NewHomeDetailFragment.kt
index f94cb7e932..f0738d5744 100644
--- a/vector/src/main/java/im/vector/app/features/home/NewHomeDetailFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/home/NewHomeDetailFragment.kt
@@ -30,6 +30,7 @@ import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState
import com.google.android.material.appbar.AppBarLayout
import com.google.android.material.badge.BadgeDrawable
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.SpaceStateHandler
import im.vector.app.core.extensions.commitTransaction
@@ -63,21 +64,23 @@ import org.matrix.android.sdk.api.session.room.model.RoomSummary
import org.matrix.android.sdk.api.util.toMatrixItem
import javax.inject.Inject
-class NewHomeDetailFragment @Inject constructor(
- private val avatarRenderer: AvatarRenderer,
- private val colorProvider: ColorProvider,
- private val alertManager: PopupAlertManager,
- private val callManager: WebRtcCallManager,
- private val vectorPreferences: VectorPreferences,
- private val spaceStateHandler: SpaceStateHandler,
- private val session: Session,
- private val buildMeta: BuildMeta,
-) : VectorBaseFragment(),
+@AndroidEntryPoint
+class NewHomeDetailFragment :
+ VectorBaseFragment(),
KeysBackupBanner.Delegate,
CurrentCallsView.Callback,
OnBackPressed,
VectorMenuProvider {
+ @Inject lateinit var avatarRenderer: AvatarRenderer
+ @Inject lateinit var colorProvider: ColorProvider
+ @Inject lateinit var alertManager: PopupAlertManager
+ @Inject lateinit var callManager: WebRtcCallManager
+ @Inject lateinit var vectorPreferences: VectorPreferences
+ @Inject lateinit var spaceStateHandler: SpaceStateHandler
+ @Inject lateinit var session: Session
+ @Inject lateinit var buildMeta: BuildMeta
+
private val viewModel: HomeDetailViewModel by fragmentViewModel()
private val unknownDeviceDetectorSharedViewModel: UnknownDeviceDetectorSharedViewModel by activityViewModel()
private val serverBackupStatusViewModel: ServerBackupStatusViewModel by activityViewModel()
diff --git a/vector/src/main/java/im/vector/app/features/home/room/breadcrumbs/BreadcrumbsFragment.kt b/vector/src/main/java/im/vector/app/features/home/room/breadcrumbs/BreadcrumbsFragment.kt
index 4d44ff775a..c5d7d76322 100644
--- a/vector/src/main/java/im/vector/app/features/home/room/breadcrumbs/BreadcrumbsFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/home/room/breadcrumbs/BreadcrumbsFragment.kt
@@ -22,6 +22,7 @@ import android.view.View
import android.view.ViewGroup
import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith
import im.vector.app.core.platform.VectorBaseFragment
@@ -30,11 +31,13 @@ import im.vector.app.features.home.room.detail.RoomDetailSharedAction
import im.vector.app.features.home.room.detail.RoomDetailSharedActionViewModel
import javax.inject.Inject
-class BreadcrumbsFragment @Inject constructor(
- private val breadcrumbsController: BreadcrumbsController
-) : VectorBaseFragment(),
+@AndroidEntryPoint
+class BreadcrumbsFragment :
+ VectorBaseFragment(),
BreadcrumbsController.Listener {
+ @Inject lateinit var breadcrumbsController: BreadcrumbsController
+
private lateinit var sharedActionViewModel: RoomDetailSharedActionViewModel
private val breadcrumbsViewModel: BreadcrumbsViewModel by fragmentViewModel()
diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/TimelineFragment.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/TimelineFragment.kt
index f164183914..b5eb0608d4 100644
--- a/vector/src/main/java/im/vector/app/features/home/room/detail/TimelineFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/home/room/detail/TimelineFragment.kt
@@ -67,10 +67,12 @@ import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.vanniktech.emoji.EmojiPopup
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.animations.play
import im.vector.app.core.dialogs.ConfirmationDialogBuilder
import im.vector.app.core.dialogs.GalleryOrCameraDialogHelper
+import im.vector.app.core.dialogs.GalleryOrCameraDialogHelperFactory
import im.vector.app.core.epoxy.LayoutManagerStateRestorer
import im.vector.app.core.error.fatalError
import im.vector.app.core.extensions.cleanup
@@ -255,31 +257,8 @@ import java.net.URL
import java.util.UUID
import javax.inject.Inject
-class TimelineFragment @Inject constructor(
- private val session: Session,
- private val avatarRenderer: AvatarRenderer,
- private val timelineEventController: TimelineEventController,
- autoCompleterFactory: AutoCompleter.Factory,
- private val permalinkHandler: PermalinkHandler,
- private val notificationDrawerManager: NotificationDrawerManager,
- private val eventHtmlRenderer: EventHtmlRenderer,
- private val vectorPreferences: VectorPreferences,
- private val threadsManager: ThreadsManager,
- private val colorProvider: ColorProvider,
- private val dimensionConverter: DimensionConverter,
- private val userPreferencesProvider: UserPreferencesProvider,
- private val notificationUtils: NotificationUtils,
- private val matrixItemColorProvider: MatrixItemColorProvider,
- private val imageContentRenderer: ImageContentRenderer,
- private val roomDetailPendingActionStore: RoomDetailPendingActionStore,
- private val pillsPostProcessorFactory: PillsPostProcessor.Factory,
- private val callManager: WebRtcCallManager,
- private val audioMessagePlaybackTracker: AudioMessagePlaybackTracker,
- private val shareIntentHandler: ShareIntentHandler,
- private val clock: Clock,
- private val vectorFeatures: VectorFeatures,
- private val buildMeta: BuildMeta,
-) :
+@AndroidEntryPoint
+class TimelineFragment :
VectorBaseFragment(),
TimelineEventController.Callback,
VectorInviteView.Callback,
@@ -289,6 +268,31 @@ class TimelineFragment @Inject constructor(
CurrentCallsView.Callback,
VectorMenuProvider {
+ @Inject lateinit var session: Session
+ @Inject lateinit var avatarRenderer: AvatarRenderer
+ @Inject lateinit var timelineEventController: TimelineEventController
+ @Inject lateinit var autoCompleterFactory: AutoCompleter.Factory
+ @Inject lateinit var permalinkHandler: PermalinkHandler
+ @Inject lateinit var notificationDrawerManager: NotificationDrawerManager
+ @Inject lateinit var eventHtmlRenderer: EventHtmlRenderer
+ @Inject lateinit var vectorPreferences: VectorPreferences
+ @Inject lateinit var threadsManager: ThreadsManager
+ @Inject lateinit var colorProvider: ColorProvider
+ @Inject lateinit var dimensionConverter: DimensionConverter
+ @Inject lateinit var userPreferencesProvider: UserPreferencesProvider
+ @Inject lateinit var notificationUtils: NotificationUtils
+ @Inject lateinit var matrixItemColorProvider: MatrixItemColorProvider
+ @Inject lateinit var imageContentRenderer: ImageContentRenderer
+ @Inject lateinit var roomDetailPendingActionStore: RoomDetailPendingActionStore
+ @Inject lateinit var pillsPostProcessorFactory: PillsPostProcessor.Factory
+ @Inject lateinit var callManager: WebRtcCallManager
+ @Inject lateinit var audioMessagePlaybackTracker: AudioMessagePlaybackTracker
+ @Inject lateinit var shareIntentHandler: ShareIntentHandler
+ @Inject lateinit var clock: Clock
+ @Inject lateinit var vectorFeatures: VectorFeatures
+ @Inject lateinit var buildMeta: BuildMeta
+ @Inject lateinit var galleryOrCameraDialogHelperFactory: GalleryOrCameraDialogHelperFactory
+
companion object {
/**
@@ -309,7 +313,7 @@ class TimelineFragment @Inject constructor(
private const val ircPattern = " (IRC)"
}
- private val galleryOrCameraDialogHelper = GalleryOrCameraDialogHelper(this, colorProvider, clock)
+ private lateinit var galleryOrCameraDialogHelper: GalleryOrCameraDialogHelper
private val timelineArgs: TimelineArgs by args()
private val glideRequests by lazy {
@@ -362,6 +366,7 @@ class TimelineFragment @Inject constructor(
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
analyticsScreenName = MobileScreen.ScreenName.Room
+ galleryOrCameraDialogHelper = galleryOrCameraDialogHelperFactory.create(this)
setFragmentResultListener(MigrateRoomBottomSheet.REQUEST_KEY) { _, bundle ->
bundle.getString(MigrateRoomBottomSheet.BUNDLE_KEY_REPLACEMENT_ROOM)?.let { replacementRoomId ->
timelineViewModel.handle(RoomDetailAction.RoomUpgradeSuccess(replacementRoomId))
diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/search/SearchFragment.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/search/SearchFragment.kt
index de51adf05a..713ca80089 100644
--- a/vector/src/main/java/im/vector/app/features/home/room/detail/search/SearchFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/home/room/detail/search/SearchFragment.kt
@@ -29,6 +29,7 @@ import com.airbnb.mvrx.Success
import com.airbnb.mvrx.args
import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith
@@ -51,12 +52,13 @@ data class SearchArgs(
val roomAvatarUrl: String?
) : Parcelable
-class SearchFragment @Inject constructor(
- private val controller: SearchResultController
-) : VectorBaseFragment(),
+@AndroidEntryPoint
+class SearchFragment :
+ VectorBaseFragment(),
StateView.EventCallback,
SearchResultController.Listener {
+ @Inject lateinit var controller: SearchResultController
private val fragmentArgs: SearchArgs by args()
private val searchViewModel: SearchViewModel by fragmentViewModel()
diff --git a/vector/src/main/java/im/vector/app/features/home/room/list/RoomListFragment.kt b/vector/src/main/java/im/vector/app/features/home/room/list/RoomListFragment.kt
index c25fe546c3..de51101804 100644
--- a/vector/src/main/java/im/vector/app/features/home/room/list/RoomListFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/home/room/list/RoomListFragment.kt
@@ -35,6 +35,7 @@ import com.airbnb.mvrx.args
import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState
import com.google.android.material.dialog.MaterialAlertDialogBuilder
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.epoxy.LayoutManagerStateRestorer
import im.vector.app.core.extensions.cleanup
@@ -70,17 +71,19 @@ data class RoomListParams(
val displayMode: RoomListDisplayMode
) : Parcelable
-class RoomListFragment @Inject constructor(
- private val pagedControllerFactory: RoomSummaryPagedControllerFactory,
- private val notificationDrawerManager: NotificationDrawerManager,
- private val footerController: RoomListFooterController,
- private val userPreferencesProvider: UserPreferencesProvider
-) : VectorBaseFragment(),
+@AndroidEntryPoint
+class RoomListFragment :
+ VectorBaseFragment(),
RoomListListener,
OnBackPressed,
FilteredRoomFooterItem.Listener,
NotifsFabMenuView.Listener {
+ @Inject lateinit var pagedControllerFactory: RoomSummaryPagedControllerFactory
+ @Inject lateinit var notificationDrawerManager: NotificationDrawerManager
+ @Inject lateinit var footerController: RoomListFooterController
+ @Inject lateinit var userPreferencesProvider: UserPreferencesProvider
+
private var modelBuildListener: OnModelBuildFinishedListener? = null
private lateinit var sharedActionViewModel: RoomListQuickActionsSharedActionViewModel
private val roomListParams: RoomListParams by args()
diff --git a/vector/src/main/java/im/vector/app/features/home/room/list/home/HomeRoomListFragment.kt b/vector/src/main/java/im/vector/app/features/home/room/list/home/HomeRoomListFragment.kt
index 9464033896..8fedfef323 100644
--- a/vector/src/main/java/im/vector/app/features/home/room/list/home/HomeRoomListFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/home/room/list/home/HomeRoomListFragment.kt
@@ -29,6 +29,7 @@ import com.airbnb.epoxy.OnModelBuildFinishedListener
import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState
import com.google.android.material.dialog.MaterialAlertDialogBuilder
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.epoxy.LayoutManagerStateRestorer
import im.vector.app.core.extensions.cleanup
@@ -57,13 +58,15 @@ import org.matrix.android.sdk.api.session.room.model.tag.RoomTag
import org.matrix.android.sdk.api.session.room.notification.RoomNotificationState
import javax.inject.Inject
-class HomeRoomListFragment @Inject constructor(
- private val roomSummaryItemFactory: RoomSummaryItemFactory,
- private val userPreferencesProvider: UserPreferencesProvider,
- private val recentRoomCarouselController: RecentRoomCarouselController
-) : VectorBaseFragment(),
+@AndroidEntryPoint
+class HomeRoomListFragment :
+ VectorBaseFragment(),
RoomListListener {
+ @Inject lateinit var roomSummaryItemFactory: RoomSummaryItemFactory
+ @Inject lateinit var userPreferencesProvider: UserPreferencesProvider
+ @Inject lateinit var recentRoomCarouselController: RecentRoomCarouselController
+
private val roomListViewModel: HomeRoomListViewModel by fragmentViewModel()
private lateinit var sharedQuickActionsViewModel: RoomListQuickActionsSharedActionViewModel
private lateinit var sharedActionViewModel: RoomListSharedActionViewModel
diff --git a/vector/src/main/java/im/vector/app/features/home/room/threads/list/views/ThreadListFragment.kt b/vector/src/main/java/im/vector/app/features/home/room/threads/list/views/ThreadListFragment.kt
index aaa9846c39..ef07067bac 100644
--- a/vector/src/main/java/im/vector/app/features/home/room/threads/list/views/ThreadListFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/home/room/threads/list/views/ThreadListFragment.kt
@@ -26,6 +26,7 @@ import androidx.core.view.isVisible
import com.airbnb.mvrx.args
import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith
@@ -48,15 +49,17 @@ import org.matrix.android.sdk.api.session.room.timeline.TimelineEvent
import org.matrix.android.sdk.api.util.MatrixItem
import javax.inject.Inject
-class ThreadListFragment @Inject constructor(
- private val avatarRenderer: AvatarRenderer,
- private val bugReporter: BugReporter,
- private val threadListController: ThreadListController,
- val threadListViewModelFactory: ThreadListViewModel.Factory
-) : VectorBaseFragment(),
+@AndroidEntryPoint
+class ThreadListFragment :
+ VectorBaseFragment(),
ThreadListController.Listener,
VectorMenuProvider {
+ @Inject lateinit var avatarRenderer: AvatarRenderer
+ @Inject lateinit var bugReporter: BugReporter
+ @Inject lateinit var threadListController: ThreadListController
+ @Inject lateinit var threadListViewModelFactory: ThreadListViewModel.Factory
+
private val threadListViewModel: ThreadListViewModel by fragmentViewModel()
private val threadListArgs: ThreadListArgs by args()
diff --git a/vector/src/main/java/im/vector/app/features/location/LocationSharingFragment.kt b/vector/src/main/java/im/vector/app/features/location/LocationSharingFragment.kt
index d96410010e..779818b3d6 100644
--- a/vector/src/main/java/im/vector/app/features/location/LocationSharingFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/location/LocationSharingFragment.kt
@@ -31,6 +31,7 @@ import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.mapbox.mapboxsdk.maps.MapView
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.platform.VectorBaseBottomSheetDialogFragment
import im.vector.app.core.platform.VectorBaseFragment
@@ -53,15 +54,17 @@ import javax.inject.Inject
/**
* We should consider using SupportMapFragment for a out of the box lifecycle handling.
*/
-class LocationSharingFragment @Inject constructor(
- private val urlMapProvider: UrlMapProvider,
- private val avatarRenderer: AvatarRenderer,
- private val matrixItemColorProvider: MatrixItemColorProvider,
- private val vectorPreferences: VectorPreferences,
-) : VectorBaseFragment(),
+@AndroidEntryPoint
+class LocationSharingFragment :
+ VectorBaseFragment(),
LocationTargetChangeListener,
VectorBaseBottomSheetDialogFragment.ResultListener {
+ @Inject lateinit var urlMapProvider: UrlMapProvider
+ @Inject lateinit var avatarRenderer: AvatarRenderer
+ @Inject lateinit var matrixItemColorProvider: MatrixItemColorProvider
+ @Inject lateinit var vectorPreferences: VectorPreferences
+
private val viewModel: LocationSharingViewModel by fragmentViewModel()
private val locationSharingNavigator: LocationSharingNavigator by lazy { DefaultLocationSharingNavigator(activity) }
diff --git a/vector/src/main/java/im/vector/app/features/location/live/map/LiveLocationMapViewFragment.kt b/vector/src/main/java/im/vector/app/features/location/live/map/LiveLocationMapViewFragment.kt
index 85095e7c9f..942021dd64 100644
--- a/vector/src/main/java/im/vector/app/features/location/live/map/LiveLocationMapViewFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/location/live/map/LiveLocationMapViewFragment.kt
@@ -62,7 +62,8 @@ import javax.inject.Inject
* Screen showing a map with all the current users sharing their live location in a room.
*/
@AndroidEntryPoint
-class LiveLocationMapViewFragment @Inject constructor() : VectorBaseFragment() {
+class LiveLocationMapViewFragment :
+ VectorBaseFragment() {
@Inject lateinit var urlMapProvider: UrlMapProvider
@Inject lateinit var bottomSheetController: LiveLocationBottomSheetController
diff --git a/vector/src/main/java/im/vector/app/features/location/preview/LocationPreviewFragment.kt b/vector/src/main/java/im/vector/app/features/location/preview/LocationPreviewFragment.kt
index 8285d0156b..082cee02f0 100644
--- a/vector/src/main/java/im/vector/app/features/location/preview/LocationPreviewFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/location/preview/LocationPreviewFragment.kt
@@ -27,6 +27,7 @@ import com.airbnb.mvrx.args
import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState
import com.mapbox.mapboxsdk.maps.MapView
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.core.platform.VectorMenuProvider
@@ -43,12 +44,14 @@ import javax.inject.Inject
/*
* TODO Move locationPinProvider to a ViewModel
*/
-class LocationPreviewFragment @Inject constructor(
- private val urlMapProvider: UrlMapProvider,
- private val locationPinProvider: LocationPinProvider
-) : VectorBaseFragment(),
+@AndroidEntryPoint
+class LocationPreviewFragment :
+ VectorBaseFragment(),
VectorMenuProvider {
+ @Inject lateinit var urlMapProvider: UrlMapProvider
+ @Inject lateinit var locationPinProvider: LocationPinProvider
+
private val args: LocationSharingArgs by args()
private val viewModel: LocationPreviewViewModel by fragmentViewModel()
diff --git a/vector/src/main/java/im/vector/app/features/login/LoginCaptchaFragment.kt b/vector/src/main/java/im/vector/app/features/login/LoginCaptchaFragment.kt
index 1b49f9bfa1..25403b06f3 100644
--- a/vector/src/main/java/im/vector/app/features/login/LoginCaptchaFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/login/LoginCaptchaFragment.kt
@@ -33,6 +33,7 @@ import android.webkit.WebViewClient
import androidx.core.view.isVisible
import com.airbnb.mvrx.args
import com.google.android.material.dialog.MaterialAlertDialogBuilder
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.utils.AssetReader
import im.vector.app.databinding.FragmentLoginCaptchaBinding
@@ -51,9 +52,11 @@ data class LoginCaptchaFragmentArgument(
/**
* In this screen, the user is asked to confirm he is not a robot.
*/
-class LoginCaptchaFragment @Inject constructor(
- private val assetReader: AssetReader
-) : AbstractLoginFragment() {
+@AndroidEntryPoint
+class LoginCaptchaFragment :
+ AbstractLoginFragment() {
+
+ @Inject lateinit var assetReader: AssetReader
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentLoginCaptchaBinding {
return FragmentLoginCaptchaBinding.inflate(inflater, container, false)
diff --git a/vector/src/main/java/im/vector/app/features/login/LoginFragment.kt b/vector/src/main/java/im/vector/app/features/login/LoginFragment.kt
index 03010e0a75..d61044d101 100644
--- a/vector/src/main/java/im/vector/app/features/login/LoginFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/login/LoginFragment.kt
@@ -28,6 +28,7 @@ import androidx.core.view.isVisible
import androidx.lifecycle.lifecycleScope
import com.airbnb.mvrx.Fail
import com.airbnb.mvrx.Loading
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.hideKeyboard
import im.vector.app.core.extensions.hidePassword
@@ -41,7 +42,6 @@ import org.matrix.android.sdk.api.failure.Failure
import org.matrix.android.sdk.api.failure.MatrixError
import org.matrix.android.sdk.api.failure.isInvalidPassword
import reactivecircus.flowbinding.android.widget.textChanges
-import javax.inject.Inject
/**
* In this screen:
@@ -51,7 +51,9 @@ import javax.inject.Inject
* In signup mode:
* - the user is asked for login and password
*/
-class LoginFragment @Inject constructor() : AbstractSSOLoginFragment() {
+@AndroidEntryPoint
+class LoginFragment :
+ AbstractSSOLoginFragment() {
private var isSignupMode = false
diff --git a/vector/src/main/java/im/vector/app/features/login/LoginGenericTextInputFormFragment.kt b/vector/src/main/java/im/vector/app/features/login/LoginGenericTextInputFormFragment.kt
index 07253d80ec..2bc8419989 100644
--- a/vector/src/main/java/im/vector/app/features/login/LoginGenericTextInputFormFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/login/LoginGenericTextInputFormFragment.kt
@@ -29,6 +29,7 @@ import androidx.lifecycle.lifecycleScope
import com.airbnb.mvrx.args
import com.google.i18n.phonenumbers.NumberParseException
import com.google.i18n.phonenumbers.PhoneNumberUtil
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.hideKeyboard
import im.vector.app.core.extensions.isEmail
@@ -41,7 +42,6 @@ import org.matrix.android.sdk.api.auth.registration.RegisterThreePid
import org.matrix.android.sdk.api.failure.Failure
import org.matrix.android.sdk.api.failure.is401
import reactivecircus.flowbinding.android.widget.textChanges
-import javax.inject.Inject
enum class TextInputFormFragmentMode {
SetEmail,
@@ -59,7 +59,9 @@ data class LoginGenericTextInputFormFragmentArgument(
/**
* In this screen, the user is asked for a text input.
*/
-class LoginGenericTextInputFormFragment @Inject constructor() : AbstractLoginFragment() {
+@AndroidEntryPoint
+class LoginGenericTextInputFormFragment :
+ AbstractLoginFragment() {
private val params: LoginGenericTextInputFormFragmentArgument by args()
diff --git a/vector/src/main/java/im/vector/app/features/login/LoginResetPasswordFragment.kt b/vector/src/main/java/im/vector/app/features/login/LoginResetPasswordFragment.kt
index 1ca0774f54..87df2d9483 100644
--- a/vector/src/main/java/im/vector/app/features/login/LoginResetPasswordFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/login/LoginResetPasswordFragment.kt
@@ -24,6 +24,7 @@ import androidx.lifecycle.lifecycleScope
import com.airbnb.mvrx.Fail
import com.airbnb.mvrx.Loading
import com.google.android.material.dialog.MaterialAlertDialogBuilder
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.hideKeyboard
import im.vector.app.core.extensions.hidePassword
@@ -36,12 +37,13 @@ import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.onEach
import reactivecircus.flowbinding.android.widget.textChanges
-import javax.inject.Inject
/**
* In this screen, the user is asked for email and new password to reset his password.
*/
-class LoginResetPasswordFragment @Inject constructor() : AbstractLoginFragment() {
+@AndroidEntryPoint
+class LoginResetPasswordFragment :
+ AbstractLoginFragment() {
// Show warning only once
private var showWarning = true
diff --git a/vector/src/main/java/im/vector/app/features/login/LoginResetPasswordMailConfirmationFragment.kt b/vector/src/main/java/im/vector/app/features/login/LoginResetPasswordMailConfirmationFragment.kt
index 689e8ef6b7..c95a778860 100644
--- a/vector/src/main/java/im/vector/app/features/login/LoginResetPasswordMailConfirmationFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/login/LoginResetPasswordMailConfirmationFragment.kt
@@ -22,15 +22,17 @@ import android.view.View
import android.view.ViewGroup
import com.airbnb.mvrx.Fail
import com.google.android.material.dialog.MaterialAlertDialogBuilder
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.databinding.FragmentLoginResetPasswordMailConfirmationBinding
import org.matrix.android.sdk.api.failure.is401
-import javax.inject.Inject
/**
* In this screen, the user is asked to check their email and to click on a button once it's done.
*/
-class LoginResetPasswordMailConfirmationFragment @Inject constructor() : AbstractLoginFragment() {
+@AndroidEntryPoint
+class LoginResetPasswordMailConfirmationFragment :
+ AbstractLoginFragment() {
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentLoginResetPasswordMailConfirmationBinding {
return FragmentLoginResetPasswordMailConfirmationBinding.inflate(inflater, container, false)
diff --git a/vector/src/main/java/im/vector/app/features/login/LoginResetPasswordSuccessFragment.kt b/vector/src/main/java/im/vector/app/features/login/LoginResetPasswordSuccessFragment.kt
index d2f1f620bd..e601f0512d 100644
--- a/vector/src/main/java/im/vector/app/features/login/LoginResetPasswordSuccessFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/login/LoginResetPasswordSuccessFragment.kt
@@ -20,13 +20,15 @@ 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.databinding.FragmentLoginResetPasswordSuccessBinding
-import javax.inject.Inject
/**
* In this screen, we confirm to the user that his password has been reset.
*/
-class LoginResetPasswordSuccessFragment @Inject constructor() : AbstractLoginFragment() {
+@AndroidEntryPoint
+class LoginResetPasswordSuccessFragment :
+ AbstractLoginFragment() {
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentLoginResetPasswordSuccessBinding {
return FragmentLoginResetPasswordSuccessBinding.inflate(inflater, container, false)
diff --git a/vector/src/main/java/im/vector/app/features/login/LoginServerSelectionFragment.kt b/vector/src/main/java/im/vector/app/features/login/LoginServerSelectionFragment.kt
index 6c49bafbba..0813957e99 100644
--- a/vector/src/main/java/im/vector/app/features/login/LoginServerSelectionFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/login/LoginServerSelectionFragment.kt
@@ -20,16 +20,18 @@ 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.R
import im.vector.app.core.utils.openUrlInChromeCustomTab
import im.vector.app.databinding.FragmentLoginServerSelectionBinding
import me.gujun.android.span.span
-import javax.inject.Inject
/**
* In this screen, the user will choose between matrix.org, modular or other type of homeserver.
*/
-class LoginServerSelectionFragment @Inject constructor() : AbstractLoginFragment() {
+@AndroidEntryPoint
+class LoginServerSelectionFragment :
+ AbstractLoginFragment() {
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentLoginServerSelectionBinding {
return FragmentLoginServerSelectionBinding.inflate(inflater, container, false)
diff --git a/vector/src/main/java/im/vector/app/features/login/LoginServerUrlFormFragment.kt b/vector/src/main/java/im/vector/app/features/login/LoginServerUrlFormFragment.kt
index 937e1bdf55..aabe0c2f2f 100644
--- a/vector/src/main/java/im/vector/app/features/login/LoginServerUrlFormFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/login/LoginServerUrlFormFragment.kt
@@ -27,6 +27,7 @@ import androidx.core.view.isInvisible
import androidx.core.view.isVisible
import androidx.lifecycle.lifecycleScope
import com.google.android.material.textfield.TextInputLayout
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.hideKeyboard
import im.vector.app.core.resources.BuildMeta
@@ -43,9 +44,11 @@ import javax.inject.Inject
/**
* In this screen, the user is prompted to enter a homeserver url.
*/
-class LoginServerUrlFormFragment @Inject constructor(
- private val buildMeta: BuildMeta,
-) : AbstractLoginFragment() {
+@AndroidEntryPoint
+class LoginServerUrlFormFragment :
+ AbstractLoginFragment() {
+
+ @Inject lateinit var buildMeta: BuildMeta
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentLoginServerUrlFormBinding {
return FragmentLoginServerUrlFormBinding.inflate(inflater, container, false)
diff --git a/vector/src/main/java/im/vector/app/features/login/LoginSignUpSignInSelectionFragment.kt b/vector/src/main/java/im/vector/app/features/login/LoginSignUpSignInSelectionFragment.kt
index aafd426335..dbcf674847 100644
--- a/vector/src/main/java/im/vector/app/features/login/LoginSignUpSignInSelectionFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/login/LoginSignUpSignInSelectionFragment.kt
@@ -22,16 +22,18 @@ import android.view.View
import android.view.ViewGroup
import androidx.core.view.isVisible
import com.airbnb.mvrx.withState
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.toReducedUrl
import im.vector.app.databinding.FragmentLoginSignupSigninSelectionBinding
import im.vector.app.features.login.SocialLoginButtonsView.Mode
-import javax.inject.Inject
/**
* In this screen, the user is asked to sign up or to sign in to the homeserver.
*/
-class LoginSignUpSignInSelectionFragment @Inject constructor() : AbstractSSOLoginFragment() {
+@AndroidEntryPoint
+class LoginSignUpSignInSelectionFragment :
+ AbstractSSOLoginFragment() {
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentLoginSignupSigninSelectionBinding {
return FragmentLoginSignupSigninSelectionBinding.inflate(inflater, container, false)
diff --git a/vector/src/main/java/im/vector/app/features/login/LoginSplashFragment.kt b/vector/src/main/java/im/vector/app/features/login/LoginSplashFragment.kt
index 7f5e87967b..6a8de819fd 100644
--- a/vector/src/main/java/im/vector/app/features/login/LoginSplashFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/login/LoginSplashFragment.kt
@@ -23,6 +23,7 @@ import android.view.View
import android.view.ViewGroup
import androidx.core.view.isVisible
import com.google.android.material.dialog.MaterialAlertDialogBuilder
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.resources.BuildMeta
import im.vector.app.databinding.FragmentLoginSplashBinding
@@ -35,10 +36,12 @@ import javax.inject.Inject
/**
* In this screen, the user is viewing an introduction to what he can do with this application.
*/
-class LoginSplashFragment @Inject constructor(
- private val vectorPreferences: VectorPreferences,
- private val buildMeta: BuildMeta,
-) : AbstractLoginFragment() {
+@AndroidEntryPoint
+class LoginSplashFragment :
+ AbstractLoginFragment() {
+
+ @Inject lateinit var vectorPreferences: VectorPreferences
+ @Inject lateinit var buildMeta: BuildMeta
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentLoginSplashBinding {
return FragmentLoginSplashBinding.inflate(inflater, container, false)
diff --git a/vector/src/main/java/im/vector/app/features/login/LoginWaitForEmailFragment.kt b/vector/src/main/java/im/vector/app/features/login/LoginWaitForEmailFragment.kt
index 07251f52a2..c13769e9e9 100644
--- a/vector/src/main/java/im/vector/app/features/login/LoginWaitForEmailFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/login/LoginWaitForEmailFragment.kt
@@ -22,11 +22,11 @@ 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.databinding.FragmentLoginWaitForEmailBinding
import kotlinx.parcelize.Parcelize
import org.matrix.android.sdk.api.failure.is401
-import javax.inject.Inject
@Parcelize
data class LoginWaitForEmailFragmentArgument(
@@ -36,7 +36,9 @@ data class LoginWaitForEmailFragmentArgument(
/**
* In this screen, the user is asked to check their emails.
*/
-class LoginWaitForEmailFragment @Inject constructor() : AbstractLoginFragment() {
+@AndroidEntryPoint
+class LoginWaitForEmailFragment :
+ AbstractLoginFragment() {
private val params: LoginWaitForEmailFragmentArgument by args()
diff --git a/vector/src/main/java/im/vector/app/features/login/LoginWebFragment.kt b/vector/src/main/java/im/vector/app/features/login/LoginWebFragment.kt
index 0940eb50ee..b89018ccff 100644
--- a/vector/src/main/java/im/vector/app/features/login/LoginWebFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/login/LoginWebFragment.kt
@@ -32,6 +32,7 @@ import android.webkit.WebView
import android.webkit.WebViewClient
import com.airbnb.mvrx.activityViewModel
import com.google.android.material.dialog.MaterialAlertDialogBuilder
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.utils.AssetReader
import im.vector.app.databinding.FragmentLoginWebBinding
@@ -47,9 +48,11 @@ import javax.inject.Inject
* This screen is displayed when the application does not support login flow or registration flow
* of the homeserver, as a fallback to login or to create an account.
*/
-class LoginWebFragment @Inject constructor(
- private val assetReader: AssetReader
-) : AbstractLoginFragment() {
+@AndroidEntryPoint
+class LoginWebFragment :
+ AbstractLoginFragment() {
+
+ @Inject lateinit var assetReader: AssetReader
private val softLogoutViewModel: SoftLogoutViewModel by activityViewModel()
diff --git a/vector/src/main/java/im/vector/app/features/login/terms/LoginTermsFragment.kt b/vector/src/main/java/im/vector/app/features/login/terms/LoginTermsFragment.kt
index ce499f290b..a7a4274876 100755
--- a/vector/src/main/java/im/vector/app/features/login/terms/LoginTermsFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/login/terms/LoginTermsFragment.kt
@@ -42,11 +42,12 @@ data class LoginTermsFragmentArgument(
/**
* LoginTermsFragment displays the list of policies the user has to accept.
*/
-class LoginTermsFragment @Inject constructor(
- private val policyController: PolicyController
-) : AbstractLoginFragment(),
+class LoginTermsFragment :
+ AbstractLoginFragment(),
PolicyController.PolicyControllerListener {
+ @Inject lateinit var policyController: PolicyController
+
private val params: LoginTermsFragmentArgument by args()
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentLoginTermsBinding {
diff --git a/vector/src/main/java/im/vector/app/features/matrixto/MatrixToRoomSpaceFragment.kt b/vector/src/main/java/im/vector/app/features/matrixto/MatrixToRoomSpaceFragment.kt
index 8dd9fd030a..f564802b57 100644
--- a/vector/src/main/java/im/vector/app/features/matrixto/MatrixToRoomSpaceFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/matrixto/MatrixToRoomSpaceFragment.kt
@@ -28,6 +28,7 @@ import com.airbnb.mvrx.Success
import com.airbnb.mvrx.Uninitialized
import com.airbnb.mvrx.parentFragmentViewModel
import com.airbnb.mvrx.withState
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.setTextOrHide
import im.vector.app.core.platform.ButtonStateView
@@ -38,10 +39,12 @@ import org.matrix.android.sdk.api.session.room.model.Membership
import org.matrix.android.sdk.api.session.room.model.RoomType
import javax.inject.Inject
-class MatrixToRoomSpaceFragment @Inject constructor(
- private val avatarRenderer: AvatarRenderer,
- private val spaceCardRenderer: SpaceCardRenderer
-) : VectorBaseFragment() {
+@AndroidEntryPoint
+class MatrixToRoomSpaceFragment :
+ VectorBaseFragment() {
+
+ @Inject lateinit var avatarRenderer: AvatarRenderer
+ @Inject lateinit var spaceCardRenderer: SpaceCardRenderer
private val sharedViewModel: MatrixToBottomSheetViewModel by parentFragmentViewModel()
diff --git a/vector/src/main/java/im/vector/app/features/matrixto/MatrixToUserFragment.kt b/vector/src/main/java/im/vector/app/features/matrixto/MatrixToUserFragment.kt
index 3792183bca..c8b18e327b 100644
--- a/vector/src/main/java/im/vector/app/features/matrixto/MatrixToUserFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/matrixto/MatrixToUserFragment.kt
@@ -28,15 +28,18 @@ import com.airbnb.mvrx.Success
import com.airbnb.mvrx.Uninitialized
import com.airbnb.mvrx.parentFragmentViewModel
import com.airbnb.mvrx.withState
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.core.extensions.setTextOrHide
import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.databinding.FragmentMatrixToUserCardBinding
import im.vector.app.features.home.AvatarRenderer
import javax.inject.Inject
-class MatrixToUserFragment @Inject constructor(
- private val avatarRenderer: AvatarRenderer
-) : VectorBaseFragment() {
+@AndroidEntryPoint
+class MatrixToUserFragment :
+ VectorBaseFragment() {
+
+ @Inject lateinit var avatarRenderer: AvatarRenderer
private val sharedViewModel: MatrixToBottomSheetViewModel by parentFragmentViewModel()
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 1441152128..dcf6521499 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
@@ -29,7 +29,6 @@ import org.matrix.android.sdk.api.failure.Failure as SdkFailure
sealed class OnboardingViewEvents : VectorViewEvents {
data class Loading(val message: CharSequence? = null) : OnboardingViewEvents()
data class Failure(val throwable: Throwable) : OnboardingViewEvents()
- data class DeeplinkAuthenticationFailure(val retryAction: OnboardingAction) : OnboardingViewEvents()
data class UnrecognisedCertificateFailure(val retryAction: OnboardingAction, val cause: SdkFailure.UnrecognizedCertificateFailure) : OnboardingViewEvents()
object DisplayRegistrationFallback : 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 e60bedc612..9661feb002 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
@@ -61,6 +61,7 @@ import org.matrix.android.sdk.api.auth.login.LoginWizard
import org.matrix.android.sdk.api.auth.registration.RegistrationAvailability
import org.matrix.android.sdk.api.auth.registration.RegistrationWizard
import org.matrix.android.sdk.api.failure.Failure
+import org.matrix.android.sdk.api.failure.isHomeserverConnectionError
import org.matrix.android.sdk.api.failure.isHomeserverUnavailable
import org.matrix.android.sdk.api.failure.isUnrecognisedCertificate
import org.matrix.android.sdk.api.network.ssl.Fingerprint
@@ -701,14 +702,15 @@ class OnboardingViewModel @AssistedInject constructor(
private fun onAuthenticationStartError(error: Throwable, trigger: OnboardingAction.HomeServerChange) {
when {
- error.isHomeserverUnavailable() && applicationContext.inferNoConnectivity(sdkIntProvider) -> _viewEvents.post(
- OnboardingViewEvents.Failure(error)
- )
- deeplinkUrlIsUnavailable(error, trigger) -> _viewEvents.post(
- OnboardingViewEvents.DeeplinkAuthenticationFailure(
- retryAction = (trigger as OnboardingAction.HomeServerChange.SelectHomeServer).resetToDefaultUrl()
- )
- )
+ error.isHomeserverUnavailable() && applicationContext.inferNoConnectivity(sdkIntProvider) -> _viewEvents.post(OnboardingViewEvents.Failure(error))
+ isUnableToSelectServer(error, trigger) -> {
+ withState { state ->
+ when {
+ canEditServerSelectionError(state) -> handle(OnboardingAction.PostViewEvent(OnboardingViewEvents.EditServerSelection))
+ else -> _viewEvents.post(OnboardingViewEvents.Failure(error))
+ }
+ }
+ }
error.isUnrecognisedCertificate() -> {
_viewEvents.post(OnboardingViewEvents.UnrecognisedCertificateFailure(trigger, error as Failure.UnrecognizedCertificateFailure))
}
@@ -716,11 +718,12 @@ class OnboardingViewModel @AssistedInject constructor(
}
}
- private fun deeplinkUrlIsUnavailable(error: Throwable, trigger: OnboardingAction.HomeServerChange) = error.isHomeserverUnavailable() &&
- loginConfig != null &&
- trigger is OnboardingAction.HomeServerChange.SelectHomeServer
+ private fun canEditServerSelectionError(state: OnboardingViewState) =
+ (state.onboardingFlow == OnboardingFlow.SignIn && vectorFeatures.isOnboardingCombinedLoginEnabled()) ||
+ (state.onboardingFlow == OnboardingFlow.SignUp && vectorFeatures.isOnboardingCombinedRegisterEnabled())
- private fun OnboardingAction.HomeServerChange.SelectHomeServer.resetToDefaultUrl() = copy(homeServerUrl = defaultHomeserverUrl)
+ private fun isUnableToSelectServer(error: Throwable, trigger: OnboardingAction.HomeServerChange) =
+ trigger is OnboardingAction.HomeServerChange.SelectHomeServer && error.isHomeserverConnectionError()
private suspend fun onAuthenticationStartedSuccess(
trigger: OnboardingAction.HomeServerChange,
@@ -807,6 +810,8 @@ class OnboardingViewModel @AssistedInject constructor(
return loginConfig?.homeServerUrl
}
+ fun getDefaultHomeserverUrl() = defaultHomeserverUrl
+
fun fetchSsoUrl(redirectUrl: String, deviceId: String?, provider: SsoIdentityProvider?): String? {
setState {
val authDescription = AuthenticationDescription.Register(provider.toAuthenticationType())
diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthAccountCreatedFragment.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthAccountCreatedFragment.kt
index 9f2aadef5c..a53ca52e85 100644
--- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthAccountCreatedFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthAccountCreatedFragment.kt
@@ -23,6 +23,7 @@ import android.view.View
import android.view.ViewGroup
import androidx.core.text.toSpannable
import androidx.core.view.isVisible
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.animations.play
import im.vector.app.core.di.ActiveSessionHolder
@@ -34,9 +35,11 @@ import im.vector.app.features.onboarding.OnboardingViewEvents
import im.vector.app.features.onboarding.OnboardingViewState
import javax.inject.Inject
-class FtueAuthAccountCreatedFragment @Inject constructor(
- private val activeSessionHolder: ActiveSessionHolder
-) : AbstractFtueAuthFragment() {
+@AndroidEntryPoint
+class FtueAuthAccountCreatedFragment :
+ AbstractFtueAuthFragment() {
+
+ @Inject lateinit var activeSessionHolder: ActiveSessionHolder
private var hasPlayedConfetti = false
diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthCaptchaFragment.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthCaptchaFragment.kt
index 1f44922b3b..f170868307 100644
--- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthCaptchaFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthCaptchaFragment.kt
@@ -24,6 +24,7 @@ import android.view.ViewGroup
import android.view.ViewStub
import com.airbnb.mvrx.args
import com.google.android.material.dialog.MaterialAlertDialogBuilder
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.crawlCausesFor
import im.vector.app.databinding.FragmentFtueLoginCaptchaBinding
@@ -43,9 +44,11 @@ data class FtueAuthCaptchaFragmentArgument(
/**
* In this screen, the user is asked to confirm they are not a robot.
*/
-class FtueAuthCaptchaFragment @Inject constructor(
- private val captchaWebview: CaptchaWebview
-) : AbstractFtueAuthFragment() {
+@AndroidEntryPoint
+class FtueAuthCaptchaFragment :
+ AbstractFtueAuthFragment() {
+
+ @Inject lateinit var captchaWebview: CaptchaWebview
private val params: FtueAuthCaptchaFragmentArgument by args()
private var webViewBinding: ViewStubWebviewBinding? = null
diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthChooseDisplayNameFragment.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthChooseDisplayNameFragment.kt
index c4b4e807ac..234a5789c1 100644
--- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthChooseDisplayNameFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthChooseDisplayNameFragment.kt
@@ -22,15 +22,17 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.inputmethod.EditorInfo
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.core.extensions.hasContent
import im.vector.app.core.platform.SimpleTextWatcher
import im.vector.app.databinding.FragmentFtueDisplayNameBinding
import im.vector.app.features.onboarding.OnboardingAction
import im.vector.app.features.onboarding.OnboardingViewEvents
import im.vector.app.features.onboarding.OnboardingViewState
-import javax.inject.Inject
-class FtueAuthChooseDisplayNameFragment @Inject constructor() : AbstractFtueAuthFragment() {
+@AndroidEntryPoint
+class FtueAuthChooseDisplayNameFragment :
+ AbstractFtueAuthFragment() {
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentFtueDisplayNameBinding {
return FragmentFtueDisplayNameBinding.inflate(inflater, container, false)
diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthChooseProfilePictureFragment.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthChooseProfilePictureFragment.kt
index 1a673b156a..92d0aa2a0f 100644
--- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthChooseProfilePictureFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthChooseProfilePictureFragment.kt
@@ -24,12 +24,11 @@ import android.view.ViewGroup
import android.widget.Toast
import androidx.core.view.isInvisible
import com.airbnb.mvrx.withState
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.di.ActiveSessionHolder
import im.vector.app.core.dialogs.GalleryOrCameraDialogHelper
-import im.vector.app.core.extensions.singletonEntryPoint
-import im.vector.app.core.resources.ColorProvider
-import im.vector.app.core.time.Clock
+import im.vector.app.core.dialogs.GalleryOrCameraDialogHelperFactory
import im.vector.app.databinding.FragmentFtueProfilePictureBinding
import im.vector.app.features.home.AvatarRenderer
import im.vector.app.features.onboarding.OnboardingAction
@@ -38,19 +37,26 @@ import im.vector.app.features.onboarding.OnboardingViewState
import org.matrix.android.sdk.api.util.MatrixItem
import javax.inject.Inject
-class FtueAuthChooseProfilePictureFragment @Inject constructor(
- private val activeSessionHolder: ActiveSessionHolder,
- colorProvider: ColorProvider,
- clock: Clock,
-) : AbstractFtueAuthFragment(), GalleryOrCameraDialogHelper.Listener {
+@AndroidEntryPoint
+class FtueAuthChooseProfilePictureFragment :
+ AbstractFtueAuthFragment(),
+ GalleryOrCameraDialogHelper.Listener {
- private val galleryOrCameraDialogHelper = GalleryOrCameraDialogHelper(this, colorProvider, clock)
- private val avatarRenderer: AvatarRenderer by lazy { requireContext().singletonEntryPoint().avatarRenderer() }
+ @Inject lateinit var activeSessionHolder: ActiveSessionHolder
+ @Inject lateinit var galleryOrCameraDialogHelperFactory: GalleryOrCameraDialogHelperFactory
+ @Inject lateinit var avatarRenderer: AvatarRenderer
+
+ private lateinit var galleryOrCameraDialogHelper: GalleryOrCameraDialogHelper
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentFtueProfilePictureBinding {
return FragmentFtueProfilePictureBinding.inflate(inflater, container, false)
}
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ galleryOrCameraDialogHelper = galleryOrCameraDialogHelperFactory.create(this)
+ }
+
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
setupViews()
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 b24511b4bc..6877810f0a 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
@@ -24,6 +24,7 @@ import android.view.ViewGroup
import androidx.autofill.HintConstants
import androidx.core.view.isVisible
import androidx.lifecycle.lifecycleScope
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.clearErrorOnChange
import im.vector.app.core.extensions.content
@@ -48,10 +49,12 @@ import kotlinx.coroutines.flow.launchIn
import reactivecircus.flowbinding.android.widget.textChanges
import javax.inject.Inject
-class FtueAuthCombinedLoginFragment @Inject constructor(
- private val loginFieldsValidation: LoginFieldsValidation,
- private val loginErrorParser: LoginErrorParser
-) : AbstractSSOFtueAuthFragment() {
+@AndroidEntryPoint
+class FtueAuthCombinedLoginFragment :
+ AbstractSSOFtueAuthFragment() {
+
+ @Inject lateinit var loginFieldsValidation: LoginFieldsValidation
+ @Inject lateinit var loginErrorParser: LoginErrorParser
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentFtueCombinedLoginBinding {
return FragmentFtueCombinedLoginBinding.inflate(inflater, container, false)
diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthCombinedRegisterFragment.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthCombinedRegisterFragment.kt
index d06d1e8051..66668f5303 100644
--- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthCombinedRegisterFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthCombinedRegisterFragment.kt
@@ -27,6 +27,7 @@ import androidx.core.view.isVisible
import androidx.lifecycle.lifecycleScope
import com.airbnb.mvrx.withState
import com.google.android.material.dialog.MaterialAlertDialogBuilder
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.clearErrorOnChange
import im.vector.app.core.extensions.content
@@ -60,11 +61,12 @@ import org.matrix.android.sdk.api.failure.isRegistrationDisabled
import org.matrix.android.sdk.api.failure.isUsernameInUse
import org.matrix.android.sdk.api.failure.isWeakPassword
import reactivecircus.flowbinding.android.widget.textChanges
-import javax.inject.Inject
private const val MINIMUM_PASSWORD_LENGTH = 8
-class FtueAuthCombinedRegisterFragment @Inject constructor() : AbstractSSOFtueAuthFragment() {
+@AndroidEntryPoint
+class FtueAuthCombinedRegisterFragment :
+ AbstractSSOFtueAuthFragment() {
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentFtueCombinedRegisterBinding {
return FragmentFtueCombinedRegisterBinding.inflate(inflater, container, false)
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 749aac2898..abb8e4ed7d 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
@@ -20,6 +20,7 @@ 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.R
import im.vector.app.core.extensions.associateContentStateWith
import im.vector.app.core.extensions.clearErrorOnChange
@@ -37,9 +38,10 @@ import im.vector.app.features.onboarding.OnboardingFlow
import im.vector.app.features.onboarding.OnboardingViewEvents
import im.vector.app.features.onboarding.OnboardingViewState
import org.matrix.android.sdk.api.failure.isHomeserverUnavailable
-import javax.inject.Inject
-class FtueAuthCombinedServerSelectionFragment @Inject constructor() : AbstractFtueAuthFragment() {
+@AndroidEntryPoint
+class FtueAuthCombinedServerSelectionFragment :
+ AbstractFtueAuthFragment() {
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentFtueServerSelectionCombinedBinding {
return FragmentFtueServerSelectionCombinedBinding.inflate(inflater, container, false)
@@ -86,7 +88,7 @@ class FtueAuthCombinedServerSelectionFragment @Inject constructor() : AbstractFt
)
if (views.chooseServerInput.content().isEmpty()) {
- val userUrlInput = state.selectedHomeserver.userFacingUrl?.toReducedUrlKeepingSchemaIfInsecure()
+ val userUrlInput = state.selectedHomeserver.userFacingUrl?.toReducedUrlKeepingSchemaIfInsecure() ?: viewModel.getDefaultHomeserverUrl()
views.chooseServerInput.editText().setText(userUrlInput)
}
}
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 5de8fce82f..4cd35c8a66 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,6 +20,7 @@ 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.R
import im.vector.app.core.extensions.associateContentStateWith
import im.vector.app.core.extensions.autofillEmail
@@ -35,9 +36,10 @@ import im.vector.app.features.onboarding.OnboardingAction
import im.vector.app.features.onboarding.OnboardingViewState
import im.vector.app.features.onboarding.RegisterAction
import org.matrix.android.sdk.api.auth.registration.RegisterThreePid
-import javax.inject.Inject
-class FtueAuthEmailEntryFragment @Inject constructor() : AbstractFtueAuthFragment() {
+@AndroidEntryPoint
+class FtueAuthEmailEntryFragment :
+ AbstractFtueAuthFragment() {
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentFtueEmailInputBinding {
return FragmentFtueEmailInputBinding.inflate(inflater, container, false)
diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthGenericTextInputFormFragment.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthGenericTextInputFormFragment.kt
index edfbcd89b6..02d0c25cfd 100644
--- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthGenericTextInputFormFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthGenericTextInputFormFragment.kt
@@ -29,6 +29,7 @@ import androidx.lifecycle.lifecycleScope
import com.airbnb.mvrx.args
import com.google.i18n.phonenumbers.NumberParseException
import com.google.i18n.phonenumbers.PhoneNumberUtil
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.hideKeyboard
import im.vector.app.core.extensions.isEmail
@@ -44,7 +45,6 @@ import org.matrix.android.sdk.api.auth.registration.RegisterThreePid
import org.matrix.android.sdk.api.failure.Failure
import org.matrix.android.sdk.api.failure.is401
import reactivecircus.flowbinding.android.widget.textChanges
-import javax.inject.Inject
@Parcelize
data class FtueAuthGenericTextInputFormFragmentArgument(
@@ -56,7 +56,9 @@ data class FtueAuthGenericTextInputFormFragmentArgument(
/**
* In this screen, the user is asked for a text input.
*/
-class FtueAuthGenericTextInputFormFragment @Inject constructor() : AbstractFtueAuthFragment() {
+@AndroidEntryPoint
+class FtueAuthGenericTextInputFormFragment :
+ AbstractFtueAuthFragment() {
private val params: FtueAuthGenericTextInputFormFragmentArgument by args()
diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthLegacyStyleCaptchaFragment.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthLegacyStyleCaptchaFragment.kt
index b8b30529a6..0efd8390ba 100644
--- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthLegacyStyleCaptchaFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthLegacyStyleCaptchaFragment.kt
@@ -20,6 +20,7 @@ import android.os.Parcelable
import android.view.LayoutInflater
import android.view.ViewGroup
import com.airbnb.mvrx.args
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.databinding.FragmentLoginCaptchaBinding
import im.vector.app.features.onboarding.OnboardingAction
import im.vector.app.features.onboarding.OnboardingViewState
@@ -35,9 +36,11 @@ data class FtueAuthLegacyStyleCaptchaFragmentArgument(
/**
* In this screen, the user is asked to confirm they are not a robot.
*/
-class FtueAuthLegacyStyleCaptchaFragment @Inject constructor(
- private val captchaWebview: CaptchaWebview
-) : AbstractFtueAuthFragment() {
+@AndroidEntryPoint
+class FtueAuthLegacyStyleCaptchaFragment :
+ AbstractFtueAuthFragment() {
+
+ @Inject lateinit var captchaWebview: CaptchaWebview
private val params: FtueAuthLegacyStyleCaptchaFragmentArgument by args()
private var isWebViewLoaded = false
diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthLegacyWaitForEmailFragment.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthLegacyWaitForEmailFragment.kt
index c815f354f0..fb468ddeb2 100644
--- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthLegacyWaitForEmailFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthLegacyWaitForEmailFragment.kt
@@ -21,16 +21,18 @@ 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.databinding.FragmentLoginWaitForEmailBinding
import im.vector.app.features.onboarding.OnboardingAction
import im.vector.app.features.onboarding.RegisterAction
-import javax.inject.Inject
/**
* In this screen, the user is asked to check their emails.
*/
-class FtueAuthLegacyWaitForEmailFragment @Inject constructor() : AbstractFtueAuthFragment() {
+@AndroidEntryPoint
+class FtueAuthLegacyWaitForEmailFragment :
+ AbstractFtueAuthFragment() {
private val params: FtueAuthWaitForEmailFragmentArgument by args()
diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthLoginFragment.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthLoginFragment.kt
index ad159943b1..3fd8df6bb9 100644
--- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthLoginFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthLoginFragment.kt
@@ -28,6 +28,7 @@ import androidx.core.view.isVisible
import androidx.lifecycle.lifecycleScope
import com.airbnb.mvrx.withState
import com.google.android.material.dialog.MaterialAlertDialogBuilder
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.hideKeyboard
import im.vector.app.core.extensions.hidePassword
@@ -53,7 +54,6 @@ import org.matrix.android.sdk.api.failure.isRegistrationDisabled
import org.matrix.android.sdk.api.failure.isUsernameInUse
import org.matrix.android.sdk.api.failure.isWeakPassword
import reactivecircus.flowbinding.android.widget.textChanges
-import javax.inject.Inject
/**
* In this screen:
@@ -63,7 +63,9 @@ import javax.inject.Inject
* In signup mode:
* - the user is asked for login and password
*/
-class FtueAuthLoginFragment @Inject constructor() : AbstractSSOFtueAuthFragment() {
+@AndroidEntryPoint
+class FtueAuthLoginFragment :
+ AbstractSSOFtueAuthFragment() {
private var isSignupMode = false
diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthPersonalizationCompleteFragment.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthPersonalizationCompleteFragment.kt
index 8e88a6ed46..96cc1c3b45 100644
--- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthPersonalizationCompleteFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthPersonalizationCompleteFragment.kt
@@ -20,12 +20,14 @@ 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.databinding.FragmentFtuePersonalizationCompleteBinding
import im.vector.app.features.onboarding.OnboardingAction
import im.vector.app.features.onboarding.OnboardingViewEvents
-import javax.inject.Inject
-class FtueAuthPersonalizationCompleteFragment @Inject constructor() : AbstractFtueAuthFragment() {
+@AndroidEntryPoint
+class FtueAuthPersonalizationCompleteFragment :
+ AbstractFtueAuthFragment() {
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentFtuePersonalizationCompleteBinding {
return FragmentFtuePersonalizationCompleteBinding.inflate(inflater, container, false)
diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthPhoneConfirmationFragment.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthPhoneConfirmationFragment.kt
index 39577efa19..af6c33c028 100644
--- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthPhoneConfirmationFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthPhoneConfirmationFragment.kt
@@ -22,6 +22,7 @@ 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.extensions.associateContentStateWith
import im.vector.app.core.extensions.clearErrorOnChange
@@ -32,14 +33,15 @@ import im.vector.app.features.onboarding.OnboardingAction
import im.vector.app.features.onboarding.RegisterAction
import kotlinx.parcelize.Parcelize
import org.matrix.android.sdk.api.failure.Failure
-import javax.inject.Inject
@Parcelize
data class FtueAuthPhoneConfirmationFragmentArgument(
val msisdn: String
) : Parcelable
-class FtueAuthPhoneConfirmationFragment @Inject constructor() : AbstractFtueAuthFragment() {
+@AndroidEntryPoint
+class FtueAuthPhoneConfirmationFragment :
+ AbstractFtueAuthFragment() {
private val params: FtueAuthPhoneConfirmationFragmentArgument by args()
diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthPhoneEntryFragment.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthPhoneEntryFragment.kt
index 32291ecb6e..620dd1293c 100644
--- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthPhoneEntryFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthPhoneEntryFragment.kt
@@ -21,6 +21,7 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.lifecycle.lifecycleScope
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.associateContentStateWith
import im.vector.app.core.extensions.autofillPhoneNumber
@@ -38,9 +39,11 @@ import org.matrix.android.sdk.api.auth.registration.RegisterThreePid
import reactivecircus.flowbinding.android.widget.textChanges
import javax.inject.Inject
-class FtueAuthPhoneEntryFragment @Inject constructor(
- private val phoneNumberParser: PhoneNumberParser
-) : AbstractFtueAuthFragment() {
+@AndroidEntryPoint
+class FtueAuthPhoneEntryFragment :
+ AbstractFtueAuthFragment() {
+
+ @Inject lateinit var phoneNumberParser: PhoneNumberParser
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentFtuePhoneInputBinding {
return FragmentFtuePhoneInputBinding.inflate(inflater, container, false)
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
index 721423ecdf..0daf1b3c6f 100644
--- 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
@@ -39,7 +39,8 @@ data class FtueAuthResetPasswordBreakerArgument(
) : Parcelable
@AndroidEntryPoint
-class FtueAuthResetPasswordBreakerFragment : AbstractFtueAuthFragment() {
+class FtueAuthResetPasswordBreakerFragment :
+ AbstractFtueAuthFragment() {
@Inject lateinit var themeProvider: ThemeProvider
private val params: FtueAuthResetPasswordBreakerArgument by args()
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
index 5fa1a8ed82..51c73a40e3 100644
--- 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
@@ -33,7 +33,8 @@ import im.vector.app.features.onboarding.OnboardingAction
import im.vector.app.features.onboarding.OnboardingViewState
@AndroidEntryPoint
-class FtueAuthResetPasswordEmailEntryFragment : AbstractFtueAuthFragment() {
+class FtueAuthResetPasswordEmailEntryFragment :
+ AbstractFtueAuthFragment() {
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentFtueResetPasswordEmailInputBinding {
return FragmentFtueResetPasswordEmailInputBinding.inflate(inflater, container, false)
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
index 61826352bf..0b0e06a0b0 100644
--- 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
@@ -34,7 +34,8 @@ import im.vector.app.features.onboarding.OnboardingViewState
import org.matrix.android.sdk.api.failure.isMissingEmailVerification
@AndroidEntryPoint
-class FtueAuthResetPasswordEntryFragment : AbstractFtueAuthFragment() {
+class FtueAuthResetPasswordEntryFragment :
+ AbstractFtueAuthFragment() {
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentFtueResetPasswordInputBinding {
return FragmentFtueResetPasswordInputBinding.inflate(inflater, container, false)
diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthResetPasswordFragment.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthResetPasswordFragment.kt
index 9bef084750..376218d474 100644
--- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthResetPasswordFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthResetPasswordFragment.kt
@@ -22,6 +22,7 @@ import android.view.View
import android.view.ViewGroup
import androidx.lifecycle.lifecycleScope
import com.google.android.material.dialog.MaterialAlertDialogBuilder
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.hideKeyboard
import im.vector.app.core.extensions.hidePassword
@@ -35,12 +36,13 @@ import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.onEach
import reactivecircus.flowbinding.android.widget.textChanges
-import javax.inject.Inject
/**
* In this screen, the user is asked for email and new password to reset his password.
*/
-class FtueAuthResetPasswordFragment @Inject constructor() : AbstractFtueAuthFragment() {
+@AndroidEntryPoint
+class FtueAuthResetPasswordFragment :
+ AbstractFtueAuthFragment() {
// Show warning only once
private var showWarning = true
diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthResetPasswordMailConfirmationFragment.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthResetPasswordMailConfirmationFragment.kt
index 76fbae6f40..301ed4fd8b 100644
--- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthResetPasswordMailConfirmationFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthResetPasswordMailConfirmationFragment.kt
@@ -21,17 +21,19 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.google.android.material.dialog.MaterialAlertDialogBuilder
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.databinding.FragmentLoginResetPasswordMailConfirmationBinding
import im.vector.app.features.onboarding.OnboardingAction
import im.vector.app.features.onboarding.OnboardingViewState
import org.matrix.android.sdk.api.failure.is401
-import javax.inject.Inject
/**
* In this screen, the user is asked to check their email and to click on a button once it's done.
*/
-class FtueAuthResetPasswordMailConfirmationFragment @Inject constructor() : AbstractFtueAuthFragment() {
+@AndroidEntryPoint
+class FtueAuthResetPasswordMailConfirmationFragment :
+ AbstractFtueAuthFragment() {
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentLoginResetPasswordMailConfirmationBinding {
return FragmentLoginResetPasswordMailConfirmationBinding.inflate(inflater, container, false)
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 956566a587..3e9881ec56 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
@@ -20,15 +20,17 @@ 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.databinding.FragmentLoginResetPasswordSuccessBinding
import im.vector.app.features.onboarding.OnboardingAction
import im.vector.app.features.onboarding.OnboardingViewEvents
-import javax.inject.Inject
/**
* In this screen, we confirm to the user that his password has been reset.
*/
-class FtueAuthResetPasswordSuccessFragment @Inject constructor() : AbstractFtueAuthFragment() {
+@AndroidEntryPoint
+class FtueAuthResetPasswordSuccessFragment :
+ AbstractFtueAuthFragment() {
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentLoginResetPasswordSuccessBinding {
return FragmentLoginResetPasswordSuccessBinding.inflate(inflater, container, false)
diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthServerSelectionFragment.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthServerSelectionFragment.kt
index d4396d81d2..9977152b5a 100644
--- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthServerSelectionFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthServerSelectionFragment.kt
@@ -20,6 +20,7 @@ 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.R
import im.vector.app.core.utils.openUrlInChromeCustomTab
import im.vector.app.databinding.FragmentLoginServerSelectionBinding
@@ -29,12 +30,13 @@ import im.vector.app.features.login.SignMode
import im.vector.app.features.onboarding.OnboardingAction
import im.vector.app.features.onboarding.OnboardingViewState
import me.gujun.android.span.span
-import javax.inject.Inject
/**
* In this screen, the user will choose between matrix.org, modular or other type of homeserver.
*/
-class FtueAuthServerSelectionFragment @Inject constructor() : AbstractFtueAuthFragment() {
+@AndroidEntryPoint
+class FtueAuthServerSelectionFragment :
+ AbstractFtueAuthFragment() {
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentLoginServerSelectionBinding {
return FragmentLoginServerSelectionBinding.inflate(inflater, container, false)
diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthServerUrlFormFragment.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthServerUrlFormFragment.kt
index b16ad3ee93..91f176edf5 100644
--- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthServerUrlFormFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthServerUrlFormFragment.kt
@@ -27,6 +27,7 @@ import androidx.core.view.isInvisible
import androidx.core.view.isVisible
import androidx.lifecycle.lifecycleScope
import com.google.android.material.textfield.TextInputLayout
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.hideKeyboard
import im.vector.app.core.resources.BuildMeta
@@ -47,9 +48,11 @@ import javax.inject.Inject
/**
* In this screen, the user is prompted to enter a homeserver url.
*/
-class FtueAuthServerUrlFormFragment @Inject constructor(
- private val buildMeta: BuildMeta,
-) : AbstractFtueAuthFragment() {
+@AndroidEntryPoint
+class FtueAuthServerUrlFormFragment :
+ AbstractFtueAuthFragment() {
+
+ @Inject lateinit var buildMeta: BuildMeta
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentLoginServerUrlFormBinding {
return FragmentLoginServerUrlFormBinding.inflate(inflater, container, false)
diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthSignUpSignInSelectionFragment.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthSignUpSignInSelectionFragment.kt
index dc4c6d8a34..b2f2eeb167 100644
--- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthSignUpSignInSelectionFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthSignUpSignInSelectionFragment.kt
@@ -23,6 +23,7 @@ import android.view.ViewGroup
import androidx.annotation.DrawableRes
import androidx.core.view.isVisible
import com.airbnb.mvrx.withState
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.toReducedUrl
import im.vector.app.databinding.FragmentLoginSignupSigninSelectionBinding
@@ -34,12 +35,13 @@ import im.vector.app.features.login.SocialLoginButtonsView.Mode
import im.vector.app.features.login.render
import im.vector.app.features.onboarding.OnboardingAction
import im.vector.app.features.onboarding.OnboardingViewState
-import javax.inject.Inject
/**
* In this screen, the user is asked to sign up or to sign in to the homeserver.
*/
-class FtueAuthSignUpSignInSelectionFragment @Inject constructor() : AbstractSSOFtueAuthFragment() {
+@AndroidEntryPoint
+class FtueAuthSignUpSignInSelectionFragment :
+ AbstractSSOFtueAuthFragment() {
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentLoginSignupSigninSelectionBinding {
return FragmentLoginSignupSigninSelectionBinding.inflate(inflater, container, false)
diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthSplashCarouselFragment.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthSplashCarouselFragment.kt
index 0333f6047b..f41bb4f547 100644
--- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthSplashCarouselFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthSplashCarouselFragment.kt
@@ -27,6 +27,7 @@ import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.lifecycleScope
import androidx.viewpager2.widget.ViewPager2
import com.google.android.material.tabs.TabLayoutMediator
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.incrementByOneAndWrap
import im.vector.app.core.extensions.setCurrentItem
@@ -44,13 +45,15 @@ import javax.inject.Inject
private const val CAROUSEL_ROTATION_DELAY_MS = 5000L
private const val CAROUSEL_TRANSITION_TIME_MS = 500L
-class FtueAuthSplashCarouselFragment @Inject constructor(
- private val vectorPreferences: VectorPreferences,
- private val vectorFeatures: VectorFeatures,
- private val carouselController: SplashCarouselController,
- private val carouselStateFactory: SplashCarouselStateFactory,
- private val buildMeta: BuildMeta,
-) : AbstractFtueAuthFragment() {
+@AndroidEntryPoint
+class FtueAuthSplashCarouselFragment :
+ AbstractFtueAuthFragment() {
+
+ @Inject lateinit var vectorPreferences: VectorPreferences
+ @Inject lateinit var vectorFeatures: VectorFeatures
+ @Inject lateinit var carouselController: SplashCarouselController
+ @Inject lateinit var carouselStateFactory: SplashCarouselStateFactory
+ @Inject lateinit var buildMeta: BuildMeta
private var tabLayoutMediator: TabLayoutMediator? = null
diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthSplashFragment.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthSplashFragment.kt
index a04e8a5c01..b62e72daee 100644
--- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthSplashFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthSplashFragment.kt
@@ -22,6 +22,7 @@ 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.R
import im.vector.app.core.resources.BuildMeta
import im.vector.app.databinding.FragmentFtueAuthSplashBinding
@@ -34,11 +35,13 @@ import javax.inject.Inject
/**
* In this screen, the user is viewing an introduction to what he can do with this application.
*/
-class FtueAuthSplashFragment @Inject constructor(
- private val vectorPreferences: VectorPreferences,
- private val vectorFeatures: VectorFeatures,
- private val buildMeta: BuildMeta,
-) : AbstractFtueAuthFragment() {
+@AndroidEntryPoint
+class FtueAuthSplashFragment :
+ AbstractFtueAuthFragment() {
+
+ @Inject lateinit var vectorPreferences: VectorPreferences
+ @Inject lateinit var vectorFeatures: VectorFeatures
+ @Inject lateinit var buildMeta: BuildMeta
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentFtueAuthSplashBinding {
return FragmentFtueAuthSplashBinding.inflate(inflater, container, false)
diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthUseCaseFragment.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthUseCaseFragment.kt
index 289aa811d6..da8aac1d54 100644
--- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthUseCaseFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthUseCaseFragment.kt
@@ -29,6 +29,7 @@ import androidx.annotation.DrawableRes
import androidx.annotation.StringRes
import androidx.core.content.ContextCompat
import androidx.core.view.isGone
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.getResTintedDrawable
import im.vector.app.core.extensions.getTintedDrawable
@@ -45,10 +46,12 @@ import javax.inject.Inject
private const val DARK_MODE_ICON_BACKGROUND_ALPHA = 0.30f
private const val LIGHT_MODE_ICON_BACKGROUND_ALPHA = 0.15f
-class FtueAuthUseCaseFragment @Inject constructor(
- private val themeProvider: ThemeProvider,
- private val vectorFeatures: VectorFeatures,
-) : AbstractFtueAuthFragment() {
+@AndroidEntryPoint
+class FtueAuthUseCaseFragment :
+ AbstractFtueAuthFragment() {
+
+ @Inject lateinit var themeProvider: ThemeProvider
+ @Inject lateinit var vectorFeatures: VectorFeatures
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentFtueAuthUseCaseBinding {
return FragmentFtueAuthUseCaseBinding.inflate(inflater, container, false)
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 601d577e02..f3767aa546 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
@@ -46,6 +46,7 @@ import im.vector.app.features.login.SignMode
import im.vector.app.features.login.TextInputFormFragmentMode
import im.vector.app.features.onboarding.OnboardingAction
import im.vector.app.features.onboarding.OnboardingActivity
+import im.vector.app.features.onboarding.OnboardingFlow
import im.vector.app.features.onboarding.OnboardingVariant
import im.vector.app.features.onboarding.OnboardingViewEvents
import im.vector.app.features.onboarding.OnboardingViewModel
@@ -213,7 +214,7 @@ class FtueAuthVariant(
option = commonOption
)
}
- OnboardingViewEvents.OpenCombinedRegister -> openStartCombinedRegister()
+ OnboardingViewEvents.OpenCombinedRegister -> onStartCombinedRegister()
is OnboardingViewEvents.OnAccountCreated -> onAccountCreated()
OnboardingViewEvents.OnAccountSignedIn -> onAccountSignedIn()
OnboardingViewEvents.OnChooseDisplayName -> onChooseDisplayName()
@@ -229,42 +230,47 @@ class FtueAuthVariant(
tag = FRAGMENT_EDIT_HOMESERVER_TAG
)
}
- OnboardingViewEvents.OnHomeserverEdited -> supportFragmentManager.popBackStack(
- FRAGMENT_EDIT_HOMESERVER_TAG,
- FragmentManager.POP_BACK_STACK_INCLUSIVE
- )
+ OnboardingViewEvents.OnHomeserverEdited -> {
+ supportFragmentManager.popBackStack(
+ FRAGMENT_EDIT_HOMESERVER_TAG,
+ FragmentManager.POP_BACK_STACK_INCLUSIVE
+ )
+ ensureEditServerBackstack()
+ }
OnboardingViewEvents.OpenCombinedLogin -> onStartCombinedLogin()
- is OnboardingViewEvents.DeeplinkAuthenticationFailure -> onDeeplinkedHomeserverUnavailable(viewEvents)
OnboardingViewEvents.DisplayRegistrationFallback -> displayFallbackWebDialog()
is OnboardingViewEvents.DisplayRegistrationStage -> doStage(viewEvents.stage)
OnboardingViewEvents.DisplayStartRegistration -> when {
- vectorFeatures.isOnboardingCombinedRegisterEnabled() -> openStartCombinedRegister()
+ vectorFeatures.isOnboardingCombinedRegisterEnabled() -> onStartCombinedRegister()
else -> openAuthLoginFragmentWithTag(FRAGMENT_REGISTRATION_STAGE_TAG)
}
}
}
- private fun onDeeplinkedHomeserverUnavailable(viewEvents: OnboardingViewEvents.DeeplinkAuthenticationFailure) {
- showHomeserverUnavailableDialog(onboardingViewModel.getInitialHomeServerUrl().orEmpty()) {
- onboardingViewModel.handle(OnboardingAction.ResetDeeplinkConfig)
- onboardingViewModel.handle(viewEvents.retryAction)
+ private fun ensureEditServerBackstack() {
+ when (activity.supportFragmentManager.findFragmentById(views.loginFragmentContainer.id)) {
+ is FtueAuthCombinedLoginFragment,
+ is FtueAuthCombinedRegisterFragment -> {
+ // do nothing
+ }
+ else -> {
+ withState(onboardingViewModel) { state ->
+ when (state.onboardingFlow) {
+ OnboardingFlow.SignIn -> onStartCombinedLogin()
+ OnboardingFlow.SignUp -> onStartCombinedRegister()
+ OnboardingFlow.SignInSignUp,
+ null -> error("${state.onboardingFlow} does not support editing server url")
+ }
+ }
+ }
}
}
- private fun showHomeserverUnavailableDialog(url: String, action: () -> Unit) {
- MaterialAlertDialogBuilder(activity)
- .setTitle(R.string.dialog_title_error)
- .setMessage(activity.getString(R.string.login_error_homeserver_from_url_not_found, url))
- .setPositiveButton(R.string.login_error_homeserver_from_url_not_found_enter_manual) { _, _ -> action() }
- .setNegativeButton(R.string.action_cancel, null)
- .show()
- }
-
private fun onStartCombinedLogin() {
addRegistrationStageFragmentToBackstack(FtueAuthCombinedLoginFragment::class.java, allowStateLoss = true)
}
- private fun openStartCombinedRegister() {
+ private fun onStartCombinedRegister() {
addRegistrationStageFragmentToBackstack(FtueAuthCombinedRegisterFragment::class.java, allowStateLoss = true)
}
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 eb00dc3e21..ddd662be86 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
@@ -23,6 +23,7 @@ import android.view.View
import android.view.ViewGroup
import androidx.core.view.isInvisible
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.FragmentFtueWaitForEmailVerificationBinding
@@ -42,9 +43,11 @@ data class FtueAuthWaitForEmailFragmentArgument(
/**
* In this screen, the user is asked to check their emails.
*/
-class FtueAuthWaitForEmailFragment @Inject constructor(
- private val themeProvider: ThemeProvider
-) : AbstractFtueAuthFragment() {
+@AndroidEntryPoint
+class FtueAuthWaitForEmailFragment :
+ AbstractFtueAuthFragment() {
+
+ @Inject lateinit var themeProvider: ThemeProvider
private val params: FtueAuthWaitForEmailFragmentArgument by args()
private var inferHasLeftAndReturnedToScreen = false
diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthWebFragment.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthWebFragment.kt
index 9e32ec263c..62a89e437b 100644
--- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthWebFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthWebFragment.kt
@@ -31,6 +31,7 @@ import android.webkit.SslErrorHandler
import android.webkit.WebView
import android.webkit.WebViewClient
import com.google.android.material.dialog.MaterialAlertDialogBuilder
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.utils.AssetReader
import im.vector.app.databinding.FragmentLoginWebBinding
@@ -49,9 +50,11 @@ import javax.inject.Inject
* This screen is displayed when the application does not support login flow or registration flow
* of the homeserver, as a fallback to login or to create an account.
*/
-class FtueAuthWebFragment @Inject constructor(
- private val assetReader: AssetReader
-) : AbstractFtueAuthFragment() {
+@AndroidEntryPoint
+class FtueAuthWebFragment :
+ AbstractFtueAuthFragment() {
+
+ @Inject lateinit var assetReader: AssetReader
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentLoginWebBinding {
return FragmentLoginWebBinding.inflate(inflater, container, false)
diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/terms/FtueAuthLegacyStyleTermsFragment.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/terms/FtueAuthLegacyStyleTermsFragment.kt
index af38062663..1b5c1adc74 100755
--- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/terms/FtueAuthLegacyStyleTermsFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/terms/FtueAuthLegacyStyleTermsFragment.kt
@@ -22,6 +22,7 @@ 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.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith
import im.vector.app.core.extensions.toReducedUrl
@@ -46,11 +47,13 @@ data class FtueAuthTermsLegacyStyleFragmentArgument(
/**
* LoginTermsFragment displays the list of policies the user has to accept.
*/
-class FtueAuthLegacyStyleTermsFragment @Inject constructor(
- private val policyController: PolicyController
-) : AbstractFtueAuthFragment(),
+@AndroidEntryPoint
+class FtueAuthLegacyStyleTermsFragment :
+ AbstractFtueAuthFragment(),
PolicyController.PolicyControllerListener {
+ @Inject lateinit var policyController: PolicyController
+
private val params: FtueAuthTermsLegacyStyleFragmentArgument by args()
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentLoginTermsBinding {
diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/terms/FtueAuthTermsFragment.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/terms/FtueAuthTermsFragment.kt
index 371c618d54..e9b32a1c7f 100644
--- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/terms/FtueAuthTermsFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/terms/FtueAuthTermsFragment.kt
@@ -23,6 +23,7 @@ import android.view.ViewGroup
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.view.doOnLayout
import com.airbnb.mvrx.args
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith
@@ -43,11 +44,13 @@ import kotlin.math.roundToInt
/**
* LoginTermsFragment displays the list of policies the user has to accept.
*/
-class FtueAuthTermsFragment @Inject constructor(
- private val policyController: PolicyController
-) : AbstractFtueAuthFragment(),
+@AndroidEntryPoint
+class FtueAuthTermsFragment :
+ AbstractFtueAuthFragment(),
PolicyController.PolicyControllerListener {
+ @Inject lateinit var policyController: PolicyController
+
private val params: FtueAuthTermsLegacyStyleFragmentArgument by args()
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentFtueLoginTermsBinding {
diff --git a/vector/src/main/java/im/vector/app/features/pin/PinFragment.kt b/vector/src/main/java/im/vector/app/features/pin/PinFragment.kt
index 1688452167..3a3a0e66fd 100644
--- a/vector/src/main/java/im/vector/app/features/pin/PinFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/pin/PinFragment.kt
@@ -26,6 +26,7 @@ import android.widget.Toast
import com.airbnb.mvrx.args
import com.airbnb.mvrx.asMavericksArgs
import com.google.android.material.dialog.MaterialAlertDialogBuilder
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.replaceFragment
import im.vector.app.core.platform.VectorBaseFragment
@@ -49,11 +50,13 @@ data class PinArgs(
val pinMode: PinMode
) : Parcelable
-class PinFragment @Inject constructor(
- private val pinCodeStore: PinCodeStore,
- private val vectorPreferences: VectorPreferences,
- private val defaultConfiguration: LockScreenConfiguration,
-) : VectorBaseFragment() {
+@AndroidEntryPoint
+class PinFragment :
+ VectorBaseFragment() {
+
+ @Inject lateinit var pinCodeStore: PinCodeStore
+ @Inject lateinit var vectorPreferences: VectorPreferences
+ @Inject lateinit var defaultConfiguration: LockScreenConfiguration
private val fragmentArgs: PinArgs by args()
diff --git a/vector/src/main/java/im/vector/app/features/pin/lockscreen/ui/LockScreenFragment.kt b/vector/src/main/java/im/vector/app/features/pin/lockscreen/ui/LockScreenFragment.kt
index a7a228a105..8e9fdf4fae 100644
--- a/vector/src/main/java/im/vector/app/features/pin/lockscreen/ui/LockScreenFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/pin/lockscreen/ui/LockScreenFragment.kt
@@ -35,7 +35,8 @@ import im.vector.app.features.pin.lockscreen.configuration.LockScreenMode
import im.vector.app.features.pin.lockscreen.views.LockScreenCodeView
@AndroidEntryPoint
-class LockScreenFragment : VectorBaseFragment() {
+class LockScreenFragment :
+ VectorBaseFragment() {
var lockScreenListener: LockScreenListener? = null
var onLeftButtonClickedListener: View.OnClickListener? = null
diff --git a/vector/src/main/java/im/vector/app/features/poll/create/CreatePollFragment.kt b/vector/src/main/java/im/vector/app/features/poll/create/CreatePollFragment.kt
index 0feef3b5e5..848b27009b 100644
--- a/vector/src/main/java/im/vector/app/features/poll/create/CreatePollFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/poll/create/CreatePollFragment.kt
@@ -25,6 +25,7 @@ import androidx.core.view.isVisible
import com.airbnb.mvrx.activityViewModel
import com.airbnb.mvrx.args
import com.airbnb.mvrx.withState
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.configureWith
import im.vector.app.core.platform.VectorBaseFragment
@@ -42,9 +43,12 @@ data class CreatePollArgs(
val mode: PollMode
) : Parcelable
-class CreatePollFragment @Inject constructor(
- private val controller: CreatePollController
-) : VectorBaseFragment(), CreatePollController.Callback {
+@AndroidEntryPoint
+class CreatePollFragment :
+ VectorBaseFragment(),
+ CreatePollController.Callback {
+
+ @Inject lateinit var controller: CreatePollController
private val viewModel: CreatePollViewModel by activityViewModel()
private val args: CreatePollArgs by args()
diff --git a/vector/src/main/java/im/vector/app/features/qrcode/QrCodeScannerFragment.kt b/vector/src/main/java/im/vector/app/features/qrcode/QrCodeScannerFragment.kt
index 9dc7fa6548..c2b81abf12 100644
--- a/vector/src/main/java/im/vector/app/features/qrcode/QrCodeScannerFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/qrcode/QrCodeScannerFragment.kt
@@ -30,6 +30,7 @@ import com.airbnb.mvrx.args
import com.google.zxing.BarcodeFormat
import com.google.zxing.Result
import com.google.zxing.ResultMetadataType
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.hideKeyboard
import im.vector.app.core.extensions.registerStartForActivityResult
@@ -45,7 +46,6 @@ import im.vector.lib.multipicker.utils.ImageUtils
import kotlinx.parcelize.Parcelize
import me.dm7.barcodescanner.zxing.ZXingScannerView
import org.matrix.android.sdk.api.extensions.tryOrNull
-import javax.inject.Inject
@Parcelize
data class QrScannerArgs(
@@ -53,7 +53,10 @@ data class QrScannerArgs(
@StringRes val titleRes: Int
) : Parcelable
-class QrCodeScannerFragment @Inject constructor() : VectorBaseFragment(), ZXingScannerView.ResultHandler {
+@AndroidEntryPoint
+class QrCodeScannerFragment :
+ VectorBaseFragment(),
+ ZXingScannerView.ResultHandler {
private val qrViewModel: QrCodeScannerViewModel by activityViewModel()
private val scannerArgs: QrScannerArgs by args()
diff --git a/vector/src/main/java/im/vector/app/features/reactions/EmojiChooserFragment.kt b/vector/src/main/java/im/vector/app/features/reactions/EmojiChooserFragment.kt
index bcc18a995a..24065645ea 100644
--- a/vector/src/main/java/im/vector/app/features/reactions/EmojiChooserFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/reactions/EmojiChooserFragment.kt
@@ -20,17 +20,20 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.lifecycle.lifecycleScope
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.core.extensions.cleanup
import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.databinding.EmojiChooserFragmentBinding
import javax.inject.Inject
-class EmojiChooserFragment @Inject constructor(
- private val emojiRecyclerAdapter: EmojiRecyclerAdapter
-) : VectorBaseFragment(),
+@AndroidEntryPoint
+class EmojiChooserFragment :
+ VectorBaseFragment(),
EmojiRecyclerAdapter.InteractionListener,
ReactionClickListener {
+ @Inject lateinit var emojiRecyclerAdapter: EmojiRecyclerAdapter
+
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): EmojiChooserFragmentBinding {
return EmojiChooserFragmentBinding.inflate(inflater, container, false)
}
diff --git a/vector/src/main/java/im/vector/app/features/reactions/EmojiSearchResultFragment.kt b/vector/src/main/java/im/vector/app/features/reactions/EmojiSearchResultFragment.kt
index 9292ad8fc6..3a448185ac 100644
--- a/vector/src/main/java/im/vector/app/features/reactions/EmojiSearchResultFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/reactions/EmojiSearchResultFragment.kt
@@ -21,6 +21,7 @@ import android.view.View
import android.view.ViewGroup
import com.airbnb.mvrx.activityViewModel
import com.airbnb.mvrx.withState
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith
@@ -29,9 +30,12 @@ import im.vector.app.core.utils.LiveEvent
import im.vector.app.databinding.FragmentGenericRecyclerBinding
import javax.inject.Inject
-class EmojiSearchResultFragment @Inject constructor(
- private val epoxyController: EmojiSearchResultController
-) : VectorBaseFragment(), ReactionClickListener {
+@AndroidEntryPoint
+class EmojiSearchResultFragment :
+ VectorBaseFragment(),
+ ReactionClickListener {
+
+ @Inject lateinit var epoxyController: EmojiSearchResultController
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentGenericRecyclerBinding {
return FragmentGenericRecyclerBinding.inflate(inflater, container, false)
diff --git a/vector/src/main/java/im/vector/app/features/roomdirectory/PublicRoomsFragment.kt b/vector/src/main/java/im/vector/app/features/roomdirectory/PublicRoomsFragment.kt
index e16e1ec313..847c675c5e 100644
--- a/vector/src/main/java/im/vector/app/features/roomdirectory/PublicRoomsFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/roomdirectory/PublicRoomsFragment.kt
@@ -25,6 +25,7 @@ import android.view.ViewGroup
import androidx.lifecycle.lifecycleScope
import com.airbnb.mvrx.activityViewModel
import com.airbnb.mvrx.withState
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith
@@ -51,14 +52,16 @@ import javax.inject.Inject
* What can be improved:
* - When filtering more (when entering new chars), we could filter on result we already have, during the new server request, to avoid empty screen effect.
*/
-class PublicRoomsFragment @Inject constructor(
- private val publicRoomsController: PublicRoomsController,
- private val permalinkHandler: PermalinkHandler,
- private val session: Session
-) : VectorBaseFragment(),
+@AndroidEntryPoint
+class PublicRoomsFragment :
+ VectorBaseFragment(),
PublicRoomsController.Callback,
VectorMenuProvider {
+ @Inject lateinit var publicRoomsController: PublicRoomsController
+ @Inject lateinit var permalinkHandler: PermalinkHandler
+ @Inject lateinit var session: Session
+
private val viewModel: RoomDirectoryViewModel by activityViewModel()
private lateinit var sharedActionViewModel: RoomDirectorySharedActionViewModel
diff --git a/vector/src/main/java/im/vector/app/features/roomdirectory/createroom/CreateRoomFragment.kt b/vector/src/main/java/im/vector/app/features/roomdirectory/createroom/CreateRoomFragment.kt
index 649ba8fd13..f4c3e515c5 100644
--- a/vector/src/main/java/im/vector/app/features/roomdirectory/createroom/CreateRoomFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/roomdirectory/createroom/CreateRoomFragment.kt
@@ -30,14 +30,14 @@ import com.airbnb.mvrx.args
import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState
import com.google.android.material.dialog.MaterialAlertDialogBuilder
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.dialogs.GalleryOrCameraDialogHelper
+import im.vector.app.core.dialogs.GalleryOrCameraDialogHelperFactory
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.time.Clock
import im.vector.app.databinding.FragmentCreateRoomBinding
import im.vector.app.features.analytics.plan.ViewRoom
import im.vector.app.features.navigation.Navigator
@@ -61,28 +61,34 @@ data class CreateRoomArgs(
val openAfterCreate: Boolean = true
) : Parcelable
-class CreateRoomFragment @Inject constructor(
- private val createRoomController: CreateRoomController,
- private val createSpaceController: CreateSubSpaceController,
- colorProvider: ColorProvider,
- clock: Clock,
-) : VectorBaseFragment(),
+@AndroidEntryPoint
+class CreateRoomFragment :
+ VectorBaseFragment(),
CreateRoomController.Listener,
GalleryOrCameraDialogHelper.Listener,
OnBackPressed {
+ @Inject lateinit var createRoomController: CreateRoomController
+ @Inject lateinit var createSpaceController: CreateSubSpaceController
+ @Inject lateinit var galleryOrCameraDialogHelperFactory: GalleryOrCameraDialogHelperFactory
+
private lateinit var sharedActionViewModel: RoomDirectorySharedActionViewModel
private val viewModel: CreateRoomViewModel by fragmentViewModel()
private val args: CreateRoomArgs by args()
private lateinit var roomJoinRuleSharedActionViewModel: RoomJoinRuleSharedActionViewModel
- private val galleryOrCameraDialogHelper = GalleryOrCameraDialogHelper(this, colorProvider, clock)
+ private lateinit var galleryOrCameraDialogHelper: GalleryOrCameraDialogHelper
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentCreateRoomBinding {
return FragmentCreateRoomBinding.inflate(inflater, container, false)
}
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ galleryOrCameraDialogHelper = galleryOrCameraDialogHelperFactory.create(this)
+ }
+
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
sharedActionViewModel = activityViewModelProvider.get(RoomDirectorySharedActionViewModel::class.java)
diff --git a/vector/src/main/java/im/vector/app/features/roomdirectory/picker/RoomDirectoryPickerFragment.kt b/vector/src/main/java/im/vector/app/features/roomdirectory/picker/RoomDirectoryPickerFragment.kt
index 66e09bb2d4..32be4e076f 100644
--- a/vector/src/main/java/im/vector/app/features/roomdirectory/picker/RoomDirectoryPickerFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/roomdirectory/picker/RoomDirectoryPickerFragment.kt
@@ -23,6 +23,7 @@ import android.view.ViewGroup
import com.airbnb.mvrx.activityViewModel
import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith
@@ -39,12 +40,14 @@ import im.vector.app.features.roomdirectory.RoomDirectoryViewModel
import timber.log.Timber
import javax.inject.Inject
-class RoomDirectoryPickerFragment @Inject constructor(
- private val roomDirectoryPickerController: RoomDirectoryPickerController
-) : VectorBaseFragment(),
+@AndroidEntryPoint
+class RoomDirectoryPickerFragment :
+ VectorBaseFragment(),
OnBackPressed,
RoomDirectoryPickerController.Callback {
+ @Inject lateinit var roomDirectoryPickerController: RoomDirectoryPickerController
+
private val viewModel: RoomDirectoryViewModel by activityViewModel()
private lateinit var sharedActionViewModel: RoomDirectorySharedActionViewModel
private val pickerViewModel: RoomDirectoryPickerViewModel by fragmentViewModel()
diff --git a/vector/src/main/java/im/vector/app/features/roomdirectory/roompreview/RoomPreviewNoPreviewFragment.kt b/vector/src/main/java/im/vector/app/features/roomdirectory/roompreview/RoomPreviewNoPreviewFragment.kt
index 826dea0c3b..7c639dde99 100644
--- a/vector/src/main/java/im/vector/app/features/roomdirectory/roompreview/RoomPreviewNoPreviewFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/roomdirectory/roompreview/RoomPreviewNoPreviewFragment.kt
@@ -30,6 +30,7 @@ import com.airbnb.mvrx.Success
import com.airbnb.mvrx.args
import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.setTextOrHide
import im.vector.app.core.platform.ButtonStateView
@@ -52,9 +53,11 @@ import javax.inject.Inject
/**
* Note: this Fragment is also used for world readable room for the moment.
*/
-class RoomPreviewNoPreviewFragment @Inject constructor(
- private val avatarRenderer: AvatarRenderer
-) : VectorBaseFragment() {
+@AndroidEntryPoint
+class RoomPreviewNoPreviewFragment :
+ VectorBaseFragment() {
+
+ @Inject lateinit var avatarRenderer: AvatarRenderer
private val roomPreviewViewModel: RoomPreviewViewModel by fragmentViewModel()
private val roomPreviewData: RoomPreviewData by args()
diff --git a/vector/src/main/java/im/vector/app/features/roommemberprofile/RoomMemberProfileFragment.kt b/vector/src/main/java/im/vector/app/features/roommemberprofile/RoomMemberProfileFragment.kt
index 686c87a18c..2894cd4621 100644
--- a/vector/src/main/java/im/vector/app/features/roommemberprofile/RoomMemberProfileFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/roommemberprofile/RoomMemberProfileFragment.kt
@@ -32,6 +32,7 @@ import com.airbnb.mvrx.args
import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState
import com.google.android.material.dialog.MaterialAlertDialogBuilder
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.animations.AppBarStateChangeListener
import im.vector.app.core.animations.MatrixItemAppBarStateChangeListener
@@ -69,15 +70,17 @@ data class RoomMemberProfileArgs(
val roomId: String? = null
) : Parcelable
-class RoomMemberProfileFragment @Inject constructor(
- private val roomMemberProfileController: RoomMemberProfileController,
- private val avatarRenderer: AvatarRenderer,
- private val roomDetailPendingActionStore: RoomDetailPendingActionStore,
- private val matrixItemColorProvider: MatrixItemColorProvider
-) : VectorBaseFragment(),
+@AndroidEntryPoint
+class RoomMemberProfileFragment :
+ VectorBaseFragment(),
RoomMemberProfileController.Callback,
VectorMenuProvider {
+ @Inject lateinit var roomMemberProfileController: RoomMemberProfileController
+ @Inject lateinit var avatarRenderer: AvatarRenderer
+ @Inject lateinit var roomDetailPendingActionStore: RoomDetailPendingActionStore
+ @Inject lateinit var matrixItemColorProvider: MatrixItemColorProvider
+
private lateinit var headerViews: ViewStubRoomMemberProfileHeaderBinding
private val fragmentArgs: RoomMemberProfileArgs by args()
diff --git a/vector/src/main/java/im/vector/app/features/roommemberprofile/devices/DeviceListFragment.kt b/vector/src/main/java/im/vector/app/features/roommemberprofile/devices/DeviceListFragment.kt
index 48a8a819bc..7ca32bb49b 100644
--- a/vector/src/main/java/im/vector/app/features/roommemberprofile/devices/DeviceListFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/roommemberprofile/devices/DeviceListFragment.kt
@@ -22,6 +22,7 @@ import android.view.View
import android.view.ViewGroup
import com.airbnb.mvrx.parentFragmentViewModel
import com.airbnb.mvrx.withState
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith
import im.vector.app.core.platform.VectorBaseFragment
@@ -30,12 +31,14 @@ import im.vector.app.databinding.BottomSheetGenericListBinding
import org.matrix.android.sdk.api.session.crypto.model.CryptoDeviceInfo
import javax.inject.Inject
-class DeviceListFragment @Inject constructor(
- val dimensionConverter: DimensionConverter,
- val epoxyController: DeviceListEpoxyController
-) : VectorBaseFragment(),
+@AndroidEntryPoint
+class DeviceListFragment :
+ VectorBaseFragment(),
DeviceListEpoxyController.InteractionListener {
+ @Inject lateinit var dimensionConverter: DimensionConverter
+ @Inject lateinit var epoxyController: DeviceListEpoxyController
+
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): BottomSheetGenericListBinding {
return BottomSheetGenericListBinding.inflate(inflater, container, false)
}
diff --git a/vector/src/main/java/im/vector/app/features/roommemberprofile/devices/DeviceTrustInfoActionFragment.kt b/vector/src/main/java/im/vector/app/features/roommemberprofile/devices/DeviceTrustInfoActionFragment.kt
index a733197372..d8abd91091 100644
--- a/vector/src/main/java/im/vector/app/features/roommemberprofile/devices/DeviceTrustInfoActionFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/roommemberprofile/devices/DeviceTrustInfoActionFragment.kt
@@ -22,6 +22,7 @@ import android.view.View
import android.view.ViewGroup
import com.airbnb.mvrx.parentFragmentViewModel
import com.airbnb.mvrx.withState
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith
import im.vector.app.core.platform.VectorBaseFragment
@@ -30,12 +31,14 @@ import im.vector.app.databinding.BottomSheetGenericListBinding
import org.matrix.android.sdk.api.session.crypto.model.CryptoDeviceInfo
import javax.inject.Inject
-class DeviceTrustInfoActionFragment @Inject constructor(
- val dimensionConverter: DimensionConverter,
- val epoxyController: DeviceTrustInfoEpoxyController
-) : VectorBaseFragment(),
+@AndroidEntryPoint
+class DeviceTrustInfoActionFragment :
+ VectorBaseFragment(),
DeviceTrustInfoEpoxyController.InteractionListener {
+ @Inject lateinit var dimensionConverter: DimensionConverter
+ @Inject lateinit var epoxyController: DeviceTrustInfoEpoxyController
+
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): BottomSheetGenericListBinding {
return BottomSheetGenericListBinding.inflate(inflater, container, false)
}
diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileFragment.kt b/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileFragment.kt
index 1830cc04e8..4135ab3d1c 100644
--- a/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileFragment.kt
@@ -31,6 +31,7 @@ import com.airbnb.mvrx.args
import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState
import com.google.android.material.dialog.MaterialAlertDialogBuilder
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.animations.AppBarStateChangeListener
import im.vector.app.core.animations.MatrixItemAppBarStateChangeListener
@@ -65,15 +66,16 @@ data class RoomProfileArgs(
val roomId: String
) : Parcelable
-class RoomProfileFragment @Inject constructor(
- private val roomProfileController: RoomProfileController,
- private val avatarRenderer: AvatarRenderer,
- private val roomDetailPendingActionStore: RoomDetailPendingActionStore,
-) :
+@AndroidEntryPoint
+class RoomProfileFragment :
VectorBaseFragment(),
RoomProfileController.Callback,
VectorMenuProvider {
+ @Inject lateinit var roomProfileController: RoomProfileController
+ @Inject lateinit var avatarRenderer: AvatarRenderer
+ @Inject lateinit var roomDetailPendingActionStore: RoomDetailPendingActionStore
+
private lateinit var headerViews: ViewStubRoomProfileHeaderBinding
private val roomProfileArgs: RoomProfileArgs by args()
diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/alias/RoomAliasFragment.kt b/vector/src/main/java/im/vector/app/features/roomprofile/alias/RoomAliasFragment.kt
index 49f658861b..b9b0f604c7 100644
--- a/vector/src/main/java/im/vector/app/features/roomprofile/alias/RoomAliasFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/roomprofile/alias/RoomAliasFragment.kt
@@ -26,6 +26,7 @@ import com.airbnb.mvrx.args
import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState
import com.google.android.material.dialog.MaterialAlertDialogBuilder
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith
@@ -46,13 +47,14 @@ import org.matrix.android.sdk.api.session.room.model.RoomDirectoryVisibility
import org.matrix.android.sdk.api.util.toMatrixItem
import javax.inject.Inject
-class RoomAliasFragment @Inject constructor(
- private val controller: RoomAliasController,
- private val avatarRenderer: AvatarRenderer
-) :
+@AndroidEntryPoint
+class RoomAliasFragment :
VectorBaseFragment(),
RoomAliasController.Callback {
+ @Inject lateinit var controller: RoomAliasController
+ @Inject lateinit var avatarRenderer: AvatarRenderer
+
private val viewModel: RoomAliasViewModel by fragmentViewModel()
private lateinit var sharedActionViewModel: RoomAliasBottomSheetSharedActionViewModel
diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/banned/RoomBannedMemberListFragment.kt b/vector/src/main/java/im/vector/app/features/roomprofile/banned/RoomBannedMemberListFragment.kt
index 8063212ba1..a8e34d0117 100644
--- a/vector/src/main/java/im/vector/app/features/roomprofile/banned/RoomBannedMemberListFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/roomprofile/banned/RoomBannedMemberListFragment.kt
@@ -26,6 +26,7 @@ import com.airbnb.mvrx.args
import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState
import com.google.android.material.dialog.MaterialAlertDialogBuilder
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith
@@ -38,12 +39,14 @@ import org.matrix.android.sdk.api.session.room.model.RoomMemberSummary
import org.matrix.android.sdk.api.util.toMatrixItem
import javax.inject.Inject
-class RoomBannedMemberListFragment @Inject constructor(
- private val roomMemberListController: RoomBannedMemberListController,
- private val avatarRenderer: AvatarRenderer
-) : VectorBaseFragment(),
+@AndroidEntryPoint
+class RoomBannedMemberListFragment :
+ VectorBaseFragment(),
RoomBannedMemberListController.Callback {
+ @Inject lateinit var roomMemberListController: RoomBannedMemberListController
+ @Inject lateinit var avatarRenderer: AvatarRenderer
+
private val viewModel: RoomBannedMemberListViewModel by fragmentViewModel()
private val roomProfileArgs: RoomProfileArgs by args()
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 52a2339f13..259fde1635 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
@@ -28,6 +28,7 @@ import com.airbnb.mvrx.args
import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState
import com.google.android.material.dialog.MaterialAlertDialogBuilder
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith
@@ -43,12 +44,14 @@ import org.matrix.android.sdk.api.session.room.model.RoomThirdPartyInviteContent
import org.matrix.android.sdk.api.util.toMatrixItem
import javax.inject.Inject
-class RoomMemberListFragment @Inject constructor(
- private val roomMemberListController: RoomMemberListController,
- private val avatarRenderer: AvatarRenderer
-) : VectorBaseFragment(),
+@AndroidEntryPoint
+class RoomMemberListFragment :
+ VectorBaseFragment(),
RoomMemberListController.Callback {
+ @Inject lateinit var roomMemberListController: RoomMemberListController
+ @Inject lateinit var avatarRenderer: AvatarRenderer
+
private val viewModel: RoomMemberListViewModel by fragmentViewModel()
private val roomProfileArgs: RoomProfileArgs by args()
diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/notifications/RoomNotificationSettingsFragment.kt b/vector/src/main/java/im/vector/app/features/roomprofile/notifications/RoomNotificationSettingsFragment.kt
index 1bf392d9f8..7afd696332 100644
--- a/vector/src/main/java/im/vector/app/features/roomprofile/notifications/RoomNotificationSettingsFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/roomprofile/notifications/RoomNotificationSettingsFragment.kt
@@ -23,6 +23,7 @@ import android.view.ViewGroup
import androidx.core.view.isVisible
import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith
@@ -35,13 +36,15 @@ import org.matrix.android.sdk.api.session.room.notification.RoomNotificationStat
import org.matrix.android.sdk.api.util.toMatrixItem
import javax.inject.Inject
-class RoomNotificationSettingsFragment @Inject constructor(
- val viewModelFactory: RoomNotificationSettingsViewModel.Factory,
- private val roomNotificationSettingsController: RoomNotificationSettingsController,
- private val avatarRenderer: AvatarRenderer
-) : VectorBaseFragment(),
+@AndroidEntryPoint
+class RoomNotificationSettingsFragment :
+ VectorBaseFragment(),
RoomNotificationSettingsController.Callback {
+ @Inject lateinit var viewModelFactory: RoomNotificationSettingsViewModel.Factory
+ @Inject lateinit var roomNotificationSettingsController: RoomNotificationSettingsController
+ @Inject lateinit var avatarRenderer: AvatarRenderer
+
private val viewModel: RoomNotificationSettingsViewModel by fragmentViewModel()
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentRoomSettingGenericBinding {
diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/permissions/RoomPermissionsFragment.kt b/vector/src/main/java/im/vector/app/features/roomprofile/permissions/RoomPermissionsFragment.kt
index dc42310c16..06b9343dbf 100644
--- a/vector/src/main/java/im/vector/app/features/roomprofile/permissions/RoomPermissionsFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/roomprofile/permissions/RoomPermissionsFragment.kt
@@ -24,6 +24,7 @@ import androidx.core.view.isVisible
import com.airbnb.mvrx.args
import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith
@@ -38,13 +39,14 @@ import org.matrix.android.sdk.api.session.room.powerlevels.Role
import org.matrix.android.sdk.api.util.toMatrixItem
import javax.inject.Inject
-class RoomPermissionsFragment @Inject constructor(
- private val controller: RoomPermissionsController,
- private val avatarRenderer: AvatarRenderer
-) :
+@AndroidEntryPoint
+class RoomPermissionsFragment :
VectorBaseFragment(),
RoomPermissionsController.Callback {
+ @Inject lateinit var controller: RoomPermissionsController
+ @Inject lateinit var avatarRenderer: AvatarRenderer
+
private val viewModel: RoomPermissionsViewModel by fragmentViewModel()
private val roomProfileArgs: RoomProfileArgs by args()
diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/settings/RoomSettingsFragment.kt b/vector/src/main/java/im/vector/app/features/roomprofile/settings/RoomSettingsFragment.kt
index 45c8461fa7..ba50890db3 100644
--- a/vector/src/main/java/im/vector/app/features/roomprofile/settings/RoomSettingsFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/roomprofile/settings/RoomSettingsFragment.kt
@@ -29,16 +29,16 @@ import com.airbnb.mvrx.args
import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState
import com.google.android.material.dialog.MaterialAlertDialogBuilder
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.dialogs.GalleryOrCameraDialogHelper
+import im.vector.app.core.dialogs.GalleryOrCameraDialogHelperFactory
import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith
import im.vector.app.core.intent.getFilenameFromUri
import im.vector.app.core.platform.OnBackPressed
import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.core.platform.VectorMenuProvider
-import im.vector.app.core.resources.ColorProvider
-import im.vector.app.core.time.Clock
import im.vector.app.core.utils.toast
import im.vector.app.databinding.FragmentRoomSettingGenericBinding
import im.vector.app.features.analytics.plan.MobileScreen
@@ -56,25 +56,25 @@ import org.matrix.android.sdk.api.util.toMatrixItem
import java.util.UUID
import javax.inject.Inject
-class RoomSettingsFragment @Inject constructor(
- private val controller: RoomSettingsController,
- colorProvider: ColorProvider,
- private val avatarRenderer: AvatarRenderer,
- clock: Clock,
-) :
+@AndroidEntryPoint
+class RoomSettingsFragment :
VectorBaseFragment(),
RoomSettingsController.Callback,
OnBackPressed,
GalleryOrCameraDialogHelper.Listener,
VectorMenuProvider {
+ @Inject lateinit var controller: RoomSettingsController
+ @Inject lateinit var avatarRenderer: AvatarRenderer
+ @Inject lateinit var galleryOrCameraDialogHelperFactory: GalleryOrCameraDialogHelperFactory
+
private val viewModel: RoomSettingsViewModel by fragmentViewModel()
private lateinit var roomProfileSharedActionViewModel: RoomProfileSharedActionViewModel
private lateinit var roomHistoryVisibilitySharedActionViewModel: RoomHistoryVisibilitySharedActionViewModel
private lateinit var roomJoinRuleSharedActionViewModel: RoomJoinRuleSharedActionViewModel
private val roomProfileArgs: RoomProfileArgs by args()
- private val galleryOrCameraDialogHelper = GalleryOrCameraDialogHelper(this, colorProvider, clock)
+ private lateinit var galleryOrCameraDialogHelper: GalleryOrCameraDialogHelper
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentRoomSettingGenericBinding {
return FragmentRoomSettingGenericBinding.inflate(inflater, container, false)
@@ -85,6 +85,7 @@ class RoomSettingsFragment @Inject constructor(
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
analyticsScreenName = MobileScreen.ScreenName.RoomSettings
+ galleryOrCameraDialogHelper = galleryOrCameraDialogHelperFactory.create(this)
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/settings/joinrule/RoomJoinRuleFragment.kt b/vector/src/main/java/im/vector/app/features/roomprofile/settings/joinrule/RoomJoinRuleFragment.kt
index 4e42cce3ee..1c4f93f49a 100644
--- a/vector/src/main/java/im/vector/app/features/roomprofile/settings/joinrule/RoomJoinRuleFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/roomprofile/settings/joinrule/RoomJoinRuleFragment.kt
@@ -25,6 +25,7 @@ import com.airbnb.mvrx.Loading
import com.airbnb.mvrx.activityViewModel
import com.airbnb.mvrx.withState
import com.google.android.material.dialog.MaterialAlertDialogBuilder
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith
@@ -37,11 +38,14 @@ import im.vector.app.features.roomprofile.settings.joinrule.advanced.RoomJoinRul
import org.matrix.android.sdk.api.session.room.model.RoomJoinRules
import javax.inject.Inject
-class RoomJoinRuleFragment @Inject constructor(
- val controller: RoomJoinRuleAdvancedController,
- val avatarRenderer: AvatarRenderer
-) : VectorBaseFragment(),
- OnBackPressed, RoomJoinRuleAdvancedController.InteractionListener {
+@AndroidEntryPoint
+class RoomJoinRuleFragment :
+ VectorBaseFragment(),
+ OnBackPressed,
+ RoomJoinRuleAdvancedController.InteractionListener {
+
+ @Inject lateinit var controller: RoomJoinRuleAdvancedController
+ @Inject lateinit var avatarRenderer: AvatarRenderer
private val viewModel: RoomJoinRuleChooseRestrictedViewModel by activityViewModel()
diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/settings/joinrule/advanced/RoomJoinRuleChooseRestrictedFragment.kt b/vector/src/main/java/im/vector/app/features/roomprofile/settings/joinrule/advanced/RoomJoinRuleChooseRestrictedFragment.kt
index b65e90aeed..462f3be1c3 100644
--- a/vector/src/main/java/im/vector/app/features/roomprofile/settings/joinrule/advanced/RoomJoinRuleChooseRestrictedFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/roomprofile/settings/joinrule/advanced/RoomJoinRuleChooseRestrictedFragment.kt
@@ -23,6 +23,7 @@ import android.view.ViewGroup
import androidx.lifecycle.lifecycleScope
import com.airbnb.mvrx.activityViewModel
import com.airbnb.mvrx.withState
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith
import im.vector.app.core.platform.OnBackPressed
@@ -36,13 +37,15 @@ import org.matrix.android.sdk.api.util.MatrixItem
import reactivecircus.flowbinding.appcompat.queryTextChanges
import javax.inject.Inject
-class RoomJoinRuleChooseRestrictedFragment @Inject constructor(
- val controller: ChooseRestrictedController,
- val avatarRenderer: AvatarRenderer
-) : VectorBaseFragment(),
+@AndroidEntryPoint
+class RoomJoinRuleChooseRestrictedFragment :
+ VectorBaseFragment(),
ChooseRestrictedController.Listener,
OnBackPressed {
+ @Inject lateinit var controller: ChooseRestrictedController
+ @Inject lateinit var avatarRenderer: AvatarRenderer
+
private val viewModel: RoomJoinRuleChooseRestrictedViewModel by activityViewModel(RoomJoinRuleChooseRestrictedViewModel::class)
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?) =
diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/uploads/RoomUploadsFragment.kt b/vector/src/main/java/im/vector/app/features/roomprofile/uploads/RoomUploadsFragment.kt
index 3ecbcb5e00..d982ab3e32 100644
--- a/vector/src/main/java/im/vector/app/features/roomprofile/uploads/RoomUploadsFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/roomprofile/uploads/RoomUploadsFragment.kt
@@ -27,6 +27,7 @@ import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState
import com.google.android.material.appbar.AppBarLayout
import com.google.android.material.tabs.TabLayoutMediator
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.intent.getMimeTypeFromUri
import im.vector.app.core.platform.VectorBaseFragment
@@ -42,11 +43,13 @@ import kotlinx.coroutines.launch
import org.matrix.android.sdk.api.util.toMatrixItem
import javax.inject.Inject
-class RoomUploadsFragment @Inject constructor(
- private val avatarRenderer: AvatarRenderer,
- private val notificationUtils: NotificationUtils,
- private val clock: Clock,
-) : VectorBaseFragment() {
+@AndroidEntryPoint
+class RoomUploadsFragment :
+ VectorBaseFragment() {
+
+ @Inject lateinit var avatarRenderer: AvatarRenderer
+ @Inject lateinit var notificationUtils: NotificationUtils
+ @Inject lateinit var clock: Clock
private val roomProfileArgs: RoomProfileArgs by args()
diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/uploads/files/RoomUploadsFilesFragment.kt b/vector/src/main/java/im/vector/app/features/roomprofile/uploads/files/RoomUploadsFilesFragment.kt
index 5bb81424cf..e7ee47020a 100644
--- a/vector/src/main/java/im/vector/app/features/roomprofile/uploads/files/RoomUploadsFilesFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/roomprofile/uploads/files/RoomUploadsFilesFragment.kt
@@ -26,6 +26,7 @@ import com.airbnb.mvrx.Loading
import com.airbnb.mvrx.Success
import com.airbnb.mvrx.parentFragmentViewModel
import com.airbnb.mvrx.withState
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith
@@ -38,12 +39,14 @@ import im.vector.app.features.roomprofile.uploads.RoomUploadsViewModel
import org.matrix.android.sdk.api.session.room.uploads.UploadEvent
import javax.inject.Inject
-class RoomUploadsFilesFragment @Inject constructor(
- private val controller: UploadsFileController
-) : VectorBaseFragment(),
+@AndroidEntryPoint
+class RoomUploadsFilesFragment :
+ VectorBaseFragment(),
UploadsFileController.Listener,
StateView.EventCallback {
+ @Inject lateinit var controller: UploadsFileController
+
private val uploadsViewModel by parentFragmentViewModel(RoomUploadsViewModel::class)
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentGenericStateViewRecyclerBinding {
diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/uploads/media/RoomUploadsMediaFragment.kt b/vector/src/main/java/im/vector/app/features/roomprofile/uploads/media/RoomUploadsMediaFragment.kt
index c6dd3c63c1..f53f572e38 100644
--- a/vector/src/main/java/im/vector/app/features/roomprofile/uploads/media/RoomUploadsMediaFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/roomprofile/uploads/media/RoomUploadsMediaFragment.kt
@@ -32,6 +32,7 @@ import com.airbnb.mvrx.Success
import com.airbnb.mvrx.parentFragmentViewModel
import com.airbnb.mvrx.withState
import com.google.android.material.appbar.AppBarLayout
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.trackItemsVisibilityChange
@@ -53,13 +54,15 @@ import org.matrix.android.sdk.api.session.room.model.message.getFileUrl
import org.matrix.android.sdk.api.session.room.model.message.getThumbnailUrl
import javax.inject.Inject
-class RoomUploadsMediaFragment @Inject constructor(
- private val controller: UploadsMediaController,
- private val dimensionConverter: DimensionConverter
-) : VectorBaseFragment(),
+@AndroidEntryPoint
+class RoomUploadsMediaFragment :
+ VectorBaseFragment(),
UploadsMediaController.Listener,
StateView.EventCallback {
+ @Inject lateinit var controller: UploadsMediaController
+ @Inject lateinit var dimensionConverter: DimensionConverter
+
private val uploadsViewModel by parentFragmentViewModel(RoomUploadsViewModel::class)
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentGenericStateViewRecyclerBinding {
diff --git a/vector/src/main/java/im/vector/app/features/settings/VectorSettingsAdvancedSettingsFragment.kt b/vector/src/main/java/im/vector/app/features/settings/VectorSettingsAdvancedSettingsFragment.kt
index e54bc4e624..9c08d446f4 100644
--- a/vector/src/main/java/im/vector/app/features/settings/VectorSettingsAdvancedSettingsFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/settings/VectorSettingsAdvancedSettingsFragment.kt
@@ -19,15 +19,17 @@ package im.vector.app.features.settings
import android.os.Bundle
import androidx.preference.Preference
import androidx.preference.SeekBarPreference
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.platform.VectorBaseActivity
import im.vector.app.core.preference.VectorPreferenceCategory
import im.vector.app.core.preference.VectorSwitchPreference
import im.vector.app.features.analytics.plan.MobileScreen
import im.vector.app.features.rageshake.RageShake
-import javax.inject.Inject
-class VectorSettingsAdvancedSettingsFragment @Inject constructor() : VectorSettingsBaseFragment() {
+@AndroidEntryPoint
+class VectorSettingsAdvancedSettingsFragment :
+ VectorSettingsBaseFragment() {
override var titleRes = R.string.settings_advanced_settings
override val preferenceXmlRes = R.xml.vector_settings_advanced_settings
diff --git a/vector/src/main/java/im/vector/app/features/settings/VectorSettingsGeneralFragment.kt b/vector/src/main/java/im/vector/app/features/settings/VectorSettingsGeneralFragment.kt
index 7906de3796..548a7be180 100644
--- a/vector/src/main/java/im/vector/app/features/settings/VectorSettingsGeneralFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/settings/VectorSettingsGeneralFragment.kt
@@ -34,8 +34,10 @@ import androidx.preference.SwitchPreference
import com.bumptech.glide.Glide
import com.bumptech.glide.load.engine.cache.DiskCache
import com.google.android.material.dialog.MaterialAlertDialogBuilder
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.dialogs.GalleryOrCameraDialogHelper
+import im.vector.app.core.dialogs.GalleryOrCameraDialogHelperFactory
import im.vector.app.core.extensions.hideKeyboard
import im.vector.app.core.extensions.hidePassword
import im.vector.app.core.extensions.toMvRxBundle
@@ -44,8 +46,6 @@ import im.vector.app.core.platform.SimpleTextWatcher
import im.vector.app.core.preference.UserAvatarPreference
import im.vector.app.core.preference.VectorPreference
import im.vector.app.core.preference.VectorSwitchPreference
-import im.vector.app.core.resources.ColorProvider
-import im.vector.app.core.time.Clock
import im.vector.app.core.utils.TextUtils
import im.vector.app.core.utils.getSizeOfFiles
import im.vector.app.core.utils.toast
@@ -74,17 +74,17 @@ import java.io.File
import java.util.UUID
import javax.inject.Inject
-class VectorSettingsGeneralFragment @Inject constructor(
- colorProvider: ColorProvider,
- clock: Clock,
-) :
+@AndroidEntryPoint
+class VectorSettingsGeneralFragment :
VectorSettingsBaseFragment(),
GalleryOrCameraDialogHelper.Listener {
+ @Inject lateinit var galleryOrCameraDialogHelperFactory: GalleryOrCameraDialogHelperFactory
+
override var titleRes = R.string.settings_general_title
override val preferenceXmlRes = R.xml.vector_settings_general
- private val galleryOrCameraDialogHelper = GalleryOrCameraDialogHelper(this, colorProvider, clock)
+ private lateinit var galleryOrCameraDialogHelper: GalleryOrCameraDialogHelper
private val mUserSettingsCategory by lazy {
findPreference(VectorPreferences.SETTINGS_USER_SETTINGS_PREFERENCE_KEY)!!
@@ -124,6 +124,7 @@ class VectorSettingsGeneralFragment @Inject constructor(
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
analyticsScreenName = MobileScreen.ScreenName.SettingsGeneral
+ galleryOrCameraDialogHelper = galleryOrCameraDialogHelperFactory.create(this)
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
diff --git a/vector/src/main/java/im/vector/app/features/settings/VectorSettingsHelpAboutFragment.kt b/vector/src/main/java/im/vector/app/features/settings/VectorSettingsHelpAboutFragment.kt
index df7baa7397..8c7afaabc0 100644
--- a/vector/src/main/java/im/vector/app/features/settings/VectorSettingsHelpAboutFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/settings/VectorSettingsHelpAboutFragment.kt
@@ -18,6 +18,7 @@ package im.vector.app.features.settings
import android.os.Bundle
import androidx.preference.Preference
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.orEmpty
import im.vector.app.core.preference.VectorPreference
@@ -31,10 +32,12 @@ import im.vector.app.features.version.VersionProvider
import org.matrix.android.sdk.api.Matrix
import javax.inject.Inject
-class VectorSettingsHelpAboutFragment @Inject constructor(
- private val versionProvider: VersionProvider,
- private val buildMeta: BuildMeta,
-) : VectorSettingsBaseFragment() {
+@AndroidEntryPoint
+class VectorSettingsHelpAboutFragment :
+ VectorSettingsBaseFragment() {
+
+ @Inject lateinit var versionProvider: VersionProvider
+ @Inject lateinit var buildMeta: BuildMeta
override var titleRes = R.string.preference_root_help_about
override val preferenceXmlRes = R.xml.vector_settings_help_about
diff --git a/vector/src/main/java/im/vector/app/features/settings/VectorSettingsLabsFragment.kt b/vector/src/main/java/im/vector/app/features/settings/VectorSettingsLabsFragment.kt
index 70908d7560..eb7864a89d 100644
--- a/vector/src/main/java/im/vector/app/features/settings/VectorSettingsLabsFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/settings/VectorSettingsLabsFragment.kt
@@ -22,6 +22,7 @@ import android.widget.TextView
import androidx.preference.Preference
import androidx.preference.SwitchPreference
import com.google.android.material.dialog.MaterialAlertDialogBuilder
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.preference.VectorSwitchPreference
import im.vector.app.features.MainActivity
@@ -31,11 +32,13 @@ import im.vector.app.features.home.room.threads.ThreadsManager
import org.matrix.android.sdk.api.settings.LightweightSettingsStorage
import javax.inject.Inject
-class VectorSettingsLabsFragment @Inject constructor(
- private val vectorPreferences: VectorPreferences,
- private val lightweightSettingsStorage: LightweightSettingsStorage,
- private val threadsManager: ThreadsManager
-) : VectorSettingsBaseFragment() {
+@AndroidEntryPoint
+class VectorSettingsLabsFragment :
+ VectorSettingsBaseFragment() {
+
+ @Inject lateinit var vectorPreferences: VectorPreferences
+ @Inject lateinit var lightweightSettingsStorage: LightweightSettingsStorage
+ @Inject lateinit var threadsManager: ThreadsManager
override var titleRes = R.string.room_settings_labs_pref_title
override val preferenceXmlRes = R.xml.vector_settings_labs
diff --git a/vector/src/main/java/im/vector/app/features/settings/VectorSettingsPinFragment.kt b/vector/src/main/java/im/vector/app/features/settings/VectorSettingsPinFragment.kt
index db402758f1..f3f013f2c7 100644
--- a/vector/src/main/java/im/vector/app/features/settings/VectorSettingsPinFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/settings/VectorSettingsPinFragment.kt
@@ -19,6 +19,7 @@ package im.vector.app.features.settings
import androidx.lifecycle.lifecycleScope
import androidx.preference.Preference
import androidx.preference.SwitchPreference
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.registerStartForActivityResult
import im.vector.app.core.preference.VectorPreference
@@ -36,13 +37,15 @@ import org.matrix.android.sdk.api.extensions.orFalse
import timber.log.Timber
import javax.inject.Inject
-class VectorSettingsPinFragment @Inject constructor(
- private val pinCodeStore: PinCodeStore,
- private val navigator: Navigator,
- private val notificationDrawerManager: NotificationDrawerManager,
- biometricHelperFactory: BiometricHelper.BiometricHelperFactory,
- defaultLockScreenConfiguration: LockScreenConfiguration,
-) : VectorSettingsBaseFragment() {
+@AndroidEntryPoint
+class VectorSettingsPinFragment :
+ VectorSettingsBaseFragment() {
+
+ @Inject lateinit var pinCodeStore: PinCodeStore
+ @Inject lateinit var navigator: Navigator
+ @Inject lateinit var notificationDrawerManager: NotificationDrawerManager
+ @Inject lateinit var biometricHelperFactory: BiometricHelper.BiometricHelperFactory
+ @Inject lateinit var defaultLockScreenConfiguration: LockScreenConfiguration
override var titleRes = R.string.settings_security_application_protection_screen_title
override val preferenceXmlRes = R.xml.vector_settings_pin
diff --git a/vector/src/main/java/im/vector/app/features/settings/VectorSettingsPreferencesFragment.kt b/vector/src/main/java/im/vector/app/features/settings/VectorSettingsPreferencesFragment.kt
index ac7d29ab7a..0bd5316b8f 100644
--- a/vector/src/main/java/im/vector/app/features/settings/VectorSettingsPreferencesFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/settings/VectorSettingsPreferencesFragment.kt
@@ -22,6 +22,7 @@ import android.os.Bundle
import androidx.lifecycle.lifecycleScope
import androidx.preference.Preference
import com.google.android.material.dialog.MaterialAlertDialogBuilder
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.dialogs.PhotoOrVideoDialog
import im.vector.app.core.extensions.restart
@@ -37,10 +38,12 @@ import kotlinx.coroutines.launch
import org.matrix.android.sdk.api.session.presence.model.PresenceEnum
import javax.inject.Inject
-class VectorSettingsPreferencesFragment @Inject constructor(
- private val vectorPreferences: VectorPreferences,
- private val fontScalePreferences: FontScalePreferences,
-) : VectorSettingsBaseFragment() {
+@AndroidEntryPoint
+class VectorSettingsPreferencesFragment :
+ VectorSettingsBaseFragment() {
+
+ @Inject lateinit var vectorPreferences: VectorPreferences
+ @Inject lateinit var fontScalePreferences: FontScalePreferences
override var titleRes = R.string.settings_preferences
override val preferenceXmlRes = R.xml.vector_settings_preferences
diff --git a/vector/src/main/java/im/vector/app/features/settings/VectorSettingsRootFragment.kt b/vector/src/main/java/im/vector/app/features/settings/VectorSettingsRootFragment.kt
index 51011e29a2..0b3dcfa2ac 100644
--- a/vector/src/main/java/im/vector/app/features/settings/VectorSettingsRootFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/settings/VectorSettingsRootFragment.kt
@@ -17,12 +17,14 @@
package im.vector.app.features.settings
import android.os.Bundle
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.preference.VectorPreference
import im.vector.app.features.analytics.plan.MobileScreen
-import javax.inject.Inject
-class VectorSettingsRootFragment @Inject constructor() : VectorSettingsBaseFragment() {
+@AndroidEntryPoint
+class VectorSettingsRootFragment :
+ VectorSettingsBaseFragment() {
override var titleRes: Int = R.string.title_activity_settings
override val preferenceXmlRes = R.xml.vector_settings_root
diff --git a/vector/src/main/java/im/vector/app/features/settings/VectorSettingsSecurityPrivacyFragment.kt b/vector/src/main/java/im/vector/app/features/settings/VectorSettingsSecurityPrivacyFragment.kt
index b6fbddd3ce..2b4d376f55 100644
--- a/vector/src/main/java/im/vector/app/features/settings/VectorSettingsSecurityPrivacyFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/settings/VectorSettingsSecurityPrivacyFragment.kt
@@ -34,6 +34,7 @@ import androidx.preference.SwitchPreference
import androidx.recyclerview.widget.RecyclerView
import com.airbnb.mvrx.fragmentViewModel
import com.google.android.material.dialog.MaterialAlertDialogBuilder
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.di.ActiveSessionHolder
import im.vector.app.core.dialogs.ExportKeysDialog
@@ -79,16 +80,18 @@ import org.matrix.android.sdk.api.session.crypto.model.DeviceInfo
import org.matrix.android.sdk.api.session.crypto.model.DevicesListResponse
import javax.inject.Inject
-class VectorSettingsSecurityPrivacyFragment @Inject constructor(
- private val activeSessionHolder: ActiveSessionHolder,
- private val pinCodeStore: PinCodeStore,
- private val keysExporter: KeysExporter,
- private val keysImporter: KeysImporter,
- private val rawService: RawService,
- private val navigator: Navigator,
- private val analyticsConfig: AnalyticsConfig,
- private val vectorFeatures: VectorFeatures,
-) : VectorSettingsBaseFragment() {
+@AndroidEntryPoint
+class VectorSettingsSecurityPrivacyFragment :
+ VectorSettingsBaseFragment() {
+
+ @Inject lateinit var activeSessionHolder: ActiveSessionHolder
+ @Inject lateinit var pinCodeStore: PinCodeStore
+ @Inject lateinit var keysExporter: KeysExporter
+ @Inject lateinit var keysImporter: KeysImporter
+ @Inject lateinit var rawService: RawService
+ @Inject lateinit var navigator: Navigator
+ @Inject lateinit var analyticsConfig: AnalyticsConfig
+ @Inject lateinit var vectorFeatures: VectorFeatures
override var titleRes = R.string.settings_security_and_privacy
override val preferenceXmlRes = R.xml.vector_settings_security_privacy
diff --git a/vector/src/main/java/im/vector/app/features/settings/account/deactivation/DeactivateAccountFragment.kt b/vector/src/main/java/im/vector/app/features/settings/account/deactivation/DeactivateAccountFragment.kt
index 7ccae3665d..c9a43c5e31 100644
--- a/vector/src/main/java/im/vector/app/features/settings/account/deactivation/DeactivateAccountFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/settings/account/deactivation/DeactivateAccountFragment.kt
@@ -24,6 +24,7 @@ import android.view.View
import android.view.ViewGroup
import androidx.appcompat.app.AppCompatActivity
import com.airbnb.mvrx.fragmentViewModel
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.registerStartForActivityResult
import im.vector.app.core.platform.VectorBaseFragment
@@ -35,9 +36,10 @@ import im.vector.app.features.auth.ReAuthActivity
import im.vector.app.features.settings.VectorSettingsActivity
import org.matrix.android.sdk.api.auth.data.LoginFlowTypes
import org.matrix.android.sdk.api.session.uia.exceptions.UiaCancelledException
-import javax.inject.Inject
-class DeactivateAccountFragment @Inject constructor() : VectorBaseFragment() {
+@AndroidEntryPoint
+class DeactivateAccountFragment :
+ VectorBaseFragment() {
private val viewModel: DeactivateAccountViewModel by fragmentViewModel()
diff --git a/vector/src/main/java/im/vector/app/features/settings/crosssigning/CrossSigningSettingsFragment.kt b/vector/src/main/java/im/vector/app/features/settings/crosssigning/CrossSigningSettingsFragment.kt
index 8fcda3219e..c0cefc9bcf 100644
--- a/vector/src/main/java/im/vector/app/features/settings/crosssigning/CrossSigningSettingsFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/settings/crosssigning/CrossSigningSettingsFragment.kt
@@ -25,6 +25,7 @@ import androidx.core.view.isVisible
import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState
import com.google.android.material.dialog.MaterialAlertDialogBuilder
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith
@@ -39,11 +40,13 @@ import javax.inject.Inject
/**
* This Fragment is only used when user activates developer mode from the settings.
*/
-class CrossSigningSettingsFragment @Inject constructor(
- private val controller: CrossSigningSettingsController,
-) : VectorBaseFragment(),
+@AndroidEntryPoint
+class CrossSigningSettingsFragment :
+ VectorBaseFragment(),
CrossSigningSettingsController.InteractionListener {
+ @Inject lateinit var controller: CrossSigningSettingsController
+
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentGenericRecyclerBinding {
return FragmentGenericRecyclerBinding.inflate(inflater, container, false)
}
diff --git a/vector/src/main/java/im/vector/app/features/settings/devices/VectorSettingsDevicesFragment.kt b/vector/src/main/java/im/vector/app/features/settings/devices/VectorSettingsDevicesFragment.kt
index a132dc1f49..2d82e48aac 100644
--- a/vector/src/main/java/im/vector/app/features/settings/devices/VectorSettingsDevicesFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/settings/devices/VectorSettingsDevicesFragment.kt
@@ -28,6 +28,7 @@ import com.airbnb.mvrx.Loading
import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState
import com.google.android.material.dialog.MaterialAlertDialogBuilder
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.dialogs.ManuallyVerifyDialog
import im.vector.app.core.extensions.cleanup
@@ -46,11 +47,13 @@ import javax.inject.Inject
/**
* Display the list of the user's device.
*/
-class VectorSettingsDevicesFragment @Inject constructor(
- private val devicesController: DevicesController
-) : VectorBaseFragment(),
+@AndroidEntryPoint
+class VectorSettingsDevicesFragment :
+ VectorBaseFragment(),
DevicesController.Callback {
+ @Inject lateinit var devicesController: DevicesController
+
// used to avoid requesting to enter the password for each deletion
// Note: Sonar does not like to use password for member name.
// private var mAccountPass: String = ""
diff --git a/vector/src/main/java/im/vector/app/features/settings/devices/v2/VectorSettingsDevicesFragment.kt b/vector/src/main/java/im/vector/app/features/settings/devices/v2/VectorSettingsDevicesFragment.kt
index 4fc429c865..a5281d1b5c 100644
--- a/vector/src/main/java/im/vector/app/features/settings/devices/v2/VectorSettingsDevicesFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/settings/devices/v2/VectorSettingsDevicesFragment.kt
@@ -27,13 +27,13 @@ import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.databinding.FragmentSettingsDevicesBinding
-import javax.inject.Inject
/**
* Display the list of the user's devices and sessions.
*/
@AndroidEntryPoint
-class VectorSettingsDevicesFragment @Inject constructor() : VectorBaseFragment() {
+class VectorSettingsDevicesFragment :
+ VectorBaseFragment() {
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentSettingsDevicesBinding {
return FragmentSettingsDevicesBinding.inflate(inflater, container, false)
diff --git a/vector/src/main/java/im/vector/app/features/settings/devtools/AccountDataFragment.kt b/vector/src/main/java/im/vector/app/features/settings/devtools/AccountDataFragment.kt
index 740ef3996a..2f8dd84ddd 100644
--- a/vector/src/main/java/im/vector/app/features/settings/devtools/AccountDataFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/settings/devtools/AccountDataFragment.kt
@@ -24,6 +24,7 @@ import androidx.appcompat.app.AppCompatActivity
import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState
import com.google.android.material.dialog.MaterialAlertDialogBuilder
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith
@@ -36,12 +37,14 @@ import org.matrix.android.sdk.api.session.accountdata.UserAccountDataEvent
import org.matrix.android.sdk.api.util.MatrixJsonParser
import javax.inject.Inject
-class AccountDataFragment @Inject constructor(
- private val epoxyController: AccountDataEpoxyController,
- private val colorProvider: ColorProvider
-) : VectorBaseFragment(),
+@AndroidEntryPoint
+class AccountDataFragment :
+ VectorBaseFragment(),
AccountDataEpoxyController.InteractionListener {
+ @Inject lateinit var epoxyController: AccountDataEpoxyController
+ @Inject lateinit var colorProvider: ColorProvider
+
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentGenericRecyclerBinding {
return FragmentGenericRecyclerBinding.inflate(inflater, container, false)
}
diff --git a/vector/src/main/java/im/vector/app/features/settings/devtools/GossipingEventsPaperTrailFragment.kt b/vector/src/main/java/im/vector/app/features/settings/devtools/GossipingEventsPaperTrailFragment.kt
index ec4ef26001..9dfcd1b15c 100644
--- a/vector/src/main/java/im/vector/app/features/settings/devtools/GossipingEventsPaperTrailFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/settings/devtools/GossipingEventsPaperTrailFragment.kt
@@ -22,21 +22,22 @@ import android.view.View
import android.view.ViewGroup
import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState
+import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith
import im.vector.app.core.platform.VectorBaseFragment
-import im.vector.app.core.resources.ColorProvider
import im.vector.app.databinding.FragmentGenericRecyclerBinding
import org.matrix.android.sdk.api.session.crypto.model.AuditTrail
import javax.inject.Inject
-class GossipingEventsPaperTrailFragment @Inject constructor(
- private val epoxyController: GossipingTrailPagedEpoxyController,
- private val colorProvider: ColorProvider
-) : VectorBaseFragment(),
+@AndroidEntryPoint
+class GossipingEventsPaperTrailFragment :
+ VectorBaseFragment