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
This commit is contained in:
Benoit Marty 2022-03-22 15:56:06 +01:00 committed by Benoit Marty
parent 97bb5a9abb
commit 03fee2a131
112 changed files with 149 additions and 298 deletions

View file

@ -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.store.IMXCryptoStore
import org.matrix.android.sdk.internal.crypto.verification.DefaultVerificationTransaction import org.matrix.android.sdk.internal.crypto.verification.DefaultVerificationTransaction
import org.matrix.android.sdk.internal.crypto.verification.ValidVerificationInfoStart import org.matrix.android.sdk.internal.crypto.verification.ValidVerificationInfoStart
import org.matrix.android.sdk.internal.util.exhaustive
import timber.log.Timber import timber.log.Timber
internal class DefaultQrCodeVerificationTransaction( 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 // 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<String>() val toVerifyDeviceIds = mutableListOf<String>()
@ -174,7 +173,7 @@ internal class DefaultQrCodeVerificationTransaction(
Unit Unit
} }
} }
}.exhaustive }
if (!canTrustOtherUserMasterKey && toVerifyDeviceIds.isEmpty()) { if (!canTrustOtherUserMasterKey && toVerifyDeviceIds.isEmpty()) {
// Nothing to verify // Nothing to verify

View file

@ -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> T.exhaustive: T get() = this

View file

@ -7,7 +7,6 @@ import com.airbnb.mvrx.ViewModelContext
import dagger.assisted.Assisted import dagger.assisted.Assisted
import dagger.assisted.AssistedInject import dagger.assisted.AssistedInject
import dagger.assisted.AssistedFactory import dagger.assisted.AssistedFactory
import im.vector.app.core.extensions.exhaustive
import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.platform.VectorViewModel
<#if createViewEvents> <#if createViewEvents>
@ -42,6 +41,6 @@ class ${viewModelClass} @AssistedInject constructor(@Assisted initialState: ${vi
override fun handle(action: ${actionClass}) { override fun handle(action: ${actionClass}) {
when (action) { when (action) {
}.exhaustive }
} }
} }

View file

@ -22,7 +22,6 @@ import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject import dagger.assisted.AssistedInject
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.hiltMavericksViewModelFactory 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.EmptyViewEvents
import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.platform.VectorViewModel
import im.vector.app.features.analytics.store.AnalyticsStore import im.vector.app.features.analytics.store.AnalyticsStore
@ -53,7 +52,7 @@ class DebugAnalyticsViewModel @AssistedInject constructor(
override fun handle(action: DebugAnalyticsViewActions) { override fun handle(action: DebugAnalyticsViewActions) {
when (action) { when (action) {
DebugAnalyticsViewActions.ResetAnalyticsOptInDisplayed -> handleResetAnalyticsOptInDisplayed() DebugAnalyticsViewActions.ResetAnalyticsOptInDisplayed -> handleResetAnalyticsOptInDisplayed()
}.exhaustive }
} }
private fun handleResetAnalyticsOptInDisplayed() { private fun handleResetAnalyticsOptInDisplayed() {

View file

@ -22,7 +22,6 @@ import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject import dagger.assisted.AssistedInject
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.hiltMavericksViewModelFactory 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.EmptyViewEvents
import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.platform.VectorViewModel
import im.vector.app.features.debug.features.DebugVectorOverrides import im.vector.app.features.debug.features.DebugVectorOverrides
@ -71,7 +70,7 @@ class DebugPrivateSettingsViewModel @AssistedInject constructor(
is DebugPrivateSettingsViewActions.SetForceLoginFallbackEnabled -> handleSetForceLoginFallbackEnabled(action) is DebugPrivateSettingsViewActions.SetForceLoginFallbackEnabled -> handleSetForceLoginFallbackEnabled(action)
is SetDisplayNameCapabilityOverride -> handSetDisplayNameCapabilityOverride(action) is SetDisplayNameCapabilityOverride -> handSetDisplayNameCapabilityOverride(action)
is SetAvatarCapabilityOverride -> handSetAvatarCapabilityOverride(action) is SetAvatarCapabilityOverride -> handSetAvatarCapabilityOverride(action)
}.exhaustive }
} }
private fun handleSetDialPadVisibility(action: DebugPrivateSettingsViewActions.SetDialPadVisibility) { private fun handleSetDialPadVisibility(action: DebugPrivateSettingsViewActions.SetDialPadVisibility) {

View file

@ -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> T.exhaustive: T get() = this

View file

@ -54,7 +54,6 @@ import im.vector.app.core.di.ActiveSessionHolder
import im.vector.app.core.di.ActivityEntryPoint import im.vector.app.core.di.ActivityEntryPoint
import im.vector.app.core.dialogs.DialogLocker import im.vector.app.core.dialogs.DialogLocker
import im.vector.app.core.dialogs.UnrecognizedCertificateDialog 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.observeEvent
import im.vector.app.core.extensions.observeNotNull import im.vector.app.core.extensions.observeNotNull
import im.vector.app.core.extensions.registerStartForActivityResult import im.vector.app.core.extensions.registerStartForActivityResult
@ -267,7 +266,7 @@ abstract class VectorBaseActivity<VB : ViewBinding> : AppCompatActivity(), Maver
is GlobalError.CertificateError -> is GlobalError.CertificateError ->
handleCertificateError(globalError) handleCertificateError(globalError)
GlobalError.ExpiredAccount -> Unit // TODO Handle account expiration GlobalError.ExpiredAccount -> Unit // TODO Handle account expiration
}.exhaustive }
} }
private fun handleCertificateError(certificateError: GlobalError.CertificateError) { private fun handleCertificateError(certificateError: GlobalError.CertificateError) {

View file

@ -27,7 +27,6 @@ import androidx.core.text.italic
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.epoxy.onClick import im.vector.app.core.epoxy.onClick
import im.vector.app.core.error.ResourceLimitErrorFormatter 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.core.utils.DimensionConverter
import im.vector.app.databinding.ViewNotificationAreaBinding import im.vector.app.databinding.ViewNotificationAreaBinding
import im.vector.app.features.themes.ThemeUtils import im.vector.app.features.themes.ThemeUtils
@ -77,7 +76,7 @@ class NotificationAreaView @JvmOverloads constructor(
is State.UnsupportedAlgorithm -> renderUnsupportedAlgorithm(newState) is State.UnsupportedAlgorithm -> renderUnsupportedAlgorithm(newState)
is State.Tombstone -> renderTombstone() is State.Tombstone -> renderTombstone()
is State.ResourceLimitExceededError -> renderResourceLimitExceededError(newState) is State.ResourceLimitExceededError -> renderResourceLimitExceededError(newState)
}.exhaustive }
} }
// PRIVATE METHODS **************************************************************************************************************************************** // PRIVATE METHODS ****************************************************************************************************************************************

View file

@ -22,7 +22,6 @@ import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject import dagger.assisted.AssistedInject
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.hiltMavericksViewModelFactory 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.VectorViewModel
import im.vector.app.features.analytics.VectorAnalytics import im.vector.app.features.analytics.VectorAnalytics
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
@ -55,7 +54,7 @@ class AnalyticsConsentViewModel @AssistedInject constructor(
override fun handle(action: AnalyticsConsentViewActions) { override fun handle(action: AnalyticsConsentViewActions) {
when (action) { when (action) {
is AnalyticsConsentViewActions.SetUserConsent -> handleSetUserConsent(action) is AnalyticsConsentViewActions.SetUserConsent -> handleSetUserConsent(action)
}.exhaustive }
} }
private fun handleSetUserConsent(action: AnalyticsConsentViewActions.SetUserConsent) { private fun handleSetUserConsent(action: AnalyticsConsentViewActions.SetUserConsent) {

View file

@ -19,7 +19,6 @@ package im.vector.app.features.analytics.ui.consent
import com.airbnb.mvrx.viewModel import com.airbnb.mvrx.viewModel
import dagger.hilt.android.AndroidEntryPoint import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.core.extensions.addFragment 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.ScreenOrientationLocker
import im.vector.app.core.platform.VectorBaseActivity import im.vector.app.core.platform.VectorBaseActivity
import im.vector.app.databinding.ActivitySimpleBinding import im.vector.app.databinding.ActivitySimpleBinding
@ -48,7 +47,7 @@ class AnalyticsOptInActivity : VectorBaseActivity<ActivitySimpleBinding>() {
viewModel.observeViewEvents { viewModel.observeViewEvents {
when (it) { when (it) {
AnalyticsOptInViewEvents.OnDataSaved -> finish() AnalyticsOptInViewEvents.OnDataSaved -> finish()
}.exhaustive }
} }
} }
} }

View file

@ -17,7 +17,6 @@
package im.vector.app.features.attachments.preview package im.vector.app.features.attachments.preview
import im.vector.app.core.extensions.exhaustive
import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.platform.VectorViewModel
class AttachmentsPreviewViewModel(initialState: AttachmentsPreviewViewState) : class AttachmentsPreviewViewModel(initialState: AttachmentsPreviewViewState) :
@ -28,7 +27,7 @@ class AttachmentsPreviewViewModel(initialState: AttachmentsPreviewViewState) :
is AttachmentsPreviewAction.SetCurrentAttachment -> handleSetCurrentAttachment(action) is AttachmentsPreviewAction.SetCurrentAttachment -> handleSetCurrentAttachment(action)
is AttachmentsPreviewAction.UpdatePathOfCurrentAttachment -> handleUpdatePathOfCurrentAttachment(action) is AttachmentsPreviewAction.UpdatePathOfCurrentAttachment -> handleUpdatePathOfCurrentAttachment(action)
AttachmentsPreviewAction.RemoveCurrentAttachment -> handleRemoveCurrentAttachment() AttachmentsPreviewAction.RemoveCurrentAttachment -> handleRemoveCurrentAttachment()
}.exhaustive }
} }
private fun handleRemoveCurrentAttachment() = withState { private fun handleRemoveCurrentAttachment() = withState {

View file

@ -26,7 +26,6 @@ import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject import dagger.assisted.AssistedInject
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.hiltMavericksViewModelFactory 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.VectorViewModel
import im.vector.app.features.call.audio.CallAudioManager import im.vector.app.features.call.audio.CallAudioManager
import im.vector.app.features.call.dialpad.DialPadLookup import im.vector.app.features.call.dialpad.DialPadLookup
@ -343,7 +342,7 @@ class VectorCallViewModel @AssistedInject constructor(
setState { VectorCallViewState(action.callArgs) } setState { VectorCallViewState(action.callArgs) }
setupCallWithCurrentState() setupCallWithCurrentState()
} }
}.exhaustive }
} }
private fun handleCallTransfer() { private fun handleCallTransfer() {
@ -358,7 +357,7 @@ class VectorCallViewModel @AssistedInject constructor(
when (result) { when (result) {
is CallTransferResult.ConnectWithUserId -> connectWithUserId(result) is CallTransferResult.ConnectWithUserId -> connectWithUserId(result)
is CallTransferResult.ConnectWithPhoneNumber -> connectWithPhoneNumber(result) is CallTransferResult.ConnectWithPhoneNumber -> connectWithPhoneNumber(result)
}.exhaustive }
} }
private fun connectWithUserId(result: CallTransferResult.ConnectWithUserId) { private fun connectWithUserId(result: CallTransferResult.ConnectWithUserId) {

View file

@ -27,7 +27,6 @@ import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject import dagger.assisted.AssistedInject
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.hiltMavericksViewModelFactory 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.VectorViewModel
import kotlinx.coroutines.Job import kotlinx.coroutines.Job
import kotlinx.coroutines.delay import kotlinx.coroutines.delay
@ -103,7 +102,7 @@ class JitsiCallViewModel @AssistedInject constructor(
when (action) { when (action) {
is JitsiCallViewActions.SwitchTo -> handleSwitchTo(action) is JitsiCallViewActions.SwitchTo -> handleSwitchTo(action)
JitsiCallViewActions.OnConferenceLeft -> handleOnConferenceLeft() JitsiCallViewActions.OnConferenceLeft -> handleOnConferenceLeft()
}.exhaustive }
} }
private fun handleSwitchTo(action: JitsiCallViewActions.SwitchTo) = withState { state -> private fun handleSwitchTo(action: JitsiCallViewActions.SwitchTo) = withState { state ->

View file

@ -35,7 +35,6 @@ import com.facebook.react.modules.core.PermissionListener
import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.google.android.material.dialog.MaterialAlertDialogBuilder
import dagger.hilt.android.AndroidEntryPoint import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.extensions.exhaustive
import im.vector.app.core.platform.VectorBaseActivity import im.vector.app.core.platform.VectorBaseActivity
import im.vector.app.databinding.ActivityJitsiBinding import im.vector.app.databinding.ActivityJitsiBinding
import kotlinx.parcelize.Parcelize import kotlinx.parcelize.Parcelize
@ -79,7 +78,7 @@ class VectorJitsiActivity : VectorBaseActivity<ActivityJitsiBinding>(), JitsiMee
JitsiCallViewEvents.FailJoiningConference -> handleFailJoining() JitsiCallViewEvents.FailJoiningConference -> handleFailJoining()
JitsiCallViewEvents.Finish -> finish() JitsiCallViewEvents.Finish -> finish()
JitsiCallViewEvents.LeaveConference -> handleLeaveConference() JitsiCallViewEvents.LeaveConference -> handleLeaveConference()
}.exhaustive }
} }
lifecycle.addObserver(ConferenceEventObserver(this, this::onBroadcastEvent)) lifecycle.addObserver(ConferenceEventObserver(this, this::onBroadcastEvent))
} }

View file

