From 2c0b7ce0f44c91882d931428bcbd4868425d458a Mon Sep 17 00:00:00 2001 From: ganfra Date: Fri, 15 Jan 2021 14:40:26 +0100 Subject: [PATCH] Dagger: update to 2.31 and use new AssistedInject --- CHANGES.md | 2 +- gradle/wrapper/gradle-wrapper.properties | 3 ++- matrix-sdk-android/build.gradle | 4 +--- .../di/SessionAssistedInjectModule.kt | 24 ------------------- .../sdk/internal/session/SessionComponent.kt | 2 -- .../session/room/alias/DefaultAliasService.kt | 9 +++---- .../room/call/DefaultRoomCallService.kt | 9 +++---- .../session/room/draft/DefaultDraftService.kt | 9 +++---- .../membership/DefaultMembershipService.kt | 9 +++---- .../DefaultRoomPushRuleService.kt | 9 +++---- .../session/room/read/DefaultReadService.kt | 9 +++---- .../room/relation/DefaultRelationService.kt | 9 +++---- .../room/reporting/DefaultReportingService.kt | 9 +++---- .../session/room/send/DefaultSendService.kt | 9 +++---- .../session/room/state/DefaultStateService.kt | 9 +++---- .../session/room/tags/DefaultTagsService.kt | 9 +++---- .../room/timeline/DefaultTimelineService.kt | 9 +++---- .../room/typing/DefaultTypingService.kt | 9 +++---- .../room/uploads/DefaultUploadsService.kt | 9 +++---- .../root/src/app_package/ViewModel.kt.ftl | 7 +++--- vector/build.gradle | 4 +--- .../app/core/di/AssistedInjectModule.kt | 24 ------------------- .../im/vector/app/core/di/ScreenComponent.kt | 1 - .../app/core/di/VectorAssistedModule.kt | 22 ----------------- .../member/AutocompleteMemberPresenter.kt | 7 +++--- .../app/features/call/VectorCallViewModel.kt | 7 +++--- .../call/conference/JitsiCallViewModel.kt | 7 +++--- .../features/call/telecom/CallConnection.kt | 2 -- .../contactsbook/ContactsBookViewModel.kt | 7 +++--- .../createdirect/CreateDirectRoomViewModel.kt | 7 +++--- .../settings/KeysBackupSettingsViewModel.kt | 7 +++--- .../quads/SharedSecureStorageViewModel.kt | 7 +++--- .../recover/BootstrapSharedViewModel.kt | 7 +++--- .../VerificationBottomSheetViewModel.kt | 7 +++--- .../VerificationChooseMethodViewModel.kt | 7 +++--- .../emoji/VerificationEmojiCodeViewModel.kt | 7 +++--- .../discovery/DiscoverySettingsViewModel.kt | 7 +++--- .../change/SetIdentityServerViewModel.kt | 7 +++--- .../features/grouplist/GroupListViewModel.kt | 7 +++--- .../features/home/HomeActivityViewModel.kt | 7 +++--- .../app/features/home/HomeDetailViewModel.kt | 7 +++--- .../UnknownDeviceDetectorSharedViewModel.kt | 7 +++--- .../room/breadcrumbs/BreadcrumbsViewModel.kt | 7 +++--- .../home/room/detail/AutoCompleter.kt | 7 +++--- .../home/room/detail/RoomDetailViewModel.kt | 7 +++--- .../room/detail/search/SearchViewModel.kt | 7 +++--- .../action/MessageActionsViewModel.kt | 7 +++--- .../edithistory/ViewEditHistoryViewModel.kt | 7 +++--- .../reactions/ViewReactionsViewModel.kt | 7 +++--- .../actions/RoomListQuickActionsViewModel.kt | 7 +++--- .../HomeServerCapabilitiesViewModel.kt | 7 +++--- .../app/features/html/PillsPostProcessor.kt | 7 +++--- .../invite/InviteUsersToRoomViewModel.kt | 7 +++--- .../app/features/login/LoginViewModel.kt | 7 +++--- .../matrixto/MatrixToBottomSheetViewModel.kt | 7 +++--- .../reactions/EmojiSearchResultViewModel.kt | 7 +++--- .../room/RequireActiveMembershipViewModel.kt | 7 +++--- .../roomdirectory/RoomDirectoryViewModel.kt | 7 +++--- .../createroom/CreateRoomViewModel.kt | 7 +++--- .../picker/RoomDirectoryPickerViewModel.kt | 7 +++--- .../roompreview/RoomPreviewViewModel.kt | 7 +++--- .../RoomMemberProfileViewModel.kt | 7 +++--- .../devices/DeviceListBottomSheetViewModel.kt | 7 +++--- .../roomprofile/RoomProfileViewModel.kt | 7 +++--- .../roomprofile/alias/RoomAliasViewModel.kt | 7 +++--- .../detail/RoomAliasBottomSheetViewModel.kt | 7 +++--- .../banned/RoomBannedMemberListViewModel.kt | 7 +++--- .../members/RoomMemberListViewModel.kt | 7 +++--- .../permissions/RoomPermissionsViewModel.kt | 7 +++--- .../settings/RoomSettingsViewModel.kt | 7 +++--- .../uploads/RoomUploadsViewModel.kt | 7 +++--- .../DeactivateAccountViewModel.kt | 7 +++--- .../CrossSigningSettingsViewModel.kt | 7 +++--- ...iceVerificationInfoBottomSheetViewModel.kt | 7 +++--- .../settings/devices/DevicesViewModel.kt | 7 +++--- .../settings/devtools/AccountDataViewModel.kt | 7 +++--- .../GossipingEventsPaperTrailViewModel.kt | 7 +++--- .../devtools/KeyRequestListViewModel.kt | 7 +++--- .../settings/devtools/KeyRequestViewModel.kt | 7 +++--- .../settings/ignored/IgnoredUsersViewModel.kt | 7 +++--- .../settings/locale/LocalePickerViewModel.kt | 7 +++--- .../settings/push/PushGatewaysViewModel.kt | 7 +++--- .../threepids/ThreePidsSettingsViewModel.kt | 7 +++--- .../features/share/IncomingShareViewModel.kt | 7 +++--- .../signout/soft/SoftLogoutViewModel.kt | 7 +++--- .../features/terms/ReviewTermsViewModel.kt | 7 +++--- .../usercode/UserCodeSharedViewModel.kt | 7 +++--- .../userdirectory/UserListViewModel.kt | 7 +++--- .../features/widgets/WidgetPostAPIHandler.kt | 7 +++--- .../app/features/widgets/WidgetViewModel.kt | 7 +++--- .../RoomWidgetPermissionViewModel.kt | 7 +++--- .../signout/ServerBackupStatusViewModel.kt | 7 +++--- .../workers/signout/SignoutCheckViewModel.kt | 7 +++--- 93 files changed, 351 insertions(+), 346 deletions(-) delete mode 100644 matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/di/SessionAssistedInjectModule.kt delete mode 100644 vector/src/main/java/im/vector/app/core/di/AssistedInjectModule.kt delete mode 100644 vector/src/main/java/im/vector/app/core/di/VectorAssistedModule.kt diff --git a/CHANGES.md b/CHANGES.md index 8460a42e6f..c9c9c5d035 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -23,7 +23,7 @@ Test: - Other changes: - - + - Update Dagger to 2.31 version so we can use the embedded AssistedInject feature Changes in Element 1.0.14 (2020-01-15) =================================================== diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f1577bddaa..247e2b90ad 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ +#Fri Jan 15 11:30:47 CET 2021 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists distributionSha256Sum=a7ca23b3ccf265680f2bfd35f1f00b1424f4466292c7337c85d46c9641b3f053 -distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-all.zip diff --git a/matrix-sdk-android/build.gradle b/matrix-sdk-android/build.gradle index 6a2f7575e5..7d5432ebb8 100644 --- a/matrix-sdk-android/build.gradle +++ b/matrix-sdk-android/build.gradle @@ -112,7 +112,7 @@ dependencies { def lifecycle_version = '2.2.0' def arch_version = '2.1.0' def markwon_version = '3.1.0' - def daggerVersion = '2.29.1' + def daggerVersion = '2.31' def work_version = '2.4.0' def retrofit_version = '2.6.2' @@ -160,8 +160,6 @@ dependencies { // DI implementation "com.google.dagger:dagger:$daggerVersion" kapt "com.google.dagger:dagger-compiler:$daggerVersion" - compileOnly 'com.squareup.inject:assisted-inject-annotations-dagger2:0.5.0' - kapt 'com.squareup.inject:assisted-inject-processor-dagger2:0.5.0' // Logging implementation 'com.jakewharton.timber:timber:4.7.1' diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/di/SessionAssistedInjectModule.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/di/SessionAssistedInjectModule.kt deleted file mode 100644 index da3ecfb907..0000000000 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/di/SessionAssistedInjectModule.kt +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2020 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.di - -import com.squareup.inject.assisted.dagger2.AssistedModule -import dagger.Module - -@AssistedModule -@Module(includes = [AssistedInject_SessionAssistedInjectModule::class]) -interface SessionAssistedInjectModule diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/SessionComponent.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/SessionComponent.kt index 659fcc8f5c..f5eade1704 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/SessionComponent.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/SessionComponent.kt @@ -27,7 +27,6 @@ import org.matrix.android.sdk.internal.crypto.SendGossipWorker import org.matrix.android.sdk.internal.crypto.crosssigning.UpdateTrustWorker import org.matrix.android.sdk.internal.crypto.verification.SendVerificationMessageWorker import org.matrix.android.sdk.internal.di.MatrixComponent -import org.matrix.android.sdk.internal.di.SessionAssistedInjectModule import org.matrix.android.sdk.internal.network.NetworkConnectivityChecker import org.matrix.android.sdk.internal.session.account.AccountModule import org.matrix.android.sdk.internal.session.cache.CacheModule @@ -86,7 +85,6 @@ import org.matrix.android.sdk.internal.util.MatrixCoroutineDispatchers TermsModule::class, AccountDataModule::class, ProfileModule::class, - SessionAssistedInjectModule::class, AccountModule::class, CallModule::class, SearchModule::class diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/alias/DefaultAliasService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/alias/DefaultAliasService.kt index b6c69224e6..8f58094a2a 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/alias/DefaultAliasService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/alias/DefaultAliasService.kt @@ -16,8 +16,9 @@ package org.matrix.android.sdk.internal.session.room.alias -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import org.matrix.android.sdk.api.session.room.alias.AliasService internal class DefaultAliasService @AssistedInject constructor( @@ -26,9 +27,9 @@ internal class DefaultAliasService @AssistedInject constructor( private val addRoomAliasTask: AddRoomAliasTask ) : AliasService { - @AssistedInject.Factory + @AssistedFactory interface Factory { - fun create(roomId: String): AliasService + fun create(roomId: String): DefaultAliasService } override suspend fun getRoomAliases(): List { diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/call/DefaultRoomCallService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/call/DefaultRoomCallService.kt index 205a085df6..9bde5054f6 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/call/DefaultRoomCallService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/call/DefaultRoomCallService.kt @@ -16,8 +16,9 @@ package org.matrix.android.sdk.internal.session.room.call -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import org.matrix.android.sdk.api.extensions.orFalse import org.matrix.android.sdk.api.session.room.call.RoomCallService import org.matrix.android.sdk.internal.session.room.RoomGetter @@ -27,9 +28,9 @@ internal class DefaultRoomCallService @AssistedInject constructor( private val roomGetter: RoomGetter ) : RoomCallService { - @AssistedInject.Factory + @AssistedFactory interface Factory { - fun create(roomId: String): RoomCallService + fun create(roomId: String): DefaultRoomCallService } override fun canStartCall(): Boolean { diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/draft/DefaultDraftService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/draft/DefaultDraftService.kt index 93fbfb4df0..1d4ab6d516 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/draft/DefaultDraftService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/draft/DefaultDraftService.kt @@ -17,8 +17,9 @@ package org.matrix.android.sdk.internal.session.room.draft import androidx.lifecycle.LiveData -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import kotlinx.coroutines.withContext import org.matrix.android.sdk.api.session.room.send.DraftService import org.matrix.android.sdk.api.session.room.send.UserDraft @@ -30,9 +31,9 @@ internal class DefaultDraftService @AssistedInject constructor(@Assisted private private val coroutineDispatchers: MatrixCoroutineDispatchers ) : DraftService { - @AssistedInject.Factory + @AssistedFactory interface Factory { - fun create(roomId: String): DraftService + fun create(roomId: String): DefaultDraftService } /** diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/membership/DefaultMembershipService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/membership/DefaultMembershipService.kt index 4fc865304b..cd1c9bbbdd 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/membership/DefaultMembershipService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/membership/DefaultMembershipService.kt @@ -17,8 +17,9 @@ package org.matrix.android.sdk.internal.session.room.membership import androidx.lifecycle.LiveData -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import com.zhuinden.monarchy.Monarchy import org.matrix.android.sdk.api.MatrixCallback import org.matrix.android.sdk.api.session.identity.ThreePid @@ -58,9 +59,9 @@ internal class DefaultMembershipService @AssistedInject constructor( private val userId: String ) : MembershipService { - @AssistedInject.Factory + @AssistedFactory interface Factory { - fun create(roomId: String): MembershipService + fun create(roomId: String): DefaultMembershipService } override fun loadRoomMembersIfNeeded(matrixCallback: MatrixCallback): Cancelable { diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/notification/DefaultRoomPushRuleService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/notification/DefaultRoomPushRuleService.kt index 67ae55c066..5486d96e28 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/notification/DefaultRoomPushRuleService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/notification/DefaultRoomPushRuleService.kt @@ -18,8 +18,9 @@ package org.matrix.android.sdk.internal.session.room.notification import androidx.lifecycle.LiveData import androidx.lifecycle.Transformations -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import com.zhuinden.monarchy.Monarchy import org.matrix.android.sdk.api.pushrules.RuleScope import org.matrix.android.sdk.api.session.room.notification.RoomNotificationState @@ -33,9 +34,9 @@ internal class DefaultRoomPushRuleService @AssistedInject constructor(@Assisted @SessionDatabase private val monarchy: Monarchy) : RoomPushRuleService { - @AssistedInject.Factory + @AssistedFactory interface Factory { - fun create(roomId: String): RoomPushRuleService + fun create(roomId: String): DefaultRoomPushRuleService } override fun getLiveRoomNotificationState(): LiveData { diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/read/DefaultReadService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/read/DefaultReadService.kt index 025bea09f4..3cf8cfe5ee 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/read/DefaultReadService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/read/DefaultReadService.kt @@ -18,8 +18,9 @@ package org.matrix.android.sdk.internal.session.room.read import androidx.lifecycle.LiveData import androidx.lifecycle.Transformations -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import com.zhuinden.monarchy.Monarchy import org.matrix.android.sdk.api.MatrixCallback import org.matrix.android.sdk.api.session.room.model.ReadReceipt @@ -46,9 +47,9 @@ internal class DefaultReadService @AssistedInject constructor( @UserId private val userId: String ) : ReadService { - @AssistedInject.Factory + @AssistedFactory interface Factory { - fun create(roomId: String): ReadService + fun create(roomId: String): DefaultReadService } override fun markAsRead(params: ReadService.MarkAsReadParams, callback: MatrixCallback) { diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/relation/DefaultRelationService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/relation/DefaultRelationService.kt index a7f3f83980..b27cbbb0b2 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/relation/DefaultRelationService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/relation/DefaultRelationService.kt @@ -17,8 +17,9 @@ package org.matrix.android.sdk.internal.session.room.relation import androidx.lifecycle.LiveData import androidx.lifecycle.Transformations -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import com.zhuinden.monarchy.Monarchy import org.matrix.android.sdk.api.MatrixCallback import org.matrix.android.sdk.api.session.events.model.Event @@ -56,9 +57,9 @@ internal class DefaultRelationService @AssistedInject constructor( private val taskExecutor: TaskExecutor) : RelationService { - @AssistedInject.Factory + @AssistedFactory interface Factory { - fun create(roomId: String): RelationService + fun create(roomId: String): DefaultRelationService } override fun sendReaction(targetEventId: String, reaction: String): Cancelable { diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/reporting/DefaultReportingService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/reporting/DefaultReportingService.kt index cac87a9d30..add17a9fa5 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/reporting/DefaultReportingService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/reporting/DefaultReportingService.kt @@ -16,17 +16,18 @@ package org.matrix.android.sdk.internal.session.room.reporting -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import org.matrix.android.sdk.api.session.room.reporting.ReportingService internal class DefaultReportingService @AssistedInject constructor(@Assisted private val roomId: String, private val reportContentTask: ReportContentTask ) : ReportingService { - @AssistedInject.Factory + @AssistedFactory interface Factory { - fun create(roomId: String): ReportingService + fun create(roomId: String): DefaultReportingService } override suspend fun reportContent(eventId: String, score: Int, reason: String) { diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/send/DefaultSendService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/send/DefaultSendService.kt index 8828f3dfed..a12962b51f 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/send/DefaultSendService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/send/DefaultSendService.kt @@ -21,8 +21,9 @@ import androidx.work.BackoffPolicy import androidx.work.ExistingWorkPolicy import androidx.work.OneTimeWorkRequest import androidx.work.Operation -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import kotlinx.coroutines.launch import org.matrix.android.sdk.api.session.content.ContentAttachmentData import org.matrix.android.sdk.api.session.events.model.Event @@ -71,9 +72,9 @@ internal class DefaultSendService @AssistedInject constructor( private val cancelSendTracker: CancelSendTracker ) : SendService { - @AssistedInject.Factory + @AssistedFactory interface Factory { - fun create(roomId: String): SendService + fun create(roomId: String): DefaultSendService } private val workerFutureListenerExecutor = Executors.newSingleThreadExecutor() diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/state/DefaultStateService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/state/DefaultStateService.kt index 804968bac0..f2640fd1e7 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/state/DefaultStateService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/state/DefaultStateService.kt @@ -18,8 +18,9 @@ package org.matrix.android.sdk.internal.session.room.state import android.net.Uri import androidx.lifecycle.LiveData -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import org.matrix.android.sdk.api.query.QueryStringValue import org.matrix.android.sdk.api.session.events.model.Event import org.matrix.android.sdk.api.session.events.model.EventType @@ -42,9 +43,9 @@ internal class DefaultStateService @AssistedInject constructor(@Assisted private private val fileUploader: FileUploader ) : StateService { - @AssistedInject.Factory + @AssistedFactory interface Factory { - fun create(roomId: String): StateService + fun create(roomId: String): DefaultStateService } override fun getStateEvent(eventType: String, stateKey: QueryStringValue): Event? { diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/tags/DefaultTagsService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/tags/DefaultTagsService.kt index d6c02f0a49..02acaa0570 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/tags/DefaultTagsService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/tags/DefaultTagsService.kt @@ -16,8 +16,9 @@ package org.matrix.android.sdk.internal.session.room.tags -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import org.matrix.android.sdk.api.session.room.tags.TagsService internal class DefaultTagsService @AssistedInject constructor( @@ -26,9 +27,9 @@ internal class DefaultTagsService @AssistedInject constructor( private val deleteTagFromRoomTask: DeleteTagFromRoomTask ) : TagsService { - @AssistedInject.Factory + @AssistedFactory interface Factory { - fun create(roomId: String): TagsService + fun create(roomId: String): DefaultTagsService } override suspend fun addTag(tag: String, order: Double?) { diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/timeline/DefaultTimelineService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/timeline/DefaultTimelineService.kt index fce09cc97c..ef890db79e 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/timeline/DefaultTimelineService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/timeline/DefaultTimelineService.kt @@ -18,8 +18,9 @@ package org.matrix.android.sdk.internal.session.room.timeline import androidx.lifecycle.LiveData import androidx.lifecycle.Transformations -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import com.zhuinden.monarchy.Monarchy import io.realm.Sort import io.realm.kotlin.where @@ -55,9 +56,9 @@ internal class DefaultTimelineService @AssistedInject constructor(@Assisted priv private val loadRoomMembersTask: LoadRoomMembersTask ) : TimelineService { - @AssistedInject.Factory + @AssistedFactory interface Factory { - fun create(roomId: String): TimelineService + fun create(roomId: String): DefaultTimelineService } override fun createTimeline(eventId: String?, settings: TimelineSettings): Timeline { diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/typing/DefaultTypingService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/typing/DefaultTypingService.kt index 5dcf3fcdd6..39b7967bc1 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/typing/DefaultTypingService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/typing/DefaultTypingService.kt @@ -17,8 +17,9 @@ package org.matrix.android.sdk.internal.session.room.typing import android.os.SystemClock -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import org.matrix.android.sdk.api.MatrixCallback import org.matrix.android.sdk.api.session.room.typing.TypingService import org.matrix.android.sdk.api.util.Cancelable @@ -38,9 +39,9 @@ internal class DefaultTypingService @AssistedInject constructor( private val sendTypingTask: SendTypingTask ) : TypingService { - @AssistedInject.Factory + @AssistedFactory interface Factory { - fun create(roomId: String): TypingService + fun create(roomId: String): DefaultTypingService } private var currentTask: Cancelable? = null diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/uploads/DefaultUploadsService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/uploads/DefaultUploadsService.kt index 895f1cf50d..6d841644dc 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/uploads/DefaultUploadsService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/uploads/DefaultUploadsService.kt @@ -16,8 +16,9 @@ package org.matrix.android.sdk.internal.session.room.uploads -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import org.matrix.android.sdk.api.session.crypto.CryptoService import org.matrix.android.sdk.api.session.room.uploads.GetUploadsResult import org.matrix.android.sdk.api.session.room.uploads.UploadsService @@ -28,9 +29,9 @@ internal class DefaultUploadsService @AssistedInject constructor( private val cryptoService: CryptoService ) : UploadsService { - @AssistedInject.Factory + @AssistedFactory interface Factory { - fun create(roomId: String): UploadsService + fun create(roomId: String): DefaultUploadsService } override suspend fun getUploads(numberOfEvents: Int, since: String?): GetUploadsResult { diff --git a/tools/templates/ElementFeature/root/src/app_package/ViewModel.kt.ftl b/tools/templates/ElementFeature/root/src/app_package/ViewModel.kt.ftl index d3c50c961c..8c25f9f9a8 100644 --- a/tools/templates/ElementFeature/root/src/app_package/ViewModel.kt.ftl +++ b/tools/templates/ElementFeature/root/src/app_package/ViewModel.kt.ftl @@ -4,8 +4,9 @@ import com.airbnb.mvrx.ActivityViewModelContext import com.airbnb.mvrx.FragmentViewModelContext import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel @@ -21,7 +22,7 @@ class ${viewModelClass} @AssistedInject constructor(@Assisted initialState: ${vi : VectorViewModel<${viewStateClass}, ${actionClass}, EmptyViewEvents>(initialState) { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: ${viewStateClass}): ${viewModelClass} } diff --git a/vector/build.gradle b/vector/build.gradle index 86e28edc96..71cbe532c3 100644 --- a/vector/build.gradle +++ b/vector/build.gradle @@ -291,7 +291,7 @@ dependencies { def big_image_viewer_version = '1.6.2' def glide_version = '4.11.0' def moshi_version = '1.11.0' - def daggerVersion = '2.29.1' + def daggerVersion = '2.31' def autofill_version = "1.0.0" def work_version = '2.4.0' def arch_version = '2.1.0' @@ -412,8 +412,6 @@ dependencies { // DI implementation "com.google.dagger:dagger:$daggerVersion" kapt "com.google.dagger:dagger-compiler:$daggerVersion" - compileOnly 'com.squareup.inject:assisted-inject-annotations-dagger2:0.5.0' - kapt 'com.squareup.inject:assisted-inject-processor-dagger2:0.5.0' // gplay flavor only gplayImplementation('com.google.firebase:firebase-messaging:21.0.0') { diff --git a/vector/src/main/java/im/vector/app/core/di/AssistedInjectModule.kt b/vector/src/main/java/im/vector/app/core/di/AssistedInjectModule.kt deleted file mode 100644 index 0ba4bedb92..0000000000 --- a/vector/src/main/java/im/vector/app/core/di/AssistedInjectModule.kt +++ /dev/null @@ -1,24 +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 com.squareup.inject.assisted.dagger2.AssistedModule -import dagger.Module - -@AssistedModule -@Module(includes = [AssistedInject_AssistedInjectModule::class]) -interface AssistedInjectModule diff --git a/vector/src/main/java/im/vector/app/core/di/ScreenComponent.kt b/vector/src/main/java/im/vector/app/core/di/ScreenComponent.kt index f56a6a3d70..e3ba70ea09 100644 --- a/vector/src/main/java/im/vector/app/core/di/ScreenComponent.kt +++ b/vector/src/main/java/im/vector/app/core/di/ScreenComponent.kt @@ -86,7 +86,6 @@ import im.vector.app.features.workers.signout.SignOutBottomSheetDialogFragment VectorComponent::class ], modules = [ - AssistedInjectModule::class, ViewModelModule::class, FragmentModule::class, HomeModule::class, diff --git a/vector/src/main/java/im/vector/app/core/di/VectorAssistedModule.kt b/vector/src/main/java/im/vector/app/core/di/VectorAssistedModule.kt deleted file mode 100644 index 78a935a1d4..0000000000 --- a/vector/src/main/java/im/vector/app/core/di/VectorAssistedModule.kt +++ /dev/null @@ -1,22 +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 - -/* -@Module(includes = [AssistedInject_VectorAssistedModule::class]) -@AssistedModule -class VectorAssistedModule*/ diff --git a/vector/src/main/java/im/vector/app/features/autocomplete/member/AutocompleteMemberPresenter.kt b/vector/src/main/java/im/vector/app/features/autocomplete/member/AutocompleteMemberPresenter.kt index de8003b28b..b2ad0a7688 100644 --- a/vector/src/main/java/im/vector/app/features/autocomplete/member/AutocompleteMemberPresenter.kt +++ b/vector/src/main/java/im/vector/app/features/autocomplete/member/AutocompleteMemberPresenter.kt @@ -18,8 +18,9 @@ package im.vector.app.features.autocomplete.member import android.content.Context import androidx.recyclerview.widget.RecyclerView -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.features.autocomplete.AutocompleteClickListener import im.vector.app.features.autocomplete.RecyclerViewPresenter import org.matrix.android.sdk.api.query.QueryStringValue @@ -44,7 +45,7 @@ class AutocompleteMemberPresenter @AssistedInject constructor(context: Context, controller.listener = null } - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(roomId: String): AutocompleteMemberPresenter } diff --git a/vector/src/main/java/im/vector/app/features/call/VectorCallViewModel.kt b/vector/src/main/java/im/vector/app/features/call/VectorCallViewModel.kt index bd16adf3e7..fd735de085 100644 --- a/vector/src/main/java/im/vector/app/features/call/VectorCallViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/call/VectorCallViewModel.kt @@ -22,8 +22,9 @@ import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.Success import com.airbnb.mvrx.Uninitialized import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel import org.matrix.android.sdk.api.MatrixCallback @@ -242,7 +243,7 @@ class VectorCallViewModel @AssistedInject constructor( }.exhaustive } - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: VectorCallViewState, args: CallArgs): VectorCallViewModel } diff --git a/vector/src/main/java/im/vector/app/features/call/conference/JitsiCallViewModel.kt b/vector/src/main/java/im/vector/app/features/call/conference/JitsiCallViewModel.kt index 783b519706..97ee41154a 100644 --- a/vector/src/main/java/im/vector/app/features/call/conference/JitsiCallViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/call/conference/JitsiCallViewModel.kt @@ -21,8 +21,9 @@ import com.airbnb.mvrx.Fail import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.Success import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.resources.StringProvider import org.jitsi.meet.sdk.JitsiMeetUserInfo @@ -40,7 +41,7 @@ class JitsiCallViewModel @AssistedInject constructor( private val stringProvider: StringProvider ) : VectorViewModel(initialState) { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: JitsiCallViewState, args: VectorJitsiActivity.Args): JitsiCallViewModel } diff --git a/vector/src/main/java/im/vector/app/features/call/telecom/CallConnection.kt b/vector/src/main/java/im/vector/app/features/call/telecom/CallConnection.kt index 6f69b4b0d0..0a9a164993 100644 --- a/vector/src/main/java/im/vector/app/features/call/telecom/CallConnection.kt +++ b/vector/src/main/java/im/vector/app/features/call/telecom/CallConnection.kt @@ -21,7 +21,6 @@ import android.os.Build import android.telecom.Connection import android.telecom.DisconnectCause import androidx.annotation.RequiresApi -import im.vector.app.features.call.VectorCallViewModel import im.vector.app.features.call.WebRtcPeerConnectionManager import timber.log.Timber import javax.inject.Inject @@ -33,7 +32,6 @@ import javax.inject.Inject ) : Connection() { @Inject lateinit var peerConnectionManager: WebRtcPeerConnectionManager - @Inject lateinit var callViewModel: VectorCallViewModel init { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { diff --git a/vector/src/main/java/im/vector/app/features/contactsbook/ContactsBookViewModel.kt b/vector/src/main/java/im/vector/app/features/contactsbook/ContactsBookViewModel.kt index 2c4c5d0596..d73794f8d8 100644 --- a/vector/src/main/java/im/vector/app/features/contactsbook/ContactsBookViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/contactsbook/ContactsBookViewModel.kt @@ -24,8 +24,9 @@ import com.airbnb.mvrx.Loading import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.Success import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.contacts.ContactsDataSource import im.vector.app.core.contacts.MappedContact import im.vector.app.core.extensions.exhaustive @@ -48,7 +49,7 @@ class ContactsBookViewModel @AssistedInject constructor(@Assisted private val session: Session) : VectorViewModel(initialState) { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: ContactsBookViewState): ContactsBookViewModel } diff --git a/vector/src/main/java/im/vector/app/features/createdirect/CreateDirectRoomViewModel.kt b/vector/src/main/java/im/vector/app/features/createdirect/CreateDirectRoomViewModel.kt index d074c93587..30bbedf7ec 100644 --- a/vector/src/main/java/im/vector/app/features/createdirect/CreateDirectRoomViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/createdirect/CreateDirectRoomViewModel.kt @@ -21,8 +21,9 @@ import com.airbnb.mvrx.ActivityViewModelContext import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.Success import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel import im.vector.app.features.raw.wellknown.getElementWellknown @@ -41,7 +42,7 @@ class CreateDirectRoomViewModel @AssistedInject constructor(@Assisted val session: Session) : VectorViewModel(initialState) { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: CreateDirectRoomViewState): CreateDirectRoomViewModel } diff --git a/vector/src/main/java/im/vector/app/features/crypto/keysbackup/settings/KeysBackupSettingsViewModel.kt b/vector/src/main/java/im/vector/app/features/crypto/keysbackup/settings/KeysBackupSettingsViewModel.kt index 3666dbce8c..cb8a6ce4e9 100644 --- a/vector/src/main/java/im/vector/app/features/crypto/keysbackup/settings/KeysBackupSettingsViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/crypto/keysbackup/settings/KeysBackupSettingsViewModel.kt @@ -22,8 +22,9 @@ import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.Success import com.airbnb.mvrx.Uninitialized import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.platform.EmptyViewEvents import im.vector.app.core.platform.VectorViewModel import org.matrix.android.sdk.api.MatrixCallback @@ -39,7 +40,7 @@ class KeysBackupSettingsViewModel @AssistedInject constructor(@Assisted initialS ) : VectorViewModel(initialState), KeysBackupStateListener { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: KeysBackupSettingViewState): KeysBackupSettingsViewModel } diff --git a/vector/src/main/java/im/vector/app/features/crypto/quads/SharedSecureStorageViewModel.kt b/vector/src/main/java/im/vector/app/features/crypto/quads/SharedSecureStorageViewModel.kt index c7533cd3df..e95f250dd3 100644 --- a/vector/src/main/java/im/vector/app/features/crypto/quads/SharedSecureStorageViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/crypto/quads/SharedSecureStorageViewModel.kt @@ -26,8 +26,9 @@ import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.Success import com.airbnb.mvrx.Uninitialized import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.R import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel @@ -71,7 +72,7 @@ class SharedSecureStorageViewModel @AssistedInject constructor( private val session: Session) : VectorViewModel(initialState) { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: SharedSecureStorageViewState, args: SharedSecureStorageActivity.Args): SharedSecureStorageViewModel } diff --git a/vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapSharedViewModel.kt b/vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapSharedViewModel.kt index 2e5097fdb7..3a6f57198e 100644 --- a/vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapSharedViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapSharedViewModel.kt @@ -25,8 +25,9 @@ import com.airbnb.mvrx.Success import com.airbnb.mvrx.Uninitialized import com.airbnb.mvrx.ViewModelContext import com.nulabinc.zxcvbn.Zxcvbn -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.R import im.vector.app.core.error.ErrorFormatter import im.vector.app.core.extensions.exhaustive @@ -60,7 +61,7 @@ class BootstrapSharedViewModel @AssistedInject constructor( private var isBackupCreatedFromPassphrase: Boolean = false private val zxcvbn = Zxcvbn() - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: BootstrapViewState, args: BootstrapBottomSheet.Args): BootstrapSharedViewModel } diff --git a/vector/src/main/java/im/vector/app/features/crypto/verification/VerificationBottomSheetViewModel.kt b/vector/src/main/java/im/vector/app/features/crypto/verification/VerificationBottomSheetViewModel.kt index 23ed9b6483..04ac79d4a4 100644 --- a/vector/src/main/java/im/vector/app/features/crypto/verification/VerificationBottomSheetViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/crypto/verification/VerificationBottomSheetViewModel.kt @@ -25,8 +25,9 @@ import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.Success import com.airbnb.mvrx.Uninitialized import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.R import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel @@ -159,7 +160,7 @@ class VerificationBottomSheetViewModel @AssistedInject constructor( super.onCleared() } - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: VerificationBottomSheetViewState, args: VerificationBottomSheet.VerificationArgs): VerificationBottomSheetViewModel diff --git a/vector/src/main/java/im/vector/app/features/crypto/verification/choose/VerificationChooseMethodViewModel.kt b/vector/src/main/java/im/vector/app/features/crypto/verification/choose/VerificationChooseMethodViewModel.kt index 4518a8d6b7..7b9acd2f57 100644 --- a/vector/src/main/java/im/vector/app/features/crypto/verification/choose/VerificationChooseMethodViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/crypto/verification/choose/VerificationChooseMethodViewModel.kt @@ -19,8 +19,9 @@ import com.airbnb.mvrx.FragmentViewModelContext import com.airbnb.mvrx.MvRxState import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.di.HasScreenInjector import im.vector.app.core.platform.EmptyAction import im.vector.app.core.platform.EmptyViewEvents @@ -79,7 +80,7 @@ class VerificationChooseMethodViewModel @AssistedInject constructor( } } - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: VerificationChooseMethodViewState): VerificationChooseMethodViewModel } diff --git a/vector/src/main/java/im/vector/app/features/crypto/verification/emoji/VerificationEmojiCodeViewModel.kt b/vector/src/main/java/im/vector/app/features/crypto/verification/emoji/VerificationEmojiCodeViewModel.kt index d511123f5e..44f0e752c8 100644 --- a/vector/src/main/java/im/vector/app/features/crypto/verification/emoji/VerificationEmojiCodeViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/crypto/verification/emoji/VerificationEmojiCodeViewModel.kt @@ -24,8 +24,9 @@ import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.Success import com.airbnb.mvrx.Uninitialized import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.di.HasScreenInjector import im.vector.app.core.platform.EmptyAction import im.vector.app.core.platform.EmptyViewEvents @@ -149,7 +150,7 @@ class VerificationEmojiCodeViewModel @AssistedInject constructor( } } - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: VerificationEmojiCodeViewState): VerificationEmojiCodeViewModel } diff --git a/vector/src/main/java/im/vector/app/features/discovery/DiscoverySettingsViewModel.kt b/vector/src/main/java/im/vector/app/features/discovery/DiscoverySettingsViewModel.kt index d16ebcdc8b..bf2defafa1 100644 --- a/vector/src/main/java/im/vector/app/features/discovery/DiscoverySettingsViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/discovery/DiscoverySettingsViewModel.kt @@ -24,8 +24,9 @@ import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.Success import com.airbnb.mvrx.Uninitialized import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel import kotlinx.coroutines.launch @@ -42,7 +43,7 @@ class DiscoverySettingsViewModel @AssistedInject constructor( private val session: Session) : VectorViewModel(initialState) { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: DiscoverySettingsState): DiscoverySettingsViewModel } diff --git a/vector/src/main/java/im/vector/app/features/discovery/change/SetIdentityServerViewModel.kt b/vector/src/main/java/im/vector/app/features/discovery/change/SetIdentityServerViewModel.kt index 0f07a0353f..9455b1bff4 100644 --- a/vector/src/main/java/im/vector/app/features/discovery/change/SetIdentityServerViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/discovery/change/SetIdentityServerViewModel.kt @@ -19,8 +19,9 @@ import androidx.lifecycle.viewModelScope import com.airbnb.mvrx.FragmentViewModelContext import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.R import im.vector.app.core.di.HasScreenInjector import im.vector.app.core.extensions.exhaustive @@ -41,7 +42,7 @@ class SetIdentityServerViewModel @AssistedInject constructor( stringProvider: StringProvider) : VectorViewModel(initialState) { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: SetIdentityServerState): SetIdentityServerViewModel } diff --git a/vector/src/main/java/im/vector/app/features/grouplist/GroupListViewModel.kt b/vector/src/main/java/im/vector/app/features/grouplist/GroupListViewModel.kt index a17aa4dbf2..3b096adbfb 100644 --- a/vector/src/main/java/im/vector/app/features/grouplist/GroupListViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/grouplist/GroupListViewModel.kt @@ -22,8 +22,9 @@ import arrow.core.Option import com.airbnb.mvrx.FragmentViewModelContext import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.R import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.resources.StringProvider @@ -45,7 +46,7 @@ class GroupListViewModel @AssistedInject constructor(@Assisted initialState: Gro private val stringProvider: StringProvider ) : VectorViewModel(initialState) { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: GroupListViewState): GroupListViewModel } diff --git a/vector/src/main/java/im/vector/app/features/home/HomeActivityViewModel.kt b/vector/src/main/java/im/vector/app/features/home/HomeActivityViewModel.kt index 90d128320b..45fce13ab9 100644 --- a/vector/src/main/java/im/vector/app/features/home/HomeActivityViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/home/HomeActivityViewModel.kt @@ -20,8 +20,9 @@ import androidx.lifecycle.viewModelScope import com.airbnb.mvrx.MvRx import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.di.ActiveSessionHolder import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel @@ -52,7 +53,7 @@ class HomeActivityViewModel @AssistedInject constructor( private val vectorPreferences: VectorPreferences ) : VectorViewModel(initialState) { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: HomeActivityViewState, args: HomeActivityArgs): HomeActivityViewModel } diff --git a/vector/src/main/java/im/vector/app/features/home/HomeDetailViewModel.kt b/vector/src/main/java/im/vector/app/features/home/HomeDetailViewModel.kt index 88c310fde8..c261081055 100644 --- a/vector/src/main/java/im/vector/app/features/home/HomeDetailViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/home/HomeDetailViewModel.kt @@ -19,8 +19,9 @@ package im.vector.app.features.home import com.airbnb.mvrx.FragmentViewModelContext import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.di.HasScreenInjector import im.vector.app.core.platform.EmptyViewEvents import im.vector.app.core.platform.VectorViewModel @@ -44,7 +45,7 @@ class HomeDetailViewModel @AssistedInject constructor(@Assisted initialState: Ho private val stringProvider: StringProvider) : VectorViewModel(initialState) { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: HomeDetailViewState): HomeDetailViewModel } diff --git a/vector/src/main/java/im/vector/app/features/home/UnknownDeviceDetectorSharedViewModel.kt b/vector/src/main/java/im/vector/app/features/home/UnknownDeviceDetectorSharedViewModel.kt index 3bdcfc4018..f4f16502ab 100644 --- a/vector/src/main/java/im/vector/app/features/home/UnknownDeviceDetectorSharedViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/home/UnknownDeviceDetectorSharedViewModel.kt @@ -24,8 +24,9 @@ import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.Success import com.airbnb.mvrx.Uninitialized import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.platform.EmptyViewEvents import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.platform.VectorViewModelAction @@ -65,7 +66,7 @@ class UnknownDeviceDetectorSharedViewModel @AssistedInject constructor(@Assisted data class IgnoreDevice(val deviceIds: List) : Action() } - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: UnknownDevicesState): UnknownDeviceDetectorSharedViewModel } diff --git a/vector/src/main/java/im/vector/app/features/home/room/breadcrumbs/BreadcrumbsViewModel.kt b/vector/src/main/java/im/vector/app/features/home/room/breadcrumbs/BreadcrumbsViewModel.kt index 8a32157097..d3825de4ef 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/breadcrumbs/BreadcrumbsViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/breadcrumbs/BreadcrumbsViewModel.kt @@ -19,8 +19,9 @@ package im.vector.app.features.home.room.breadcrumbs import com.airbnb.mvrx.FragmentViewModelContext import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.platform.EmptyAction import im.vector.app.core.platform.EmptyViewEvents import im.vector.app.core.platform.VectorViewModel @@ -35,7 +36,7 @@ class BreadcrumbsViewModel @AssistedInject constructor(@Assisted initialState: B private val session: Session) : VectorViewModel(initialState) { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: BreadcrumbsViewState): BreadcrumbsViewModel } diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/AutoCompleter.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/AutoCompleter.kt index d560a675fe..ec2ff82e67 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/AutoCompleter.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/AutoCompleter.kt @@ -24,8 +24,9 @@ import android.widget.EditText import com.otaliastudios.autocomplete.Autocomplete import com.otaliastudios.autocomplete.AutocompleteCallback import com.otaliastudios.autocomplete.CharPolicy -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.R import im.vector.app.core.glide.GlideApp import im.vector.app.core.glide.GlideRequests @@ -59,7 +60,7 @@ class AutoCompleter @AssistedInject constructor( private lateinit var autocompleteMemberPresenter: AutocompleteMemberPresenter - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(roomId: String): AutoCompleter } diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailViewModel.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailViewModel.kt index 975eda5d2f..ecfd1f85d3 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailViewModel.kt @@ -25,8 +25,9 @@ import com.airbnb.mvrx.Success import com.airbnb.mvrx.ViewModelContext import com.jakewharton.rxrelay2.BehaviorRelay import com.jakewharton.rxrelay2.PublishRelay -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.R import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel @@ -134,7 +135,7 @@ class RoomDetailViewModel @AssistedInject constructor( private var trackUnreadMessages = AtomicBoolean(false) private var mostRecentDisplayedEvent: TimelineEvent? = null - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: RoomDetailViewState): RoomDetailViewModel } diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/search/SearchViewModel.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/search/SearchViewModel.kt index ab440f6b5f..cb93cf95d2 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/search/SearchViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/search/SearchViewModel.kt @@ -23,8 +23,9 @@ import com.airbnb.mvrx.Loading import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.Success import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel import kotlinx.coroutines.launch @@ -46,7 +47,7 @@ class SearchViewModel @AssistedInject constructor( private var nextBatch: String? = null - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: SearchViewState): SearchViewModel } diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/action/MessageActionsViewModel.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/action/MessageActionsViewModel.kt index 2eae58c6b9..5008f0e0aa 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/action/MessageActionsViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/action/MessageActionsViewModel.kt @@ -18,8 +18,9 @@ package im.vector.app.features.home.room.detail.timeline.action import com.airbnb.mvrx.FragmentViewModelContext import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import dagger.Lazy import im.vector.app.R import im.vector.app.core.extensions.canReact @@ -75,7 +76,7 @@ class MessageActionsViewModel @AssistedInject constructor(@Assisted pillsPostProcessorFactory.create(initialState.roomId) } - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: MessageActionState): MessageActionsViewModel } diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/edithistory/ViewEditHistoryViewModel.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/edithistory/ViewEditHistoryViewModel.kt index e4d124dd94..fff1c8a0ff 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/edithistory/ViewEditHistoryViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/edithistory/ViewEditHistoryViewModel.kt @@ -24,8 +24,9 @@ import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.Success import com.airbnb.mvrx.Uninitialized import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.date.VectorDateFormatter import im.vector.app.core.platform.EmptyAction import im.vector.app.core.platform.EmptyViewEvents @@ -61,7 +62,7 @@ class ViewEditHistoryViewModel @AssistedInject constructor(@Assisted private val room = session.getRoom(roomId) ?: throw IllegalStateException("Shouldn't use this ViewModel without a room") - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: ViewEditHistoryViewState): ViewEditHistoryViewModel } diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/reactions/ViewReactionsViewModel.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/reactions/ViewReactionsViewModel.kt index a36f656f52..c1f98cc3ab 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/reactions/ViewReactionsViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/reactions/ViewReactionsViewModel.kt @@ -22,8 +22,9 @@ import com.airbnb.mvrx.MvRxState import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.Uninitialized import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.date.DateFormatKind import im.vector.app.core.date.VectorDateFormatter import im.vector.app.core.platform.EmptyAction @@ -68,7 +69,7 @@ class ViewReactionsViewModel @AssistedInject constructor(@Assisted private val room = session.getRoom(roomId) ?: throw IllegalStateException("Shouldn't use this ViewModel without a room") - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: DisplayReactionsViewState): ViewReactionsViewModel } diff --git a/vector/src/main/java/im/vector/app/features/home/room/list/actions/RoomListQuickActionsViewModel.kt b/vector/src/main/java/im/vector/app/features/home/room/list/actions/RoomListQuickActionsViewModel.kt index a062b2b034..c51c571815 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/list/actions/RoomListQuickActionsViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/list/actions/RoomListQuickActionsViewModel.kt @@ -18,8 +18,9 @@ package im.vector.app.features.home.room.list.actions import com.airbnb.mvrx.FragmentViewModelContext import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.platform.EmptyAction import im.vector.app.core.platform.EmptyViewEvents import im.vector.app.core.platform.VectorViewModel @@ -31,7 +32,7 @@ class RoomListQuickActionsViewModel @AssistedInject constructor(@Assisted initia private val session: Session ) : VectorViewModel(initialState) { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: RoomListQuickActionsState): RoomListQuickActionsViewModel } diff --git a/vector/src/main/java/im/vector/app/features/homeserver/HomeServerCapabilitiesViewModel.kt b/vector/src/main/java/im/vector/app/features/homeserver/HomeServerCapabilitiesViewModel.kt index fe7a8006e0..05fd825558 100644 --- a/vector/src/main/java/im/vector/app/features/homeserver/HomeServerCapabilitiesViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/homeserver/HomeServerCapabilitiesViewModel.kt @@ -20,8 +20,9 @@ import androidx.lifecycle.viewModelScope import com.airbnb.mvrx.FragmentViewModelContext import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.di.HasScreenInjector import im.vector.app.core.platform.EmptyAction import im.vector.app.core.platform.EmptyViewEvents @@ -42,7 +43,7 @@ class HomeServerCapabilitiesViewModel @AssistedInject constructor( private val rawService: RawService ) : VectorViewModel(initialState) { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: HomeServerCapabilitiesViewState): HomeServerCapabilitiesViewModel } diff --git a/vector/src/main/java/im/vector/app/features/html/PillsPostProcessor.kt b/vector/src/main/java/im/vector/app/features/html/PillsPostProcessor.kt index c13f5fdfb3..716baff757 100644 --- a/vector/src/main/java/im/vector/app/features/html/PillsPostProcessor.kt +++ b/vector/src/main/java/im/vector/app/features/html/PillsPostProcessor.kt @@ -19,8 +19,9 @@ package im.vector.app.features.html import android.content.Context import android.text.Spannable import android.text.Spanned -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.di.ActiveSessionHolder import im.vector.app.core.glide.GlideApp import im.vector.app.features.home.AvatarRenderer @@ -37,7 +38,7 @@ class PillsPostProcessor @AssistedInject constructor(@Assisted private val roomI private val sessionHolder: ActiveSessionHolder) : EventHtmlRenderer.PostProcessor { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(roomId: String?): PillsPostProcessor } diff --git a/vector/src/main/java/im/vector/app/features/invite/InviteUsersToRoomViewModel.kt b/vector/src/main/java/im/vector/app/features/invite/InviteUsersToRoomViewModel.kt index 21a998d8e2..a694ee36ba 100644 --- a/vector/src/main/java/im/vector/app/features/invite/InviteUsersToRoomViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/invite/InviteUsersToRoomViewModel.kt @@ -19,8 +19,9 @@ package im.vector.app.features.invite import com.airbnb.mvrx.ActivityViewModelContext import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.R import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.resources.StringProvider @@ -37,7 +38,7 @@ class InviteUsersToRoomViewModel @AssistedInject constructor(@Assisted private val room = session.getRoom(initialState.roomId)!! - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: InviteUsersToRoomViewState): InviteUsersToRoomViewModel } diff --git a/vector/src/main/java/im/vector/app/features/login/LoginViewModel.kt b/vector/src/main/java/im/vector/app/features/login/LoginViewModel.kt index a3f1c36d08..7bf0b98841 100644 --- a/vector/src/main/java/im/vector/app/features/login/LoginViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/login/LoginViewModel.kt @@ -26,8 +26,9 @@ import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.Success import com.airbnb.mvrx.Uninitialized import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.R import im.vector.app.core.di.ActiveSessionHolder import im.vector.app.core.extensions.configureAndStart @@ -68,7 +69,7 @@ class LoginViewModel @AssistedInject constructor( private val homeServerHistoryService: HomeServerHistoryService ) : VectorViewModel(initialState) { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: LoginViewState): LoginViewModel } diff --git a/vector/src/main/java/im/vector/app/features/matrixto/MatrixToBottomSheetViewModel.kt b/vector/src/main/java/im/vector/app/features/matrixto/MatrixToBottomSheetViewModel.kt index 6e8a530c9a..207256c75a 100644 --- a/vector/src/main/java/im/vector/app/features/matrixto/MatrixToBottomSheetViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/matrixto/MatrixToBottomSheetViewModel.kt @@ -24,8 +24,9 @@ import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.Success import com.airbnb.mvrx.Uninitialized import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.R import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel @@ -50,7 +51,7 @@ class MatrixToBottomSheetViewModel @AssistedInject constructor( private val stringProvider: StringProvider, private val rawService: RawService) : VectorViewModel(initialState) { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: MatrixToBottomSheetState): MatrixToBottomSheetViewModel } diff --git a/vector/src/main/java/im/vector/app/features/reactions/EmojiSearchResultViewModel.kt b/vector/src/main/java/im/vector/app/features/reactions/EmojiSearchResultViewModel.kt index 98b729603a..ac7aee797a 100644 --- a/vector/src/main/java/im/vector/app/features/reactions/EmojiSearchResultViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/reactions/EmojiSearchResultViewModel.kt @@ -19,8 +19,9 @@ import com.airbnb.mvrx.ActivityViewModelContext import com.airbnb.mvrx.MvRxState import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.platform.EmptyViewEvents import im.vector.app.core.platform.VectorViewModel import im.vector.app.features.reactions.data.EmojiDataSource @@ -36,7 +37,7 @@ class EmojiSearchResultViewModel @AssistedInject constructor( private val dataSource: EmojiDataSource) : VectorViewModel(initialState) { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: EmojiSearchResultViewState): EmojiSearchResultViewModel } diff --git a/vector/src/main/java/im/vector/app/features/room/RequireActiveMembershipViewModel.kt b/vector/src/main/java/im/vector/app/features/room/RequireActiveMembershipViewModel.kt index 868a4e4dd6..c8b0037311 100644 --- a/vector/src/main/java/im/vector/app/features/room/RequireActiveMembershipViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/room/RequireActiveMembershipViewModel.kt @@ -21,8 +21,9 @@ import com.airbnb.mvrx.FragmentViewModelContext import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.ViewModelContext import com.jakewharton.rxrelay2.BehaviorRelay -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.R import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel @@ -48,7 +49,7 @@ class RequireActiveMembershipViewModel @AssistedInject constructor( private val session: Session) : VectorViewModel(initialState) { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: RequireActiveMembershipViewState): RequireActiveMembershipViewModel } diff --git a/vector/src/main/java/im/vector/app/features/roomdirectory/RoomDirectoryViewModel.kt b/vector/src/main/java/im/vector/app/features/roomdirectory/RoomDirectoryViewModel.kt index b047b2ede9..f5c545c34d 100644 --- a/vector/src/main/java/im/vector/app/features/roomdirectory/RoomDirectoryViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/roomdirectory/RoomDirectoryViewModel.kt @@ -23,8 +23,9 @@ import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.Success import com.airbnb.mvrx.ViewModelContext import com.airbnb.mvrx.appendAt -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.platform.VectorViewModel import org.matrix.android.sdk.api.MatrixCallback import org.matrix.android.sdk.api.extensions.orFalse @@ -46,7 +47,7 @@ class RoomDirectoryViewModel @AssistedInject constructor(@Assisted initialState: private val session: Session) : VectorViewModel(initialState) { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: PublicRoomsViewState): RoomDirectoryViewModel } diff --git a/vector/src/main/java/im/vector/app/features/roomdirectory/createroom/CreateRoomViewModel.kt b/vector/src/main/java/im/vector/app/features/roomdirectory/createroom/CreateRoomViewModel.kt index 216a016fbe..3c027c4845 100644 --- a/vector/src/main/java/im/vector/app/features/roomdirectory/createroom/CreateRoomViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/roomdirectory/createroom/CreateRoomViewModel.kt @@ -25,8 +25,9 @@ import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.Success import com.airbnb.mvrx.Uninitialized import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel import im.vector.app.features.raw.wellknown.getElementWellknown @@ -46,7 +47,7 @@ class CreateRoomViewModel @AssistedInject constructor(@Assisted initialState: Cr private val rawService: RawService ) : VectorViewModel(initialState) { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: CreateRoomViewState): CreateRoomViewModel } diff --git a/vector/src/main/java/im/vector/app/features/roomdirectory/picker/RoomDirectoryPickerViewModel.kt b/vector/src/main/java/im/vector/app/features/roomdirectory/picker/RoomDirectoryPickerViewModel.kt index 44044304bc..5460411907 100644 --- a/vector/src/main/java/im/vector/app/features/roomdirectory/picker/RoomDirectoryPickerViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/roomdirectory/picker/RoomDirectoryPickerViewModel.kt @@ -21,8 +21,9 @@ import com.airbnb.mvrx.FragmentViewModelContext import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.Success import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.platform.EmptyViewEvents import im.vector.app.core.platform.VectorViewModel import org.matrix.android.sdk.api.MatrixCallback @@ -33,7 +34,7 @@ class RoomDirectoryPickerViewModel @AssistedInject constructor(@Assisted initial private val session: Session) : VectorViewModel(initialState) { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: RoomDirectoryPickerViewState): RoomDirectoryPickerViewModel } diff --git a/vector/src/main/java/im/vector/app/features/roomdirectory/roompreview/RoomPreviewViewModel.kt b/vector/src/main/java/im/vector/app/features/roomdirectory/roompreview/RoomPreviewViewModel.kt index 63b9a50546..c99213d890 100644 --- a/vector/src/main/java/im/vector/app/features/roomdirectory/roompreview/RoomPreviewViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/roomdirectory/roompreview/RoomPreviewViewModel.kt @@ -22,8 +22,9 @@ import com.airbnb.mvrx.Loading import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.Success import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.EmptyViewEvents import im.vector.app.core.platform.VectorViewModel @@ -46,7 +47,7 @@ class RoomPreviewViewModel @AssistedInject constructor(@Assisted private val ini private val session: Session) : VectorViewModel(initialState) { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: RoomPreviewViewState): RoomPreviewViewModel } diff --git a/vector/src/main/java/im/vector/app/features/roommemberprofile/RoomMemberProfileViewModel.kt b/vector/src/main/java/im/vector/app/features/roommemberprofile/RoomMemberProfileViewModel.kt index 8211a05127..0556b9d2d6 100644 --- a/vector/src/main/java/im/vector/app/features/roommemberprofile/RoomMemberProfileViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/roommemberprofile/RoomMemberProfileViewModel.kt @@ -25,8 +25,9 @@ import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.Success import com.airbnb.mvrx.Uninitialized import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.R import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.resources.StringProvider @@ -61,7 +62,7 @@ class RoomMemberProfileViewModel @AssistedInject constructor(@Assisted private v private val session: Session) : VectorViewModel(initialState) { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: RoomMemberProfileViewState): RoomMemberProfileViewModel } diff --git a/vector/src/main/java/im/vector/app/features/roommemberprofile/devices/DeviceListBottomSheetViewModel.kt b/vector/src/main/java/im/vector/app/features/roommemberprofile/devices/DeviceListBottomSheetViewModel.kt index 0f1ac3bfea..7d31a5c811 100644 --- a/vector/src/main/java/im/vector/app/features/roommemberprofile/devices/DeviceListBottomSheetViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/roommemberprofile/devices/DeviceListBottomSheetViewModel.kt @@ -22,8 +22,9 @@ import com.airbnb.mvrx.Loading import com.airbnb.mvrx.MvRxState import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.di.HasScreenInjector import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel @@ -48,7 +49,7 @@ class DeviceListBottomSheetViewModel @AssistedInject constructor(@Assisted priva private val session: Session) : VectorViewModel(initialState) { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: DeviceListViewState, args: DeviceListBottomSheet.Args): DeviceListBottomSheetViewModel } diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileViewModel.kt b/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileViewModel.kt index cfdf1d9c0b..02a648287f 100644 --- a/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileViewModel.kt @@ -21,8 +21,9 @@ import androidx.lifecycle.viewModelScope import com.airbnb.mvrx.FragmentViewModelContext import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.R import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel @@ -49,7 +50,7 @@ class RoomProfileViewModel @AssistedInject constructor( private val session: Session ) : VectorViewModel(initialState) { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: RoomProfileViewState): RoomProfileViewModel } diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/alias/RoomAliasViewModel.kt b/vector/src/main/java/im/vector/app/features/roomprofile/alias/RoomAliasViewModel.kt index f470eeefc2..8832c9f7d8 100644 --- a/vector/src/main/java/im/vector/app/features/roomprofile/alias/RoomAliasViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/roomprofile/alias/RoomAliasViewModel.kt @@ -24,8 +24,9 @@ import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.Success import com.airbnb.mvrx.Uninitialized import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel import im.vector.app.features.powerlevel.PowerLevelsObservableFactory @@ -44,7 +45,7 @@ class RoomAliasViewModel @AssistedInject constructor(@Assisted initialState: Roo private val session: Session) : VectorViewModel(initialState) { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: RoomAliasViewState): RoomAliasViewModel } diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/alias/detail/RoomAliasBottomSheetViewModel.kt b/vector/src/main/java/im/vector/app/features/roomprofile/alias/detail/RoomAliasBottomSheetViewModel.kt index 7f723cae53..e762b52025 100644 --- a/vector/src/main/java/im/vector/app/features/roomprofile/alias/detail/RoomAliasBottomSheetViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/roomprofile/alias/detail/RoomAliasBottomSheetViewModel.kt @@ -18,8 +18,9 @@ package im.vector.app.features.roomprofile.alias.detail import com.airbnb.mvrx.FragmentViewModelContext import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.platform.EmptyAction import im.vector.app.core.platform.EmptyViewEvents import im.vector.app.core.platform.VectorViewModel @@ -30,7 +31,7 @@ class RoomAliasBottomSheetViewModel @AssistedInject constructor( session: Session ) : VectorViewModel(initialState) { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: RoomAliasBottomSheetState): RoomAliasBottomSheetViewModel } diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/banned/RoomBannedMemberListViewModel.kt b/vector/src/main/java/im/vector/app/features/roomprofile/banned/RoomBannedMemberListViewModel.kt index 0cecd22fa0..5663392c6c 100644 --- a/vector/src/main/java/im/vector/app/features/roomprofile/banned/RoomBannedMemberListViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/roomprofile/banned/RoomBannedMemberListViewModel.kt @@ -20,8 +20,9 @@ import androidx.lifecycle.viewModelScope import com.airbnb.mvrx.FragmentViewModelContext import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.R import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel @@ -47,7 +48,7 @@ class RoomBannedMemberListViewModel @AssistedInject constructor(@Assisted initia private val session: Session) : VectorViewModel(initialState) { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: RoomBannedMemberListViewState): RoomBannedMemberListViewModel } diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/members/RoomMemberListViewModel.kt b/vector/src/main/java/im/vector/app/features/roomprofile/members/RoomMemberListViewModel.kt index 9f15e62b3b..de983537fc 100644 --- a/vector/src/main/java/im/vector/app/features/roomprofile/members/RoomMemberListViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/roomprofile/members/RoomMemberListViewModel.kt @@ -20,8 +20,9 @@ import androidx.lifecycle.viewModelScope import com.airbnb.mvrx.FragmentViewModelContext import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.EmptyViewEvents import im.vector.app.core.platform.VectorViewModel @@ -53,7 +54,7 @@ class RoomMemberListViewModel @AssistedInject constructor(@Assisted initialState private val session: Session) : VectorViewModel(initialState) { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: RoomMemberListViewState): RoomMemberListViewModel } diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/permissions/RoomPermissionsViewModel.kt b/vector/src/main/java/im/vector/app/features/roomprofile/permissions/RoomPermissionsViewModel.kt index 183488a5e0..626c20010c 100644 --- a/vector/src/main/java/im/vector/app/features/roomprofile/permissions/RoomPermissionsViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/roomprofile/permissions/RoomPermissionsViewModel.kt @@ -21,8 +21,9 @@ import com.airbnb.mvrx.FragmentViewModelContext import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.Success import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel import im.vector.app.features.powerlevel.PowerLevelsObservableFactory @@ -39,7 +40,7 @@ class RoomPermissionsViewModel @AssistedInject constructor(@Assisted initialStat private val session: Session) : VectorViewModel(initialState) { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: RoomPermissionsViewState): RoomPermissionsViewModel } diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/settings/RoomSettingsViewModel.kt b/vector/src/main/java/im/vector/app/features/roomprofile/settings/RoomSettingsViewModel.kt index 48ff38f92e..bf227ea5e8 100644 --- a/vector/src/main/java/im/vector/app/features/roomprofile/settings/RoomSettingsViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/roomprofile/settings/RoomSettingsViewModel.kt @@ -20,8 +20,9 @@ import androidx.core.net.toFile import com.airbnb.mvrx.FragmentViewModelContext import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel import im.vector.app.features.powerlevel.PowerLevelsObservableFactory @@ -45,7 +46,7 @@ class RoomSettingsViewModel @AssistedInject constructor(@Assisted initialState: private val session: Session) : VectorViewModel(initialState) { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: RoomSettingsViewState): RoomSettingsViewModel } diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/uploads/RoomUploadsViewModel.kt b/vector/src/main/java/im/vector/app/features/roomprofile/uploads/RoomUploadsViewModel.kt index b62b633a36..cdf139c7f6 100644 --- a/vector/src/main/java/im/vector/app/features/roomprofile/uploads/RoomUploadsViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/roomprofile/uploads/RoomUploadsViewModel.kt @@ -24,8 +24,9 @@ import com.airbnb.mvrx.Loading import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.Success import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel import kotlinx.coroutines.launch @@ -41,7 +42,7 @@ class RoomUploadsViewModel @AssistedInject constructor( private val session: Session ) : VectorViewModel(initialState) { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: RoomUploadsViewState): RoomUploadsViewModel } diff --git a/vector/src/main/java/im/vector/app/features/settings/account/deactivation/DeactivateAccountViewModel.kt b/vector/src/main/java/im/vector/app/features/settings/account/deactivation/DeactivateAccountViewModel.kt index 211559c657..6a7084fb81 100644 --- a/vector/src/main/java/im/vector/app/features/settings/account/deactivation/DeactivateAccountViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/settings/account/deactivation/DeactivateAccountViewModel.kt @@ -20,8 +20,9 @@ import com.airbnb.mvrx.FragmentViewModelContext import com.airbnb.mvrx.MvRxState import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.platform.VectorViewModelAction @@ -43,7 +44,7 @@ class DeactivateAccountViewModel @AssistedInject constructor(@Assisted private v private val session: Session) : VectorViewModel(initialState) { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: DeactivateAccountViewState): DeactivateAccountViewModel } diff --git a/vector/src/main/java/im/vector/app/features/settings/crosssigning/CrossSigningSettingsViewModel.kt b/vector/src/main/java/im/vector/app/features/settings/crosssigning/CrossSigningSettingsViewModel.kt index 3f70ac1fd7..fdf5d611fa 100644 --- a/vector/src/main/java/im/vector/app/features/settings/crosssigning/CrossSigningSettingsViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/settings/crosssigning/CrossSigningSettingsViewModel.kt @@ -18,8 +18,9 @@ package im.vector.app.features.settings.crosssigning import com.airbnb.mvrx.FragmentViewModelContext import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.platform.VectorViewModel import io.reactivex.Observable import io.reactivex.functions.BiFunction @@ -57,7 +58,7 @@ class CrossSigningSettingsViewModel @AssistedInject constructor(@Assisted privat } } - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: CrossSigningSettingsViewState): CrossSigningSettingsViewModel } diff --git a/vector/src/main/java/im/vector/app/features/settings/devices/DeviceVerificationInfoBottomSheetViewModel.kt b/vector/src/main/java/im/vector/app/features/settings/devices/DeviceVerificationInfoBottomSheetViewModel.kt index ad840d2efb..ee5b0a6092 100644 --- a/vector/src/main/java/im/vector/app/features/settings/devices/DeviceVerificationInfoBottomSheetViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/settings/devices/DeviceVerificationInfoBottomSheetViewModel.kt @@ -19,8 +19,9 @@ import com.airbnb.mvrx.FragmentViewModelContext import com.airbnb.mvrx.Loading import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.platform.EmptyAction import im.vector.app.core.platform.EmptyViewEvents import im.vector.app.core.platform.VectorViewModel @@ -33,7 +34,7 @@ class DeviceVerificationInfoBottomSheetViewModel @AssistedInject constructor(@As val session: Session ) : VectorViewModel(initialState) { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: DeviceVerificationInfoBottomSheetViewState, deviceId: String): DeviceVerificationInfoBottomSheetViewModel } diff --git a/vector/src/main/java/im/vector/app/features/settings/devices/DevicesViewModel.kt b/vector/src/main/java/im/vector/app/features/settings/devices/DevicesViewModel.kt index 8c5762afce..eb034530ef 100644 --- a/vector/src/main/java/im/vector/app/features/settings/devices/DevicesViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/settings/devices/DevicesViewModel.kt @@ -26,8 +26,9 @@ import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.Success import com.airbnb.mvrx.Uninitialized import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.error.SsoFlowNotSupportedYet import im.vector.app.core.platform.VectorViewModel import io.reactivex.Observable @@ -72,7 +73,7 @@ class DevicesViewModel @AssistedInject constructor( private val session: Session ) : VectorViewModel(initialState), VerificationService.Listener { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: DevicesViewState): DevicesViewModel } diff --git a/vector/src/main/java/im/vector/app/features/settings/devtools/AccountDataViewModel.kt b/vector/src/main/java/im/vector/app/features/settings/devtools/AccountDataViewModel.kt index af8d162f15..b2200e6a6d 100644 --- a/vector/src/main/java/im/vector/app/features/settings/devtools/AccountDataViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/settings/devtools/AccountDataViewModel.kt @@ -23,8 +23,9 @@ import com.airbnb.mvrx.MvRxState import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.Uninitialized import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.EmptyViewEvents import im.vector.app.core.platform.VectorViewModel @@ -63,7 +64,7 @@ class AccountDataViewModel @AssistedInject constructor(@Assisted initialState: A } } - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: AccountDataViewState): AccountDataViewModel } diff --git a/vector/src/main/java/im/vector/app/features/settings/devtools/GossipingEventsPaperTrailViewModel.kt b/vector/src/main/java/im/vector/app/features/settings/devtools/GossipingEventsPaperTrailViewModel.kt index 4249ef09fa..325538ee5e 100644 --- a/vector/src/main/java/im/vector/app/features/settings/devtools/GossipingEventsPaperTrailViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/settings/devtools/GossipingEventsPaperTrailViewModel.kt @@ -24,8 +24,9 @@ import com.airbnb.mvrx.MvRxState import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.Uninitialized import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.platform.EmptyAction import im.vector.app.core.platform.EmptyViewEvents import im.vector.app.core.platform.VectorViewModel @@ -57,7 +58,7 @@ class GossipingEventsPaperTrailViewModel @AssistedInject constructor(@Assisted i override fun handle(action: EmptyAction) {} - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: GossipingEventsPaperTrailState): GossipingEventsPaperTrailViewModel } diff --git a/vector/src/main/java/im/vector/app/features/settings/devtools/KeyRequestListViewModel.kt b/vector/src/main/java/im/vector/app/features/settings/devtools/KeyRequestListViewModel.kt index 0b0b923a48..c0a791233f 100644 --- a/vector/src/main/java/im/vector/app/features/settings/devtools/KeyRequestListViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/settings/devtools/KeyRequestListViewModel.kt @@ -24,8 +24,9 @@ import com.airbnb.mvrx.MvRxState import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.Uninitialized import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.platform.EmptyAction import im.vector.app.core.platform.EmptyViewEvents import im.vector.app.core.platform.VectorViewModel @@ -65,7 +66,7 @@ class KeyRequestListViewModel @AssistedInject constructor(@Assisted initialState override fun handle(action: EmptyAction) {} - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: KeyRequestListViewState): KeyRequestListViewModel } diff --git a/vector/src/main/java/im/vector/app/features/settings/devtools/KeyRequestViewModel.kt b/vector/src/main/java/im/vector/app/features/settings/devtools/KeyRequestViewModel.kt index a7d5e8f1ac..e7a56ef9df 100644 --- a/vector/src/main/java/im/vector/app/features/settings/devtools/KeyRequestViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/settings/devtools/KeyRequestViewModel.kt @@ -27,8 +27,9 @@ import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.Success import com.airbnb.mvrx.Uninitialized import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewEvents import im.vector.app.core.platform.VectorViewModel @@ -54,7 +55,7 @@ class KeyRequestViewModel @AssistedInject constructor( private val session: Session) : VectorViewModel(initialState) { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: KeyRequestViewState): KeyRequestViewModel } diff --git a/vector/src/main/java/im/vector/app/features/settings/ignored/IgnoredUsersViewModel.kt b/vector/src/main/java/im/vector/app/features/settings/ignored/IgnoredUsersViewModel.kt index 98c9f8e4f1..fdc6585829 100644 --- a/vector/src/main/java/im/vector/app/features/settings/ignored/IgnoredUsersViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/settings/ignored/IgnoredUsersViewModel.kt @@ -25,8 +25,9 @@ import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.Success import com.airbnb.mvrx.Uninitialized import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.platform.VectorViewModelAction import org.matrix.android.sdk.api.MatrixCallback @@ -47,7 +48,7 @@ class IgnoredUsersViewModel @AssistedInject constructor(@Assisted initialState: private val session: Session) : VectorViewModel(initialState) { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: IgnoredUsersViewState): IgnoredUsersViewModel } diff --git a/vector/src/main/java/im/vector/app/features/settings/locale/LocalePickerViewModel.kt b/vector/src/main/java/im/vector/app/features/settings/locale/LocalePickerViewModel.kt index df7cc4ba84..2e59b0ef7d 100644 --- a/vector/src/main/java/im/vector/app/features/settings/locale/LocalePickerViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/settings/locale/LocalePickerViewModel.kt @@ -22,8 +22,9 @@ import com.airbnb.mvrx.FragmentViewModelContext import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.Success import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel import im.vector.app.features.configuration.VectorConfiguration @@ -35,7 +36,7 @@ class LocalePickerViewModel @AssistedInject constructor( private val vectorConfiguration: VectorConfiguration ) : VectorViewModel(initialState) { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: LocalePickerViewState): LocalePickerViewModel } diff --git a/vector/src/main/java/im/vector/app/features/settings/push/PushGatewaysViewModel.kt b/vector/src/main/java/im/vector/app/features/settings/push/PushGatewaysViewModel.kt index 2c8b902188..7981d71ce1 100644 --- a/vector/src/main/java/im/vector/app/features/settings/push/PushGatewaysViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/settings/push/PushGatewaysViewModel.kt @@ -22,8 +22,9 @@ import com.airbnb.mvrx.MvRxState import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.Uninitialized import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.EmptyViewEvents import im.vector.app.core.platform.VectorViewModel @@ -39,7 +40,7 @@ class PushGatewaysViewModel @AssistedInject constructor(@Assisted initialState: private val session: Session) : VectorViewModel(initialState) { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: PushGatewayViewState): PushGatewaysViewModel } diff --git a/vector/src/main/java/im/vector/app/features/settings/threepids/ThreePidsSettingsViewModel.kt b/vector/src/main/java/im/vector/app/features/settings/threepids/ThreePidsSettingsViewModel.kt index 41b6146bb1..65cfadb6a9 100644 --- a/vector/src/main/java/im/vector/app/features/settings/threepids/ThreePidsSettingsViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/settings/threepids/ThreePidsSettingsViewModel.kt @@ -23,8 +23,9 @@ import com.airbnb.mvrx.FragmentViewModelContext import com.airbnb.mvrx.Loading import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.R import im.vector.app.core.error.SsoFlowNotSupportedYet import im.vector.app.core.extensions.exhaustive @@ -89,7 +90,7 @@ class ThreePidsSettingsViewModel @AssistedInject constructor( } } - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: ThreePidsSettingsViewState): ThreePidsSettingsViewModel } diff --git a/vector/src/main/java/im/vector/app/features/share/IncomingShareViewModel.kt b/vector/src/main/java/im/vector/app/features/share/IncomingShareViewModel.kt index 9014565e08..4d211d11de 100644 --- a/vector/src/main/java/im/vector/app/features/share/IncomingShareViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/share/IncomingShareViewModel.kt @@ -20,8 +20,9 @@ import com.airbnb.mvrx.FragmentViewModelContext import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.ViewModelContext import com.jakewharton.rxrelay2.BehaviorRelay -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.extensions.exhaustive import im.vector.app.core.extensions.toggle import im.vector.app.core.platform.VectorViewModel @@ -42,7 +43,7 @@ class IncomingShareViewModel @AssistedInject constructor( private val breadcrumbsRoomComparator: BreadcrumbsRoomComparator) : VectorViewModel(initialState) { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: IncomingShareViewState): IncomingShareViewModel } diff --git a/vector/src/main/java/im/vector/app/features/signout/soft/SoftLogoutViewModel.kt b/vector/src/main/java/im/vector/app/features/signout/soft/SoftLogoutViewModel.kt index 81ac1dbd54..bebaa09063 100644 --- a/vector/src/main/java/im/vector/app/features/signout/soft/SoftLogoutViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/signout/soft/SoftLogoutViewModel.kt @@ -23,8 +23,9 @@ import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.Success import com.airbnb.mvrx.Uninitialized import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.di.ActiveSessionHolder import im.vector.app.core.extensions.hasUnsavedKeys import im.vector.app.core.platform.VectorViewModel @@ -47,7 +48,7 @@ class SoftLogoutViewModel @AssistedInject constructor( private val authenticationService: AuthenticationService ) : VectorViewModel(initialState) { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: SoftLogoutViewState): SoftLogoutViewModel } diff --git a/vector/src/main/java/im/vector/app/features/terms/ReviewTermsViewModel.kt b/vector/src/main/java/im/vector/app/features/terms/ReviewTermsViewModel.kt index 89d6e970cc..4ecad80876 100644 --- a/vector/src/main/java/im/vector/app/features/terms/ReviewTermsViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/terms/ReviewTermsViewModel.kt @@ -22,8 +22,9 @@ import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.Success import com.airbnb.mvrx.Uninitialized import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel import kotlinx.coroutines.launch @@ -35,7 +36,7 @@ class ReviewTermsViewModel @AssistedInject constructor( private val session: Session ) : VectorViewModel(initialState) { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: ReviewTermsViewState): ReviewTermsViewModel } diff --git a/vector/src/main/java/im/vector/app/features/usercode/UserCodeSharedViewModel.kt b/vector/src/main/java/im/vector/app/features/usercode/UserCodeSharedViewModel.kt index 45b6f0ee65..4caa75b39c 100644 --- a/vector/src/main/java/im/vector/app/features/usercode/UserCodeSharedViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/usercode/UserCodeSharedViewModel.kt @@ -21,8 +21,9 @@ import com.airbnb.mvrx.ActivityViewModelContext import com.airbnb.mvrx.FragmentViewModelContext import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.R import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.resources.StringProvider @@ -66,7 +67,7 @@ class UserCodeSharedViewModel @AssistedInject constructor( } } - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: UserCodeState): UserCodeSharedViewModel } diff --git a/vector/src/main/java/im/vector/app/features/userdirectory/UserListViewModel.kt b/vector/src/main/java/im/vector/app/features/userdirectory/UserListViewModel.kt index f8eabbaed0..9766d640c7 100644 --- a/vector/src/main/java/im/vector/app/features/userdirectory/UserListViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/userdirectory/UserListViewModel.kt @@ -21,8 +21,9 @@ import com.airbnb.mvrx.FragmentViewModelContext import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.ViewModelContext import com.jakewharton.rxrelay2.BehaviorRelay -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.extensions.exhaustive import im.vector.app.core.extensions.toggle import im.vector.app.core.platform.VectorViewModel @@ -51,7 +52,7 @@ class UserListViewModel @AssistedInject constructor(@Assisted initialState: User private var currentUserSearchDisposable: Disposable? = null - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: UserListViewState): UserListViewModel } diff --git a/vector/src/main/java/im/vector/app/features/widgets/WidgetPostAPIHandler.kt b/vector/src/main/java/im/vector/app/features/widgets/WidgetPostAPIHandler.kt index 3906ea687c..13d49eb20b 100644 --- a/vector/src/main/java/im/vector/app/features/widgets/WidgetPostAPIHandler.kt +++ b/vector/src/main/java/im/vector/app/features/widgets/WidgetPostAPIHandler.kt @@ -17,8 +17,9 @@ package im.vector.app.features.widgets import android.text.TextUtils -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.R import im.vector.app.core.resources.StringProvider import kotlinx.coroutines.GlobalScope @@ -45,7 +46,7 @@ class WidgetPostAPIHandler @AssistedInject constructor(@Assisted private val roo private val stringProvider: StringProvider, private val session: Session) : WidgetPostAPIMediator.Handler { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(roomId: String): WidgetPostAPIHandler } diff --git a/vector/src/main/java/im/vector/app/features/widgets/WidgetViewModel.kt b/vector/src/main/java/im/vector/app/features/widgets/WidgetViewModel.kt index 1bc10e26d4..203b58f68f 100644 --- a/vector/src/main/java/im/vector/app/features/widgets/WidgetViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/widgets/WidgetViewModel.kt @@ -25,8 +25,9 @@ import com.airbnb.mvrx.Loading import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.Success import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.resources.StringProvider import im.vector.app.features.widgets.permissions.WidgetPermissionsHelper @@ -55,7 +56,7 @@ class WidgetViewModel @AssistedInject constructor(@Assisted val initialState: Wi WidgetPostAPIHandler.NavigationCallback, IntegrationManagerService.Listener { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: WidgetViewState): WidgetViewModel } diff --git a/vector/src/main/java/im/vector/app/features/widgets/permissions/RoomWidgetPermissionViewModel.kt b/vector/src/main/java/im/vector/app/features/widgets/permissions/RoomWidgetPermissionViewModel.kt index eb588ec9ae..3accc56680 100644 --- a/vector/src/main/java/im/vector/app/features/widgets/permissions/RoomWidgetPermissionViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/widgets/permissions/RoomWidgetPermissionViewModel.kt @@ -20,8 +20,9 @@ import com.airbnb.mvrx.ActivityViewModelContext import com.airbnb.mvrx.FragmentViewModelContext import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.R import im.vector.app.core.platform.VectorViewModel import kotlinx.coroutines.launch @@ -141,7 +142,7 @@ class RoomWidgetPermissionViewModel @AssistedInject constructor(@Assisted val in } } - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: RoomWidgetPermissionViewState): RoomWidgetPermissionViewModel } diff --git a/vector/src/main/java/im/vector/app/features/workers/signout/ServerBackupStatusViewModel.kt b/vector/src/main/java/im/vector/app/features/workers/signout/ServerBackupStatusViewModel.kt index 68f62cffe5..a73facc009 100644 --- a/vector/src/main/java/im/vector/app/features/workers/signout/ServerBackupStatusViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/workers/signout/ServerBackupStatusViewModel.kt @@ -24,8 +24,9 @@ import com.airbnb.mvrx.MvRxState import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.Uninitialized import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.platform.EmptyAction import im.vector.app.core.platform.EmptyViewEvents import im.vector.app.core.platform.VectorViewModel @@ -69,7 +70,7 @@ class ServerBackupStatusViewModel @AssistedInject constructor(@Assisted initialS private val session: Session) : VectorViewModel(initialState), KeysBackupStateListener { - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: ServerBackupStatusViewState): ServerBackupStatusViewModel } diff --git a/vector/src/main/java/im/vector/app/features/workers/signout/SignoutCheckViewModel.kt b/vector/src/main/java/im/vector/app/features/workers/signout/SignoutCheckViewModel.kt index 8a1055e780..2f8d45043b 100644 --- a/vector/src/main/java/im/vector/app/features/workers/signout/SignoutCheckViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/workers/signout/SignoutCheckViewModel.kt @@ -26,8 +26,9 @@ import com.airbnb.mvrx.MvRxViewModelFactory import com.airbnb.mvrx.Success import com.airbnb.mvrx.Uninitialized import com.airbnb.mvrx.ViewModelContext -import com.squareup.inject.assisted.Assisted -import com.squareup.inject.assisted.AssistedInject +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import dagger.assisted.AssistedFactory import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewEvents import im.vector.app.core.platform.VectorViewModel @@ -63,7 +64,7 @@ class SignoutCheckViewModel @AssistedInject constructor(@Assisted initialState: data class ExportKeys(val exporter: KeysExporter, val passphrase: String, val uri: Uri) : ViewEvents() } - @AssistedInject.Factory + @AssistedFactory interface Factory { fun create(initialState: SignoutCheckViewState): SignoutCheckViewModel }