From 03fee2a131a402baf2579adf3441df1880c86c38 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 22 Mar 2022 15:56:06 +0100 Subject: [PATCH] The `.exhaustive` trick is not needed anymore in Kotlin 1.6.0 https://kotlinlang.org/docs/whatsnew16.html#stable-exhaustive-when-statements-for-enum-sealed-and-boolean-subjects --- .../DefaultQrCodeVerificationTransaction.kt | 5 ++--- .../android/sdk/internal/util/Exhaustive.kt | 20 ------------------- .../root/src/app_package/ViewModel.kt.ftl | 3 +-- .../analytics/DebugAnalyticsViewModel.kt | 3 +-- .../settings/DebugPrivateSettingsViewModel.kt | 3 +-- .../vector/app/core/extensions/Exhaustive.kt | 20 ------------------- .../app/core/platform/VectorBaseActivity.kt | 3 +-- .../app/core/ui/views/NotificationAreaView.kt | 3 +-- .../ui/consent/AnalyticsConsentViewModel.kt | 3 +-- .../ui/consent/AnalyticsOptInActivity.kt | 3 +-- .../preview/AttachmentsPreviewViewModel.kt | 3 +-- .../app/features/call/VectorCallViewModel.kt | 5 ++--- .../call/conference/JitsiCallViewModel.kt | 3 +-- .../call/conference/VectorJitsiActivity.kt | 3 +-- .../call/transfer/CallTransferActivity.kt | 3 +-- .../contactsbook/ContactsBookFragment.kt | 3 +-- .../contactsbook/ContactsBookViewModel.kt | 3 +-- .../createdirect/CreateDirectRoomActivity.kt | 7 +++---- .../createdirect/CreateDirectRoomViewModel.kt | 5 ++--- .../quads/SharedSecureStorageViewModel.kt | 3 +-- .../crypto/recover/BootstrapBottomSheet.kt | 3 +-- .../recover/BootstrapSharedViewModel.kt | 9 ++++----- .../verification/VerificationBottomSheet.kt | 3 +-- .../VerificationBottomSheetViewModel.kt | 3 +-- .../features/devtools/RoomDevToolActivity.kt | 3 +-- .../discovery/DiscoverySettingsFragment.kt | 5 ++--- .../discovery/DiscoverySettingsViewModel.kt | 5 ++--- .../SettingsTextButtonSingleLineItem.kt | 5 ++--- .../change/SetIdentityServerFragment.kt | 3 +-- .../change/SetIdentityServerViewModel.kt | 3 +-- .../vector/app/features/home/HomeActivity.kt | 8 ++++---- .../features/home/HomeActivityViewModel.kt | 3 +-- .../home/room/detail/TimelineFragment.kt | 13 ++++++------ .../home/room/detail/TimelineViewModel.kt | 3 +-- .../composer/MessageComposerViewModel.kt | 5 ++--- .../voice/VoiceMessageRecorderView.kt | 3 +-- .../room/detail/search/SearchViewModel.kt | 3 +-- .../helper/ContentUploadStateTrackerBinder.kt | 3 +-- .../detail/timeline/item/PollOptionView.kt | 3 +-- .../timeline/item/VerificationRequestItem.kt | 3 +-- .../home/room/list/RoomListFragment.kt | 5 ++--- .../home/room/list/RoomListViewModel.kt | 3 +-- .../location/LocationSharingFragment.kt | 3 +-- .../location/LocationSharingViewModel.kt | 3 +-- .../features/login/AbstractLoginFragment.kt | 3 +-- .../app/features/login/LoginActivity.kt | 7 +++---- .../app/features/login/LoginFragment.kt | 5 ++--- .../app/features/login/LoginViewModel.kt | 9 ++++----- .../features/login2/AbstractLoginFragment2.kt | 3 +-- .../app/features/login2/LoginViewModel2.kt | 9 ++++----- .../matrixto/MatrixToBottomSheetViewModel.kt | 3 +-- .../app/features/onboarding/Login2Variant.kt | 3 +-- .../onboarding/OnboardingViewModel.kt | 9 ++++----- .../ftueauth/AbstractFtueAuthFragment.kt | 3 +-- .../ftueauth/FtueAuthLoginFragment.kt | 5 ++--- .../onboarding/ftueauth/FtueAuthVariant.kt | 5 ++--- .../poll/create/CreatePollFragment.kt | 3 +-- .../features/qrcode/QrCodeScannerActivity.kt | 3 +-- .../room/RequireActiveMembershipViewModel.kt | 3 +-- .../roomdirectory/PublicRoomsFragment.kt | 3 +-- .../createroom/CreateRoomFragment.kt | 3 +-- .../createroom/CreateRoomViewModel.kt | 5 ++--- .../picker/RoomDirectoryPickerViewModel.kt | 3 +-- .../roompreview/RoomPreviewViewModel.kt | 3 +-- .../RoomMemberProfileFragment.kt | 3 +-- .../RoomMemberProfileViewModel.kt | 3 +-- .../devices/DeviceListBottomSheet.kt | 3 +-- .../devices/DeviceListBottomSheetViewModel.kt | 3 +-- .../roomprofile/RoomProfileActivity.kt | 3 +-- .../roomprofile/RoomProfileFragment.kt | 3 +-- .../roomprofile/RoomProfileViewModel.kt | 3 +-- .../roomprofile/alias/RoomAliasFragment.kt | 3 +-- .../roomprofile/alias/RoomAliasViewModel.kt | 3 +-- .../banned/RoomBannedMemberListViewModel.kt | 3 +-- .../members/RoomMemberListViewModel.kt | 3 +-- .../permissions/RoomPermissionsFragment.kt | 3 +-- .../permissions/RoomPermissionsViewModel.kt | 3 +-- .../settings/RoomSettingsFragment.kt | 3 +-- .../settings/RoomSettingsViewModel.kt | 3 +-- .../RoomJoinRuleChooseRestrictedViewModel.kt | 3 +-- .../uploads/RoomUploadsFragment.kt | 3 +-- .../uploads/RoomUploadsViewModel.kt | 3 +-- .../deactivation/DeactivateAccountFragment.kt | 3 +-- .../DeactivateAccountViewModel.kt | 3 +-- .../CrossSigningSettingsFragment.kt | 3 +-- .../CrossSigningSettingsViewModel.kt | 3 +-- .../devices/VectorSettingsDevicesFragment.kt | 3 +-- .../settings/devtools/AccountDataViewModel.kt | 3 +-- .../settings/devtools/KeyRequestViewModel.kt | 3 +-- .../settings/devtools/KeyRequestsFragment.kt | 3 +-- .../VectorSettingsIgnoredUsersFragment.kt | 3 +-- .../settings/legals/LegalsViewModel.kt | 3 +-- .../settings/locale/LocalePickerFragment.kt | 3 +-- .../settings/locale/LocalePickerViewModel.kt | 3 +-- .../settings/push/PushGatewaysFragment.kt | 3 +-- .../settings/push/PushGatewaysViewModel.kt | 3 +-- .../threepids/ThreePidsSettingsController.kt | 5 ++--- .../threepids/ThreePidsSettingsFragment.kt | 3 +-- .../threepids/ThreePidsSettingsViewModel.kt | 3 +-- .../features/share/IncomingShareFragment.kt | 3 +-- .../features/share/IncomingShareViewModel.kt | 5 ++--- .../app/features/spaces/SpaceListFragment.kt | 3 +-- .../spaces/create/CreateSpaceViewModel.kt | 3 +-- .../manage/SpaceManageSharedViewModel.kt | 3 +-- .../spaces/manage/SpaceSettingsFragment.kt | 3 +-- .../spaces/people/SpacePeopleViewModel.kt | 3 +-- .../app/features/terms/ReviewTermsActivity.kt | 3 +-- .../app/features/terms/ReviewTermsFragment.kt | 3 +-- .../features/terms/ReviewTermsViewModel.kt | 3 +-- .../app/features/usercode/UserCodeActivity.kt | 5 ++--- .../userdirectory/UserListViewModel.kt | 3 +-- .../workers/signout/SignoutCheckViewModel.kt | 3 +-- 112 files changed, 149 insertions(+), 298 deletions(-) delete mode 100644 matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/util/Exhaustive.kt delete mode 100644 vector/src/main/java/im/vector/app/core/extensions/Exhaustive.kt diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/qrcode/DefaultQrCodeVerificationTransaction.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/qrcode/DefaultQrCodeVerificationTransaction.kt index 8bfbcfaef4..90ede18dc8 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/qrcode/DefaultQrCodeVerificationTransaction.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/qrcode/DefaultQrCodeVerificationTransaction.kt @@ -29,7 +29,6 @@ import org.matrix.android.sdk.internal.crypto.crosssigning.fromBase64Safe import org.matrix.android.sdk.internal.crypto.store.IMXCryptoStore import org.matrix.android.sdk.internal.crypto.verification.DefaultVerificationTransaction import org.matrix.android.sdk.internal.crypto.verification.ValidVerificationInfoStart -import org.matrix.android.sdk.internal.util.exhaustive import timber.log.Timber internal class DefaultQrCodeVerificationTransaction( @@ -129,7 +128,7 @@ internal class DefaultQrCodeVerificationTransaction( // Nothing special here, we will send a reciprocate start event, and then the other session will trust it's view of the MSK } } - }.exhaustive + } val toVerifyDeviceIds = mutableListOf() @@ -174,7 +173,7 @@ internal class DefaultQrCodeVerificationTransaction( Unit } } - }.exhaustive + } if (!canTrustOtherUserMasterKey && toVerifyDeviceIds.isEmpty()) { // Nothing to verify diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/util/Exhaustive.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/util/Exhaustive.kt deleted file mode 100644 index 097bdaf153..0000000000 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/util/Exhaustive.kt +++ /dev/null @@ -1,20 +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.util - -// Trick to ensure that when block is exhaustive -internal val T.exhaustive: T get() = this 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 64e6a0f83f..62b1f40df5 100644 --- a/tools/templates/ElementFeature/root/src/app_package/ViewModel.kt.ftl +++ b/tools/templates/ElementFeature/root/src/app_package/ViewModel.kt.ftl @@ -7,7 +7,6 @@ import com.airbnb.mvrx.ViewModelContext 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 <#if createViewEvents> @@ -42,6 +41,6 @@ class ${viewModelClass} @AssistedInject constructor(@Assisted initialState: ${vi override fun handle(action: ${actionClass}) { when (action) { - }.exhaustive + } } } diff --git a/vector/src/debug/java/im/vector/app/features/debug/analytics/DebugAnalyticsViewModel.kt b/vector/src/debug/java/im/vector/app/features/debug/analytics/DebugAnalyticsViewModel.kt index 03e416813a..e007e61c1c 100644 --- a/vector/src/debug/java/im/vector/app/features/debug/analytics/DebugAnalyticsViewModel.kt +++ b/vector/src/debug/java/im/vector/app/features/debug/analytics/DebugAnalyticsViewModel.kt @@ -22,7 +22,6 @@ import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.EmptyViewEvents import im.vector.app.core.platform.VectorViewModel import im.vector.app.features.analytics.store.AnalyticsStore @@ -53,7 +52,7 @@ class DebugAnalyticsViewModel @AssistedInject constructor( override fun handle(action: DebugAnalyticsViewActions) { when (action) { DebugAnalyticsViewActions.ResetAnalyticsOptInDisplayed -> handleResetAnalyticsOptInDisplayed() - }.exhaustive + } } private fun handleResetAnalyticsOptInDisplayed() { diff --git a/vector/src/debug/java/im/vector/app/features/debug/settings/DebugPrivateSettingsViewModel.kt b/vector/src/debug/java/im/vector/app/features/debug/settings/DebugPrivateSettingsViewModel.kt index 62871023bc..e469dbacda 100644 --- a/vector/src/debug/java/im/vector/app/features/debug/settings/DebugPrivateSettingsViewModel.kt +++ b/vector/src/debug/java/im/vector/app/features/debug/settings/DebugPrivateSettingsViewModel.kt @@ -22,7 +22,6 @@ import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.EmptyViewEvents import im.vector.app.core.platform.VectorViewModel import im.vector.app.features.debug.features.DebugVectorOverrides @@ -71,7 +70,7 @@ class DebugPrivateSettingsViewModel @AssistedInject constructor( is DebugPrivateSettingsViewActions.SetForceLoginFallbackEnabled -> handleSetForceLoginFallbackEnabled(action) is SetDisplayNameCapabilityOverride -> handSetDisplayNameCapabilityOverride(action) is SetAvatarCapabilityOverride -> handSetAvatarCapabilityOverride(action) - }.exhaustive + } } private fun handleSetDialPadVisibility(action: DebugPrivateSettingsViewActions.SetDialPadVisibility) { diff --git a/vector/src/main/java/im/vector/app/core/extensions/Exhaustive.kt b/vector/src/main/java/im/vector/app/core/extensions/Exhaustive.kt deleted file mode 100644 index 158ea84f0c..0000000000 --- a/vector/src/main/java/im/vector/app/core/extensions/Exhaustive.kt +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2020 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.extensions - -// Trick to ensure that when block is exhaustive -val T.exhaustive: T get() = this diff --git a/vector/src/main/java/im/vector/app/core/platform/VectorBaseActivity.kt b/vector/src/main/java/im/vector/app/core/platform/VectorBaseActivity.kt index 2c161feb37..4796022856 100644 --- a/vector/src/main/java/im/vector/app/core/platform/VectorBaseActivity.kt +++ b/vector/src/main/java/im/vector/app/core/platform/VectorBaseActivity.kt @@ -54,7 +54,6 @@ import im.vector.app.core.di.ActiveSessionHolder import im.vector.app.core.di.ActivityEntryPoint import im.vector.app.core.dialogs.DialogLocker import im.vector.app.core.dialogs.UnrecognizedCertificateDialog -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.extensions.observeEvent import im.vector.app.core.extensions.observeNotNull import im.vector.app.core.extensions.registerStartForActivityResult @@ -267,7 +266,7 @@ abstract class VectorBaseActivity : AppCompatActivity(), Maver is GlobalError.CertificateError -> handleCertificateError(globalError) GlobalError.ExpiredAccount -> Unit // TODO Handle account expiration - }.exhaustive + } } private fun handleCertificateError(certificateError: GlobalError.CertificateError) { diff --git a/vector/src/main/java/im/vector/app/core/ui/views/NotificationAreaView.kt b/vector/src/main/java/im/vector/app/core/ui/views/NotificationAreaView.kt index 1615e77902..5190bb21a8 100644 --- a/vector/src/main/java/im/vector/app/core/ui/views/NotificationAreaView.kt +++ b/vector/src/main/java/im/vector/app/core/ui/views/NotificationAreaView.kt @@ -27,7 +27,6 @@ import androidx.core.text.italic import im.vector.app.R import im.vector.app.core.epoxy.onClick import im.vector.app.core.error.ResourceLimitErrorFormatter -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.utils.DimensionConverter import im.vector.app.databinding.ViewNotificationAreaBinding import im.vector.app.features.themes.ThemeUtils @@ -77,7 +76,7 @@ class NotificationAreaView @JvmOverloads constructor( is State.UnsupportedAlgorithm -> renderUnsupportedAlgorithm(newState) is State.Tombstone -> renderTombstone() is State.ResourceLimitExceededError -> renderResourceLimitExceededError(newState) - }.exhaustive + } } // PRIVATE METHODS **************************************************************************************************************************************** diff --git a/vector/src/main/java/im/vector/app/features/analytics/ui/consent/AnalyticsConsentViewModel.kt b/vector/src/main/java/im/vector/app/features/analytics/ui/consent/AnalyticsConsentViewModel.kt index 2c7a8ac9bc..a570b31452 100644 --- a/vector/src/main/java/im/vector/app/features/analytics/ui/consent/AnalyticsConsentViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/analytics/ui/consent/AnalyticsConsentViewModel.kt @@ -22,7 +22,6 @@ import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel import im.vector.app.features.analytics.VectorAnalytics import kotlinx.coroutines.launch @@ -55,7 +54,7 @@ class AnalyticsConsentViewModel @AssistedInject constructor( override fun handle(action: AnalyticsConsentViewActions) { when (action) { is AnalyticsConsentViewActions.SetUserConsent -> handleSetUserConsent(action) - }.exhaustive + } } private fun handleSetUserConsent(action: AnalyticsConsentViewActions.SetUserConsent) { diff --git a/vector/src/main/java/im/vector/app/features/analytics/ui/consent/AnalyticsOptInActivity.kt b/vector/src/main/java/im/vector/app/features/analytics/ui/consent/AnalyticsOptInActivity.kt index c84031d2fd..c11cf582d3 100644 --- a/vector/src/main/java/im/vector/app/features/analytics/ui/consent/AnalyticsOptInActivity.kt +++ b/vector/src/main/java/im/vector/app/features/analytics/ui/consent/AnalyticsOptInActivity.kt @@ -19,7 +19,6 @@ package im.vector.app.features.analytics.ui.consent import com.airbnb.mvrx.viewModel import dagger.hilt.android.AndroidEntryPoint import im.vector.app.core.extensions.addFragment -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.ScreenOrientationLocker import im.vector.app.core.platform.VectorBaseActivity import im.vector.app.databinding.ActivitySimpleBinding @@ -48,7 +47,7 @@ class AnalyticsOptInActivity : VectorBaseActivity() { viewModel.observeViewEvents { when (it) { AnalyticsOptInViewEvents.OnDataSaved -> finish() - }.exhaustive + } } } } diff --git a/vector/src/main/java/im/vector/app/features/attachments/preview/AttachmentsPreviewViewModel.kt b/vector/src/main/java/im/vector/app/features/attachments/preview/AttachmentsPreviewViewModel.kt index 0a0e700ce9..3e9d72e98b 100644 --- a/vector/src/main/java/im/vector/app/features/attachments/preview/AttachmentsPreviewViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/attachments/preview/AttachmentsPreviewViewModel.kt @@ -17,7 +17,6 @@ package im.vector.app.features.attachments.preview -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel class AttachmentsPreviewViewModel(initialState: AttachmentsPreviewViewState) : @@ -28,7 +27,7 @@ class AttachmentsPreviewViewModel(initialState: AttachmentsPreviewViewState) : is AttachmentsPreviewAction.SetCurrentAttachment -> handleSetCurrentAttachment(action) is AttachmentsPreviewAction.UpdatePathOfCurrentAttachment -> handleUpdatePathOfCurrentAttachment(action) AttachmentsPreviewAction.RemoveCurrentAttachment -> handleRemoveCurrentAttachment() - }.exhaustive + } } private fun handleRemoveCurrentAttachment() = withState { 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 a26eec04f3..449a740cf3 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 @@ -26,7 +26,6 @@ import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel import im.vector.app.features.call.audio.CallAudioManager import im.vector.app.features.call.dialpad.DialPadLookup @@ -343,7 +342,7 @@ class VectorCallViewModel @AssistedInject constructor( setState { VectorCallViewState(action.callArgs) } setupCallWithCurrentState() } - }.exhaustive + } } private fun handleCallTransfer() { @@ -358,7 +357,7 @@ class VectorCallViewModel @AssistedInject constructor( when (result) { is CallTransferResult.ConnectWithUserId -> connectWithUserId(result) is CallTransferResult.ConnectWithPhoneNumber -> connectWithPhoneNumber(result) - }.exhaustive + } } private fun connectWithUserId(result: CallTransferResult.ConnectWithUserId) { 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 d04bebfd1b..f0b7b75afb 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 @@ -27,7 +27,6 @@ import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel import kotlinx.coroutines.Job import kotlinx.coroutines.delay @@ -103,7 +102,7 @@ class JitsiCallViewModel @AssistedInject constructor( when (action) { is JitsiCallViewActions.SwitchTo -> handleSwitchTo(action) JitsiCallViewActions.OnConferenceLeft -> handleOnConferenceLeft() - }.exhaustive + } } private fun handleSwitchTo(action: JitsiCallViewActions.SwitchTo) = withState { state -> diff --git a/vector/src/main/java/im/vector/app/features/call/conference/VectorJitsiActivity.kt b/vector/src/main/java/im/vector/app/features/call/conference/VectorJitsiActivity.kt index a668f66f30..5a12337e4f 100644 --- a/vector/src/main/java/im/vector/app/features/call/conference/VectorJitsiActivity.kt +++ b/vector/src/main/java/im/vector/app/features/call/conference/VectorJitsiActivity.kt @@ -35,7 +35,6 @@ import com.facebook.react.modules.core.PermissionListener import com.google.android.material.dialog.MaterialAlertDialogBuilder import dagger.hilt.android.AndroidEntryPoint import im.vector.app.R -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorBaseActivity import im.vector.app.databinding.ActivityJitsiBinding import kotlinx.parcelize.Parcelize @@ -79,7 +78,7 @@ class VectorJitsiActivity : VectorBaseActivity(), JitsiMee JitsiCallViewEvents.FailJoiningConference -> handleFailJoining() JitsiCallViewEvents.Finish -> finish() JitsiCallViewEvents.LeaveConference -> handleLeaveConference() - }.exhaustive + } } lifecycle.addObserver(ConferenceEventObserver(this, this::onBroadcastEvent)) } diff --git a/vector/src/main/java/im/vector/app/features/call/transfer/CallTransferActivity.kt b/vector/src/main/java/im/vector/app/features/call/transfer/CallTransferActivity.kt index d8eede6a55..b10353be13 100644 --- a/vector/src/main/java/im/vector/app/features/call/transfer/CallTransferActivity.kt +++ b/vector/src/main/java/im/vector/app/features/call/transfer/CallTransferActivity.kt @@ -26,7 +26,6 @@ import com.google.android.material.tabs.TabLayoutMediator import dagger.hilt.android.AndroidEntryPoint import im.vector.app.R import im.vector.app.core.error.ErrorFormatter -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorBaseActivity import im.vector.app.databinding.ActivityCallTransferBinding import kotlinx.parcelize.Parcelize @@ -57,7 +56,7 @@ class CallTransferActivity : VectorBaseActivity() { callTransferViewModel.observeViewEvents { when (it) { is CallTransferViewEvents.Complete -> handleComplete() - }.exhaustive + } } sectionsPagerAdapter = CallTransferPagerAdapter(this) diff --git a/vector/src/main/java/im/vector/app/features/contactsbook/ContactsBookFragment.kt b/vector/src/main/java/im/vector/app/features/contactsbook/ContactsBookFragment.kt index ebd0089736..7425e0ae8a 100644 --- a/vector/src/main/java/im/vector/app/features/contactsbook/ContactsBookFragment.kt +++ b/vector/src/main/java/im/vector/app/features/contactsbook/ContactsBookFragment.kt @@ -26,7 +26,6 @@ import com.airbnb.mvrx.activityViewModel import com.airbnb.mvrx.withState import im.vector.app.core.extensions.cleanup import im.vector.app.core.extensions.configureWith -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.extensions.hideKeyboard import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.core.utils.showIdentityServerConsentDialog @@ -73,7 +72,7 @@ class ContactsBookFragment @Inject constructor( when (it) { is ContactsBookViewEvents.Failure -> showFailure(it.throwable) is ContactsBookViewEvents.OnPoliciesRetrieved -> showConsentDialog(it) - }.exhaustive + } } } 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 5678668b25..d016558764 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 @@ -27,7 +27,6 @@ import im.vector.app.core.contacts.ContactsDataSource import im.vector.app.core.contacts.MappedContact import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.resources.StringProvider import im.vector.app.features.discovery.fetchIdentityServerWithTerms @@ -165,7 +164,7 @@ class ContactsBookViewModel @AssistedInject constructor( is ContactsBookAction.OnlyBoundContacts -> handleOnlyBoundContacts(action) ContactsBookAction.UserConsentGranted -> handleUserConsentGranted() ContactsBookAction.UserConsentRequest -> handleUserConsentRequest() - }.exhaustive + } } private fun handleUserConsentRequest() { diff --git a/vector/src/main/java/im/vector/app/features/createdirect/CreateDirectRoomActivity.kt b/vector/src/main/java/im/vector/app/features/createdirect/CreateDirectRoomActivity.kt index 111b872a15..0d36c7c7cc 100644 --- a/vector/src/main/java/im/vector/app/features/createdirect/CreateDirectRoomActivity.kt +++ b/vector/src/main/java/im/vector/app/features/createdirect/CreateDirectRoomActivity.kt @@ -36,7 +36,6 @@ import im.vector.app.R import im.vector.app.core.error.ErrorFormatter import im.vector.app.core.extensions.addFragment import im.vector.app.core.extensions.addFragmentToBackstack -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.SimpleFragmentActivity import im.vector.app.core.platform.WaitingViewData import im.vector.app.core.utils.PERMISSIONS_FOR_MEMBERS_SEARCH @@ -85,7 +84,7 @@ class CreateDirectRoomActivity : SimpleFragmentActivity() { is UserListSharedAction.OnMenuItemSelected -> onMenuItemSelected(action) UserListSharedAction.OpenPhoneBook -> openPhoneBook() UserListSharedAction.AddByQrCode -> openAddByQrCode() - }.exhaustive + } } .launchIn(lifecycleScope) if (isFirstCreation()) { @@ -112,7 +111,7 @@ class CreateDirectRoomActivity : SimpleFragmentActivity() { Toast.makeText(this, R.string.cannot_dm_self, Toast.LENGTH_SHORT).show() finish() } - }.exhaustive + } } qrViewModel.observeViewEvents { @@ -125,7 +124,7 @@ class CreateDirectRoomActivity : SimpleFragmentActivity() { finish() } else -> Unit - }.exhaustive + } } } 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 9dd3ef6a9b..d3011496d2 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 @@ -24,7 +24,6 @@ import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.mvrx.runCatchingToAsync import im.vector.app.core.platform.VectorViewModel import im.vector.app.features.raw.wellknown.getElementWellknown @@ -56,7 +55,7 @@ class CreateDirectRoomViewModel @AssistedInject constructor(@Assisted when (action) { is CreateDirectRoomAction.CreateRoomAndInviteSelectedUsers -> onSubmitInvitees(action.selections) is CreateDirectRoomAction.QrScannedAction -> onCodeParsed(action) - }.exhaustive + } } private fun onCodeParsed(action: CreateDirectRoomAction.QrScannedAction) { @@ -108,7 +107,7 @@ class CreateDirectRoomViewModel @AssistedInject constructor(@Assisted when (it) { is PendingSelection.UserPendingSelection -> invitedUserIds.add(it.user.userId) is PendingSelection.ThreePidPendingSelection -> invite3pids.add(it.threePid) - }.exhaustive + } } setDirectMessage() enableEncryptionIfInvitedUsersSupportIt = adminE2EByDefault 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 8994ad901b..d324a52242 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 @@ -29,7 +29,6 @@ import dagger.assisted.AssistedInject import im.vector.app.R import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.platform.WaitingViewData import im.vector.app.core.resources.StringProvider @@ -142,7 +141,7 @@ class SharedSecureStorageViewModel @AssistedInject constructor( SharedSecureStorageAction.Back -> handleBack() SharedSecureStorageAction.ForgotResetAll -> handleResetAll() SharedSecureStorageAction.DoResetAll -> handleDoResetAll() - }.exhaustive + } } private fun handleDoResetAll() { diff --git a/vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapBottomSheet.kt b/vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapBottomSheet.kt index 8448422a56..ac7662ca59 100644 --- a/vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapBottomSheet.kt +++ b/vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapBottomSheet.kt @@ -36,7 +36,6 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder import dagger.hilt.android.AndroidEntryPoint import im.vector.app.R import im.vector.app.core.extensions.commitTransaction -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.extensions.registerStartForActivityResult import im.vector.app.core.extensions.toMvRxBundle import im.vector.app.core.platform.VectorBaseBottomSheetDialogFragment @@ -209,7 +208,7 @@ class BootstrapBottomSheet : VectorBaseBottomSheetDialogFragment showSnackbar(it.message) - }.exhaustive + } } supportFragmentManager.addOnBackStackChangedListener(this) } diff --git a/vector/src/main/java/im/vector/app/features/discovery/DiscoverySettingsFragment.kt b/vector/src/main/java/im/vector/app/features/discovery/DiscoverySettingsFragment.kt index 523e8cb9bb..2de03f296e 100644 --- a/vector/src/main/java/im/vector/app/features/discovery/DiscoverySettingsFragment.kt +++ b/vector/src/main/java/im/vector/app/features/discovery/DiscoverySettingsFragment.kt @@ -28,7 +28,6 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder import im.vector.app.R import im.vector.app.core.extensions.cleanup import im.vector.app.core.extensions.configureWith -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.extensions.observeEvent import im.vector.app.core.extensions.registerStartForActivityResult import im.vector.app.core.platform.VectorBaseFragment @@ -70,7 +69,7 @@ class DiscoverySettingsFragment @Inject constructor( when (it) { is DiscoverySharedViewModelAction.ChangeIdentityServer -> viewModel.handle(DiscoverySettingsAction.ChangeIdentityServer(it.newUrl)) - }.exhaustive + } } viewModel.observeViewEvents { @@ -78,7 +77,7 @@ class DiscoverySettingsFragment @Inject constructor( is DiscoverySettingsViewEvents.Failure -> { displayErrorDialog(it.throwable) } - }.exhaustive + } } if (discoveryArgs.expandIdentityPolicies) { viewModel.handle(DiscoverySettingsAction.SetPoliciesExpandState(expanded = true)) 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 19f233fe98..8c1caaf67a 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 @@ -27,7 +27,6 @@ import dagger.assisted.AssistedInject import im.vector.app.R import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.resources.StringProvider import kotlinx.coroutines.flow.launchIn @@ -113,7 +112,7 @@ class DiscoverySettingsViewModel @AssistedInject constructor( is DiscoverySettingsAction.FinalizeBind3pid -> finalizeBind3pid(action, true) is DiscoverySettingsAction.SubmitMsisdnToken -> submitMsisdnToken(action) is DiscoverySettingsAction.CancelBinding -> cancelBinding(action) - }.exhaustive + } } private fun handleUpdateUserConsent(action: DiscoverySettingsAction.UpdateUserConsent) { @@ -235,7 +234,7 @@ class DiscoverySettingsViewModel @AssistedInject constructor( when (action.threePid) { is ThreePid.Email -> revokeEmail(action.threePid) is ThreePid.Msisdn -> revokeMsisdn(action.threePid) - }.exhaustive + } } private fun revokeEmail(threePid: ThreePid.Email) = withState { state -> diff --git a/vector/src/main/java/im/vector/app/features/discovery/SettingsTextButtonSingleLineItem.kt b/vector/src/main/java/im/vector/app/features/discovery/SettingsTextButtonSingleLineItem.kt index 527d28dfad..29a44a1d8a 100644 --- a/vector/src/main/java/im/vector/app/features/discovery/SettingsTextButtonSingleLineItem.kt +++ b/vector/src/main/java/im/vector/app/features/discovery/SettingsTextButtonSingleLineItem.kt @@ -34,7 +34,6 @@ import im.vector.app.core.epoxy.attributes.ButtonStyle import im.vector.app.core.epoxy.attributes.ButtonType import im.vector.app.core.epoxy.attributes.IconMode import im.vector.app.core.epoxy.onClick -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.extensions.setTextOrHide import im.vector.app.core.resources.ColorProvider import im.vector.app.core.resources.StringProvider @@ -122,7 +121,7 @@ abstract class SettingsTextButtonSingleLineItem : EpoxyModelWithHolder { holder.mainButton.setTextColor(colorProvider.getColorFromAttribute(R.attr.colorError)) } - }.exhaustive + } holder.mainButton.onClick(buttonClickListener) } ButtonType.SWITCH -> { @@ -133,7 +132,7 @@ abstract class SettingsTextButtonSingleLineItem : EpoxyModelWithHolder useDefault() is SetIdentityServerAction.UseCustomIdentityServer -> usedCustomIdentityServerUrl(action) - }.exhaustive + } } private fun useDefault() = withState { state -> diff --git a/vector/src/main/java/im/vector/app/features/home/HomeActivity.kt b/vector/src/main/java/im/vector/app/features/home/HomeActivity.kt index 2e9ab0efcb..009edcc69e 100644 --- a/vector/src/main/java/im/vector/app/features/home/HomeActivity.kt +++ b/vector/src/main/java/im/vector/app/features/home/HomeActivity.kt @@ -38,7 +38,6 @@ import dagger.hilt.android.AndroidEntryPoint import im.vector.app.AppStateHandler import im.vector.app.R import im.vector.app.core.di.ActiveSessionHolder -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.extensions.hideKeyboard import im.vector.app.core.extensions.registerStartForActivityResult import im.vector.app.core.extensions.replaceFragment @@ -107,6 +106,7 @@ class HomeActivity : @Suppress("UNUSED") private val analyticsAccountDataViewModel: AnalyticsAccountDataViewModel by viewModel() + @Suppress("UNUSED") private val userColorAccountDataViewModel: UserColorAccountDataViewModel by viewModel() @@ -232,7 +232,7 @@ class HomeActivity : HomeActivitySharedAction.SendSpaceFeedBack -> { bugReporter.openBugReportScreen(this, ReportType.SPACE_BETA_FEEDBACK) } - }.exhaustive + } } .launchIn(lifecycleScope) @@ -256,7 +256,7 @@ class HomeActivity : HomeActivityViewEvents.ShowAnalyticsOptIn -> handleShowAnalyticsOptIn() HomeActivityViewEvents.NotifyUserForThreadsMigration -> handleNotifyUserForThreadsMigration() is HomeActivityViewEvents.MigrateThreads -> migrateThreadsIfNeeded(it.checkSession) - }.exhaustive + } } homeActivityViewModel.onEach { renderState(it) } @@ -374,7 +374,7 @@ class HomeActivity : // Idle or Incremental sync status views.waitingView.root.isVisible = false } - }.exhaustive + } } private fun handleAskPasswordToInitCrossSigning(events: HomeActivityViewEvents.AskPasswordToInitCrossSigning) { 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 b4af50c7ff..87de0a32e3 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 @@ -25,7 +25,6 @@ import im.vector.app.config.analyticsConfig import im.vector.app.core.di.ActiveSessionHolder import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel import im.vector.app.features.analytics.store.AnalyticsStore import im.vector.app.features.login.ReAuthHelper @@ -306,6 +305,6 @@ class HomeActivityViewModel @AssistedInject constructor( HomeActivityViewActions.ViewStarted -> { initialize() } - }.exhaustive + } } } diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/TimelineFragment.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/TimelineFragment.kt index 7137cbc4cf..a0844a9a96 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/TimelineFragment.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/TimelineFragment.kt @@ -72,7 +72,6 @@ import im.vector.app.core.dialogs.ConfirmationDialogBuilder import im.vector.app.core.dialogs.GalleryOrCameraDialogHelper import im.vector.app.core.epoxy.LayoutManagerStateRestorer import im.vector.app.core.extensions.cleanup -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.extensions.hideKeyboard import im.vector.app.core.extensions.registerStartForActivityResult import im.vector.app.core.extensions.setTextOrHide @@ -446,7 +445,7 @@ class TimelineFragment @Inject constructor( } showErrorInSnackbar(it.throwable) } - }.exhaustive + } } timelineViewModel.observeViewEvents { @@ -483,7 +482,7 @@ class TimelineFragment @Inject constructor( RoomDetailViewEvents.StopChatEffects -> handleStopChatEffects() is RoomDetailViewEvents.DisplayAndAcceptCall -> acceptIncomingCall(it) RoomDetailViewEvents.RoomReplacementStarted -> handleRoomReplacement() - }.exhaustive + } } if (savedInstanceState == null) { @@ -875,7 +874,7 @@ class TimelineFragment @Inject constructor( onContentAttachmentsReady(sharedData.attachmentData) } null -> Timber.v("No share data to process") - }.exhaustive + } } private fun handleSpaceShare() { @@ -1241,7 +1240,7 @@ class TimelineFragment @Inject constructor( insertUserDisplayNameInTextEditor(roomDetailPendingAction.userId) is RoomDetailPendingAction.OpenRoom -> handleOpenRoom(RoomDetailViewEvents.OpenRoom(roomDetailPendingAction.roomId, roomDetailPendingAction.closeCurrentRoom)) - }.exhaustive + } } override fun onPause() { @@ -1658,7 +1657,7 @@ class TimelineFragment @Inject constructor( is MessageComposerViewEvents.SlashCommandNotSupportedInThreads -> { displayCommandError(getString(R.string.command_not_supported_in_threads, sendMessageResult.command.command)) } - } // .exhaustive + } // lockSendButton = false } @@ -2437,7 +2436,7 @@ class TimelineFragment @Inject constructor( locationOwnerId = session.myUserId ) } - }.exhaustive + } } // AttachmentsHelper.Callback diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/TimelineViewModel.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/TimelineViewModel.kt index a9235b5699..6933adc758 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/TimelineViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/TimelineViewModel.kt @@ -33,7 +33,6 @@ import im.vector.app.BuildConfig import im.vector.app.R import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.mvrx.runCatchingToAsync import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.resources.StringProvider @@ -440,7 +439,7 @@ class TimelineViewModel @AssistedInject constructor( _viewEvents.post(RoomDetailViewEvents.OpenRoom(action.replacementRoomId, closeCurrentRoom = true)) } is RoomDetailAction.EndPoll -> handleEndPoll(action.eventId) - }.exhaustive + } } private fun handleJitsiCallJoinStatus(action: RoomDetailAction.UpdateJoinJitsiCallStatus) = withState { state -> diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/composer/MessageComposerViewModel.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/composer/MessageComposerViewModel.kt index 009d898940..8b34d9d9a9 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/composer/MessageComposerViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/composer/MessageComposerViewModel.kt @@ -23,7 +23,6 @@ import dagger.assisted.AssistedInject import im.vector.app.R import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.resources.StringProvider import im.vector.app.features.analytics.AnalyticsTracker @@ -463,7 +462,7 @@ class MessageComposerViewModel @AssistedInject constructor( _viewEvents.post(MessageComposerViewEvents.SlashCommandResultOk()) popDraft() } - }.exhaustive + } } is SendMode.Edit -> { // is original event a reply? @@ -536,7 +535,7 @@ class MessageComposerViewModel @AssistedInject constructor( is SendMode.Voice -> { // do nothing } - }.exhaustive + } } } diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/composer/voice/VoiceMessageRecorderView.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/composer/voice/VoiceMessageRecorderView.kt index ba39f40daf..7cb8bbad95 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/composer/voice/VoiceMessageRecorderView.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/composer/voice/VoiceMessageRecorderView.kt @@ -23,7 +23,6 @@ import androidx.constraintlayout.widget.ConstraintLayout import dagger.hilt.android.AndroidEntryPoint import im.vector.app.BuildConfig import im.vector.app.R -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.hardware.vibrate import im.vector.app.core.time.Clock import im.vector.app.core.utils.DimensionConverter @@ -168,7 +167,7 @@ class VoiceMessageRecorderView @JvmOverloads constructor( DraggingState.Ready -> { // do nothing } - }.exhaustive + } dragState = newDragState } 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 7bff76cc36..1702fb95cd 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 @@ -25,7 +25,6 @@ import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel import kotlinx.coroutines.CancellationException import kotlinx.coroutines.Job @@ -56,7 +55,7 @@ class SearchViewModel @AssistedInject constructor( is SearchAction.SearchWith -> handleSearchWith(action) is SearchAction.LoadMore -> handleLoadMore() is SearchAction.Retry -> handleRetry() - }.exhaustive + } } private fun handleSearchWith(action: SearchAction.SearchWith) { diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/helper/ContentUploadStateTrackerBinder.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/helper/ContentUploadStateTrackerBinder.kt index 0909cbe8de..9ff8ddfbce 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/helper/ContentUploadStateTrackerBinder.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/helper/ContentUploadStateTrackerBinder.kt @@ -26,7 +26,6 @@ import dagger.hilt.android.scopes.ActivityScoped import im.vector.app.R import im.vector.app.core.di.ActiveSessionHolder import im.vector.app.core.error.ErrorFormatter -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.utils.TextUtils import im.vector.app.features.home.room.detail.timeline.MessageColorProvider import org.matrix.android.sdk.api.session.content.ContentUploadStateTracker @@ -86,7 +85,7 @@ private class ContentMediaProgressUpdater(private val progressLayout: ViewGroup, is ContentUploadStateTracker.State.Success -> handleSuccess() is ContentUploadStateTracker.State.CompressingImage -> handleCompressingImage() is ContentUploadStateTracker.State.CompressingVideo -> handleCompressingVideo(state) - }.exhaustive + } } private fun handleIdle() { diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/PollOptionView.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/PollOptionView.kt index 2be933d9c3..80daa595b6 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/PollOptionView.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/PollOptionView.kt @@ -23,7 +23,6 @@ import androidx.appcompat.content.res.AppCompatResources import androidx.constraintlayout.widget.ConstraintLayout import androidx.core.view.isVisible import im.vector.app.R -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.extensions.setAttributeTintedImageResource import im.vector.app.databinding.ItemPollOptionBinding @@ -49,7 +48,7 @@ class PollOptionView @JvmOverloads constructor( is PollOptionViewState.PollReady -> renderPollReady() is PollOptionViewState.PollVoted -> renderPollVoted(state) is PollOptionViewState.PollUndisclosed -> renderPollUndisclosed(state) - }.exhaustive + } } private fun renderPollSending() { diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/VerificationRequestItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/VerificationRequestItem.kt index 821531416b..61fcddd123 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/VerificationRequestItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/VerificationRequestItem.kt @@ -31,7 +31,6 @@ import com.airbnb.epoxy.EpoxyModelClass import im.vector.app.R import im.vector.app.core.epoxy.ClickListener import im.vector.app.core.epoxy.onClick -import im.vector.app.core.extensions.exhaustive import im.vector.app.features.home.AvatarRenderer import im.vector.app.features.home.room.detail.RoomDetailAction import im.vector.app.features.home.room.detail.timeline.MessageColorProvider @@ -105,7 +104,7 @@ abstract class VerificationRequestItem : AbsBaseMessageItem handleSelectRoom(it, it.isInviteAlreadyAccepted) is RoomListViewEvents.Done -> Unit is RoomListViewEvents.NavigateToMxToBottomSheet -> handleShowMxToLink(it.link) - }.exhaustive + } } views.createChatFabMenu.listener = this @@ -418,7 +417,7 @@ class RoomListFragment @Inject constructor( is RoomListQuickActionsSharedAction.Leave -> { promptLeaveRoom(quickAction.roomId) } - }.exhaustive + } } private fun promptLeaveRoom(roomId: String) { diff --git a/vector/src/main/java/im/vector/app/features/home/room/list/RoomListViewModel.kt b/vector/src/main/java/im/vector/app/features/home/room/list/RoomListViewModel.kt index ec8b01876b..70974bc1f6 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/list/RoomListViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/list/RoomListViewModel.kt @@ -29,7 +29,6 @@ import im.vector.app.AppStateHandler import im.vector.app.RoomGroupingMethod import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.resources.StringProvider import im.vector.app.features.analytics.AnalyticsTracker @@ -163,7 +162,7 @@ class RoomListViewModel @AssistedInject constructor( is RoomListAction.ToggleSection -> handleToggleSection(action.section) is RoomListAction.JoinSuggestedRoom -> handleJoinSuggestedRoom(action) is RoomListAction.ShowRoomDetails -> handleShowRoomDetails(action) - }.exhaustive + } } fun isPublicRoom(roomId: String): Boolean { diff --git a/vector/src/main/java/im/vector/app/features/location/LocationSharingFragment.kt b/vector/src/main/java/im/vector/app/features/location/LocationSharingFragment.kt index c4dccc1b73..d61d53ae51 100644 --- a/vector/src/main/java/im/vector/app/features/location/LocationSharingFragment.kt +++ b/vector/src/main/java/im/vector/app/features/location/LocationSharingFragment.kt @@ -29,7 +29,6 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.mapbox.mapboxsdk.maps.MapView import im.vector.app.BuildConfig import im.vector.app.R -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.core.utils.PERMISSIONS_FOR_BACKGROUND_LOCATION_SHARING import im.vector.app.core.utils.PERMISSIONS_FOR_FOREGROUND_LOCATION_SHARING @@ -86,7 +85,7 @@ class LocationSharingFragment @Inject constructor( LocationSharingViewEvents.Close -> locationSharingNavigator.quit() LocationSharingViewEvents.LocationNotAvailableError -> handleLocationNotAvailableError() is LocationSharingViewEvents.ZoomToUserLocation -> handleZoomToUserLocationEvent(it) - }.exhaustive + } } } diff --git a/vector/src/main/java/im/vector/app/features/location/LocationSharingViewModel.kt b/vector/src/main/java/im/vector/app/features/location/LocationSharingViewModel.kt index 639666e63f..1d68247f2c 100644 --- a/vector/src/main/java/im/vector/app/features/location/LocationSharingViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/location/LocationSharingViewModel.kt @@ -23,7 +23,6 @@ import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel import im.vector.app.features.home.room.detail.timeline.helper.LocationPinProvider import im.vector.app.features.location.domain.usecase.CompareLocationsUseCase @@ -122,7 +121,7 @@ class LocationSharingViewModel @AssistedInject constructor( is LocationSharingAction.LocationTargetChange -> handleLocationTargetChangeAction(action) LocationSharingAction.ZoomToUserLocation -> handleZoomToUserLocationAction() LocationSharingAction.StartLiveLocationSharing -> handleStartLiveLocationSharingAction() - }.exhaustive + } } private fun handleCurrentUserLocationSharingAction() = withState { state -> diff --git a/vector/src/main/java/im/vector/app/features/login/AbstractLoginFragment.kt b/vector/src/main/java/im/vector/app/features/login/AbstractLoginFragment.kt index 8b83873142..f5e48e84e7 100644 --- a/vector/src/main/java/im/vector/app/features/login/AbstractLoginFragment.kt +++ b/vector/src/main/java/im/vector/app/features/login/AbstractLoginFragment.kt @@ -26,7 +26,6 @@ import com.airbnb.mvrx.withState import com.google.android.material.dialog.MaterialAlertDialogBuilder import im.vector.app.R import im.vector.app.core.dialogs.UnrecognizedCertificateDialog -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.OnBackPressed import im.vector.app.core.platform.VectorBaseFragment import kotlinx.coroutines.CancellationException @@ -69,7 +68,7 @@ abstract class AbstractLoginFragment : VectorBaseFragment( else -> // This is handled by the Activity Unit - }.exhaustive + } } override fun showFailure(throwable: Throwable) { diff --git a/vector/src/main/java/im/vector/app/features/login/LoginActivity.kt b/vector/src/main/java/im/vector/app/features/login/LoginActivity.kt index a40f26acec..dec6fef040 100644 --- a/vector/src/main/java/im/vector/app/features/login/LoginActivity.kt +++ b/vector/src/main/java/im/vector/app/features/login/LoginActivity.kt @@ -35,7 +35,6 @@ import im.vector.app.R import im.vector.app.core.extensions.POP_BACK_STACK_EXCLUSIVE import im.vector.app.core.extensions.addFragment import im.vector.app.core.extensions.addFragmentToBackstack -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.extensions.validateBackPressed import im.vector.app.core.platform.VectorBaseActivity import im.vector.app.databinding.ActivityLoginBinding @@ -197,7 +196,7 @@ open class LoginActivity : VectorBaseActivity(), UnlockedA is LoginViewEvents.Loading -> // This is handled by the Fragments Unit - }.exhaustive + } } private fun updateWithState(loginViewState: LoginViewState) { @@ -260,13 +259,13 @@ open class LoginActivity : VectorBaseActivity(), UnlockedA tag = FRAGMENT_LOGIN_TAG, option = commonOption) LoginMode.Unsupported -> onLoginModeNotSupported(state.loginModeSupportedTypes) - }.exhaustive + } } SignMode.SignInWithMatrixId -> addFragmentToBackstack(views.loginFragmentContainer, LoginFragment::class.java, tag = FRAGMENT_LOGIN_TAG, option = commonOption) - }.exhaustive + } } /** diff --git a/vector/src/main/java/im/vector/app/features/login/LoginFragment.kt b/vector/src/main/java/im/vector/app/features/login/LoginFragment.kt index 61d32eadd8..22f8792078 100644 --- a/vector/src/main/java/im/vector/app/features/login/LoginFragment.kt +++ b/vector/src/main/java/im/vector/app/features/login/LoginFragment.kt @@ -31,7 +31,6 @@ import com.airbnb.mvrx.Loading import com.airbnb.mvrx.Success import com.airbnb.mvrx.Uninitialized import im.vector.app.R -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.extensions.hideKeyboard import im.vector.app.core.extensions.hidePassword import im.vector.app.core.extensions.toReducedUrl @@ -98,7 +97,7 @@ class LoginFragment @Inject constructor() : AbstractSSOLoginFragment SocialLoginButtonsView.Mode.MODE_SIGN_UP SignMode.SignIn, SignMode.SignInWithMatrixId -> SocialLoginButtonsView.Mode.MODE_SIGN_IN - }.exhaustive + } } private fun submit() { 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 4eba31994b..246c3ad464 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 @@ -31,7 +31,6 @@ import im.vector.app.core.di.ActiveSessionHolder import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory import im.vector.app.core.extensions.configureAndStart -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.resources.StringProvider import im.vector.app.core.utils.ensureTrailingSlash @@ -131,7 +130,7 @@ class LoginViewModel @AssistedInject constructor( is LoginAction.UserAcceptCertificate -> handleUserAcceptCertificate(action) LoginAction.ClearHomeServerHistory -> handleClearHomeServerHistory() is LoginAction.PostViewEvent -> _viewEvents.post(action.viewEvent) - }.exhaustive + } } private fun handleOnGetStarted(action: LoginAction.OnGetStarted) { @@ -448,7 +447,7 @@ class LoginViewModel @AssistedInject constructor( handle(LoginAction.UpdateHomeServer(matrixOrgUrl)) ServerType.EMS, ServerType.Other -> _viewEvents.post(LoginViewEvents.OnServerSelectionDone(action.serverType)) - }.exhaustive + } } private fun handleInitWith(action: LoginAction.InitWith) { @@ -556,7 +555,7 @@ class LoginViewModel @AssistedInject constructor( SignMode.SignIn -> handleLogin(action) SignMode.SignUp -> handleRegisterWith(action) SignMode.SignInWithMatrixId -> handleDirectLogin(action, null) - }.exhaustive + } } private fun handleDirectLogin(action: LoginAction.LoginOrRegister, homeServerConnectionConfig: HomeServerConnectionConfig?) { @@ -586,7 +585,7 @@ class LoginViewModel @AssistedInject constructor( else -> { onWellKnownError() } - }.exhaustive + } } } diff --git a/vector/src/main/java/im/vector/app/features/login2/AbstractLoginFragment2.kt b/vector/src/main/java/im/vector/app/features/login2/AbstractLoginFragment2.kt index 8c9749d91e..68568d1420 100644 --- a/vector/src/main/java/im/vector/app/features/login2/AbstractLoginFragment2.kt +++ b/vector/src/main/java/im/vector/app/features/login2/AbstractLoginFragment2.kt @@ -26,7 +26,6 @@ import com.airbnb.mvrx.withState import com.google.android.material.dialog.MaterialAlertDialogBuilder import im.vector.app.R import im.vector.app.core.dialogs.UnrecognizedCertificateDialog -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.OnBackPressed import im.vector.app.core.platform.VectorBaseFragment import kotlinx.coroutines.CancellationException @@ -67,7 +66,7 @@ abstract class AbstractLoginFragment2 : VectorBaseFragment else -> // This is handled by the Activity Unit - }.exhaustive + } } override fun showFailure(throwable: Throwable) { diff --git a/vector/src/main/java/im/vector/app/features/login2/LoginViewModel2.kt b/vector/src/main/java/im/vector/app/features/login2/LoginViewModel2.kt index e2831e7d2d..8125c6e089 100644 --- a/vector/src/main/java/im/vector/app/features/login2/LoginViewModel2.kt +++ b/vector/src/main/java/im/vector/app/features/login2/LoginViewModel2.kt @@ -28,7 +28,6 @@ import im.vector.app.core.di.ActiveSessionHolder import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory import im.vector.app.core.extensions.configureAndStart -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.extensions.tryAsync import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.resources.StringProvider @@ -136,7 +135,7 @@ class LoginViewModel2 @AssistedInject constructor( LoginAction2.ClearHomeServerHistory -> handleClearHomeServerHistory() is LoginAction2.PostViewEvent -> _viewEvents.post(action.viewEvent) is LoginAction2.Finish -> handleFinish() - }.exhaustive + } } private fun handleFinish() { @@ -500,7 +499,7 @@ class LoginViewModel2 @AssistedInject constructor( SignMode2.Unknown -> error("Developer error, invalid sign mode") SignMode2.SignIn -> handleSetUserNameForSignIn(action, null) SignMode2.SignUp -> handleSetUserNameForSignUp(action) - }.exhaustive + } } private fun handleSetUserPassword(action: LoginAction2.SetUserPassword) = withState { state -> @@ -508,7 +507,7 @@ class LoginViewModel2 @AssistedInject constructor( SignMode2.Unknown -> error("Developer error, invalid sign mode") SignMode2.SignIn -> handleSignInWithPassword(action) SignMode2.SignUp -> handleRegisterWithPassword(action) - }.exhaustive + } } private fun handleRegisterWithPassword(action: LoginAction2.SetUserPassword) = withState { state -> @@ -588,7 +587,7 @@ class LoginViewModel2 @AssistedInject constructor( else -> { onWellKnownError() } - }.exhaustive + } } } 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 76391c6dec..04c2c8dd44 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 @@ -28,7 +28,6 @@ import im.vector.app.R import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory import im.vector.app.core.error.ErrorFormatter -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.resources.StringProvider import im.vector.app.features.createdirect.DirectRoomHelper @@ -264,7 +263,7 @@ class MatrixToBottomSheetViewModel @AssistedInject constructor( is MatrixToAction.OpenRoom -> { _viewEvents.post(MatrixToViewEvents.NavigateToRoom(action.roomId)) } - }.exhaustive + } } private fun handleJoinSpace(joinSpace: MatrixToAction.JoinSpace) { diff --git a/vector/src/main/java/im/vector/app/features/onboarding/Login2Variant.kt b/vector/src/main/java/im/vector/app/features/onboarding/Login2Variant.kt index 107c08da5a..163af5d8d1 100644 --- a/vector/src/main/java/im/vector/app/features/onboarding/Login2Variant.kt +++ b/vector/src/main/java/im/vector/app/features/onboarding/Login2Variant.kt @@ -30,7 +30,6 @@ import im.vector.app.R import im.vector.app.core.extensions.POP_BACK_STACK_EXCLUSIVE import im.vector.app.core.extensions.addFragment import im.vector.app.core.extensions.addFragmentToBackstack -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.extensions.resetBackstack import im.vector.app.core.platform.VectorBaseActivity import im.vector.app.databinding.ActivityLoginBinding @@ -257,7 +256,7 @@ class Login2Variant( is LoginViewEvents2.OnSessionCreated -> handleOnSessionCreated(event) is LoginViewEvents2.Finish -> terminate(true) is LoginViewEvents2.CancelRegistration -> handleCancelRegistration() - }.exhaustive + } } private fun handleCancelRegistration() { diff --git a/vector/src/main/java/im/vector/app/features/onboarding/OnboardingViewModel.kt b/vector/src/main/java/im/vector/app/features/onboarding/OnboardingViewModel.kt index 856b2ab567..e7302cb1e2 100644 --- a/vector/src/main/java/im/vector/app/features/onboarding/OnboardingViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/onboarding/OnboardingViewModel.kt @@ -31,7 +31,6 @@ import im.vector.app.core.di.ActiveSessionHolder import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory import im.vector.app.core.extensions.configureAndStart -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.extensions.vectorStore import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.resources.StringProvider @@ -166,7 +165,7 @@ class OnboardingViewModel @AssistedInject constructor( OnboardingAction.SaveSelectedProfilePicture -> updateProfilePicture() is OnboardingAction.PostViewEvent -> _viewEvents.post(action.viewEvent) OnboardingAction.StopEmailValidationCheck -> cancelWaitForEmailValidation() - }.exhaustive + } } private fun handleSplashAction(resetConfig: Boolean, onboardingFlow: OnboardingFlow) { @@ -404,7 +403,7 @@ class OnboardingViewModel @AssistedInject constructor( handle(OnboardingAction.UpdateHomeServer(matrixOrgUrl)) ServerType.EMS, ServerType.Other -> _viewEvents.post(OnboardingViewEvents.OnServerSelectionDone(action.serverType)) - }.exhaustive + } } private fun handleInitWith(action: OnboardingAction.InitWith) { @@ -512,7 +511,7 @@ class OnboardingViewModel @AssistedInject constructor( SignMode.SignIn -> handleLogin(action) SignMode.SignUp -> handleRegisterWith(action) SignMode.SignInWithMatrixId -> handleDirectLogin(action, null) - }.exhaustive + } } private fun handleDirectLogin(action: OnboardingAction.LoginOrRegister, homeServerConnectionConfig: HomeServerConnectionConfig?) { @@ -542,7 +541,7 @@ class OnboardingViewModel @AssistedInject constructor( else -> { onWellKnownError() } - }.exhaustive + } } } diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/AbstractFtueAuthFragment.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/AbstractFtueAuthFragment.kt index 0caf2ea152..f8f6f6cefa 100644 --- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/AbstractFtueAuthFragment.kt +++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/AbstractFtueAuthFragment.kt @@ -26,7 +26,6 @@ import com.airbnb.mvrx.withState import com.google.android.material.dialog.MaterialAlertDialogBuilder import im.vector.app.R import im.vector.app.core.dialogs.UnrecognizedCertificateDialog -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.OnBackPressed import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.features.onboarding.OnboardingAction @@ -73,7 +72,7 @@ abstract class AbstractFtueAuthFragment : VectorBaseFragment // This is handled by the Activity Unit - }.exhaustive + } } override fun showFailure(throwable: Throwable) { diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthLoginFragment.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthLoginFragment.kt index 632625f4de..dacd8feab3 100644 --- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthLoginFragment.kt +++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthLoginFragment.kt @@ -29,7 +29,6 @@ import androidx.lifecycle.lifecycleScope import com.airbnb.mvrx.Fail import com.airbnb.mvrx.Loading import im.vector.app.R -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.extensions.hideKeyboard import im.vector.app.core.extensions.hidePassword import im.vector.app.core.extensions.toReducedUrl @@ -104,7 +103,7 @@ class FtueAuthLoginFragment @Inject constructor() : AbstractSSOFtueAuthFragment< views.loginField.setAutofillHints(HintConstants.AUTOFILL_HINT_USERNAME) views.passwordField.setAutofillHints(HintConstants.AUTOFILL_HINT_PASSWORD) } - }.exhaustive + } } } @@ -114,7 +113,7 @@ class FtueAuthLoginFragment @Inject constructor() : AbstractSSOFtueAuthFragment< SignMode.SignUp -> SocialLoginButtonsView.Mode.MODE_SIGN_UP SignMode.SignIn, SignMode.SignInWithMatrixId -> SocialLoginButtonsView.Mode.MODE_SIGN_IN - }.exhaustive + } } private fun submit() { diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthVariant.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthVariant.kt index 79a974038b..13b5f61010 100644 --- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthVariant.kt +++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthVariant.kt @@ -31,7 +31,6 @@ import im.vector.app.R import im.vector.app.core.extensions.POP_BACK_STACK_EXCLUSIVE import im.vector.app.core.extensions.addFragment import im.vector.app.core.extensions.addFragmentToBackstack -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.extensions.popBackstack import im.vector.app.core.extensions.replaceFragment import im.vector.app.core.platform.ScreenOrientationLocker @@ -229,7 +228,7 @@ class FtueAuthVariant( OnboardingViewEvents.OnChooseProfilePicture -> onChooseProfilePicture() OnboardingViewEvents.OnPersonalizationComplete -> onPersonalizationComplete() OnboardingViewEvents.OnBack -> activity.popBackstack() - }.exhaustive + } } private fun registrationShouldFallback(registrationFlowResult: OnboardingViewEvents.RegistrationFlowResult) = @@ -281,7 +280,7 @@ class FtueAuthVariant( SignMode.SignUp -> Unit // This case is processed in handleOnboardingViewEvents SignMode.SignIn -> handleSignInSelected(state) SignMode.SignInWithMatrixId -> handleSignInWithMatrixId(state) - }.exhaustive + } } private fun handleSignInSelected(state: OnboardingViewState) { diff --git a/vector/src/main/java/im/vector/app/features/poll/create/CreatePollFragment.kt b/vector/src/main/java/im/vector/app/features/poll/create/CreatePollFragment.kt index 4483b00158..2abff7f22b 100644 --- a/vector/src/main/java/im/vector/app/features/poll/create/CreatePollFragment.kt +++ b/vector/src/main/java/im/vector/app/features/poll/create/CreatePollFragment.kt @@ -27,7 +27,6 @@ import com.airbnb.mvrx.args import com.airbnb.mvrx.withState import im.vector.app.R import im.vector.app.core.extensions.configureWith -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.databinding.FragmentCreatePollBinding import im.vector.app.features.poll.create.CreatePollViewModel.Companion.MAX_OPTIONS_COUNT @@ -68,7 +67,7 @@ class CreatePollFragment @Inject constructor( views.createPollToolbar.title = getString(R.string.edit_poll_title) views.createPollButton.text = getString(R.string.edit_poll_title) } - }.exhaustive + } views.createPollRecyclerView.configureWith(controller, disableItemAnimation = true) // workaround for https://github.com/vector-im/element-android/issues/4735 diff --git a/vector/src/main/java/im/vector/app/features/qrcode/QrCodeScannerActivity.kt b/vector/src/main/java/im/vector/app/features/qrcode/QrCodeScannerActivity.kt index dda7b2e2eb..b23f2f171d 100644 --- a/vector/src/main/java/im/vector/app/features/qrcode/QrCodeScannerActivity.kt +++ b/vector/src/main/java/im/vector/app/features/qrcode/QrCodeScannerActivity.kt @@ -24,7 +24,6 @@ import androidx.activity.result.ActivityResultLauncher import com.airbnb.mvrx.viewModel import dagger.hilt.android.AndroidEntryPoint import im.vector.app.R -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.extensions.replaceFragment import im.vector.app.core.platform.VectorBaseActivity import im.vector.app.databinding.ActivitySimpleBinding @@ -51,7 +50,7 @@ class QrCodeScannerActivity() : VectorBaseActivity() { finish() } else -> Unit - }.exhaustive + } } if (isFirstCreation()) { 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 a77bd32f26..0cb49746f1 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 @@ -23,7 +23,6 @@ import dagger.assisted.AssistedInject import im.vector.app.R import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.resources.StringProvider import kotlinx.coroutines.Dispatchers @@ -127,6 +126,6 @@ class RequireActiveMembershipViewModel @AssistedInject constructor( } roomIdFlow.tryEmit(Optional.from(action.roomId)) } - }.exhaustive + } } } diff --git a/vector/src/main/java/im/vector/app/features/roomdirectory/PublicRoomsFragment.kt b/vector/src/main/java/im/vector/app/features/roomdirectory/PublicRoomsFragment.kt index 14b50c2745..b8bba347fd 100644 --- a/vector/src/main/java/im/vector/app/features/roomdirectory/PublicRoomsFragment.kt +++ b/vector/src/main/java/im/vector/app/features/roomdirectory/PublicRoomsFragment.kt @@ -28,7 +28,6 @@ import com.airbnb.mvrx.withState import im.vector.app.R import im.vector.app.core.extensions.cleanup import im.vector.app.core.extensions.configureWith -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.extensions.trackItemsVisibilityChange import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.core.platform.showOptimizedSnackbar @@ -96,7 +95,7 @@ class PublicRoomsFragment @Inject constructor( is RoomDirectoryViewEvents.Failure -> { views.coordinatorLayout.showOptimizedSnackbar(errorFormatter.toHumanReadable(viewEvents.throwable)) } - }.exhaustive + } } override fun onDestroyView() { diff --git a/vector/src/main/java/im/vector/app/features/roomdirectory/createroom/CreateRoomFragment.kt b/vector/src/main/java/im/vector/app/features/roomdirectory/createroom/CreateRoomFragment.kt index 2bd41ae3af..2871513c1f 100644 --- a/vector/src/main/java/im/vector/app/features/roomdirectory/createroom/CreateRoomFragment.kt +++ b/vector/src/main/java/im/vector/app/features/roomdirectory/createroom/CreateRoomFragment.kt @@ -34,7 +34,6 @@ import im.vector.app.R import im.vector.app.core.dialogs.GalleryOrCameraDialogHelper import im.vector.app.core.extensions.cleanup import im.vector.app.core.extensions.configureWith -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.OnBackPressed import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.core.resources.ColorProvider @@ -94,7 +93,7 @@ class CreateRoomFragment @Inject constructor( when (it) { CreateRoomViewEvents.Quit -> vectorBaseActivity.onBackPressed() is CreateRoomViewEvents.Failure -> showFailure(it.throwable) - }.exhaustive + } } } 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 3b2e9de2d1..7d65c44a57 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 @@ -28,7 +28,6 @@ import dagger.assisted.AssistedInject import im.vector.app.AppStateHandler import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel import im.vector.app.features.analytics.AnalyticsTracker import im.vector.app.features.analytics.plan.CreatedRoom @@ -138,7 +137,7 @@ class CreateRoomViewModel @AssistedInject constructor( CreateRoomAction.Reset -> doReset() CreateRoomAction.ToggleShowAdvanced -> toggleShowAdvanced() is CreateRoomAction.DisableFederation -> disableFederation(action) - }.exhaustive + } } private fun disableFederation(action: CreateRoomAction.DisableFederation) { @@ -281,7 +280,7 @@ class CreateRoomViewModel @AssistedInject constructor( // Preset preset = CreateRoomPreset.PRESET_PRIVATE_CHAT } - }.exhaustive + } // Disabling federation disableFederation = state.disableFederation 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 a5673e78a2..51af9a8286 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 @@ -27,7 +27,6 @@ import dagger.assisted.AssistedInject import im.vector.app.R import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.EmptyViewEvents import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.resources.StringProvider @@ -104,7 +103,7 @@ class RoomDirectoryPickerViewModel @AssistedInject constructor( is RoomDirectoryPickerAction.SetServerUrl -> handleSetServerUrl(action) RoomDirectoryPickerAction.Submit -> handleSubmit() is RoomDirectoryPickerAction.RemoveServer -> handleRemoveServer(action) - }.exhaustive + } } private fun handleEnterEditMode() { 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 42bec8c8b3..a22dc7ed95 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 @@ -24,7 +24,6 @@ import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.EmptyViewEvents import im.vector.app.core.platform.VectorViewModel import im.vector.app.features.analytics.AnalyticsTracker @@ -204,7 +203,7 @@ class RoomPreviewViewModel @AssistedInject constructor( when (action) { is RoomPreviewAction.Join -> handleJoinRoom() RoomPreviewAction.JoinThirdParty -> handleJoinRoomThirdParty() - }.exhaustive + } } private fun handleJoinRoomThirdParty() = withState { state -> diff --git a/vector/src/main/java/im/vector/app/features/roommemberprofile/RoomMemberProfileFragment.kt b/vector/src/main/java/im/vector/app/features/roommemberprofile/RoomMemberProfileFragment.kt index 44e7405ee5..d9ed6d227a 100644 --- a/vector/src/main/java/im/vector/app/features/roommemberprofile/RoomMemberProfileFragment.kt +++ b/vector/src/main/java/im/vector/app/features/roommemberprofile/RoomMemberProfileFragment.kt @@ -39,7 +39,6 @@ import im.vector.app.core.dialogs.ConfirmationDialogBuilder import im.vector.app.core.extensions.cleanup import im.vector.app.core.extensions.configureWith import im.vector.app.core.extensions.copyOnLongClick -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.extensions.setTextOrHide import im.vector.app.core.platform.StateView import im.vector.app.core.platform.VectorBaseFragment @@ -134,7 +133,7 @@ class RoomMemberProfileFragment @Inject constructor( is RoomMemberProfileViewEvents.OnBanActionSuccess -> Unit is RoomMemberProfileViewEvents.OnIgnoreActionSuccess -> Unit is RoomMemberProfileViewEvents.OnInviteActionSuccess -> Unit - }.exhaustive + } } setupLongClicks() } 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 a79a9f4c1d..db54f27910 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 @@ -28,7 +28,6 @@ import dagger.assisted.AssistedInject import im.vector.app.R import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.mvrx.runCatchingToAsync import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.resources.StringProvider @@ -170,7 +169,7 @@ class RoomMemberProfileViewModel @AssistedInject constructor( RoomMemberProfileAction.InviteUser -> handleInviteAction() is RoomMemberProfileAction.SetUserColorOverride -> handleSetUserColorOverride(action) is RoomMemberProfileAction.OpenOrCreateDm -> handleOpenOrCreateDm(action) - }.exhaustive + } } private fun handleOpenOrCreateDm(action: RoomMemberProfileAction.OpenOrCreateDm) { diff --git a/vector/src/main/java/im/vector/app/features/roommemberprofile/devices/DeviceListBottomSheet.kt b/vector/src/main/java/im/vector/app/features/roommemberprofile/devices/DeviceListBottomSheet.kt index bb2317b59c..8df0b3ffd5 100644 --- a/vector/src/main/java/im/vector/app/features/roommemberprofile/devices/DeviceListBottomSheet.kt +++ b/vector/src/main/java/im/vector/app/features/roommemberprofile/devices/DeviceListBottomSheet.kt @@ -29,7 +29,6 @@ import com.airbnb.mvrx.withState import dagger.hilt.android.AndroidEntryPoint import im.vector.app.R import im.vector.app.core.extensions.commitTransaction -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorBaseBottomSheetDialogFragment import im.vector.app.databinding.BottomSheetWithFragmentsBinding import im.vector.app.features.crypto.verification.VerificationBottomSheet @@ -57,7 +56,7 @@ class DeviceListBottomSheet : transactionId = it.txID ).show(requireActivity().supportFragmentManager, "REQPOP") } - }.exhaustive + } } } 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 d2491237ca..03e07a2f82 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 @@ -28,7 +28,6 @@ import dagger.hilt.EntryPoints import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.SingletonEntryPoint import im.vector.app.core.di.hiltMavericksViewModelFactory -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel import org.matrix.android.sdk.api.session.Session import org.matrix.android.sdk.api.session.crypto.crosssigning.MXCrossSigningInfo @@ -94,7 +93,7 @@ class DeviceListBottomSheetViewModel @AssistedInject constructor(@Assisted priva is DeviceListAction.SelectDevice -> selectDevice(action) is DeviceListAction.DeselectDevice -> deselectDevice() is DeviceListAction.ManuallyVerify -> manuallyVerify(action) - }.exhaustive + } } private fun refreshSelectedId() = withState { state -> diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileActivity.kt b/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileActivity.kt index 4c6d2ed2e3..12a5d94eca 100644 --- a/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileActivity.kt +++ b/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileActivity.kt @@ -26,7 +26,6 @@ import com.airbnb.mvrx.viewModel import dagger.hilt.android.AndroidEntryPoint import im.vector.app.core.extensions.addFragment import im.vector.app.core.extensions.addFragmentToBackstack -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorBaseActivity import im.vector.app.databinding.ActivitySimpleBinding import im.vector.app.features.home.room.detail.RoomDetailPendingActionStore @@ -102,7 +101,7 @@ class RoomProfileActivity : RoomProfileSharedAction.OpenRoomUploads -> openRoomUploads() RoomProfileSharedAction.OpenBannedRoomMembers -> openBannedRoomMembers() RoomProfileSharedAction.OpenRoomNotificationSettings -> openRoomNotificationSettings() - }.exhaustive + } } .launchIn(lifecycleScope) diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileFragment.kt b/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileFragment.kt index b13ef2a5d1..ba9280dc59 100644 --- a/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileFragment.kt +++ b/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileFragment.kt @@ -37,7 +37,6 @@ import im.vector.app.core.animations.MatrixItemAppBarStateChangeListener import im.vector.app.core.extensions.cleanup import im.vector.app.core.extensions.configureWith import im.vector.app.core.extensions.copyOnLongClick -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.extensions.setTextOrHide import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.core.utils.copyToClipboard @@ -127,7 +126,7 @@ class RoomProfileFragment @Inject constructor( is RoomProfileViewEvents.ShareRoomProfile -> onShareRoomProfile(it.permalink) is RoomProfileViewEvents.OnShortcutReady -> addShortcut(it) RoomProfileViewEvents.DismissLoading -> dismissLoadingDialog() - }.exhaustive + } } roomListQuickActionsSharedActionViewModel .stream() 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 b7c7d24888..61013c8eb6 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 @@ -24,7 +24,6 @@ import dagger.assisted.AssistedInject import im.vector.app.R import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.resources.StringProvider import im.vector.app.features.home.ShortcutCreator @@ -137,7 +136,7 @@ class RoomProfileViewModel @AssistedInject constructor( is RoomProfileAction.ShareRoomProfile -> handleShareRoomProfile() RoomProfileAction.CreateShortcut -> handleCreateShortcut() RoomProfileAction.RestoreEncryptionState -> restoreEncryptionState() - }.exhaustive + } } fun isPublicRoom(): Boolean { diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/alias/RoomAliasFragment.kt b/vector/src/main/java/im/vector/app/features/roomprofile/alias/RoomAliasFragment.kt index e48ce54e6c..2a738fd07c 100644 --- a/vector/src/main/java/im/vector/app/features/roomprofile/alias/RoomAliasFragment.kt +++ b/vector/src/main/java/im/vector/app/features/roomprofile/alias/RoomAliasFragment.kt @@ -29,7 +29,6 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder import im.vector.app.R import im.vector.app.core.extensions.cleanup import im.vector.app.core.extensions.configureWith -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.core.utils.shareText import im.vector.app.core.utils.toast @@ -77,7 +76,7 @@ class RoomAliasFragment @Inject constructor( when (it) { is RoomAliasViewEvents.Failure -> showFailure(it.throwable) RoomAliasViewEvents.Success -> showSuccess() - }.exhaustive + } } sharedActionViewModel 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 19f600e5de..adffbcbd06 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 @@ -26,7 +26,6 @@ import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel import im.vector.app.features.powerlevel.PowerLevelsFlowFactory import kotlinx.coroutines.flow.launchIn @@ -190,7 +189,7 @@ class RoomAliasViewModel @AssistedInject constructor(@Assisted initialState: Roo is RoomAliasAction.RemoveLocalAlias -> handleRemoveLocalAlias(action) is RoomAliasAction.PublishAlias -> handlePublishAlias(action) RoomAliasAction.Retry -> handleRetry() - }.exhaustive + } } private fun handleRetry() = withState { state -> 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 d7efc2fb79..ec249c75ba 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 @@ -23,7 +23,6 @@ import dagger.assisted.AssistedInject import im.vector.app.R import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.resources.StringProvider import im.vector.app.features.powerlevel.PowerLevelsFlowFactory @@ -84,7 +83,7 @@ class RoomBannedMemberListViewModel @AssistedInject constructor(@Assisted initia is RoomBannedMemberListAction.QueryInfo -> onQueryBanInfo(action.roomMemberSummary) is RoomBannedMemberListAction.UnBanUser -> unBanUser(action.roomMemberSummary) is RoomBannedMemberListAction.Filter -> handleFilter(action) - }.exhaustive + } } private fun handleFilter(action: RoomBannedMemberListAction.Filter) { 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 0bbdd87f3e..c9a70fbef8 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 @@ -23,7 +23,6 @@ import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.EmptyViewEvents import im.vector.app.core.platform.VectorViewModel import im.vector.app.features.powerlevel.PowerLevelsFlowFactory @@ -181,7 +180,7 @@ class RoomMemberListViewModel @AssistedInject constructor(@Assisted initialState when (action) { is RoomMemberListAction.RevokeThreePidInvite -> handleRevokeThreePidInvite(action) is RoomMemberListAction.FilterMemberList -> handleFilterMemberList(action) - }.exhaustive + } } private fun handleRevokeThreePidInvite(action: RoomMemberListAction.RevokeThreePidInvite) { diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/permissions/RoomPermissionsFragment.kt b/vector/src/main/java/im/vector/app/features/roomprofile/permissions/RoomPermissionsFragment.kt index 0d5ac7dea8..c1175796fb 100644 --- a/vector/src/main/java/im/vector/app/features/roomprofile/permissions/RoomPermissionsFragment.kt +++ b/vector/src/main/java/im/vector/app/features/roomprofile/permissions/RoomPermissionsFragment.kt @@ -27,7 +27,6 @@ import com.airbnb.mvrx.withState import im.vector.app.R import im.vector.app.core.extensions.cleanup import im.vector.app.core.extensions.configureWith -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.core.utils.toast import im.vector.app.databinding.FragmentRoomSettingGenericBinding @@ -67,7 +66,7 @@ class RoomPermissionsFragment @Inject constructor( when (it) { is RoomPermissionsViewEvents.Failure -> showFailure(it.throwable) RoomPermissionsViewEvents.Success -> showSuccess() - }.exhaustive + } } } 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 7e8a66d12a..6fbc545b6c 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 @@ -23,7 +23,6 @@ import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel import im.vector.app.features.powerlevel.PowerLevelsFlowFactory import kotlinx.coroutines.flow.launchIn @@ -90,7 +89,7 @@ class RoomPermissionsViewModel @AssistedInject constructor(@Assisted initialStat when (action) { is RoomPermissionsAction.UpdatePermission -> updatePermission(action) RoomPermissionsAction.ToggleShowAllPermissions -> toggleShowAllPermissions() - }.exhaustive + } } private fun toggleShowAllPermissions() { diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/settings/RoomSettingsFragment.kt b/vector/src/main/java/im/vector/app/features/roomprofile/settings/RoomSettingsFragment.kt index 51f6b247d4..0bde35f41e 100644 --- a/vector/src/main/java/im/vector/app/features/roomprofile/settings/RoomSettingsFragment.kt +++ b/vector/src/main/java/im/vector/app/features/roomprofile/settings/RoomSettingsFragment.kt @@ -33,7 +33,6 @@ import im.vector.app.R import im.vector.app.core.dialogs.GalleryOrCameraDialogHelper import im.vector.app.core.extensions.cleanup import im.vector.app.core.extensions.configureWith -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.intent.getFilenameFromUri import im.vector.app.core.platform.OnBackPressed import im.vector.app.core.platform.VectorBaseFragment @@ -98,7 +97,7 @@ class RoomSettingsFragment @Inject constructor( ignoreChanges = true vectorBaseActivity.onBackPressed() } - }.exhaustive + } } } 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 a0325cfc2b..8ad5bcdce6 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 @@ -23,7 +23,6 @@ import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel import im.vector.app.features.powerlevel.PowerLevelsFlowFactory import im.vector.app.features.settings.VectorPreferences @@ -201,7 +200,7 @@ class RoomSettingsViewModel @AssistedInject constructor(@Assisted initialState: is RoomSettingsAction.SetRoomGuestAccess -> handleSetGuestAccess(action) is RoomSettingsAction.Save -> saveSettings() is RoomSettingsAction.Cancel -> cancel() - }.exhaustive + } } private fun handleSetRoomJoinRule(action: RoomSettingsAction.SetRoomJoinRule) = withState { state -> diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/settings/joinrule/advanced/RoomJoinRuleChooseRestrictedViewModel.kt b/vector/src/main/java/im/vector/app/features/roomprofile/settings/joinrule/advanced/RoomJoinRuleChooseRestrictedViewModel.kt index 548ec9cfe4..f1897761b2 100644 --- a/vector/src/main/java/im/vector/app/features/roomprofile/settings/joinrule/advanced/RoomJoinRuleChooseRestrictedViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/roomprofile/settings/joinrule/advanced/RoomJoinRuleChooseRestrictedViewModel.kt @@ -29,7 +29,6 @@ import dagger.assisted.AssistedInject import im.vector.app.R import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.resources.StringProvider import im.vector.app.core.utils.styleMatchingText @@ -180,7 +179,7 @@ class RoomJoinRuleChooseRestrictedViewModel @AssistedInject constructor( is RoomJoinRuleChooseRestrictedActions.SelectJoinRules -> handleSelectRule(action) is RoomJoinRuleChooseRestrictedActions.SwitchToRoomAfterMigration -> handleSwitchToRoom(action) RoomJoinRuleChooseRestrictedActions.DoUpdateJoinRules -> handleSubmit() - }.exhaustive + } checkForChanges() } diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/uploads/RoomUploadsFragment.kt b/vector/src/main/java/im/vector/app/features/roomprofile/uploads/RoomUploadsFragment.kt index a0adf42d5b..6a115ad272 100644 --- a/vector/src/main/java/im/vector/app/features/roomprofile/uploads/RoomUploadsFragment.kt +++ b/vector/src/main/java/im/vector/app/features/roomprofile/uploads/RoomUploadsFragment.kt @@ -28,7 +28,6 @@ import com.airbnb.mvrx.withState import com.google.android.material.appbar.AppBarLayout import com.google.android.material.tabs.TabLayoutMediator import im.vector.app.R -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.intent.getMimeTypeFromUri import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.core.utils.saveMedia @@ -99,7 +98,7 @@ class RoomUploadsFragment @Inject constructor( Unit } is RoomUploadsViewEvents.Failure -> showFailure(it.throwable) - }.exhaustive + } } } 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 92ff33395e..c9aaca4373 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 @@ -25,7 +25,6 @@ import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel import kotlinx.coroutines.launch import org.matrix.android.sdk.api.session.Session @@ -110,7 +109,7 @@ class RoomUploadsViewModel @AssistedInject constructor( is RoomUploadsAction.Share -> handleShare(action) RoomUploadsAction.Retry -> handleLoadMore() RoomUploadsAction.LoadMore -> handleLoadMore() - }.exhaustive + } } private fun handleShare(action: RoomUploadsAction.Share) { diff --git a/vector/src/main/java/im/vector/app/features/settings/account/deactivation/DeactivateAccountFragment.kt b/vector/src/main/java/im/vector/app/features/settings/account/deactivation/DeactivateAccountFragment.kt index 631c375e62..4397da00c4 100644 --- a/vector/src/main/java/im/vector/app/features/settings/account/deactivation/DeactivateAccountFragment.kt +++ b/vector/src/main/java/im/vector/app/features/settings/account/deactivation/DeactivateAccountFragment.kt @@ -25,7 +25,6 @@ import android.view.ViewGroup import androidx.appcompat.app.AppCompatActivity import com.airbnb.mvrx.fragmentViewModel import im.vector.app.R -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.extensions.registerStartForActivityResult import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.databinding.FragmentDeactivateAccountBinding @@ -128,7 +127,7 @@ class DeactivateAccountFragment @Inject constructor() : VectorBaseFragment { views.waitingView.waitingView.isVisible = false } - }.exhaustive + } } } 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 644b7f33dd..5e691f64b2 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 @@ -22,7 +22,6 @@ import dagger.assisted.AssistedInject import im.vector.app.R import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.resources.StringProvider import im.vector.app.features.auth.ReAuthActivity @@ -146,7 +145,7 @@ class CrossSigningSettingsViewModel @AssistedInject constructor( uiaContinuation = null pendingAuth = null } - }.exhaustive + } } private fun handleInitializeXSigningError(failure: Throwable) { diff --git a/vector/src/main/java/im/vector/app/features/settings/devices/VectorSettingsDevicesFragment.kt b/vector/src/main/java/im/vector/app/features/settings/devices/VectorSettingsDevicesFragment.kt index 5bbb03c8a4..407af19151 100644 --- a/vector/src/main/java/im/vector/app/features/settings/devices/VectorSettingsDevicesFragment.kt +++ b/vector/src/main/java/im/vector/app/features/settings/devices/VectorSettingsDevicesFragment.kt @@ -32,7 +32,6 @@ import im.vector.app.R import im.vector.app.core.dialogs.ManuallyVerifyDialog import im.vector.app.core.extensions.cleanup import im.vector.app.core.extensions.configureWith -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.extensions.registerStartForActivityResult import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.databinding.DialogBaseEditTextBinding @@ -90,7 +89,7 @@ class VectorSettingsDevicesFragment @Inject constructor( viewModel.handle(DevicesAction.MarkAsManuallyVerified(it.cryptoDeviceInfo)) } } - }.exhaustive + } } } 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 6289699687..9576b84e98 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 @@ -25,7 +25,6 @@ import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.EmptyViewEvents import im.vector.app.core.platform.VectorViewModel import kotlinx.coroutines.launch @@ -51,7 +50,7 @@ class AccountDataViewModel @AssistedInject constructor(@Assisted initialState: A override fun handle(action: AccountDataAction) { when (action) { is AccountDataAction.DeleteAccountData -> handleDeleteAccountData(action) - }.exhaustive + } } private fun handleDeleteAccountData(action: AccountDataAction.DeleteAccountData) { 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 f480eb2db8..fd1cd3480d 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 @@ -29,7 +29,6 @@ import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewEvents import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.platform.VectorViewModelAction @@ -64,7 +63,7 @@ class KeyRequestViewModel @AssistedInject constructor( override fun handle(action: KeyRequestAction) { when (action) { is KeyRequestAction.ExportAudit -> exportAudit(action) - }.exhaustive + } } private fun exportAudit(action: KeyRequestAction.ExportAudit) { diff --git a/vector/src/main/java/im/vector/app/features/settings/devtools/KeyRequestsFragment.kt b/vector/src/main/java/im/vector/app/features/settings/devtools/KeyRequestsFragment.kt index d807fc620a..db2d07feef 100644 --- a/vector/src/main/java/im/vector/app/features/settings/devtools/KeyRequestsFragment.kt +++ b/vector/src/main/java/im/vector/app/features/settings/devtools/KeyRequestsFragment.kt @@ -33,7 +33,6 @@ import com.airbnb.mvrx.fragmentViewModel import com.airbnb.mvrx.withState import com.google.android.material.tabs.TabLayoutMediator import im.vector.app.R -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.extensions.registerStartForActivityResult import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.core.utils.selectTxtFileToWrite @@ -111,7 +110,7 @@ class KeyRequestsFragment @Inject constructor() : VectorBaseFragment os.write(it.raw.toByteArray()) } } } - }.exhaustive + } } } diff --git a/vector/src/main/java/im/vector/app/features/settings/ignored/VectorSettingsIgnoredUsersFragment.kt b/vector/src/main/java/im/vector/app/features/settings/ignored/VectorSettingsIgnoredUsersFragment.kt index 509014492d..5c188fe933 100644 --- a/vector/src/main/java/im/vector/app/features/settings/ignored/VectorSettingsIgnoredUsersFragment.kt +++ b/vector/src/main/java/im/vector/app/features/settings/ignored/VectorSettingsIgnoredUsersFragment.kt @@ -30,7 +30,6 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder import im.vector.app.R import im.vector.app.core.extensions.cleanup import im.vector.app.core.extensions.configureWith -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.databinding.FragmentGenericRecyclerBinding import javax.inject.Inject @@ -57,7 +56,7 @@ class VectorSettingsIgnoredUsersFragment @Inject constructor( when (it) { is IgnoredUsersViewEvents.Loading -> showLoading(it.message) is IgnoredUsersViewEvents.Failure -> showFailure(it.throwable) - }.exhaustive + } } } diff --git a/vector/src/main/java/im/vector/app/features/settings/legals/LegalsViewModel.kt b/vector/src/main/java/im/vector/app/features/settings/legals/LegalsViewModel.kt index 9d58535490..1497c793c2 100644 --- a/vector/src/main/java/im/vector/app/features/settings/legals/LegalsViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/settings/legals/LegalsViewModel.kt @@ -25,7 +25,6 @@ import dagger.assisted.AssistedInject import im.vector.app.R import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.EmptyViewEvents import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.resources.StringProvider @@ -50,7 +49,7 @@ class LegalsViewModel @AssistedInject constructor( override fun handle(action: LegalsAction) { when (action) { LegalsAction.Refresh -> loadData() - }.exhaustive + } } private fun loadData() = withState { state -> diff --git a/vector/src/main/java/im/vector/app/features/settings/locale/LocalePickerFragment.kt b/vector/src/main/java/im/vector/app/features/settings/locale/LocalePickerFragment.kt index 601574c908..d46b66dd87 100644 --- a/vector/src/main/java/im/vector/app/features/settings/locale/LocalePickerFragment.kt +++ b/vector/src/main/java/im/vector/app/features/settings/locale/LocalePickerFragment.kt @@ -26,7 +26,6 @@ import com.airbnb.mvrx.withState import im.vector.app.R import im.vector.app.core.extensions.cleanup import im.vector.app.core.extensions.configureWith -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.extensions.restart import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.databinding.FragmentLocalePickerBinding @@ -54,7 +53,7 @@ class LocalePickerFragment @Inject constructor( LocalePickerViewEvents.RestartActivity -> { activity?.restart() } - }.exhaustive + } } } 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 d6b35fa4fe..0bbbc323e0 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 @@ -23,7 +23,6 @@ import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel import im.vector.app.features.configuration.VectorConfiguration import im.vector.app.features.settings.VectorLocale @@ -56,7 +55,7 @@ class LocalePickerViewModel @AssistedInject constructor( override fun handle(action: LocalePickerAction) { when (action) { is LocalePickerAction.SelectLocale -> handleSelectLocale(action) - }.exhaustive + } } private fun handleSelectLocale(action: LocalePickerAction.SelectLocale) { diff --git a/vector/src/main/java/im/vector/app/features/settings/push/PushGatewaysFragment.kt b/vector/src/main/java/im/vector/app/features/settings/push/PushGatewaysFragment.kt index 65c62542bb..73a74b1e3f 100644 --- a/vector/src/main/java/im/vector/app/features/settings/push/PushGatewaysFragment.kt +++ b/vector/src/main/java/im/vector/app/features/settings/push/PushGatewaysFragment.kt @@ -28,7 +28,6 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder import im.vector.app.R import im.vector.app.core.extensions.cleanup import im.vector.app.core.extensions.configureWith -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.databinding.FragmentGenericRecyclerBinding import org.matrix.android.sdk.api.session.pushers.Pusher @@ -78,7 +77,7 @@ class PushGatewaysFragment @Inject constructor( .setPositiveButton(android.R.string.ok, null) .show() } - }.exhaustive + } } } 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 1256673364..4d95447f2d 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 @@ -25,7 +25,6 @@ import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel import kotlinx.coroutines.launch import org.matrix.android.sdk.api.session.Session @@ -65,7 +64,7 @@ class PushGatewaysViewModel @AssistedInject constructor(@Assisted initialState: when (action) { is PushGatewayAction.Refresh -> handleRefresh() is PushGatewayAction.RemovePusher -> removePusher(action.pusher) - }.exhaustive + } } private fun removePusher(pusher: Pusher) { diff --git a/vector/src/main/java/im/vector/app/features/settings/threepids/ThreePidsSettingsController.kt b/vector/src/main/java/im/vector/app/features/settings/threepids/ThreePidsSettingsController.kt index 7fd2292274..61d93b6f5f 100644 --- a/vector/src/main/java/im/vector/app/features/settings/threepids/ThreePidsSettingsController.kt +++ b/vector/src/main/java/im/vector/app/features/settings/threepids/ThreePidsSettingsController.kt @@ -26,7 +26,6 @@ import im.vector.app.R import im.vector.app.core.epoxy.loadingItem import im.vector.app.core.epoxy.noResultItem import im.vector.app.core.error.ErrorFormatter -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.extensions.getFormattedValue import im.vector.app.core.resources.ColorProvider import im.vector.app.core.resources.StringProvider @@ -162,7 +161,7 @@ class ThreePidsSettingsController @Inject constructor( } } is ThreePidsSettingsUiState.AddingPhoneNumber -> Unit - }.exhaustive + } settingsSectionTitleItem { id("msisdn") @@ -225,7 +224,7 @@ class ThreePidsSettingsController @Inject constructor( cancelOnClick { host.interactionListener?.cancelAdding() } } } - }.exhaustive + } } private fun buildThreePid(idPrefix: String, threePid: ThreePid) { diff --git a/vector/src/main/java/im/vector/app/features/settings/threepids/ThreePidsSettingsFragment.kt b/vector/src/main/java/im/vector/app/features/settings/threepids/ThreePidsSettingsFragment.kt index bdb1fb895f..ee7f8efab4 100644 --- a/vector/src/main/java/im/vector/app/features/settings/threepids/ThreePidsSettingsFragment.kt +++ b/vector/src/main/java/im/vector/app/features/settings/threepids/ThreePidsSettingsFragment.kt @@ -28,7 +28,6 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder import im.vector.app.R import im.vector.app.core.extensions.cleanup import im.vector.app.core.extensions.configureWith -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.extensions.getFormattedValue import im.vector.app.core.extensions.hideKeyboard import im.vector.app.core.extensions.isEmail @@ -64,7 +63,7 @@ class ThreePidsSettingsFragment @Inject constructor( when (it) { is ThreePidsSettingsViewEvents.Failure -> displayErrorDialog(it.throwable) is ThreePidsSettingsViewEvents.RequestReAuth -> askAuthentication(it) - }.exhaustive + } } } 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 12ff436ccb..acbe893d58 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 @@ -25,7 +25,6 @@ import dagger.assisted.AssistedInject import im.vector.app.R import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.resources.StringProvider import im.vector.app.core.utils.ReadOnceTrue @@ -149,7 +148,7 @@ class ThreePidsSettingsViewModel @AssistedInject constructor( uiaContinuation = null pendingAuth = null } - }.exhaustive + } } var uiaContinuation: Continuation? = null diff --git a/vector/src/main/java/im/vector/app/features/share/IncomingShareFragment.kt b/vector/src/main/java/im/vector/app/features/share/IncomingShareFragment.kt index 62fb064536..9dc433e96f 100644 --- a/vector/src/main/java/im/vector/app/features/share/IncomingShareFragment.kt +++ b/vector/src/main/java/im/vector/app/features/share/IncomingShareFragment.kt @@ -34,7 +34,6 @@ import im.vector.app.R import im.vector.app.core.di.ActiveSessionHolder import im.vector.app.core.extensions.cleanup import im.vector.app.core.extensions.configureWith -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.extensions.registerStartForActivityResult import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.databinding.FragmentIncomingShareBinding @@ -81,7 +80,7 @@ class IncomingShareFragment @Inject constructor( is IncomingShareViewEvents.ShareToRoom -> handleShareToRoom(it) is IncomingShareViewEvents.EditMediaBeforeSending -> handleEditMediaBeforeSending(it) is IncomingShareViewEvents.MultipleRoomsShareDone -> handleMultipleRoomsShareDone(it) - }.exhaustive + } } val intent = vectorBaseActivity.intent 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 4a413ad8ba..ca4148ebb7 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 @@ -22,7 +22,6 @@ import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.extensions.toggle import im.vector.app.core.platform.VectorViewModel import im.vector.app.features.attachments.isPreviewable @@ -96,7 +95,7 @@ class IncomingShareViewModel @AssistedInject constructor( is IncomingShareAction.ShareMedia -> handleShareMediaToSelectedRooms(action) is IncomingShareAction.FilterWith -> handleFilter(action) is IncomingShareAction.UpdateSharedData -> handleUpdateSharedData(action) - }.exhaustive + } } private fun handleUpdateSharedData(action: IncomingShareAction.UpdateSharedData) { @@ -127,7 +126,7 @@ class IncomingShareViewModel @AssistedInject constructor( is SharedData.Attachments -> { shareAttachments(sharedData.attachmentData, state.selectedRoomIds, proposeMediaEdition = true, compressMediaBeforeSending = false) } - }.exhaustive + } } } diff --git a/vector/src/main/java/im/vector/app/features/spaces/SpaceListFragment.kt b/vector/src/main/java/im/vector/app/features/spaces/SpaceListFragment.kt index fb7786e3bd..1fc131ca86 100644 --- a/vector/src/main/java/im/vector/app/features/spaces/SpaceListFragment.kt +++ b/vector/src/main/java/im/vector/app/features/spaces/SpaceListFragment.kt @@ -29,7 +29,6 @@ import com.airbnb.mvrx.fragmentViewModel import com.airbnb.mvrx.withState import im.vector.app.core.extensions.cleanup import im.vector.app.core.extensions.configureWith -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.StateView import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.databinding.FragmentGroupListBinding @@ -110,7 +109,7 @@ class SpaceListFragment @Inject constructor( is SpaceListViewEvents.AddSpace -> sharedActionViewModel.post(HomeActivitySharedAction.AddSpace) is SpaceListViewEvents.OpenGroup -> sharedActionViewModel.post(HomeActivitySharedAction.OpenGroup(it.groupingMethodHasChanged)) is SpaceListViewEvents.OpenSpaceInvite -> sharedActionViewModel.post(HomeActivitySharedAction.OpenSpaceInvite(it.id)) - }.exhaustive + } } } diff --git a/vector/src/main/java/im/vector/app/features/spaces/create/CreateSpaceViewModel.kt b/vector/src/main/java/im/vector/app/features/spaces/create/CreateSpaceViewModel.kt index 8ddeab3223..2b8276a4d7 100644 --- a/vector/src/main/java/im/vector/app/features/spaces/create/CreateSpaceViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/spaces/create/CreateSpaceViewModel.kt @@ -29,7 +29,6 @@ import im.vector.app.R import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory import im.vector.app.core.error.ErrorFormatter -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.extensions.isEmail import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.resources.StringProvider @@ -192,7 +191,7 @@ class CreateSpaceViewModel @AssistedInject constructor( is CreateSpaceAction.SetSpaceTopology -> { handleSetTopology(action) } - }.exhaustive + } } private fun handleSetTopology(action: CreateSpaceAction.SetSpaceTopology) { diff --git a/vector/src/main/java/im/vector/app/features/spaces/manage/SpaceManageSharedViewModel.kt b/vector/src/main/java/im/vector/app/features/spaces/manage/SpaceManageSharedViewModel.kt index bedd1873e8..2a2598075f 100644 --- a/vector/src/main/java/im/vector/app/features/spaces/manage/SpaceManageSharedViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/spaces/manage/SpaceManageSharedViewModel.kt @@ -22,7 +22,6 @@ import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel import org.matrix.android.sdk.api.session.Session @@ -51,6 +50,6 @@ class SpaceManageSharedViewModel @AssistedInject constructor( SpaceManagedSharedAction.ManageRooms -> _viewEvents.post(SpaceManagedSharedViewEvents.NavigateToManageRooms) SpaceManagedSharedAction.OpenSpaceAliasesSettings -> _viewEvents.post(SpaceManagedSharedViewEvents.NavigateToAliasSettings) SpaceManagedSharedAction.OpenSpacePermissionSettings -> _viewEvents.post(SpaceManagedSharedViewEvents.NavigateToPermissionSettings) - }.exhaustive + } } } diff --git a/vector/src/main/java/im/vector/app/features/spaces/manage/SpaceSettingsFragment.kt b/vector/src/main/java/im/vector/app/features/spaces/manage/SpaceSettingsFragment.kt index 266d08fd12..db9420abc2 100644 --- a/vector/src/main/java/im/vector/app/features/spaces/manage/SpaceSettingsFragment.kt +++ b/vector/src/main/java/im/vector/app/features/spaces/manage/SpaceSettingsFragment.kt @@ -34,7 +34,6 @@ import im.vector.app.R import im.vector.app.core.dialogs.GalleryOrCameraDialogHelper import im.vector.app.core.extensions.cleanup import im.vector.app.core.extensions.configureWith -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.intent.getFilenameFromUri import im.vector.app.core.platform.OnBackPressed import im.vector.app.core.platform.VectorBaseFragment @@ -102,7 +101,7 @@ class SpaceSettingsFragment @Inject constructor( ignoreChanges = true vectorBaseActivity.onBackPressed() } - }.exhaustive + } } } diff --git a/vector/src/main/java/im/vector/app/features/spaces/people/SpacePeopleViewModel.kt b/vector/src/main/java/im/vector/app/features/spaces/people/SpacePeopleViewModel.kt index 55d1dbe61e..2e386697d4 100644 --- a/vector/src/main/java/im/vector/app/features/spaces/people/SpacePeopleViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/spaces/people/SpacePeopleViewModel.kt @@ -25,7 +25,6 @@ import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel import im.vector.app.features.raw.wellknown.getElementWellknown import im.vector.app.features.raw.wellknown.isE2EByDefault @@ -52,7 +51,7 @@ class SpacePeopleViewModel @AssistedInject constructor( when (action) { is SpacePeopleViewAction.ChatWith -> handleChatWith(action) SpacePeopleViewAction.InviteToSpace -> handleInviteToSpace() - }.exhaustive + } } private fun handleInviteToSpace() { diff --git a/vector/src/main/java/im/vector/app/features/terms/ReviewTermsActivity.kt b/vector/src/main/java/im/vector/app/features/terms/ReviewTermsActivity.kt index e6071fdd2a..9a86e550a8 100644 --- a/vector/src/main/java/im/vector/app/features/terms/ReviewTermsActivity.kt +++ b/vector/src/main/java/im/vector/app/features/terms/ReviewTermsActivity.kt @@ -23,7 +23,6 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder import dagger.hilt.android.AndroidEntryPoint import im.vector.app.R import im.vector.app.core.error.ErrorFormatter -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.extensions.replaceFragment import im.vector.app.core.platform.SimpleFragmentActivity import org.matrix.android.sdk.api.session.terms.TermsService @@ -63,7 +62,7 @@ class ReviewTermsActivity : SimpleFragmentActivity() { setResult(Activity.RESULT_OK) finish() } - }.exhaustive + } } } diff --git a/vector/src/main/java/im/vector/app/features/terms/ReviewTermsFragment.kt b/vector/src/main/java/im/vector/app/features/terms/ReviewTermsFragment.kt index cb76e5b31f..53afbf7a07 100644 --- a/vector/src/main/java/im/vector/app/features/terms/ReviewTermsFragment.kt +++ b/vector/src/main/java/im/vector/app/features/terms/ReviewTermsFragment.kt @@ -29,7 +29,6 @@ import im.vector.app.R import im.vector.app.core.epoxy.onClick import im.vector.app.core.extensions.cleanup import im.vector.app.core.extensions.configureWith -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.core.utils.openUrlInChromeCustomTab import im.vector.app.databinding.FragmentReviewTermsBinding @@ -70,7 +69,7 @@ class ReviewTermsFragment @Inject constructor( ReviewTermsViewEvents.Success -> { // Handled by the Activity } - }.exhaustive + } } reviewTermsViewModel.handle(ReviewTermsAction.LoadTerms(getString(R.string.resources_language))) 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 9932efb11a..8fe1f598f6 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 @@ -24,7 +24,6 @@ import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.VectorViewModel import kotlinx.coroutines.launch import org.matrix.android.sdk.api.session.Session @@ -49,7 +48,7 @@ class ReviewTermsViewModel @AssistedInject constructor( is ReviewTermsAction.LoadTerms -> loadTerms(action) is ReviewTermsAction.MarkTermAsAccepted -> markTermAsAccepted(action) ReviewTermsAction.Accept -> acceptTerms() - }.exhaustive + } } private fun markTermAsAccepted(action: ReviewTermsAction.MarkTermAsAccepted) = withState { state -> diff --git a/vector/src/main/java/im/vector/app/features/usercode/UserCodeActivity.kt b/vector/src/main/java/im/vector/app/features/usercode/UserCodeActivity.kt index 356893aee2..9e0aa15297 100644 --- a/vector/src/main/java/im/vector/app/features/usercode/UserCodeActivity.kt +++ b/vector/src/main/java/im/vector/app/features/usercode/UserCodeActivity.kt @@ -30,7 +30,6 @@ import com.airbnb.mvrx.viewModel import com.airbnb.mvrx.withState import dagger.hilt.android.AndroidEntryPoint import im.vector.app.R -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.extensions.replaceFragment import im.vector.app.core.platform.VectorBaseActivity import im.vector.app.core.utils.onPermissionDeniedSnackbar @@ -127,7 +126,7 @@ class UserCodeActivity : VectorBaseActivity(), Toast.makeText(this, R.string.qr_code_not_scanned, Toast.LENGTH_SHORT).show() finish() } - }.exhaustive + } } } @@ -153,7 +152,7 @@ class UserCodeActivity : VectorBaseActivity(), UserCodeState.Mode.SHOW -> super.onBackPressed() is UserCodeState.Mode.RESULT, UserCodeState.Mode.SCAN -> sharedViewModel.handle(UserCodeActions.SwitchMode(UserCodeState.Mode.SHOW)) - }.exhaustive + } } companion object { 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 61f8bc35f3..039c7041b0 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 @@ -26,7 +26,6 @@ import dagger.assisted.AssistedInject import im.vector.app.R import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.extensions.isEmail import im.vector.app.core.extensions.toggle import im.vector.app.core.platform.VectorViewModel @@ -113,7 +112,7 @@ class UserListViewModel @AssistedInject constructor( UserListAction.UserConsentRequest -> handleUserConsentRequest() is UserListAction.UpdateUserConsent -> handleISUpdateConsent(action) UserListAction.Resumed -> handleResumed() - }.exhaustive + } } private fun handleUserConsentRequest() { 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 4daaef6fe1..fbc0b8fcff 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 @@ -28,7 +28,6 @@ import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory -import im.vector.app.core.extensions.exhaustive import im.vector.app.core.platform.EmptyViewEvents import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.platform.VectorViewModelAction @@ -124,7 +123,7 @@ class SignoutCheckViewModel @AssistedInject constructor( copy(hasBeenExportedToFile = Success(true)) } } - }.exhaustive + } } private fun handleExportKeys(action: Actions.ExportKeys) {