@ -26,7 +26,6 @@ import com.google.android.material.tabs.TabLayoutMediator
import dagger.hilt.android.AndroidEntryPoint import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.error.ErrorFormatter 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.core.platform.VectorBaseActivity
import im.vector.app.databinding.ActivityCallTransferBinding import im.vector.app.databinding.ActivityCallTransferBinding
import kotlinx.parcelize.Parcelize import kotlinx.parcelize.Parcelize
@ -57,7 +56,7 @@ class CallTransferActivity : VectorBaseActivity<ActivityCallTransferBinding>() {
callTransferViewModel.observeViewEvents { callTransferViewModel.observeViewEvents {
when (it) { when (it) {
is CallTransferViewEvents.Complete -> handleComplete() is CallTransferViewEvents.Complete -> handleComplete()
}.exhaustive }
} }
sectionsPagerAdapter = CallTransferPagerAdapter(this) sectionsPagerAdapter = CallTransferPagerAdapter(this)

View file

@ -26,7 +26,6 @@ import com.airbnb.mvrx.activityViewModel
import com.airbnb.mvrx.withState import com.airbnb.mvrx.withState
import im.vector.app.core.extensions.cleanup import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith 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.extensions.hideKeyboard
import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.core.utils.showIdentityServerConsentDialog import im.vector.app.core.utils.showIdentityServerConsentDialog
@ -73,7 +72,7 @@ class ContactsBookFragment @Inject constructor(
when (it) { when (it) {
is ContactsBookViewEvents.Failure -> showFailure(it.throwable) is ContactsBookViewEvents.Failure -> showFailure(it.throwable)
is ContactsBookViewEvents.OnPoliciesRetrieved -> showConsentDialog(it) is ContactsBookViewEvents.OnPoliciesRetrieved -> showConsentDialog(it)
}.exhaustive }
} }
} }

View file

@ -27,7 +27,6 @@ import im.vector.app.core.contacts.ContactsDataSource
import im.vector.app.core.contacts.MappedContact import im.vector.app.core.contacts.MappedContact
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.hiltMavericksViewModelFactory 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.VectorViewModel
import im.vector.app.core.resources.StringProvider import im.vector.app.core.resources.StringProvider
import im.vector.app.features.discovery.fetchIdentityServerWithTerms import im.vector.app.features.discovery.fetchIdentityServerWithTerms
@ -165,7 +164,7 @@ class ContactsBookViewModel @AssistedInject constructor(
is ContactsBookAction.OnlyBoundContacts -> handleOnlyBoundContacts(action) is ContactsBookAction.OnlyBoundContacts -> handleOnlyBoundContacts(action)
ContactsBookAction.UserConsentGranted -> handleUserConsentGranted() ContactsBookAction.UserConsentGranted -> handleUserConsentGranted()
ContactsBookAction.UserConsentRequest -> handleUserConsentRequest() ContactsBookAction.UserConsentRequest -> handleUserConsentRequest()
}.exhaustive }
} }
private fun handleUserConsentRequest() { private fun handleUserConsentRequest() {

View file

@ -36,7 +36,6 @@ import im.vector.app.R
import im.vector.app.core.error.ErrorFormatter import im.vector.app.core.error.ErrorFormatter
import im.vector.app.core.extensions.addFragment import im.vector.app.core.extensions.addFragment
import im.vector.app.core.extensions.addFragmentToBackstack 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.SimpleFragmentActivity
import im.vector.app.core.platform.WaitingViewData import im.vector.app.core.platform.WaitingViewData
import im.vector.app.core.utils.PERMISSIONS_FOR_MEMBERS_SEARCH import im.vector.app.core.utils.PERMISSIONS_FOR_MEMBERS_SEARCH
@ -85,7 +84,7 @@ class CreateDirectRoomActivity : SimpleFragmentActivity() {
is UserListSharedAction.OnMenuItemSelected -> onMenuItemSelected(action) is UserListSharedAction.OnMenuItemSelected -> onMenuItemSelected(action)
UserListSharedAction.OpenPhoneBook -> openPhoneBook() UserListSharedAction.OpenPhoneBook -> openPhoneBook()
UserListSharedAction.AddByQrCode -> openAddByQrCode() UserListSharedAction.AddByQrCode -> openAddByQrCode()
}.exhaustive }
} }
.launchIn(lifecycleScope) .launchIn(lifecycleScope)
if (isFirstCreation()) { if (isFirstCreation()) {
@ -112,7 +111,7 @@ class CreateDirectRoomActivity : SimpleFragmentActivity() {
Toast.makeText(this, R.string.cannot_dm_self, Toast.LENGTH_SHORT).show() Toast.makeText(this, R.string.cannot_dm_self, Toast.LENGTH_SHORT).show()
finish() finish()
} }
}.exhaustive }
} }
qrViewModel.observeViewEvents { qrViewModel.observeViewEvents {
@ -125,7 +124,7 @@ class CreateDirectRoomActivity : SimpleFragmentActivity() {
finish() finish()
} }
else -> Unit else -> Unit
}.exhaustive }
} }
} }

View file

@ -24,7 +24,6 @@ import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject import dagger.assisted.AssistedInject
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.hiltMavericksViewModelFactory 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.mvrx.runCatchingToAsync
import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.platform.VectorViewModel
import im.vector.app.features.raw.wellknown.getElementWellknown import im.vector.app.features.raw.wellknown.getElementWellknown
@ -56,7 +55,7 @@ class CreateDirectRoomViewModel @AssistedInject constructor(@Assisted
when (action) { when (action) {
is CreateDirectRoomAction.CreateRoomAndInviteSelectedUsers -> onSubmitInvitees(action.selections) is CreateDirectRoomAction.CreateRoomAndInviteSelectedUsers -> onSubmitInvitees(action.selections)
is CreateDirectRoomAction.QrScannedAction -> onCodeParsed(action) is CreateDirectRoomAction.QrScannedAction -> onCodeParsed(action)
}.exhaustive }
} }
private fun onCodeParsed(action: CreateDirectRoomAction.QrScannedAction) { private fun onCodeParsed(action: CreateDirectRoomAction.QrScannedAction) {
@ -108,7 +107,7 @@ class CreateDirectRoomViewModel @AssistedInject constructor(@Assisted
when (it) { when (it) {
is PendingSelection.UserPendingSelection -> invitedUserIds.add(it.user.userId) is PendingSelection.UserPendingSelection -> invitedUserIds.add(it.user.userId)
is PendingSelection.ThreePidPendingSelection -> invite3pids.add(it.threePid) is PendingSelection.ThreePidPendingSelection -> invite3pids.add(it.threePid)
}.exhaustive }
} }
setDirectMessage() setDirectMessage()
enableEncryptionIfInvitedUsersSupportIt = adminE2EByDefault enableEncryptionIfInvitedUsersSupportIt = adminE2EByDefault

View file

@ -29,7 +29,6 @@ import dagger.assisted.AssistedInject
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.hiltMavericksViewModelFactory 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.VectorViewModel
import im.vector.app.core.platform.WaitingViewData import im.vector.app.core.platform.WaitingViewData
import im.vector.app.core.resources.StringProvider import im.vector.app.core.resources.StringProvider
@ -142,7 +141,7 @@ class SharedSecureStorageViewModel @AssistedInject constructor(
SharedSecureStorageAction.Back -> handleBack() SharedSecureStorageAction.Back -> handleBack()
SharedSecureStorageAction.ForgotResetAll -> handleResetAll() SharedSecureStorageAction.ForgotResetAll -> handleResetAll()
SharedSecureStorageAction.DoResetAll -> handleDoResetAll() SharedSecureStorageAction.DoResetAll -> handleDoResetAll()
}.exhaustive }
} }
private fun handleDoResetAll() { private fun handleDoResetAll() {

View file

@ -36,7 +36,6 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder
import dagger.hilt.android.AndroidEntryPoint import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.extensions.commitTransaction 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.registerStartForActivityResult
import im.vector.app.core.extensions.toMvRxBundle import im.vector.app.core.extensions.toMvRxBundle
import im.vector.app.core.platform.VectorBaseBottomSheetDialogFragment import im.vector.app.core.platform.VectorBaseBottomSheetDialogFragment
@ -209,7 +208,7 @@ class BootstrapBottomSheet : VectorBaseBottomSheetDialogFragment<BottomSheetBoot
views.bootstrapTitleText.text = getString(R.string.upgrade_security) views.bootstrapTitleText.text = getString(R.string.upgrade_security)
showFragment(BootstrapMigrateBackupFragment::class) showFragment(BootstrapMigrateBackupFragment::class)
} }
}.exhaustive }
super.invalidate() super.invalidate()
} }

View file

@ -29,7 +29,6 @@ import im.vector.app.R
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.hiltMavericksViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory
import im.vector.app.core.error.ErrorFormatter 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.platform.VectorViewModel
import im.vector.app.core.platform.WaitingViewData import im.vector.app.core.platform.WaitingViewData
import im.vector.app.core.resources.StringProvider import im.vector.app.core.resources.StringProvider
@ -259,7 +258,7 @@ class BootstrapSharedViewModel @AssistedInject constructor(
copy(step = BootstrapStep.AccountReAuth(stringProvider.getString(R.string.authentication_error))) copy(step = BootstrapStep.AccountReAuth(stringProvider.getString(R.string.authentication_error)))
} }
} }
}.exhaustive }
} }
private fun handleStart(action: BootstrapActions.Start) = withState { private fun handleStart(action: BootstrapActions.Start) = withState {
@ -344,7 +343,7 @@ class BootstrapSharedViewModel @AssistedInject constructor(
) )
} }
} }
}.exhaustive }
} }
} }
} }
@ -449,7 +448,7 @@ class BootstrapSharedViewModel @AssistedInject constructor(
} }
} }
} }
}.exhaustive }
} }
} }
} }
@ -533,7 +532,7 @@ class BootstrapSharedViewModel @AssistedInject constructor(
) )
} }
} }
}.exhaustive }
} }
private fun BackupToQuadSMigrationTask.Result.Failure.toHumanReadable(): String { private fun BackupToQuadSMigrationTask.Result.Failure.toHumanReadable(): String {

View file

@ -30,7 +30,6 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder
import dagger.hilt.android.AndroidEntryPoint import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.extensions.commitTransaction 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.registerStartForActivityResult
import im.vector.app.core.extensions.toMvRxBundle import im.vector.app.core.extensions.toMvRxBundle
import im.vector.app.core.platform.VectorBaseActivity import im.vector.app.core.platform.VectorBaseActivity
@ -118,7 +117,7 @@ class VerificationBottomSheet : VectorBaseBottomSheetDialogFragment<BottomSheetV
activity.navigator.openSettings(activity, VectorSettingsActivity.EXTRA_DIRECT_ACCESS_SECURITY_PRIVACY) activity.navigator.openSettings(activity, VectorSettingsActivity.EXTRA_DIRECT_ACCESS_SECURITY_PRIVACY)
} }
} }
}.exhaustive }
} }
} }

View file

@ -28,7 +28,6 @@ import dagger.assisted.AssistedInject
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.hiltMavericksViewModelFactory 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.VectorViewModel
import im.vector.app.core.resources.StringProvider import im.vector.app.core.resources.StringProvider
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
@ -365,7 +364,7 @@ class VerificationBottomSheetViewModel @AssistedInject constructor(
copy(verifyingFrom4S = false) copy(verifyingFrom4S = false)
} }
} }
}.exhaustive }
} }
private fun handleSecretBackFromSSSS(action: VerificationAction.GotResultFromSsss) { private fun handleSecretBackFromSSSS(action: VerificationAction.GotResultFromSsss) {

View file

@ -34,7 +34,6 @@ import com.airbnb.mvrx.withState
import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.google.android.material.dialog.MaterialAlertDialogBuilder
import dagger.hilt.android.AndroidEntryPoint import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.extensions.exhaustive
import im.vector.app.core.extensions.replaceFragment import im.vector.app.core.extensions.replaceFragment
import im.vector.app.core.platform.SimpleFragmentActivity import im.vector.app.core.platform.SimpleFragmentActivity
import im.vector.app.core.resources.ColorProvider import im.vector.app.core.resources.ColorProvider
@ -79,7 +78,7 @@ class RoomDevToolActivity : SimpleFragmentActivity(), FragmentManager.OnBackStac
Unit Unit
} }
is DevToolsViewEvents.ShowSnackMessage -> showSnackbar(it.message) is DevToolsViewEvents.ShowSnackMessage -> showSnackbar(it.message)
}.exhaustive }
} }
supportFragmentManager.addOnBackStackChangedListener(this) supportFragmentManager.addOnBackStackChangedListener(this)
} }

View file

@ -28,7 +28,6 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.extensions.cleanup import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith 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.observeEvent
import im.vector.app.core.extensions.registerStartForActivityResult import im.vector.app.core.extensions.registerStartForActivityResult
import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.core.platform.VectorBaseFragment
@ -70,7 +69,7 @@ class DiscoverySettingsFragment @Inject constructor(
when (it) { when (it) {
is DiscoverySharedViewModelAction.ChangeIdentityServer -> is DiscoverySharedViewModelAction.ChangeIdentityServer ->
viewModel.handle(DiscoverySettingsAction.ChangeIdentityServer(it.newUrl)) viewModel.handle(DiscoverySettingsAction.ChangeIdentityServer(it.newUrl))
}.exhaustive }
} }
viewModel.observeViewEvents { viewModel.observeViewEvents {
@ -78,7 +77,7 @@ class DiscoverySettingsFragment @Inject constructor(
is DiscoverySettingsViewEvents.Failure -> { is DiscoverySettingsViewEvents.Failure -> {
displayErrorDialog(it.throwable) displayErrorDialog(it.throwable)
} }
}.exhaustive }
} }
if (discoveryArgs.expandIdentityPolicies) { if (discoveryArgs.expandIdentityPolicies) {
viewModel.handle(DiscoverySettingsAction.SetPoliciesExpandState(expanded = true)) viewModel.handle(DiscoverySettingsAction.SetPoliciesExpandState(expanded = true))

View file

@ -27,7 +27,6 @@ import dagger.assisted.AssistedInject
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.hiltMavericksViewModelFactory 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.VectorViewModel
import im.vector.app.core.resources.StringProvider import im.vector.app.core.resources.StringProvider
import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.launchIn
@ -113,7 +112,7 @@ class DiscoverySettingsViewModel @AssistedInject constructor(
is DiscoverySettingsAction.FinalizeBind3pid -> finalizeBind3pid(action, true) is DiscoverySettingsAction.FinalizeBind3pid -> finalizeBind3pid(action, true)
is DiscoverySettingsAction.SubmitMsisdnToken -> submitMsisdnToken(action) is DiscoverySettingsAction.SubmitMsisdnToken -> submitMsisdnToken(action)
is DiscoverySettingsAction.CancelBinding -> cancelBinding(action) is DiscoverySettingsAction.CancelBinding -> cancelBinding(action)
}.exhaustive }
} }
private fun handleUpdateUserConsent(action: DiscoverySettingsAction.UpdateUserConsent) { private fun handleUpdateUserConsent(action: DiscoverySettingsAction.UpdateUserConsent) {
@ -235,7 +234,7 @@ class DiscoverySettingsViewModel @AssistedInject constructor(
when (action.threePid) { when (action.threePid) {
is ThreePid.Email -> revokeEmail(action.threePid) is ThreePid.Email -> revokeEmail(action.threePid)
is ThreePid.Msisdn -> revokeMsisdn(action.threePid) is ThreePid.Msisdn -> revokeMsisdn(action.threePid)
}.exhaustive }
} }
private fun revokeEmail(threePid: ThreePid.Email) = withState { state -> private fun revokeEmail(threePid: ThreePid.Email) = withState { state ->

View file

@ -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.ButtonType
import im.vector.app.core.epoxy.attributes.IconMode import im.vector.app.core.epoxy.attributes.IconMode
import im.vector.app.core.epoxy.onClick 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.extensions.setTextOrHide
import im.vector.app.core.resources.ColorProvider import im.vector.app.core.resources.ColorProvider
import im.vector.app.core.resources.StringProvider import im.vector.app.core.resources.StringProvider
@ -122,7 +121,7 @@ abstract class SettingsTextButtonSingleLineItem : EpoxyModelWithHolder<SettingsT
ButtonStyle.DESTRUCTIVE -> { ButtonStyle.DESTRUCTIVE -> {
holder.mainButton.setTextColor(colorProvider.getColorFromAttribute(R.attr.colorError)) holder.mainButton.setTextColor(colorProvider.getColorFromAttribute(R.attr.colorError))
} }
}.exhaustive }
holder.mainButton.onClick(buttonClickListener) holder.mainButton.onClick(buttonClickListener)
} }
ButtonType.SWITCH -> { ButtonType.SWITCH -> {
@ -133,7 +132,7 @@ abstract class SettingsTextButtonSingleLineItem : EpoxyModelWithHolder<SettingsT
checked?.let { holder.switchButton.isChecked = it } checked?.let { holder.switchButton.isChecked = it }
holder.switchButton.setOnCheckedChangeListener(switchChangeListener) holder.switchButton.setOnCheckedChangeListener(switchChangeListener)
} }
}.exhaustive }
} }
when (iconMode) { when (iconMode) {

View file

@ -29,7 +29,6 @@ import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState import com.airbnb.mvrx.withState
import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.google.android.material.dialog.MaterialAlertDialogBuilder
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.extensions.exhaustive
import im.vector.app.core.extensions.registerStartForActivityResult import im.vector.app.core.extensions.registerStartForActivityResult
import im.vector.app.core.extensions.toReducedUrl import im.vector.app.core.extensions.toReducedUrl
import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.core.platform.VectorBaseFragment
@ -132,7 +131,7 @@ class SetIdentityServerFragment @Inject constructor(
it.identityServerUrl, it.identityServerUrl,
null) null)
} }
}.exhaustive }
} }
} }

View file

@ -25,7 +25,6 @@ import im.vector.app.R
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.SingletonEntryPoint import im.vector.app.core.di.SingletonEntryPoint
import im.vector.app.core.di.hiltMavericksViewModelFactory 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.VectorViewModel
import im.vector.app.core.resources.StringProvider import im.vector.app.core.resources.StringProvider
import im.vector.app.core.utils.ensureProtocol import im.vector.app.core.utils.ensureProtocol
@ -67,7 +66,7 @@ class SetIdentityServerViewModel @AssistedInject constructor(
when (action) { when (action) {
SetIdentityServerAction.UseDefaultIdentityServer -> useDefault() SetIdentityServerAction.UseDefaultIdentityServer -> useDefault()
is SetIdentityServerAction.UseCustomIdentityServer -> usedCustomIdentityServerUrl(action) is SetIdentityServerAction.UseCustomIdentityServer -> usedCustomIdentityServerUrl(action)
}.exhaustive }
} }
private fun useDefault() = withState { state -> private fun useDefault() = withState { state ->

View file

@ -38,7 +38,6 @@ import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.AppStateHandler import im.vector.app.AppStateHandler
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.di.ActiveSessionHolder 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.hideKeyboard
import im.vector.app.core.extensions.registerStartForActivityResult import im.vector.app.core.extensions.registerStartForActivityResult
import im.vector.app.core.extensions.replaceFragment import im.vector.app.core.extensions.replaceFragment
@ -107,6 +106,7 @@ class HomeActivity :
@Suppress("UNUSED") @Suppress("UNUSED")
private val analyticsAccountDataViewModel: AnalyticsAccountDataViewModel by viewModel() private val analyticsAccountDataViewModel: AnalyticsAccountDataViewModel by viewModel()
@Suppress("UNUSED") @Suppress("UNUSED")
private val userColorAccountDataViewModel: UserColorAccountDataViewModel by viewModel() private val userColorAccountDataViewModel: UserColorAccountDataViewModel by viewModel()
@ -232,7 +232,7 @@ class HomeActivity :
HomeActivitySharedAction.SendSpaceFeedBack -> { HomeActivitySharedAction.SendSpaceFeedBack -> {
bugReporter.openBugReportScreen(this, ReportType.SPACE_BETA_FEEDBACK) bugReporter.openBugReportScreen(this, ReportType.SPACE_BETA_FEEDBACK)
} }
}.exhaustive }
} }
.launchIn(lifecycleScope) .launchIn(lifecycleScope)
@ -256,7 +256,7 @@ class HomeActivity :
HomeActivityViewEvents.ShowAnalyticsOptIn -> handleShowAnalyticsOptIn() HomeActivityViewEvents.ShowAnalyticsOptIn -> handleShowAnalyticsOptIn()
HomeActivityViewEvents.NotifyUserForThreadsMigration -> handleNotifyUserForThreadsMigration() HomeActivityViewEvents.NotifyUserForThreadsMigration -> handleNotifyUserForThreadsMigration()
is HomeActivityViewEvents.MigrateThreads -> migrateThreadsIfNeeded(it.checkSession) is HomeActivityViewEvents.MigrateThreads -> migrateThreadsIfNeeded(it.checkSession)
}.exhaustive }
} }
homeActivityViewModel.onEach { renderState(it) } homeActivityViewModel.onEach { renderState(it) }
@ -374,7 +374,7 @@ class HomeActivity :
// Idle or Incremental sync status // Idle or Incremental sync status
views.waitingView.root.isVisible = false views.waitingView.root.isVisible = false
} }
}.exhaustive }
} }
private fun handleAskPasswordToInitCrossSigning(events: HomeActivityViewEvents.AskPasswordToInitCrossSigning) { private fun handleAskPasswordToInitCrossSigning(events: HomeActivityViewEvents.AskPasswordToInitCrossSigning) {

View file

@ -25,7 +25,6 @@ import im.vector.app.config.analyticsConfig
import im.vector.app.core.di.ActiveSessionHolder import im.vector.app.core.di.ActiveSessionHolder
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.hiltMavericksViewModelFactory 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.VectorViewModel
import im.vector.app.features.analytics.store.AnalyticsStore import im.vector.app.features.analytics.store.AnalyticsStore
import im.vector.app.features.login.ReAuthHelper import im.vector.app.features.login.ReAuthHelper
@ -306,6 +305,6 @@ class HomeActivityViewModel @AssistedInject constructor(
HomeActivityViewActions.ViewStarted -> { HomeActivityViewActions.ViewStarted -> {
initialize() initialize()
} }
}.exhaustive }
} }
} }

View file

@ -72,7 +72,6 @@ import im.vector.app.core.dialogs.ConfirmationDialogBuilder
import im.vector.app.core.dialogs.GalleryOrCameraDialogHelper import im.vector.app.core.dialogs.GalleryOrCameraDialogHelper
import im.vector.app.core.epoxy.LayoutManagerStateRestorer import im.vector.app.core.epoxy.LayoutManagerStateRestorer
import im.vector.app.core.extensions.cleanup 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.hideKeyboard
import im.vector.app.core.extensions.registerStartForActivityResult import im.vector.app.core.extensions.registerStartForActivityResult
import im.vector.app.core.extensions.setTextOrHide import im.vector.app.core.extensions.setTextOrHide
@ -446,7 +445,7 @@ class TimelineFragment @Inject constructor(
} }
showErrorInSnackbar(it.throwable) showErrorInSnackbar(it.throwable)
} }
}.exhaustive }
} }
timelineViewModel.observeViewEvents { timelineViewModel.observeViewEvents {
@ -483,7 +482,7 @@ class TimelineFragment @Inject constructor(
RoomDetailViewEvents.StopChatEffects -> handleStopChatEffects() RoomDetailViewEvents.StopChatEffects -> handleStopChatEffects()
is RoomDetailViewEvents.DisplayAndAcceptCall -> acceptIncomingCall(it) is RoomDetailViewEvents.DisplayAndAcceptCall -> acceptIncomingCall(it)
RoomDetailViewEvents.RoomReplacementStarted -> handleRoomReplacement() RoomDetailViewEvents.RoomReplacementStarted -> handleRoomReplacement()
}.exhaustive }
} }
if (savedInstanceState == null) { if (savedInstanceState == null) {
@ -875,7 +874,7 @@ class TimelineFragment @Inject constructor(
onContentAttachmentsReady(sharedData.attachmentData) onContentAttachmentsReady(sharedData.attachmentData)
} }
null -> Timber.v("No share data to process") null -> Timber.v("No share data to process")
}.exhaustive }
} }
private fun handleSpaceShare() { private fun handleSpaceShare() {
@ -1241,7 +1240,7 @@ class TimelineFragment @Inject constructor(
insertUserDisplayNameInTextEditor(roomDetailPendingAction.userId) insertUserDisplayNameInTextEditor(roomDetailPendingAction.userId)
is RoomDetailPendingAction.OpenRoom -> is RoomDetailPendingAction.OpenRoom ->
handleOpenRoom(RoomDetailViewEvents.OpenRoom(roomDetailPendingAction.roomId, roomDetailPendingAction.closeCurrentRoom)) handleOpenRoom(RoomDetailViewEvents.OpenRoom(roomDetailPendingAction.roomId, roomDetailPendingAction.closeCurrentRoom))
}.exhaustive }
} }
override fun onPause() { override fun onPause() {
@ -1658,7 +1657,7 @@ class TimelineFragment @Inject constructor(
is MessageComposerViewEvents.SlashCommandNotSupportedInThreads -> { is MessageComposerViewEvents.SlashCommandNotSupportedInThreads -> {
displayCommandError(getString(R.string.command_not_supported_in_threads, sendMessageResult.command.command)) displayCommandError(getString(R.string.command_not_supported_in_threads, sendMessageResult.command.command))
} }
} // .exhaustive } //
lockSendButton = false lockSendButton = false
} }
@ -2437,7 +2436,7 @@ class TimelineFragment @Inject constructor(
locationOwnerId = session.myUserId locationOwnerId = session.myUserId
) )
} }
}.exhaustive }
} }
// AttachmentsHelper.Callback // AttachmentsHelper.Callback

View file

@ -33,7 +33,6 @@ import im.vector.app.BuildConfig
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.hiltMavericksViewModelFactory 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.mvrx.runCatchingToAsync
import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.platform.VectorViewModel
import im.vector.app.core.resources.StringProvider import im.vector.app.core.resources.StringProvider
@ -440,7 +439,7 @@ class TimelineViewModel @AssistedInject constructor(
_viewEvents.post(RoomDetailViewEvents.OpenRoom(action.replacementRoomId, closeCurrentRoom = true)) _viewEvents.post(RoomDetailViewEvents.OpenRoom(action.replacementRoomId, closeCurrentRoom = true))
} }
is RoomDetailAction.EndPoll -> handleEndPoll(action.eventId) is RoomDetailAction.EndPoll -> handleEndPoll(action.eventId)
}.exhaustive }
} }
private fun handleJitsiCallJoinStatus(action: RoomDetailAction.UpdateJoinJitsiCallStatus) = withState { state -> private fun handleJitsiCallJoinStatus(action: RoomDetailAction.UpdateJoinJitsiCallStatus) = withState { state ->

View file

@ -23,7 +23,6 @@ import dagger.assisted.AssistedInject
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.hiltMavericksViewModelFactory 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.VectorViewModel
import im.vector.app.core.resources.StringProvider import im.vector.app.core.resources.StringProvider
import im.vector.app.features.analytics.AnalyticsTracker import im.vector.app.features.analytics.AnalyticsTracker
@ -463,7 +462,7 @@ class MessageComposerViewModel @AssistedInject constructor(
_viewEvents.post(MessageComposerViewEvents.SlashCommandResultOk()) _viewEvents.post(MessageComposerViewEvents.SlashCommandResultOk())
popDraft() popDraft()
} }
}.exhaustive }
} }
is SendMode.Edit -> { is SendMode.Edit -> {
// is original event a reply? // is original event a reply?
@ -536,7 +535,7 @@ class MessageComposerViewModel @AssistedInject constructor(
is SendMode.Voice -> { is SendMode.Voice -> {
// do nothing // do nothing
} }
}.exhaustive }
} }
} }

View file

@ -23,7 +23,6 @@ import androidx.constraintlayout.widget.ConstraintLayout
import dagger.hilt.android.AndroidEntryPoint import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.BuildConfig import im.vector.app.BuildConfig
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.extensions.exhaustive
import im.vector.app.core.hardware.vibrate import im.vector.app.core.hardware.vibrate
import im.vector.app.core.time.Clock import im.vector.app.core.time.Clock
import im.vector.app.core.utils.DimensionConverter import im.vector.app.core.utils.DimensionConverter
@ -168,7 +167,7 @@ class VoiceMessageRecorderView @JvmOverloads constructor(
DraggingState.Ready -> { DraggingState.Ready -> {
// do nothing // do nothing
} }
}.exhaustive }
dragState = newDragState dragState = newDragState
} }

View file

@ -25,7 +25,6 @@ import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject import dagger.assisted.AssistedInject
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.hiltMavericksViewModelFactory 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.VectorViewModel
import kotlinx.coroutines.CancellationException import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.Job import kotlinx.coroutines.Job
@ -56,7 +55,7 @@ class SearchViewModel @AssistedInject constructor(
is SearchAction.SearchWith -> handleSearchWith(action) is SearchAction.SearchWith -> handleSearchWith(action)
is SearchAction.LoadMore -> handleLoadMore() is SearchAction.LoadMore -> handleLoadMore()
is SearchAction.Retry -> handleRetry() is SearchAction.Retry -> handleRetry()
}.exhaustive }
} }
private fun handleSearchWith(action: SearchAction.SearchWith) { private fun handleSearchWith(action: SearchAction.SearchWith) {

View file

@ -26,7 +26,6 @@ import dagger.hilt.android.scopes.ActivityScoped
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.di.ActiveSessionHolder import im.vector.app.core.di.ActiveSessionHolder
import im.vector.app.core.error.ErrorFormatter 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.core.utils.TextUtils
import im.vector.app.features.home.room.detail.timeline.MessageColorProvider import im.vector.app.features.home.room.detail.timeline.MessageColorProvider
import org.matrix.android.sdk.api.session.content.ContentUploadStateTracker 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.Success -> handleSuccess()
is ContentUploadStateTracker.State.CompressingImage -> handleCompressingImage() is ContentUploadStateTracker.State.CompressingImage -> handleCompressingImage()
is ContentUploadStateTracker.State.CompressingVideo -> handleCompressingVideo(state) is ContentUploadStateTracker.State.CompressingVideo -> handleCompressingVideo(state)
}.exhaustive }
} }
private fun handleIdle() { private fun handleIdle() {

View file

@ -23,7 +23,6 @@ import androidx.appcompat.content.res.AppCompatResources
import androidx.constraintlayout.widget.ConstraintLayout import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.view.isVisible import androidx.core.view.isVisible
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.extensions.exhaustive
import im.vector.app.core.extensions.setAttributeTintedImageResource import im.vector.app.core.extensions.setAttributeTintedImageResource
import im.vector.app.databinding.ItemPollOptionBinding import im.vector.app.databinding.ItemPollOptionBinding
@ -49,7 +48,7 @@ class PollOptionView @JvmOverloads constructor(
is PollOptionViewState.PollReady -> renderPollReady() is PollOptionViewState.PollReady -> renderPollReady()
is PollOptionViewState.PollVoted -> renderPollVoted(state) is PollOptionViewState.PollVoted -> renderPollVoted(state)
is PollOptionViewState.PollUndisclosed -> renderPollUndisclosed(state) is PollOptionViewState.PollUndisclosed -> renderPollUndisclosed(state)
}.exhaustive }
} }
private fun renderPollSending() { private fun renderPollSending() {

View file

@ -31,7 +31,6 @@ import com.airbnb.epoxy.EpoxyModelClass
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.epoxy.ClickListener import im.vector.app.core.epoxy.ClickListener
import im.vector.app.core.epoxy.onClick 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.AvatarRenderer
import im.vector.app.features.home.room.detail.RoomDetailAction import im.vector.app.features.home.room.detail.RoomDetailAction
import im.vector.app.features.home.room.detail.timeline.MessageColorProvider import im.vector.app.features.home.room.detail.timeline.MessageColorProvider
@ -105,7 +104,7 @@ abstract class VerificationRequestItem : AbsBaseMessageItem<VerificationRequestI
} }
holder.statusTextView.isVisible = true holder.statusTextView.isVisible = true
} }
}.exhaustive }
// Always hide buttons if request is too old // Always hide buttons if request is too old
if (!VerificationService.isValidRequest(attributes.informationData.ageLocalTS)) { if (!VerificationService.isValidRequest(attributes.informationData.ageLocalTS)) {

View file

@ -38,7 +38,6 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.epoxy.LayoutManagerStateRestorer import im.vector.app.core.epoxy.LayoutManagerStateRestorer
import im.vector.app.core.extensions.cleanup import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.exhaustive
import im.vector.app.core.platform.OnBackPressed import im.vector.app.core.platform.OnBackPressed
import im.vector.app.core.platform.StateView import im.vector.app.core.platform.StateView
import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.core.platform.VectorBaseFragment
@ -128,7 +127,7 @@ class RoomListFragment @Inject constructor(
is RoomListViewEvents.SelectRoom -> handleSelectRoom(it, it.isInviteAlreadyAccepted) is RoomListViewEvents.SelectRoom -> handleSelectRoom(it, it.isInviteAlreadyAccepted)
is RoomListViewEvents.Done -> Unit is RoomListViewEvents.Done -> Unit
is RoomListViewEvents.NavigateToMxToBottomSheet -> handleShowMxToLink(it.link) is RoomListViewEvents.NavigateToMxToBottomSheet -> handleShowMxToLink(it.link)
}.exhaustive }
} }
views.createChatFabMenu.listener = this views.createChatFabMenu.listener = this
@ -418,7 +417,7 @@ class RoomListFragment @Inject constructor(
is RoomListQuickActionsSharedAction.Leave -> { is RoomListQuickActionsSharedAction.Leave -> {
promptLeaveRoom(quickAction.roomId) promptLeaveRoom(quickAction.roomId)
} }
}.exhaustive }
} }
private fun promptLeaveRoom(roomId: String) { private fun promptLeaveRoom(roomId: String) {

View file

@ -29,7 +29,6 @@ import im.vector.app.AppStateHandler
import im.vector.app.RoomGroupingMethod import im.vector.app.RoomGroupingMethod
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.hiltMavericksViewModelFactory 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.VectorViewModel
import im.vector.app.core.resources.StringProvider import im.vector.app.core.resources.StringProvider
import im.vector.app.features.analytics.AnalyticsTracker import im.vector.app.features.analytics.AnalyticsTracker
@ -163,7 +162,7 @@ class RoomListViewModel @AssistedInject constructor(
is RoomListAction.ToggleSection -> handleToggleSection(action.section) is RoomListAction.ToggleSection -> handleToggleSection(action.section)
is RoomListAction.JoinSuggestedRoom -> handleJoinSuggestedRoom(action) is RoomListAction.JoinSuggestedRoom -> handleJoinSuggestedRoom(action)
is RoomListAction.ShowRoomDetails -> handleShowRoomDetails(action) is RoomListAction.ShowRoomDetails -> handleShowRoomDetails(action)
}.exhaustive }
} }
fun isPublicRoom(roomId: String): Boolean { fun isPublicRoom(roomId: String): Boolean {

View file

@ -29,7 +29,6 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.mapbox.mapboxsdk.maps.MapView import com.mapbox.mapboxsdk.maps.MapView
import im.vector.app.BuildConfig import im.vector.app.BuildConfig
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.extensions.exhaustive
import im.vector.app.core.platform.VectorBaseFragment 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_BACKGROUND_LOCATION_SHARING
import im.vector.app.core.utils.PERMISSIONS_FOR_FOREGROUND_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.Close -> locationSharingNavigator.quit()
LocationSharingViewEvents.LocationNotAvailableError -> handleLocationNotAvailableError() LocationSharingViewEvents.LocationNotAvailableError -> handleLocationNotAvailableError()
is LocationSharingViewEvents.ZoomToUserLocation -> handleZoomToUserLocationEvent(it) is LocationSharingViewEvents.ZoomToUserLocation -> handleZoomToUserLocationEvent(it)
}.exhaustive }
} }
} }

View file

@ -23,7 +23,6 @@ import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject import dagger.assisted.AssistedInject
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.hiltMavericksViewModelFactory 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.VectorViewModel
import im.vector.app.features.home.room.detail.timeline.helper.LocationPinProvider import im.vector.app.features.home.room.detail.timeline.helper.LocationPinProvider
import im.vector.app.features.location.domain.usecase.CompareLocationsUseCase import im.vector.app.features.location.domain.usecase.CompareLocationsUseCase
@ -122,7 +121,7 @@ class LocationSharingViewModel @AssistedInject constructor(
is LocationSharingAction.LocationTargetChange -> handleLocationTargetChangeAction(action) is LocationSharingAction.LocationTargetChange -> handleLocationTargetChangeAction(action)
LocationSharingAction.ZoomToUserLocation -> handleZoomToUserLocationAction() LocationSharingAction.ZoomToUserLocation -> handleZoomToUserLocationAction()
LocationSharingAction.StartLiveLocationSharing -> handleStartLiveLocationSharingAction() LocationSharingAction.StartLiveLocationSharing -> handleStartLiveLocationSharingAction()
}.exhaustive }
} }
private fun handleCurrentUserLocationSharingAction() = withState { state -> private fun handleCurrentUserLocationSharingAction() = withState { state ->

View file

@ -26,7 +26,6 @@ import com.airbnb.mvrx.withState
import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.google.android.material.dialog.MaterialAlertDialogBuilder
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.dialogs.UnrecognizedCertificateDialog 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.OnBackPressed
import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.core.platform.VectorBaseFragment
import kotlinx.coroutines.CancellationException import kotlinx.coroutines.CancellationException
@ -69,7 +68,7 @@ abstract class AbstractLoginFragment<VB : ViewBinding> : VectorBaseFragment<VB>(
else -> else ->
// This is handled by the Activity // This is handled by the Activity
Unit Unit
}.exhaustive }
} }
override fun showFailure(throwable: Throwable) { override fun showFailure(throwable: Throwable) {

View file

@ -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.POP_BACK_STACK_EXCLUSIVE
import im.vector.app.core.extensions.addFragment import im.vector.app.core.extensions.addFragment
import im.vector.app.core.extensions.addFragmentToBackstack 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.extensions.validateBackPressed
import im.vector.app.core.platform.VectorBaseActivity import im.vector.app.core.platform.VectorBaseActivity
import im.vector.app.databinding.ActivityLoginBinding import im.vector.app.databinding.ActivityLoginBinding
@ -197,7 +196,7 @@ open class LoginActivity : VectorBaseActivity<ActivityLoginBinding>(), UnlockedA
is LoginViewEvents.Loading -> is LoginViewEvents.Loading ->
// This is handled by the Fragments // This is handled by the Fragments
Unit Unit
}.exhaustive }
} }
private fun updateWithState(loginViewState: LoginViewState) { private fun updateWithState(loginViewState: LoginViewState) {
@ -260,13 +259,13 @@ open class LoginActivity : VectorBaseActivity<ActivityLoginBinding>(), UnlockedA
tag = FRAGMENT_LOGIN_TAG, tag = FRAGMENT_LOGIN_TAG,
option = commonOption) option = commonOption)
LoginMode.Unsupported -> onLoginModeNotSupported(state.loginModeSupportedTypes) LoginMode.Unsupported -> onLoginModeNotSupported(state.loginModeSupportedTypes)
}.exhaustive }
} }
SignMode.SignInWithMatrixId -> addFragmentToBackstack(views.loginFragmentContainer, SignMode.SignInWithMatrixId -> addFragmentToBackstack(views.loginFragmentContainer,
LoginFragment::class.java, LoginFragment::class.java,
tag = FRAGMENT_LOGIN_TAG, tag = FRAGMENT_LOGIN_TAG,
option = commonOption) option = commonOption)
}.exhaustive }
} }
/** /**

View file

@ -31,7 +31,6 @@ import com.airbnb.mvrx.Loading
import com.airbnb.mvrx.Success import com.airbnb.mvrx.Success
import com.airbnb.mvrx.Uninitialized import com.airbnb.mvrx.Uninitialized
import im.vector.app.R 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.hideKeyboard
import im.vector.app.core.extensions.hidePassword import im.vector.app.core.extensions.hidePassword
import im.vector.app.core.extensions.toReducedUrl import im.vector.app.core.extensions.toReducedUrl
@ -98,7 +97,7 @@ class LoginFragment @Inject constructor() : AbstractSSOLoginFragment<FragmentLog
views.loginField.setAutofillHints(HintConstants.AUTOFILL_HINT_USERNAME) views.loginField.setAutofillHints(HintConstants.AUTOFILL_HINT_USERNAME)
views.passwordField.setAutofillHints(HintConstants.AUTOFILL_HINT_PASSWORD) views.passwordField.setAutofillHints(HintConstants.AUTOFILL_HINT_PASSWORD)
} }
}.exhaustive }
} }
} }
@ -108,7 +107,7 @@ class LoginFragment @Inject constructor() : AbstractSSOLoginFragment<FragmentLog
SignMode.SignUp -> SocialLoginButtonsView.Mode.MODE_SIGN_UP SignMode.SignUp -> SocialLoginButtonsView.Mode.MODE_SIGN_UP
SignMode.SignIn, SignMode.SignIn,
SignMode.SignInWithMatrixId -> SocialLoginButtonsView.Mode.MODE_SIGN_IN SignMode.SignInWithMatrixId -> SocialLoginButtonsView.Mode.MODE_SIGN_IN
}.exhaustive }
} }
private fun submit() { private fun submit() {

View file

@ -31,7 +31,6 @@ import im.vector.app.core.di.ActiveSessionHolder
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.hiltMavericksViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory
import im.vector.app.core.extensions.configureAndStart 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.platform.VectorViewModel
import im.vector.app.core.resources.StringProvider import im.vector.app.core.resources.StringProvider
import im.vector.app.core.utils.ensureTrailingSlash import im.vector.app.core.utils.ensureTrailingSlash
@ -131,7 +130,7 @@ class LoginViewModel @AssistedInject constructor(
is LoginAction.UserAcceptCertificate -> handleUserAcceptCertificate(action) is LoginAction.UserAcceptCertificate -> handleUserAcceptCertificate(action)
LoginAction.ClearHomeServerHistory -> handleClearHomeServerHistory() LoginAction.ClearHomeServerHistory -> handleClearHomeServerHistory()
is LoginAction.PostViewEvent -> _viewEvents.post(action.viewEvent) is LoginAction.PostViewEvent -> _viewEvents.post(action.viewEvent)
}.exhaustive }
} }
private fun handleOnGetStarted(action: LoginAction.OnGetStarted) { private fun handleOnGetStarted(action: LoginAction.OnGetStarted) {
@ -448,7 +447,7 @@ class LoginViewModel @AssistedInject constructor(
handle(LoginAction.UpdateHomeServer(matrixOrgUrl)) handle(LoginAction.UpdateHomeServer(matrixOrgUrl))
ServerType.EMS, ServerType.EMS,
ServerType.Other -> _viewEvents.post(LoginViewEvents.OnServerSelectionDone(action.serverType)) ServerType.Other -> _viewEvents.post(LoginViewEvents.OnServerSelectionDone(action.serverType))
}.exhaustive }
} }
private fun handleInitWith(action: LoginAction.InitWith) { private fun handleInitWith(action: LoginAction.InitWith) {
@ -556,7 +555,7 @@ class LoginViewModel @AssistedInject constructor(
SignMode.SignIn -> handleLogin(action) SignMode.SignIn -> handleLogin(action)
SignMode.SignUp -> handleRegisterWith(action) SignMode.SignUp -> handleRegisterWith(action)
SignMode.SignInWithMatrixId -> handleDirectLogin(action, null) SignMode.SignInWithMatrixId -> handleDirectLogin(action, null)
}.exhaustive }
} }
private fun handleDirectLogin(action: LoginAction.LoginOrRegister, homeServerConnectionConfig: HomeServerConnectionConfig?) { private fun handleDirectLogin(action: LoginAction.LoginOrRegister, homeServerConnectionConfig: HomeServerConnectionConfig?) {
@ -586,7 +585,7 @@ class LoginViewModel @AssistedInject constructor(
else -> { else -> {
onWellKnownError() onWellKnownError()
} }
}.exhaustive }
} }
} }

View file

@ -26,7 +26,6 @@ import com.airbnb.mvrx.withState
import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.google.android.material.dialog.MaterialAlertDialogBuilder
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.dialogs.UnrecognizedCertificateDialog 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.OnBackPressed
import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.core.platform.VectorBaseFragment
import kotlinx.coroutines.CancellationException import kotlinx.coroutines.CancellationException
@ -67,7 +66,7 @@ abstract class AbstractLoginFragment2<VB : ViewBinding> : VectorBaseFragment<VB>
else -> else ->
// This is handled by the Activity // This is handled by the Activity
Unit Unit
}.exhaustive }
} }
override fun showFailure(throwable: Throwable) { override fun showFailure(throwable: Throwable) {

View file

@ -28,7 +28,6 @@ import im.vector.app.core.di.ActiveSessionHolder
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.hiltMavericksViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory
import im.vector.app.core.extensions.configureAndStart 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.extensions.tryAsync
import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.platform.VectorViewModel
import im.vector.app.core.resources.StringProvider import im.vector.app.core.resources.StringProvider
@ -136,7 +135,7 @@ class LoginViewModel2 @AssistedInject constructor(
LoginAction2.ClearHomeServerHistory -> handleClearHomeServerHistory() LoginAction2.ClearHomeServerHistory -> handleClearHomeServerHistory()
is LoginAction2.PostViewEvent -> _viewEvents.post(action.viewEvent) is LoginAction2.PostViewEvent -> _viewEvents.post(action.viewEvent)
is LoginAction2.Finish -> handleFinish() is LoginAction2.Finish -> handleFinish()
}.exhaustive }
} }
private fun handleFinish() { private fun handleFinish() {
@ -500,7 +499,7 @@ class LoginViewModel2 @AssistedInject constructor(
SignMode2.Unknown -> error("Developer error, invalid sign mode") SignMode2.Unknown -> error("Developer error, invalid sign mode")
SignMode2.SignIn -> handleSetUserNameForSignIn(action, null) SignMode2.SignIn -> handleSetUserNameForSignIn(action, null)
SignMode2.SignUp -> handleSetUserNameForSignUp(action) SignMode2.SignUp -> handleSetUserNameForSignUp(action)
}.exhaustive }
} }
private fun handleSetUserPassword(action: LoginAction2.SetUserPassword) = withState { state -> 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.Unknown -> error("Developer error, invalid sign mode")
SignMode2.SignIn -> handleSignInWithPassword(action) SignMode2.SignIn -> handleSignInWithPassword(action)
SignMode2.SignUp -> handleRegisterWithPassword(action) SignMode2.SignUp -> handleRegisterWithPassword(action)
}.exhaustive }
} }
private fun handleRegisterWithPassword(action: LoginAction2.SetUserPassword) = withState { state -> private fun handleRegisterWithPassword(action: LoginAction2.SetUserPassword) = withState { state ->
@ -588,7 +587,7 @@ class LoginViewModel2 @AssistedInject constructor(
else -> { else -> {
onWellKnownError() onWellKnownError()
} }
}.exhaustive }
} }
} }

View file

@ -28,7 +28,6 @@ import im.vector.app.R
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.hiltMavericksViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory
import im.vector.app.core.error.ErrorFormatter 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.platform.VectorViewModel
import im.vector.app.core.resources.StringProvider import im.vector.app.core.resources.StringProvider
import im.vector.app.features.createdirect.DirectRoomHelper import im.vector.app.features.createdirect.DirectRoomHelper
@ -264,7 +263,7 @@ class MatrixToBottomSheetViewModel @AssistedInject constructor(
is MatrixToAction.OpenRoom -> { is MatrixToAction.OpenRoom -> {
_viewEvents.post(MatrixToViewEvents.NavigateToRoom(action.roomId)) _viewEvents.post(MatrixToViewEvents.NavigateToRoom(action.roomId))
} }
}.exhaustive }
} }
private fun handleJoinSpace(joinSpace: MatrixToAction.JoinSpace) { private fun handleJoinSpace(joinSpace: MatrixToAction.JoinSpace) {

View file

@ -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.POP_BACK_STACK_EXCLUSIVE
import im.vector.app.core.extensions.addFragment import im.vector.app.core.extensions.addFragment
import im.vector.app.core.extensions.addFragmentToBackstack 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.extensions.resetBackstack
import im.vector.app.core.platform.VectorBaseActivity import im.vector.app.core.platform.VectorBaseActivity
import im.vector.app.databinding.ActivityLoginBinding import im.vector.app.databinding.ActivityLoginBinding
@ -257,7 +256,7 @@ class Login2Variant(
is LoginViewEvents2.OnSessionCreated -> handleOnSessionCreated(event) is LoginViewEvents2.OnSessionCreated -> handleOnSessionCreated(event)
is LoginViewEvents2.Finish -> terminate(true) is LoginViewEvents2.Finish -> terminate(true)
is LoginViewEvents2.CancelRegistration -> handleCancelRegistration() is LoginViewEvents2.CancelRegistration -> handleCancelRegistration()
}.exhaustive }
} }
private fun handleCancelRegistration() { private fun handleCancelRegistration() {

View file

@ -31,7 +31,6 @@ import im.vector.app.core.di.ActiveSessionHolder
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.hiltMavericksViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory
import im.vector.app.core.extensions.configureAndStart 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.extensions.vectorStore
import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.platform.VectorViewModel
import im.vector.app.core.resources.StringProvider import im.vector.app.core.resources.StringProvider
@ -166,7 +165,7 @@ class OnboardingViewModel @AssistedInject constructor(
OnboardingAction.SaveSelectedProfilePicture -> updateProfilePicture() OnboardingAction.SaveSelectedProfilePicture -> updateProfilePicture()
is OnboardingAction.PostViewEvent -> _viewEvents.post(action.viewEvent) is OnboardingAction.PostViewEvent -> _viewEvents.post(action.viewEvent)
OnboardingAction.StopEmailValidationCheck -> cancelWaitForEmailValidation() OnboardingAction.StopEmailValidationCheck -> cancelWaitForEmailValidation()
}.exhaustive }
} }
private fun handleSplashAction(resetConfig: Boolean, onboardingFlow: OnboardingFlow) { private fun handleSplashAction(resetConfig: Boolean, onboardingFlow: OnboardingFlow) {
@ -404,7 +403,7 @@ class OnboardingViewModel @AssistedInject constructor(
handle(OnboardingAction.UpdateHomeServer(matrixOrgUrl)) handle(OnboardingAction.UpdateHomeServer(matrixOrgUrl))
ServerType.EMS, ServerType.EMS,
ServerType.Other -> _viewEvents.post(OnboardingViewEvents.OnServerSelectionDone(action.serverType)) ServerType.Other -> _viewEvents.post(OnboardingViewEvents.OnServerSelectionDone(action.serverType))
}.exhaustive }
} }
private fun handleInitWith(action: OnboardingAction.InitWith) { private fun handleInitWith(action: OnboardingAction.InitWith) {
@ -512,7 +511,7 @@ class OnboardingViewModel @AssistedInject constructor(
SignMode.SignIn -> handleLogin(action) SignMode.SignIn -> handleLogin(action)
SignMode.SignUp -> handleRegisterWith(action) SignMode.SignUp -> handleRegisterWith(action)
SignMode.SignInWithMatrixId -> handleDirectLogin(action, null) SignMode.SignInWithMatrixId -> handleDirectLogin(action, null)
}.exhaustive }
} }
private fun handleDirectLogin(action: OnboardingAction.LoginOrRegister, homeServerConnectionConfig: HomeServerConnectionConfig?) { private fun handleDirectLogin(action: OnboardingAction.LoginOrRegister, homeServerConnectionConfig: HomeServerConnectionConfig?) {
@ -542,7 +541,7 @@ class OnboardingViewModel @AssistedInject constructor(
else -> { else -> {
onWellKnownError() onWellKnownError()
} }
}.exhaustive }
} }
} }

View file

@ -26,7 +26,6 @@ import com.airbnb.mvrx.withState
import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.google.android.material.dialog.MaterialAlertDialogBuilder
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.dialogs.UnrecognizedCertificateDialog 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.OnBackPressed
import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.features.onboarding.OnboardingAction import im.vector.app.features.onboarding.OnboardingAction
@ -73,7 +72,7 @@ abstract class AbstractFtueAuthFragment<VB : ViewBinding> : VectorBaseFragment<V
else -> else ->
// This is handled by the Activity // This is handled by the Activity
Unit Unit
}.exhaustive }
} }
override fun showFailure(throwable: Throwable) { override fun showFailure(throwable: Throwable) {

View file

@ -29,7 +29,6 @@ import androidx.lifecycle.lifecycleScope
import com.airbnb.mvrx.Fail import com.airbnb.mvrx.Fail
import com.airbnb.mvrx.Loading import com.airbnb.mvrx.Loading
import im.vector.app.R 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.hideKeyboard
import im.vector.app.core.extensions.hidePassword import im.vector.app.core.extensions.hidePassword
import im.vector.app.core.extensions.toReducedUrl import im.vector.app.core.extensions.toReducedUrl
@ -104,7 +103,7 @@ class FtueAuthLoginFragment @Inject constructor() : AbstractSSOFtueAuthFragment<
views.loginField.setAutofillHints(HintConstants.AUTOFILL_HINT_USERNAME) views.loginField.setAutofillHints(HintConstants.AUTOFILL_HINT_USERNAME)
views.passwordField.setAutofillHints(HintConstants.AUTOFILL_HINT_PASSWORD) 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.SignUp -> SocialLoginButtonsView.Mode.MODE_SIGN_UP
SignMode.SignIn, SignMode.SignIn,
SignMode.SignInWithMatrixId -> SocialLoginButtonsView.Mode.MODE_SIGN_IN SignMode.SignInWithMatrixId -> SocialLoginButtonsView.Mode.MODE_SIGN_IN
}.exhaustive }
} }
private fun submit() { private fun submit() {

View file

@ -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.POP_BACK_STACK_EXCLUSIVE
import im.vector.app.core.extensions.addFragment import im.vector.app.core.extensions.addFragment
import im.vector.app.core.extensions.addFragmentToBackstack 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.popBackstack
import im.vector.app.core.extensions.replaceFragment import im.vector.app.core.extensions.replaceFragment
import im.vector.app.core.platform.ScreenOrientationLocker import im.vector.app.core.platform.ScreenOrientationLocker
@ -229,7 +228,7 @@ class FtueAuthVariant(
OnboardingViewEvents.OnChooseProfilePicture -> onChooseProfilePicture() OnboardingViewEvents.OnChooseProfilePicture -> onChooseProfilePicture()
OnboardingViewEvents.OnPersonalizationComplete -> onPersonalizationComplete() OnboardingViewEvents.OnPersonalizationComplete -> onPersonalizationComplete()
OnboardingViewEvents.OnBack -> activity.popBackstack() OnboardingViewEvents.OnBack -> activity.popBackstack()
}.exhaustive }
} }
private fun registrationShouldFallback(registrationFlowResult: OnboardingViewEvents.RegistrationFlowResult) = private fun registrationShouldFallback(registrationFlowResult: OnboardingViewEvents.RegistrationFlowResult) =
@ -281,7 +280,7 @@ class FtueAuthVariant(
SignMode.SignUp -> Unit // This case is processed in handleOnboardingViewEvents SignMode.SignUp -> Unit // This case is processed in handleOnboardingViewEvents
SignMode.SignIn -> handleSignInSelected(state) SignMode.SignIn -> handleSignInSelected(state)
SignMode.SignInWithMatrixId -> handleSignInWithMatrixId(state) SignMode.SignInWithMatrixId -> handleSignInWithMatrixId(state)
}.exhaustive }
} }
private fun handleSignInSelected(state: OnboardingViewState) { private fun handleSignInSelected(state: OnboardingViewState) {

View file

@ -27,7 +27,6 @@ import com.airbnb.mvrx.args
import com.airbnb.mvrx.withState import com.airbnb.mvrx.withState
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.extensions.configureWith 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.platform.VectorBaseFragment
import im.vector.app.databinding.FragmentCreatePollBinding import im.vector.app.databinding.FragmentCreatePollBinding
import im.vector.app.features.poll.create.CreatePollViewModel.Companion.MAX_OPTIONS_COUNT 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.createPollToolbar.title = getString(R.string.edit_poll_title)
views.createPollButton.text = getString(R.string.edit_poll_title) views.createPollButton.text = getString(R.string.edit_poll_title)
} }
}.exhaustive }
views.createPollRecyclerView.configureWith(controller, disableItemAnimation = true) views.createPollRecyclerView.configureWith(controller, disableItemAnimation = true)
// workaround for https://github.com/vector-im/element-android/issues/4735 // workaround for https://github.com/vector-im/element-android/issues/4735

View file

@ -24,7 +24,6 @@ import androidx.activity.result.ActivityResultLauncher
import com.airbnb.mvrx.viewModel import com.airbnb.mvrx.viewModel
import dagger.hilt.android.AndroidEntryPoint import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.extensions.exhaustive
import im.vector.app.core.extensions.replaceFragment import im.vector.app.core.extensions.replaceFragment
import im.vector.app.core.platform.VectorBaseActivity import im.vector.app.core.platform.VectorBaseActivity
import im.vector.app.databinding.ActivitySimpleBinding import im.vector.app.databinding.ActivitySimpleBinding
@ -51,7 +50,7 @@ class QrCodeScannerActivity() : VectorBaseActivity<ActivitySimpleBinding>() {
finish() finish()
} }
else -> Unit else -> Unit
}.exhaustive }
} }
if (isFirstCreation()) { if (isFirstCreation()) {

View file

@ -23,7 +23,6 @@ import dagger.assisted.AssistedInject
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.hiltMavericksViewModelFactory 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.VectorViewModel
import im.vector.app.core.resources.StringProvider import im.vector.app.core.resources.StringProvider
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
@ -127,6 +126,6 @@ class RequireActiveMembershipViewModel @AssistedInject constructor(
} }
roomIdFlow.tryEmit(Optional.from(action.roomId)) roomIdFlow.tryEmit(Optional.from(action.roomId))
} }
}.exhaustive }
} }
} }

View file

@ -28,7 +28,6 @@ import com.airbnb.mvrx.withState
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.extensions.cleanup import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith 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.extensions.trackItemsVisibilityChange
import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.core.platform.showOptimizedSnackbar import im.vector.app.core.platform.showOptimizedSnackbar
@ -96,7 +95,7 @@ class PublicRoomsFragment @Inject constructor(
is RoomDirectoryViewEvents.Failure -> { is RoomDirectoryViewEvents.Failure -> {
views.coordinatorLayout.showOptimizedSnackbar(errorFormatter.toHumanReadable(viewEvents.throwable)) views.coordinatorLayout.showOptimizedSnackbar(errorFormatter.toHumanReadable(viewEvents.throwable))
} }
}.exhaustive }
} }
override fun onDestroyView() { override fun onDestroyView() {

View file

@ -34,7 +34,6 @@ import im.vector.app.R
import im.vector.app.core.dialogs.GalleryOrCameraDialogHelper import im.vector.app.core.dialogs.GalleryOrCameraDialogHelper
import im.vector.app.core.extensions.cleanup import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith 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.OnBackPressed
import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.core.resources.ColorProvider import im.vector.app.core.resources.ColorProvider
@ -94,7 +93,7 @@ class CreateRoomFragment @Inject constructor(
when (it) { when (it) {
CreateRoomViewEvents.Quit -> vectorBaseActivity.onBackPressed() CreateRoomViewEvents.Quit -> vectorBaseActivity.onBackPressed()
is CreateRoomViewEvents.Failure -> showFailure(it.throwable) is CreateRoomViewEvents.Failure -> showFailure(it.throwable)
}.exhaustive }
} }
} }

View file

@ -28,7 +28,6 @@ import dagger.assisted.AssistedInject
import im.vector.app.AppStateHandler import im.vector.app.AppStateHandler
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.hiltMavericksViewModelFactory 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.VectorViewModel
import im.vector.app.features.analytics.AnalyticsTracker import im.vector.app.features.analytics.AnalyticsTracker
import im.vector.app.features.analytics.plan.CreatedRoom import im.vector.app.features.analytics.plan.CreatedRoom
@ -138,7 +137,7 @@ class CreateRoomViewModel @AssistedInject constructor(
CreateRoomAction.Reset -> doReset() CreateRoomAction.Reset -> doReset()
CreateRoomAction.ToggleShowAdvanced -> toggleShowAdvanced() CreateRoomAction.ToggleShowAdvanced -> toggleShowAdvanced()
is CreateRoomAction.DisableFederation -> disableFederation(action) is CreateRoomAction.DisableFederation -> disableFederation(action)
}.exhaustive }
} }
private fun disableFederation(action: CreateRoomAction.DisableFederation) { private fun disableFederation(action: CreateRoomAction.DisableFederation) {
@ -281,7 +280,7 @@ class CreateRoomViewModel @AssistedInject constructor(
// Preset // Preset
preset = CreateRoomPreset.PRESET_PRIVATE_CHAT preset = CreateRoomPreset.PRESET_PRIVATE_CHAT
} }
}.exhaustive }
// Disabling federation // Disabling federation
disableFederation = state.disableFederation disableFederation = state.disableFederation

View file

@ -27,7 +27,6 @@ import dagger.assisted.AssistedInject
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.hiltMavericksViewModelFactory 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.EmptyViewEvents
import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.platform.VectorViewModel
import im.vector.app.core.resources.StringProvider import im.vector.app.core.resources.StringProvider
@ -104,7 +103,7 @@ class RoomDirectoryPickerViewModel @AssistedInject constructor(
is RoomDirectoryPickerAction.SetServerUrl -> handleSetServerUrl(action) is RoomDirectoryPickerAction.SetServerUrl -> handleSetServerUrl(action)
RoomDirectoryPickerAction.Submit -> handleSubmit() RoomDirectoryPickerAction.Submit -> handleSubmit()
is RoomDirectoryPickerAction.RemoveServer -> handleRemoveServer(action) is RoomDirectoryPickerAction.RemoveServer -> handleRemoveServer(action)
}.exhaustive }
} }
private fun handleEnterEditMode() { private fun handleEnterEditMode() {

View file

@ -24,7 +24,6 @@ import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject import dagger.assisted.AssistedInject
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.hiltMavericksViewModelFactory 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.EmptyViewEvents
import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.platform.VectorViewModel
import im.vector.app.features.analytics.AnalyticsTracker import im.vector.app.features.analytics.AnalyticsTracker
@ -204,7 +203,7 @@ class RoomPreviewViewModel @AssistedInject constructor(
when (action) { when (action) {
is RoomPreviewAction.Join -> handleJoinRoom() is RoomPreviewAction.Join -> handleJoinRoom()
RoomPreviewAction.JoinThirdParty -> handleJoinRoomThirdParty() RoomPreviewAction.JoinThirdParty -> handleJoinRoomThirdParty()
}.exhaustive }
} }
private fun handleJoinRoomThirdParty() = withState { state -> private fun handleJoinRoomThirdParty() = withState { state ->

View file

@ -39,7 +39,6 @@ import im.vector.app.core.dialogs.ConfirmationDialogBuilder
import im.vector.app.core.extensions.cleanup import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith import im.vector.app.core.extensions.configureWith
import im.vector.app.core.extensions.copyOnLongClick 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.extensions.setTextOrHide
import im.vector.app.core.platform.StateView import im.vector.app.core.platform.StateView
import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.core.platform.VectorBaseFragment
@ -134,7 +133,7 @@ class RoomMemberProfileFragment @Inject constructor(
is RoomMemberProfileViewEvents.OnBanActionSuccess -> Unit is RoomMemberProfileViewEvents.OnBanActionSuccess -> Unit
is RoomMemberProfileViewEvents.OnIgnoreActionSuccess -> Unit is RoomMemberProfileViewEvents.OnIgnoreActionSuccess -> Unit
is RoomMemberProfileViewEvents.OnInviteActionSuccess -> Unit is RoomMemberProfileViewEvents.OnInviteActionSuccess -> Unit
}.exhaustive }
} }
setupLongClicks() setupLongClicks()
} }

View file

@ -28,7 +28,6 @@ import dagger.assisted.AssistedInject
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.hiltMavericksViewModelFactory 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.mvrx.runCatchingToAsync
import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.platform.VectorViewModel
import im.vector.app.core.resources.StringProvider import im.vector.app.core.resources.StringProvider
@ -170,7 +169,7 @@ class RoomMemberProfileViewModel @AssistedInject constructor(
RoomMemberProfileAction.InviteUser -> handleInviteAction() RoomMemberProfileAction.InviteUser -> handleInviteAction()
is RoomMemberProfileAction.SetUserColorOverride -> handleSetUserColorOverride(action) is RoomMemberProfileAction.SetUserColorOverride -> handleSetUserColorOverride(action)
is RoomMemberProfileAction.OpenOrCreateDm -> handleOpenOrCreateDm(action) is RoomMemberProfileAction.OpenOrCreateDm -> handleOpenOrCreateDm(action)
}.exhaustive }
} }
private fun handleOpenOrCreateDm(action: RoomMemberProfileAction.OpenOrCreateDm) { private fun handleOpenOrCreateDm(action: RoomMemberProfileAction.OpenOrCreateDm) {

View file

@ -29,7 +29,6 @@ import com.airbnb.mvrx.withState
import dagger.hilt.android.AndroidEntryPoint import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.extensions.commitTransaction 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.core.platform.VectorBaseBottomSheetDialogFragment
import im.vector.app.databinding.BottomSheetWithFragmentsBinding import im.vector.app.databinding.BottomSheetWithFragmentsBinding
import im.vector.app.features.crypto.verification.VerificationBottomSheet import im.vector.app.features.crypto.verification.VerificationBottomSheet
@ -57,7 +56,7 @@ class DeviceListBottomSheet :
transactionId = it.txID transactionId = it.txID
).show(requireActivity().supportFragmentManager, "REQPOP") ).show(requireActivity().supportFragmentManager, "REQPOP")
} }
}.exhaustive }
} }
} }

View file

@ -28,7 +28,6 @@ import dagger.hilt.EntryPoints
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.SingletonEntryPoint import im.vector.app.core.di.SingletonEntryPoint
import im.vector.app.core.di.hiltMavericksViewModelFactory 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.VectorViewModel
import org.matrix.android.sdk.api.session.Session import org.matrix.android.sdk.api.session.Session
import org.matrix.android.sdk.api.session.crypto.crosssigning.MXCrossSigningInfo 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.SelectDevice -> selectDevice(action)
is DeviceListAction.DeselectDevice -> deselectDevice() is DeviceListAction.DeselectDevice -> deselectDevice()
is DeviceListAction.ManuallyVerify -> manuallyVerify(action) is DeviceListAction.ManuallyVerify -> manuallyVerify(action)
}.exhaustive }
} }
private fun refreshSelectedId() = withState { state -> private fun refreshSelectedId() = withState { state ->

View file

@ -26,7 +26,6 @@ import com.airbnb.mvrx.viewModel
import dagger.hilt.android.AndroidEntryPoint import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.core.extensions.addFragment import im.vector.app.core.extensions.addFragment
import im.vector.app.core.extensions.addFragmentToBackstack 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.core.platform.VectorBaseActivity
import im.vector.app.databinding.ActivitySimpleBinding import im.vector.app.databinding.ActivitySimpleBinding
import im.vector.app.features.home.room.detail.RoomDetailPendingActionStore import im.vector.app.features.home.room.detail.RoomDetailPendingActionStore
@ -102,7 +101,7 @@ class RoomProfileActivity :
RoomProfileSharedAction.OpenRoomUploads -> openRoomUploads() RoomProfileSharedAction.OpenRoomUploads -> openRoomUploads()
RoomProfileSharedAction.OpenBannedRoomMembers -> openBannedRoomMembers() RoomProfileSharedAction.OpenBannedRoomMembers -> openBannedRoomMembers()
RoomProfileSharedAction.OpenRoomNotificationSettings -> openRoomNotificationSettings() RoomProfileSharedAction.OpenRoomNotificationSettings -> openRoomNotificationSettings()
}.exhaustive }
} }
.launchIn(lifecycleScope) .launchIn(lifecycleScope)

View file

@ -37,7 +37,6 @@ import im.vector.app.core.animations.MatrixItemAppBarStateChangeListener
import im.vector.app.core.extensions.cleanup import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith import im.vector.app.core.extensions.configureWith
import im.vector.app.core.extensions.copyOnLongClick 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.extensions.setTextOrHide
import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.core.utils.copyToClipboard import im.vector.app.core.utils.copyToClipboard
@ -127,7 +126,7 @@ class RoomProfileFragment @Inject constructor(
is RoomProfileViewEvents.ShareRoomProfile -> onShareRoomProfile(it.permalink) is RoomProfileViewEvents.ShareRoomProfile -> onShareRoomProfile(it.permalink)
is RoomProfileViewEvents.OnShortcutReady -> addShortcut(it) is RoomProfileViewEvents.OnShortcutReady -> addShortcut(it)
RoomProfileViewEvents.DismissLoading -> dismissLoadingDialog() RoomProfileViewEvents.DismissLoading -> dismissLoadingDialog()
}.exhaustive }
} }
roomListQuickActionsSharedActionViewModel roomListQuickActionsSharedActionViewModel
.stream() .stream()

View file

@ -24,7 +24,6 @@ import dagger.assisted.AssistedInject
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.hiltMavericksViewModelFactory 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.VectorViewModel
import im.vector.app.core.resources.StringProvider import im.vector.app.core.resources.StringProvider
import im.vector.app.features.home.ShortcutCreator import im.vector.app.features.home.ShortcutCreator
@ -137,7 +136,7 @@ class RoomProfileViewModel @AssistedInject constructor(
is RoomProfileAction.ShareRoomProfile -> handleShareRoomProfile() is RoomProfileAction.ShareRoomProfile -> handleShareRoomProfile()
RoomProfileAction.CreateShortcut -> handleCreateShortcut() RoomProfileAction.CreateShortcut -> handleCreateShortcut()
RoomProfileAction.RestoreEncryptionState -> restoreEncryptionState() RoomProfileAction.RestoreEncryptionState -> restoreEncryptionState()
}.exhaustive }
} }
fun isPublicRoom(): Boolean { fun isPublicRoom(): Boolean {

View file

@ -29,7 +29,6 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.extensions.cleanup import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith 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.platform.VectorBaseFragment
import im.vector.app.core.utils.shareText import im.vector.app.core.utils.shareText
import im.vector.app.core.utils.toast import im.vector.app.core.utils.toast
@ -77,7 +76,7 @@ class RoomAliasFragment @Inject constructor(
when (it) { when (it) {
is RoomAliasViewEvents.Failure -> showFailure(it.throwable) is RoomAliasViewEvents.Failure -> showFailure(it.throwable)
RoomAliasViewEvents.Success -> showSuccess() RoomAliasViewEvents.Success -> showSuccess()
}.exhaustive }
} }
sharedActionViewModel sharedActionViewModel

View file

@ -26,7 +26,6 @@ import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject import dagger.assisted.AssistedInject
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.hiltMavericksViewModelFactory 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.VectorViewModel
import im.vector.app.features.powerlevel.PowerLevelsFlowFactory import im.vector.app.features.powerlevel.PowerLevelsFlowFactory
import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.launchIn
@ -190,7 +189,7 @@ class RoomAliasViewModel @AssistedInject constructor(@Assisted initialState: Roo
is RoomAliasAction.RemoveLocalAlias -> handleRemoveLocalAlias(action) is RoomAliasAction.RemoveLocalAlias -> handleRemoveLocalAlias(action)
is RoomAliasAction.PublishAlias -> handlePublishAlias(action) is RoomAliasAction.PublishAlias -> handlePublishAlias(action)
RoomAliasAction.Retry -> handleRetry() RoomAliasAction.Retry -> handleRetry()
}.exhaustive }
} }
private fun handleRetry() = withState { state -> private fun handleRetry() = withState { state ->

View file

@ -23,7 +23,6 @@ import dagger.assisted.AssistedInject
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.hiltMavericksViewModelFactory 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.VectorViewModel
import im.vector.app.core.resources.StringProvider import im.vector.app.core.resources.StringProvider
import im.vector.app.features.powerlevel.PowerLevelsFlowFactory 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.QueryInfo -> onQueryBanInfo(action.roomMemberSummary)
is RoomBannedMemberListAction.UnBanUser -> unBanUser(action.roomMemberSummary) is RoomBannedMemberListAction.UnBanUser -> unBanUser(action.roomMemberSummary)
is RoomBannedMemberListAction.Filter -> handleFilter(action) is RoomBannedMemberListAction.Filter -> handleFilter(action)
}.exhaustive }
} }
private fun handleFilter(action: RoomBannedMemberListAction.Filter) { private fun handleFilter(action: RoomBannedMemberListAction.Filter) {

View file

@ -23,7 +23,6 @@ import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject import dagger.assisted.AssistedInject
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.hiltMavericksViewModelFactory 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.EmptyViewEvents
import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.platform.VectorViewModel
import im.vector.app.features.powerlevel.PowerLevelsFlowFactory import im.vector.app.features.powerlevel.PowerLevelsFlowFactory
@ -181,7 +180,7 @@ class RoomMemberListViewModel @AssistedInject constructor(@Assisted initialState
when (action) { when (action) {
is RoomMemberListAction.RevokeThreePidInvite -> handleRevokeThreePidInvite(action) is RoomMemberListAction.RevokeThreePidInvite -> handleRevokeThreePidInvite(action)
is RoomMemberListAction.FilterMemberList -> handleFilterMemberList(action) is RoomMemberListAction.FilterMemberList -> handleFilterMemberList(action)
}.exhaustive }
} }
private fun handleRevokeThreePidInvite(action: RoomMemberListAction.RevokeThreePidInvite) { private fun handleRevokeThreePidInvite(action: RoomMemberListAction.RevokeThreePidInvite) {

View file

@ -27,7 +27,6 @@ import com.airbnb.mvrx.withState
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.extensions.cleanup import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith 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.platform.VectorBaseFragment
import im.vector.app.core.utils.toast import im.vector.app.core.utils.toast
import im.vector.app.databinding.FragmentRoomSettingGenericBinding import im.vector.app.databinding.FragmentRoomSettingGenericBinding
@ -67,7 +66,7 @@ class RoomPermissionsFragment @Inject constructor(
when (it) { when (it) {
is RoomPermissionsViewEvents.Failure -> showFailure(it.throwable) is RoomPermissionsViewEvents.Failure -> showFailure(it.throwable)
RoomPermissionsViewEvents.Success -> showSuccess() RoomPermissionsViewEvents.Success -> showSuccess()
}.exhaustive }
} }
} }

View file

@ -23,7 +23,6 @@ import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject import dagger.assisted.AssistedInject
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.hiltMavericksViewModelFactory 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.VectorViewModel
import im.vector.app.features.powerlevel.PowerLevelsFlowFactory import im.vector.app.features.powerlevel.PowerLevelsFlowFactory
import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.launchIn
@ -90,7 +89,7 @@ class RoomPermissionsViewModel @AssistedInject constructor(@Assisted initialStat
when (action) { when (action) {
is RoomPermissionsAction.UpdatePermission -> updatePermission(action) is RoomPermissionsAction.UpdatePermission -> updatePermission(action)
RoomPermissionsAction.ToggleShowAllPermissions -> toggleShowAllPermissions() RoomPermissionsAction.ToggleShowAllPermissions -> toggleShowAllPermissions()
}.exhaustive }
} }
private fun toggleShowAllPermissions() { private fun toggleShowAllPermissions() {

View file

@ -33,7 +33,6 @@ import im.vector.app.R
import im.vector.app.core.dialogs.GalleryOrCameraDialogHelper import im.vector.app.core.dialogs.GalleryOrCameraDialogHelper
import im.vector.app.core.extensions.cleanup import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith 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.intent.getFilenameFromUri
import im.vector.app.core.platform.OnBackPressed import im.vector.app.core.platform.OnBackPressed
import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.core.platform.VectorBaseFragment
@ -98,7 +97,7 @@ class RoomSettingsFragment @Inject constructor(
ignoreChanges = true ignoreChanges = true
vectorBaseActivity.onBackPressed() vectorBaseActivity.onBackPressed()
} }
}.exhaustive }
} }
} }

View file

@ -23,7 +23,6 @@ import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject import dagger.assisted.AssistedInject
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.hiltMavericksViewModelFactory 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.VectorViewModel
import im.vector.app.features.powerlevel.PowerLevelsFlowFactory import im.vector.app.features.powerlevel.PowerLevelsFlowFactory
import im.vector.app.features.settings.VectorPreferences import im.vector.app.features.settings.VectorPreferences
@ -201,7 +200,7 @@ class RoomSettingsViewModel @AssistedInject constructor(@Assisted initialState:
is RoomSettingsAction.SetRoomGuestAccess -> handleSetGuestAccess(action) is RoomSettingsAction.SetRoomGuestAccess -> handleSetGuestAccess(action)
is RoomSettingsAction.Save -> saveSettings() is RoomSettingsAction.Save -> saveSettings()
is RoomSettingsAction.Cancel -> cancel() is RoomSettingsAction.Cancel -> cancel()
}.exhaustive }
} }
private fun handleSetRoomJoinRule(action: RoomSettingsAction.SetRoomJoinRule) = withState { state -> private fun handleSetRoomJoinRule(action: RoomSettingsAction.SetRoomJoinRule) = withState { state ->

View file

@ -29,7 +29,6 @@ import dagger.assisted.AssistedInject
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.hiltMavericksViewModelFactory 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.VectorViewModel
import im.vector.app.core.resources.StringProvider import im.vector.app.core.resources.StringProvider
import im.vector.app.core.utils.styleMatchingText import im.vector.app.core.utils.styleMatchingText
@ -180,7 +179,7 @@ class RoomJoinRuleChooseRestrictedViewModel @AssistedInject constructor(
is RoomJoinRuleChooseRestrictedActions.SelectJoinRules -> handleSelectRule(action) is RoomJoinRuleChooseRestrictedActions.SelectJoinRules -> handleSelectRule(action)
is RoomJoinRuleChooseRestrictedActions.SwitchToRoomAfterMigration -> handleSwitchToRoom(action) is RoomJoinRuleChooseRestrictedActions.SwitchToRoomAfterMigration -> handleSwitchToRoom(action)
RoomJoinRuleChooseRestrictedActions.DoUpdateJoinRules -> handleSubmit() RoomJoinRuleChooseRestrictedActions.DoUpdateJoinRules -> handleSubmit()
}.exhaustive }
checkForChanges() checkForChanges()
} }

View file

@ -28,7 +28,6 @@ import com.airbnb.mvrx.withState
import com.google.android.material.appbar.AppBarLayout import com.google.android.material.appbar.AppBarLayout
import com.google.android.material.tabs.TabLayoutMediator import com.google.android.material.tabs.TabLayoutMediator
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.extensions.exhaustive
import im.vector.app.core.intent.getMimeTypeFromUri import im.vector.app.core.intent.getMimeTypeFromUri
import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.core.utils.saveMedia import im.vector.app.core.utils.saveMedia
@ -99,7 +98,7 @@ class RoomUploadsFragment @Inject constructor(
Unit Unit
} }
is RoomUploadsViewEvents.Failure -> showFailure(it.throwable) is RoomUploadsViewEvents.Failure -> showFailure(it.throwable)
}.exhaustive }
} }
} }

View file

@ -25,7 +25,6 @@ import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject import dagger.assisted.AssistedInject
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.hiltMavericksViewModelFactory 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.VectorViewModel
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import org.matrix.android.sdk.api.session.Session import org.matrix.android.sdk.api.session.Session
@ -110,7 +109,7 @@ class RoomUploadsViewModel @AssistedInject constructor(
is RoomUploadsAction.Share -> handleShare(action) is RoomUploadsAction.Share -> handleShare(action)
RoomUploadsAction.Retry -> handleLoadMore() RoomUploadsAction.Retry -> handleLoadMore()
RoomUploadsAction.LoadMore -> handleLoadMore() RoomUploadsAction.LoadMore -> handleLoadMore()
}.exhaustive }
} }
private fun handleShare(action: RoomUploadsAction.Share) { private fun handleShare(action: RoomUploadsAction.Share) {

View file

@ -25,7 +25,6 @@ import android.view.ViewGroup
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import com.airbnb.mvrx.fragmentViewModel import com.airbnb.mvrx.fragmentViewModel
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.extensions.exhaustive
import im.vector.app.core.extensions.registerStartForActivityResult import im.vector.app.core.extensions.registerStartForActivityResult
import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.databinding.FragmentDeactivateAccountBinding import im.vector.app.databinding.FragmentDeactivateAccountBinding
@ -128,7 +127,7 @@ class DeactivateAccountFragment @Inject constructor() : VectorBaseFragment<Fragm
reAuthActivityResultLauncher.launch(intent) reAuthActivityResultLauncher.launch(intent)
} }
} }
}.exhaustive }
} }
} }
} }

View file

@ -22,7 +22,6 @@ import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject import dagger.assisted.AssistedInject
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.hiltMavericksViewModelFactory 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.VectorViewModel
import im.vector.app.features.auth.ReAuthActivity import im.vector.app.features.auth.ReAuthActivity
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
@ -82,7 +81,7 @@ class DeactivateAccountViewModel @AssistedInject constructor(@Assisted private v
uiaContinuation = null uiaContinuation = null
pendingAuth = null pendingAuth = null
} }
}.exhaustive }
} }
private fun handleDeactivateAccount(action: DeactivateAccountAction.DeactivateAccount) { private fun handleDeactivateAccount(action: DeactivateAccountAction.DeactivateAccount) {

View file

@ -28,7 +28,6 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.extensions.cleanup import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith 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.extensions.registerStartForActivityResult
import im.vector.app.core.extensions.setTextOrHide import im.vector.app.core.extensions.setTextOrHide
import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.core.platform.VectorBaseFragment
@ -100,7 +99,7 @@ class CrossSigningSettingsFragment @Inject constructor(
CrossSigningSettingsViewEvents.HideModalWaitingView -> { CrossSigningSettingsViewEvents.HideModalWaitingView -> {
views.waitingView.waitingView.isVisible = false views.waitingView.waitingView.isVisible = false
} }
}.exhaustive }
} }
} }

View file

@ -22,7 +22,6 @@ import dagger.assisted.AssistedInject
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.hiltMavericksViewModelFactory 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.VectorViewModel
import im.vector.app.core.resources.StringProvider import im.vector.app.core.resources.StringProvider
import im.vector.app.features.auth.ReAuthActivity import im.vector.app.features.auth.ReAuthActivity
@ -146,7 +145,7 @@ class CrossSigningSettingsViewModel @AssistedInject constructor(
uiaContinuation = null uiaContinuation = null
pendingAuth = null pendingAuth = null
} }
}.exhaustive }
} }
private fun handleInitializeXSigningError(failure: Throwable) { private fun handleInitializeXSigningError(failure: Throwable) {

View file

@ -32,7 +32,6 @@ import im.vector.app.R
import im.vector.app.core.dialogs.ManuallyVerifyDialog import im.vector.app.core.dialogs.ManuallyVerifyDialog
import im.vector.app.core.extensions.cleanup import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith 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.extensions.registerStartForActivityResult
import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.databinding.DialogBaseEditTextBinding import im.vector.app.databinding.DialogBaseEditTextBinding
@ -90,7 +89,7 @@ class VectorSettingsDevicesFragment @Inject constructor(
viewModel.handle(DevicesAction.MarkAsManuallyVerified(it.cryptoDeviceInfo)) viewModel.handle(DevicesAction.MarkAsManuallyVerified(it.cryptoDeviceInfo))
} }
} }
}.exhaustive }
} }
} }

View file

@ -25,7 +25,6 @@ import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject import dagger.assisted.AssistedInject
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.hiltMavericksViewModelFactory 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.EmptyViewEvents
import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.platform.VectorViewModel
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
@ -51,7 +50,7 @@ class AccountDataViewModel @AssistedInject constructor(@Assisted initialState: A
override fun handle(action: AccountDataAction) { override fun handle(action: AccountDataAction) {
when (action) { when (action) {
is AccountDataAction.DeleteAccountData -> handleDeleteAccountData(action) is AccountDataAction.DeleteAccountData -> handleDeleteAccountData(action)
}.exhaustive }
} }
private fun handleDeleteAccountData(action: AccountDataAction.DeleteAccountData) { private fun handleDeleteAccountData(action: AccountDataAction.DeleteAccountData) {

View file

@ -29,7 +29,6 @@ import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject import dagger.assisted.AssistedInject
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.hiltMavericksViewModelFactory 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.VectorViewEvents
import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.platform.VectorViewModel
import im.vector.app.core.platform.VectorViewModelAction import im.vector.app.core.platform.VectorViewModelAction
@ -64,7 +63,7 @@ class KeyRequestViewModel @AssistedInject constructor(
override fun handle(action: KeyRequestAction) { override fun handle(action: KeyRequestAction) {
when (action) { when (action) {
is KeyRequestAction.ExportAudit -> exportAudit(action) is KeyRequestAction.ExportAudit -> exportAudit(action)
}.exhaustive }
} }
private fun exportAudit(action: KeyRequestAction.ExportAudit) { private fun exportAudit(action: KeyRequestAction.ExportAudit) {

View file

@ -33,7 +33,6 @@ import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState import com.airbnb.mvrx.withState
import com.google.android.material.tabs.TabLayoutMediator import com.google.android.material.tabs.TabLayoutMediator
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.extensions.exhaustive
import im.vector.app.core.extensions.registerStartForActivityResult import im.vector.app.core.extensions.registerStartForActivityResult
import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.core.utils.selectTxtFileToWrite import im.vector.app.core.utils.selectTxtFileToWrite
@ -111,7 +110,7 @@ class KeyRequestsFragment @Inject constructor() : VectorBaseFragment<FragmentDev
?.use { os -> os.write(it.raw.toByteArray()) } ?.use { os -> os.write(it.raw.toByteArray()) }
} }
} }
}.exhaustive }
} }
} }

View file

@ -30,7 +30,6 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.extensions.cleanup import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith 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.platform.VectorBaseFragment
import im.vector.app.databinding.FragmentGenericRecyclerBinding import im.vector.app.databinding.FragmentGenericRecyclerBinding
import javax.inject.Inject import javax.inject.Inject
@ -57,7 +56,7 @@ class VectorSettingsIgnoredUsersFragment @Inject constructor(
when (it) { when (it) {
is IgnoredUsersViewEvents.Loading -> showLoading(it.message) is IgnoredUsersViewEvents.Loading -> showLoading(it.message)
is IgnoredUsersViewEvents.Failure -> showFailure(it.throwable) is IgnoredUsersViewEvents.Failure -> showFailure(it.throwable)
}.exhaustive }
} }
} }

View file

@ -25,7 +25,6 @@ import dagger.assisted.AssistedInject
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.hiltMavericksViewModelFactory 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.EmptyViewEvents
import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.platform.VectorViewModel
import im.vector.app.core.resources.StringProvider import im.vector.app.core.resources.StringProvider
@ -50,7 +49,7 @@ class LegalsViewModel @AssistedInject constructor(
override fun handle(action: LegalsAction) { override fun handle(action: LegalsAction) {
when (action) { when (action) {
LegalsAction.Refresh -> loadData() LegalsAction.Refresh -> loadData()
}.exhaustive }
} }
private fun loadData() = withState { state -> private fun loadData() = withState { state ->

View file

@ -26,7 +26,6 @@ import com.airbnb.mvrx.withState
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.extensions.cleanup import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith 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.extensions.restart
import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.databinding.FragmentLocalePickerBinding import im.vector.app.databinding.FragmentLocalePickerBinding
@ -54,7 +53,7 @@ class LocalePickerFragment @Inject constructor(
LocalePickerViewEvents.RestartActivity -> { LocalePickerViewEvents.RestartActivity -> {
activity?.restart() activity?.restart()
} }
}.exhaustive }
} }
} }

View file

@ -23,7 +23,6 @@ import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject import dagger.assisted.AssistedInject
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.hiltMavericksViewModelFactory 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.VectorViewModel
import im.vector.app.features.configuration.VectorConfiguration import im.vector.app.features.configuration.VectorConfiguration
import im.vector.app.features.settings.VectorLocale import im.vector.app.features.settings.VectorLocale
@ -56,7 +55,7 @@ class LocalePickerViewModel @AssistedInject constructor(
override fun handle(action: LocalePickerAction) { override fun handle(action: LocalePickerAction) {
when (action) { when (action) {
is LocalePickerAction.SelectLocale -> handleSelectLocale(action) is LocalePickerAction.SelectLocale -> handleSelectLocale(action)
}.exhaustive }
} }
private fun handleSelectLocale(action: LocalePickerAction.SelectLocale) { private fun handleSelectLocale(action: LocalePickerAction.SelectLocale) {

View file

@ -28,7 +28,6 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.extensions.cleanup import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith 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.platform.VectorBaseFragment
import im.vector.app.databinding.FragmentGenericRecyclerBinding import im.vector.app.databinding.FragmentGenericRecyclerBinding
import org.matrix.android.sdk.api.session.pushers.Pusher import org.matrix.android.sdk.api.session.pushers.Pusher
@ -78,7 +77,7 @@ class PushGatewaysFragment @Inject constructor(
.setPositiveButton(android.R.string.ok, null) .setPositiveButton(android.R.string.ok, null)
.show() .show()
} }
}.exhaustive }
} }
} }

View file

@ -25,7 +25,6 @@ import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject import dagger.assisted.AssistedInject
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.hiltMavericksViewModelFactory 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.VectorViewModel
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import org.matrix.android.sdk.api.session.Session import org.matrix.android.sdk.api.session.Session
@ -65,7 +64,7 @@ class PushGatewaysViewModel @AssistedInject constructor(@Assisted initialState:
when (action) { when (action) {
is PushGatewayAction.Refresh -> handleRefresh() is PushGatewayAction.Refresh -> handleRefresh()
is PushGatewayAction.RemovePusher -> removePusher(action.pusher) is PushGatewayAction.RemovePusher -> removePusher(action.pusher)
}.exhaustive }
} }
private fun removePusher(pusher: Pusher) { private fun removePusher(pusher: Pusher) {

View file

@ -26,7 +26,6 @@ import im.vector.app.R
import im.vector.app.core.epoxy.loadingItem import im.vector.app.core.epoxy.loadingItem
import im.vector.app.core.epoxy.noResultItem import im.vector.app.core.epoxy.noResultItem
import im.vector.app.core.error.ErrorFormatter 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.extensions.getFormattedValue
import im.vector.app.core.resources.ColorProvider import im.vector.app.core.resources.ColorProvider
import im.vector.app.core.resources.StringProvider import im.vector.app.core.resources.StringProvider
@ -162,7 +161,7 @@ class ThreePidsSettingsController @Inject constructor(
} }
} }
is ThreePidsSettingsUiState.AddingPhoneNumber -> Unit is ThreePidsSettingsUiState.AddingPhoneNumber -> Unit
}.exhaustive }
settingsSectionTitleItem { settingsSectionTitleItem {
id("msisdn") id("msisdn")
@ -225,7 +224,7 @@ class ThreePidsSettingsController @Inject constructor(
cancelOnClick { host.interactionListener?.cancelAdding() } cancelOnClick { host.interactionListener?.cancelAdding() }
} }
} }
}.exhaustive }
} }
private fun buildThreePid(idPrefix: String, threePid: ThreePid) { private fun buildThreePid(idPrefix: String, threePid: ThreePid) {

View file

@ -28,7 +28,6 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.extensions.cleanup import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith 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.getFormattedValue
import im.vector.app.core.extensions.hideKeyboard import im.vector.app.core.extensions.hideKeyboard
import im.vector.app.core.extensions.isEmail import im.vector.app.core.extensions.isEmail
@ -64,7 +63,7 @@ class ThreePidsSettingsFragment @Inject constructor(
when (it) { when (it) {
is ThreePidsSettingsViewEvents.Failure -> displayErrorDialog(it.throwable) is ThreePidsSettingsViewEvents.Failure -> displayErrorDialog(it.throwable)
is ThreePidsSettingsViewEvents.RequestReAuth -> askAuthentication(it) is ThreePidsSettingsViewEvents.RequestReAuth -> askAuthentication(it)
}.exhaustive }
} }
} }

View file

@ -25,7 +25,6 @@ import dagger.assisted.AssistedInject
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.hiltMavericksViewModelFactory 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.VectorViewModel
import im.vector.app.core.resources.StringProvider import im.vector.app.core.resources.StringProvider
import im.vector.app.core.utils.ReadOnceTrue import im.vector.app.core.utils.ReadOnceTrue
@ -149,7 +148,7 @@ class ThreePidsSettingsViewModel @AssistedInject constructor(
uiaContinuation = null uiaContinuation = null
pendingAuth = null pendingAuth = null
} }
}.exhaustive }
} }
var uiaContinuation: Continuation<UIABaseAuth>? = null var uiaContinuation: Continuation<UIABaseAuth>? = null

View file

@ -34,7 +34,6 @@ import im.vector.app.R
import im.vector.app.core.di.ActiveSessionHolder import im.vector.app.core.di.ActiveSessionHolder
import im.vector.app.core.extensions.cleanup import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith 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.extensions.registerStartForActivityResult
import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.databinding.FragmentIncomingShareBinding import im.vector.app.databinding.FragmentIncomingShareBinding
@ -81,7 +80,7 @@ class IncomingShareFragment @Inject constructor(
is IncomingShareViewEvents.ShareToRoom -> handleShareToRoom(it) is IncomingShareViewEvents.ShareToRoom -> handleShareToRoom(it)
is IncomingShareViewEvents.EditMediaBeforeSending -> handleEditMediaBeforeSending(it) is IncomingShareViewEvents.EditMediaBeforeSending -> handleEditMediaBeforeSending(it)
is IncomingShareViewEvents.MultipleRoomsShareDone -> handleMultipleRoomsShareDone(it) is IncomingShareViewEvents.MultipleRoomsShareDone -> handleMultipleRoomsShareDone(it)
}.exhaustive }
} }
val intent = vectorBaseActivity.intent val intent = vectorBaseActivity.intent

Some files were not shown because too many files have changed in this diff Show more