Mavericks 2: switch from MvRxState to MavericksState

This commit is contained in:
ganfra 2021-10-01 10:08:06 +02:00
parent 2324bf5d05
commit f6b81b36d0
96 changed files with 193 additions and 193 deletions

View File

@ -1,5 +1,5 @@
package ${escapeKotlinIdentifiers(packageName)}
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
data class ${viewStateClass}() : MvRxState
data class ${viewStateClass}() : MavericksState

View File

@ -20,17 +20,17 @@ import com.airbnb.mvrx.Async
import com.airbnb.mvrx.BaseMvRxViewModel
import com.airbnb.mvrx.Fail
import com.airbnb.mvrx.Loading
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Success
import im.vector.app.core.utils.DataSource
import im.vector.app.core.utils.PublishDataSource
import io.reactivex.Observable
import io.reactivex.Single
abstract class VectorViewModel<S : MvRxState, VA : VectorViewModelAction, VE : VectorViewEvents>(initialState: S)
abstract class VectorViewModel<S : MavericksState, VA : VectorViewModelAction, VE : VectorViewEvents>(initialState: S)
: BaseMvRxViewModel<S>(initialState) {
interface Factory<S : MvRxState> {
interface Factory<S : MavericksState> {
fun create(state: S): BaseMvRxViewModel<S>
}

View File

@ -16,6 +16,6 @@
package im.vector.app.core.ui.bottomsheet
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
abstract class BottomSheetGenericState : MvRxState
abstract class BottomSheetGenericState : MavericksState

View File

@ -16,12 +16,12 @@
package im.vector.app.core.ui.bottomsheet
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import im.vector.app.core.platform.EmptyAction
import im.vector.app.core.platform.EmptyViewEvents
import im.vector.app.core.platform.VectorViewModel
abstract class BottomSheetGenericViewModel<State : MvRxState>(initialState: State) :
abstract class BottomSheetGenericViewModel<State : MavericksState>(initialState: State) :
VectorViewModel<State, EmptyAction, EmptyViewEvents>(initialState) {
override fun handle(action: EmptyAction) {

View File

@ -17,14 +17,14 @@
package im.vector.app.features.attachments.preview
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import org.matrix.android.sdk.api.session.content.ContentAttachmentData
data class AttachmentsPreviewViewState(
val attachments: List<ContentAttachmentData>,
val currentAttachmentIndex: Int = 0,
val sendImagesWithOriginalSize: Boolean = false
) : MvRxState {
) : MavericksState {
constructor(args: AttachmentsPreviewArgs) : this(attachments = args.attachments)
}

View File

@ -16,7 +16,7 @@
package im.vector.app.features.auth
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
data class ReAuthState(
val title: String? = null,
@ -25,7 +25,7 @@ data class ReAuthState(
val ssoFallbackPageWasShown: Boolean = false,
val lastErrorCode: String? = null,
val resultKeyStoreAlias: String = ""
) : MvRxState {
) : MavericksState {
constructor(args: ReAuthActivity.Args) : this(
args.title,
args.session,

View File

@ -17,7 +17,7 @@
package im.vector.app.features.call
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
import im.vector.app.features.call.audio.CallAudioManager
import org.matrix.android.sdk.api.session.call.CallState
@ -43,7 +43,7 @@ data class VectorCallViewState(
val formattedDuration: String = "",
val canOpponentBeTransferred: Boolean = false,
val transferee: TransfereeState = TransfereeState.NoTransferee
) : MvRxState {
) : MavericksState {
sealed class TransfereeState {
object NoTransferee : TransfereeState()

View File

@ -17,7 +17,7 @@
package im.vector.app.features.call.conference
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
import org.matrix.android.sdk.api.session.widgets.model.Widget
@ -26,4 +26,4 @@ data class JitsiCallViewState(
val widgetId: String = "",
val enableVideo: Boolean = false,
val widget: Async<Widget> = Uninitialized
) : MvRxState
) : MavericksState

View File

@ -16,11 +16,11 @@
package im.vector.app.features.call.transfer
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
data class CallTransferViewState(
val callId: String
) : MvRxState {
) : MavericksState {
constructor(args: CallTransferArgs) : this(callId = args.callId)
}

View File

@ -18,7 +18,7 @@ package im.vector.app.features.contactsbook
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.Loading
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import im.vector.app.core.contacts.MappedContact
data class ContactsBookViewState(
@ -36,4 +36,4 @@ data class ContactsBookViewState(
val identityServerUrl: String? = null,
// User consent to perform lookup (send emails to the identity server)
val userConsent: Boolean = false
) : MvRxState
) : MavericksState

View File

@ -17,9 +17,9 @@
package im.vector.app.features.createdirect
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
data class CreateDirectRoomViewState(
val createAndInviteState: Async<String> = Uninitialized
) : MvRxState
) : MavericksState

View File

@ -17,7 +17,7 @@
package im.vector.app.features.crypto.keysbackup.settings
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
import org.matrix.android.sdk.api.session.crypto.keysbackup.KeysBackupState
import org.matrix.android.sdk.internal.crypto.keysbackup.model.KeysBackupVersionTrust
@ -27,4 +27,4 @@ data class KeysBackupSettingViewState(val keysBackupVersionTrust: Async<KeysBack
val keysBackupState: KeysBackupState? = null,
val keysBackupVersion: KeysVersionResult? = null,
val deleteBackupRequest: Async<Unit> = Uninitialized)
: MvRxState
: MavericksState

View File

@ -21,7 +21,7 @@ import com.airbnb.mvrx.Async
import com.airbnb.mvrx.Fail
import com.airbnb.mvrx.Loading
import com.airbnb.mvrx.MvRx
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.MvRxViewModelFactory
import com.airbnb.mvrx.Success
import com.airbnb.mvrx.Uninitialized
@ -55,7 +55,7 @@ data class SharedSecureStorageViewState(
val activeDeviceCount: Int = 0,
val showResetAllAction: Boolean = false,
val userId: String = ""
) : MvRxState {
) : MavericksState {
enum class Step {
EnterPassphrase,
EnterKey,

View File

@ -17,7 +17,7 @@
package im.vector.app.features.crypto.recover
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
import com.nulabinc.zxcvbn.Strength
import im.vector.app.core.platform.WaitingViewData
@ -34,4 +34,4 @@ data class BootstrapViewState(
val recoveryKeyCreationInfo: SsssKeyCreationInfo? = null,
val initializationWaitingViewData: WaitingViewData? = null,
val recoverySaveFileProcess: Async<Unit> = Uninitialized
) : MvRxState
) : MavericksState

View File

@ -20,7 +20,7 @@ import com.airbnb.mvrx.Async
import com.airbnb.mvrx.Fail
import com.airbnb.mvrx.FragmentViewModelContext
import com.airbnb.mvrx.Loading
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.MvRxViewModelFactory
import com.airbnb.mvrx.Success
import com.airbnb.mvrx.Uninitialized
@ -79,7 +79,7 @@ data class VerificationBottomSheetViewState(
val quadSContainsSecrets: Boolean = true,
val quadSHasBeenReset: Boolean = false,
val hasAnyOtherSession: Boolean = false
) : MvRxState
) : MavericksState
class VerificationBottomSheetViewModel @AssistedInject constructor(
@Assisted initialState: VerificationBottomSheetViewState,

View File

@ -16,7 +16,7 @@
package im.vector.app.features.crypto.verification.choose
import com.airbnb.mvrx.FragmentViewModelContext
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.MvRxViewModelFactory
import com.airbnb.mvrx.ViewModelContext
import dagger.assisted.Assisted
@ -43,7 +43,7 @@ data class VerificationChooseMethodViewState(
val sasModeAvailable: Boolean = false,
val isMe: Boolean = false,
val canCrossSign: Boolean = false
) : MvRxState
) : MavericksState
class VerificationChooseMethodViewModel @AssistedInject constructor(
@Assisted initialState: VerificationChooseMethodViewState,

View File

@ -15,7 +15,7 @@
*/
package im.vector.app.features.crypto.verification.conclusion
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.MvRxViewModelFactory
import com.airbnb.mvrx.ViewModelContext
import im.vector.app.core.platform.EmptyAction
@ -27,7 +27,7 @@ import org.matrix.android.sdk.api.session.crypto.verification.safeValueOf
data class VerificationConclusionViewState(
val conclusionState: ConclusionState = ConclusionState.CANCELLED,
val isSelfVerification: Boolean = false
) : MvRxState
) : MavericksState
enum class ConclusionState {
SUCCESS,

View File

@ -19,7 +19,7 @@ import com.airbnb.mvrx.Async
import com.airbnb.mvrx.Fail
import com.airbnb.mvrx.FragmentViewModelContext
import com.airbnb.mvrx.Loading
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.MvRxViewModelFactory
import com.airbnb.mvrx.Success
import com.airbnb.mvrx.Uninitialized
@ -48,7 +48,7 @@ data class VerificationEmojiCodeViewState(
val emojiDescription: Async<List<EmojiRepresentation>> = Uninitialized,
val decimalDescription: Async<String> = Uninitialized,
val isWaitingFromOther: Boolean = false
) : MvRxState
) : MavericksState
class VerificationEmojiCodeViewModel @AssistedInject constructor(
@Assisted initialState: VerificationEmojiCodeViewState,

View File

@ -17,7 +17,7 @@
package im.vector.app.features.devtools
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
import org.matrix.android.sdk.api.session.events.model.Event
@ -31,7 +31,7 @@ data class RoomDevToolViewState(
val editedContent: String? = null,
val modalLoading: Async<Unit> = Uninitialized,
val sendEventDraft: SendEventDraft? = null
) : MvRxState {
) : MavericksState {
constructor(args: RoomDevToolActivity.Args) : this(roomId = args.roomId, displayMode = Mode.Root)

View File

@ -17,7 +17,7 @@
package im.vector.app.features.discovery
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
data class DiscoverySettingsState(
@ -27,4 +27,4 @@ data class DiscoverySettingsState(
// Can be true if terms are updated
val termsNotSigned: Boolean = false,
val userConsent: Boolean = false
) : MvRxState
) : MavericksState

View File

@ -16,10 +16,10 @@
package im.vector.app.features.discovery.change
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
data class SetIdentityServerState(
val homeServerUrl: String = "",
// Will contain the default identity server url if any
val defaultIdentityServerUrl: String? = null
) : MvRxState
) : MavericksState

View File

@ -16,9 +16,9 @@
package im.vector.app.features.home
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import org.matrix.android.sdk.api.session.initsync.SyncStatusService
data class HomeActivityViewState(
val syncStatusServiceStatus: SyncStatusService.Status = SyncStatusService.Status.Idle
) : MvRxState
) : MavericksState

View File

@ -18,7 +18,7 @@ package im.vector.app.features.home
import androidx.annotation.StringRes
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
import im.vector.app.R
import im.vector.app.RoomGroupingMethod
@ -43,7 +43,7 @@ data class HomeDetailViewState(
val incrementalSyncStatus: SyncStatusService.Status.IncrementalSyncStatus = SyncStatusService.Status.IncrementalSyncIdle,
val pushCounter: Int = 0,
val showDialPadTab: Boolean = false
) : MvRxState
) : MavericksState
sealed class HomeTab(@StringRes val titleRes: Int) {
data class RoomList(val displayMode: RoomListDisplayMode) : HomeTab(displayMode.titleRes)

View File

@ -18,7 +18,7 @@ package im.vector.app.features.home
import com.airbnb.mvrx.ActivityViewModelContext
import com.airbnb.mvrx.FragmentViewModelContext
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.MvRxViewModelFactory
import com.airbnb.mvrx.ViewModelContext
import dagger.assisted.Assisted
@ -41,7 +41,7 @@ data class ActiveSpaceViewState(
val isInSpaceMode: Boolean = false,
val activeSpaceSummary: RoomSummary? = null,
val canUserManageSpace: Boolean = false
) : MvRxState
) : MavericksState
class PromoteRestrictedViewModel @AssistedInject constructor(
@Assisted initialState: ActiveSpaceViewState,

View File

@ -19,7 +19,7 @@ package im.vector.app.features.home
import com.airbnb.mvrx.ActivityViewModelContext
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.FragmentViewModelContext
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.MvRxViewModelFactory
import com.airbnb.mvrx.Success
import com.airbnb.mvrx.Uninitialized
@ -48,7 +48,7 @@ import java.util.concurrent.TimeUnit
data class UnknownDevicesState(
val myMatrixItem: MatrixItem.UserItem? = null,
val unknownSessions: Async<List<DeviceDetectionInfo>> = Uninitialized
) : MvRxState
) : MavericksState
data class DeviceDetectionInfo(
val deviceInfo: DeviceInfo,

View File

@ -18,7 +18,7 @@ package im.vector.app.features.home
import com.airbnb.mvrx.ActivityViewModelContext
import com.airbnb.mvrx.FragmentViewModelContext
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.MvRxViewModelFactory
import com.airbnb.mvrx.ViewModelContext
import dagger.assisted.Assisted
@ -46,7 +46,7 @@ import java.util.concurrent.TimeUnit
data class UnreadMessagesState(
val homeSpaceUnread: RoomAggregateNotificationCount = RoomAggregateNotificationCount(0, 0),
val otherSpacesUnread: RoomAggregateNotificationCount = RoomAggregateNotificationCount(0, 0)
) : MvRxState
) : MavericksState
data class CountInfo(
val homeCount: RoomAggregateNotificationCount,

View File

@ -17,10 +17,10 @@
package im.vector.app.features.home.room.breadcrumbs
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
import org.matrix.android.sdk.api.session.room.model.RoomSummary
data class BreadcrumbsViewState(
val asyncBreadcrumbs: Async<List<RoomSummary>> = Uninitialized
) : MvRxState
) : MavericksState

View File

@ -17,7 +17,7 @@
package im.vector.app.features.home.room.detail
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
import org.matrix.android.sdk.api.extensions.orFalse
import org.matrix.android.sdk.api.session.events.model.Event
@ -90,7 +90,7 @@ data class RoomDetailViewState(
val isAllowedToStartWebRTCCall: Boolean = true,
val hasFailedSending: Boolean = false,
val jitsiState: JitsiState = JitsiState()
) : MvRxState {
) : MavericksState {
constructor(args: RoomDetailArgs) : this(
roomId = args.roomId,

View File

@ -17,7 +17,7 @@
package im.vector.app.features.home.room.detail.search
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
import org.matrix.android.sdk.api.session.search.EventAndSender
@ -32,7 +32,7 @@ data class SearchViewState(
val roomId: String = "",
// Current pagination request
val asyncSearchRequest: Async<Unit> = Uninitialized
) : MvRxState {
) : MavericksState {
constructor(args: SearchArgs) : this(roomId = args.roomId)
}

View File

@ -17,7 +17,7 @@
package im.vector.app.features.home.room.detail.timeline.action
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
import im.vector.app.core.extensions.canReact
import im.vector.app.features.home.room.detail.timeline.item.MessageInformationData
@ -50,7 +50,7 @@ data class MessageActionState(
val actions: List<EventSharedAction> = emptyList(),
val expendedReportContentMenu: Boolean = false,
val actionPermissions: ActionPermissions = ActionPermissions()
) : MvRxState {
) : MavericksState {
constructor(args: TimelineEventFragmentArgs) : this(roomId = args.roomId, eventId = args.eventId, informationData = args.informationData)

View File

@ -17,7 +17,7 @@
package im.vector.app.features.home.room.detail.timeline.edithistory
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
import im.vector.app.features.home.room.detail.timeline.action.TimelineEventFragmentArgs
import org.matrix.android.sdk.api.session.events.model.Event
@ -27,7 +27,7 @@ data class ViewEditHistoryViewState(
val roomId: String,
val isOriginalAReply: Boolean = false,
val editList: Async<List<Event>> = Uninitialized)
: MvRxState {
: MavericksState {
constructor(args: TimelineEventFragmentArgs) : this(roomId = args.roomId, eventId = args.eventId)
}

View File

@ -18,7 +18,7 @@ package im.vector.app.features.home.room.detail.timeline.reactions
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.FragmentViewModelContext
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.MvRxViewModelFactory
import com.airbnb.mvrx.Uninitialized
import com.airbnb.mvrx.ViewModelContext
@ -42,7 +42,7 @@ data class DisplayReactionsViewState(
val eventId: String,
val roomId: String,
val mapReactionKeyToMemberList: Async<List<ReactionInfo>> = Uninitialized)
: MvRxState {
: MavericksState {
constructor(args: TimelineEventFragmentArgs) : this(roomId = args.roomId, eventId = args.eventId)
}

View File

@ -17,7 +17,7 @@
package im.vector.app.features.home.room.detail.upgrade
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
data class MigrateRoomViewState(
@ -36,7 +36,7 @@ data class MigrateRoomViewState(
val upgradingProgressIndeterminate: Boolean = true,
val migrationReason: MigrateRoomBottomSheet.MigrationReason = MigrateRoomBottomSheet.MigrationReason.MANUAL,
val autoMigrateMembersAndParents: Boolean = false
) : MvRxState {
) : MavericksState {
constructor(args: MigrateRoomBottomSheet.Args) : this(
roomId = args.roomId,
newVersion = args.newVersion,

View File

@ -17,7 +17,7 @@
package im.vector.app.features.home.room.list
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
import im.vector.app.RoomGroupingMethod
import im.vector.app.features.home.RoomListDisplayMode
@ -31,7 +31,7 @@ data class RoomListViewState(
val asyncSuggestedRooms: Async<List<SpaceChildInfo>> = Uninitialized,
val currentUserName: String? = null,
val currentRoomGrouping: Async<RoomGroupingMethod> = Uninitialized
) : MvRxState {
) : MavericksState {
constructor(args: RoomListParams) : this(displayMode = args.displayMode)
}

View File

@ -16,10 +16,10 @@
package im.vector.app.features.homeserver
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import org.matrix.android.sdk.api.session.homeserver.HomeServerCapabilities
data class HomeServerCapabilitiesViewState(
val capabilities: HomeServerCapabilities = HomeServerCapabilities(),
val isE2EByDefault: Boolean = true
) : MvRxState
) : MavericksState

View File

@ -17,13 +17,13 @@
package im.vector.app.features.invite
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
data class InviteUsersToRoomViewState(
val roomId: String,
val inviteState: Async<Unit> = Uninitialized
) : MvRxState {
) : MavericksState {
constructor(args: InviteUsersToRoomArgs) : this(roomId = args.roomId)
}

View File

@ -18,7 +18,7 @@ package im.vector.app.features.login
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.Loading
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.PersistState
import com.airbnb.mvrx.Success
import com.airbnb.mvrx.Uninitialized
@ -55,7 +55,7 @@ data class LoginViewState(
// Supported types for the login. We cannot use a sealed class for LoginType because it is not serializable
val loginModeSupportedTypes: List<String> = emptyList(),
val knownCustomHomeServersUrls: List<String> = emptyList()
) : MvRxState {
) : MavericksState {
fun isLoading(): Boolean {
return asyncLoginAction is Loading

View File

@ -16,12 +16,12 @@
package im.vector.app.features.login.terms
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import org.matrix.android.sdk.internal.auth.registration.LocalizedFlowDataLoginTerms
data class LoginTermsViewState(
val localizedFlowDataLoginTermsChecked: List<LocalizedFlowDataLoginTermsChecked>
) : MvRxState {
) : MavericksState {
fun check(data: LocalizedFlowDataLoginTerms) {
localizedFlowDataLoginTermsChecked.find { it.localizedFlowDataLoginTerms == data }?.checked = true
}

View File

@ -17,7 +17,7 @@
package im.vector.app.features.login2
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.PersistState
import com.airbnb.mvrx.Uninitialized
import im.vector.app.core.extensions.toReducedUrl
@ -55,7 +55,7 @@ data class LoginViewState2(
// From database
val knownCustomHomeServersUrls: List<String> = emptyList()
) : MvRxState {
) : MavericksState {
// Pending user identifier
fun userIdentifier(): String {

View File

@ -17,7 +17,7 @@
package im.vector.app.features.login2.created
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
import org.matrix.android.sdk.api.util.MatrixItem
@ -26,4 +26,4 @@ data class AccountCreatedViewState(
val isLoading: Boolean = false,
val currentUser: Async<MatrixItem.UserItem> = Uninitialized,
val hasBeenModified: Boolean = false
) : MvRxState
) : MavericksState

View File

@ -17,7 +17,7 @@
package im.vector.app.features.matrixto
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
import org.matrix.android.sdk.api.session.permalinks.PermalinkData
import org.matrix.android.sdk.api.session.permalinks.PermalinkParser
@ -31,7 +31,7 @@ data class MatrixToBottomSheetState(
val startChattingState: Async<Unit> = Uninitialized,
val roomPeekResult: Async<RoomInfoResult> = Uninitialized,
val peopleYouKnow: Async<List<MatrixItem.UserItem>> = Uninitialized
) : MvRxState {
) : MavericksState {
constructor(args: MatrixToBottomSheet.MatrixToArgs) : this(
deepLink = args.matrixToLink,

View File

@ -16,8 +16,8 @@
package im.vector.app.features.rageshake
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
data class BugReportState(
val serverVersion: String = ""
) : MvRxState
) : MavericksState

View File

@ -17,7 +17,7 @@ package im.vector.app.features.reactions
import androidx.lifecycle.viewModelScope
import com.airbnb.mvrx.ActivityViewModelContext
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.MvRxViewModelFactory
import com.airbnb.mvrx.ViewModelContext
import dagger.assisted.Assisted
@ -32,7 +32,7 @@ import kotlinx.coroutines.launch
data class EmojiSearchResultViewState(
val query: String = "",
val results: List<EmojiItem> = emptyList()
) : MvRxState
) : MavericksState
class EmojiSearchResultViewModel @AssistedInject constructor(
@Assisted initialState: EmojiSearchResultViewState,

View File

@ -16,13 +16,13 @@
package im.vector.app.features.room
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import im.vector.app.features.roommemberprofile.RoomMemberProfileArgs
import im.vector.app.features.roomprofile.RoomProfileArgs
data class RequireActiveMembershipViewState(
val roomId: String? = null
) : MvRxState {
) : MavericksState {
// No constructor for RoomDetailArgs because of intent for Shortcut

View File

@ -17,7 +17,7 @@
package im.vector.app.features.roomdirectory
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
import org.matrix.android.sdk.api.session.room.members.ChangeMembershipState
import org.matrix.android.sdk.api.session.room.model.roomdirectory.PublicRoom
@ -36,4 +36,4 @@ data class PublicRoomsViewState(
// keys are room alias or roomId
val changeMembershipStates: Map<String, ChangeMembershipState> = emptyMap(),
val roomDirectoryData: RoomDirectoryData = RoomDirectoryData()
) : MvRxState
) : MavericksState

View File

@ -18,7 +18,7 @@ package im.vector.app.features.roomdirectory.createroom
import android.net.Uri
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
import org.matrix.android.sdk.api.session.room.model.RoomJoinRules
import org.matrix.android.sdk.api.session.room.model.RoomSummary
@ -39,7 +39,7 @@ data class CreateRoomViewState(
val supportsRestricted: Boolean = false,
val aliasLocalPart: String? = null,
val isSubSpace: Boolean = false
) : MvRxState {
) : MavericksState {
constructor(args: CreateRoomArgs) : this(
roomName = args.initialName,

View File

@ -17,7 +17,7 @@
package im.vector.app.features.roomdirectory.picker
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
import im.vector.app.features.roomdirectory.RoomDirectoryServer
import org.matrix.android.sdk.api.session.room.model.thirdparty.ThirdPartyProtocol
@ -30,4 +30,4 @@ data class RoomDirectoryPickerViewState(
val addServerAsync: Async<Unit> = Uninitialized,
// computed
val directories: List<RoomDirectoryServer> = emptyList()
) : MvRxState
) : MavericksState

View File

@ -17,7 +17,7 @@
package im.vector.app.features.roomdirectory.roompreview
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
import im.vector.app.features.roomdirectory.JoinState
import org.matrix.android.sdk.api.session.permalinks.PermalinkData
@ -48,7 +48,7 @@ data class RoomPreviewViewState(
val fromEmailInvite: PermalinkData.RoomEmailInviteLink? = null,
// used only if it's an email invite
val isEmailBoundToAccount: Boolean = false
) : MvRxState {
) : MavericksState {
constructor(args: RoomPreviewData) : this(
roomId = args.roomId,

View File

@ -18,7 +18,7 @@
package im.vector.app.features.roommemberprofile
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
import org.matrix.android.sdk.api.session.crypto.crosssigning.MXCrossSigningInfo
import org.matrix.android.sdk.api.session.room.model.Membership
@ -42,7 +42,7 @@ data class RoomMemberProfileViewState(
val asyncMembership: Async<Membership> = Uninitialized,
val hasReadReceipt: Boolean = false,
val actionPermissions: ActionPermissions = ActionPermissions()
) : MvRxState {
) : MavericksState {
constructor(args: RoomMemberProfileArgs) : this(userId = args.userId, roomId = args.roomId)
}

View File

@ -19,7 +19,7 @@ package im.vector.app.features.roommemberprofile.devices
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.FragmentViewModelContext
import com.airbnb.mvrx.Loading
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.MvRxViewModelFactory
import com.airbnb.mvrx.ViewModelContext
import dagger.assisted.Assisted
@ -42,7 +42,7 @@ data class DeviceListViewState(
val memberCrossSigningKey: MXCrossSigningInfo? = null,
val cryptoDevices: Async<List<CryptoDeviceInfo>> = Loading(),
val selectedDevice: CryptoDeviceInfo? = null
) : MvRxState
) : MavericksState
class DeviceListBottomSheetViewModel @AssistedInject constructor(@Assisted private val initialState: DeviceListViewState,
@Assisted private val args: DeviceListBottomSheet.Args,

View File

@ -18,7 +18,7 @@
package im.vector.app.features.roomprofile
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
import org.matrix.android.sdk.api.session.room.model.RoomMemberSummary
import org.matrix.android.sdk.api.session.room.model.RoomSummary
@ -35,7 +35,7 @@ data class RoomProfileViewState(
val recommendedRoomVersion: String? = null,
val canUpgradeRoom: Boolean = false,
val isTombstoned: Boolean = false
) : MvRxState {
) : MavericksState {
constructor(args: RoomProfileArgs) : this(roomId = args.roomId)

View File

@ -17,7 +17,7 @@
package im.vector.app.features.roomprofile.alias
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
import im.vector.app.features.roomprofile.RoomProfileArgs
import org.matrix.android.sdk.api.session.room.model.RoomDirectoryVisibility
@ -35,7 +35,7 @@ data class RoomAliasViewState(
val publishManuallyState: AddAliasState = AddAliasState.Hidden,
val localAliases: Async<List<String>> = Uninitialized,
val newLocalAliasState: AddAliasState = AddAliasState.Closed
) : MvRxState {
) : MavericksState {
constructor(args: RoomProfileArgs) : this(roomId = args.roomId)

View File

@ -16,7 +16,7 @@
package im.vector.app.features.roomprofile.alias.detail
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
data class RoomAliasBottomSheetState(
val alias: String,
@ -25,7 +25,7 @@ data class RoomAliasBottomSheetState(
val isMainAlias: Boolean,
val isLocal: Boolean,
val canEditCanonicalAlias: Boolean
) : MvRxState {
) : MavericksState {
constructor(args: RoomAliasBottomSheetArgs) : this(
alias = args.alias,

View File

@ -17,7 +17,7 @@
package im.vector.app.features.roomprofile.banned
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
import im.vector.app.features.roomprofile.RoomProfileArgs
import org.matrix.android.sdk.api.session.room.model.RoomMemberSummary
@ -30,7 +30,7 @@ data class RoomBannedMemberListViewState(
val filter: String = "",
val onGoingModerationAction: List<String> = emptyList(),
val canUserBan: Boolean = false
) : MvRxState {
) : MavericksState {
constructor(args: RoomProfileArgs) : this(roomId = args.roomId)
}

View File

@ -18,7 +18,7 @@ package im.vector.app.features.roomprofile.members
import androidx.annotation.StringRes
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
import im.vector.app.R
import im.vector.app.core.platform.GenericIdArgs
@ -36,7 +36,7 @@ data class RoomMemberListViewState(
val threePidInvites: Async<List<Event>> = Uninitialized,
val trustLevelMap: Async<Map<String, RoomEncryptionTrustLevel?>> = Uninitialized,
val actionsPermissions: ActionPermissions = ActionPermissions()
) : MvRxState {
) : MavericksState {
constructor(args: RoomProfileArgs) : this(roomId = args.roomId)

View File

@ -17,7 +17,7 @@
package im.vector.app.features.roomprofile.notifications
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Success
import com.airbnb.mvrx.Uninitialized
import im.vector.app.features.home.room.list.actions.RoomListActionsArgs
@ -30,7 +30,7 @@ data class RoomNotificationSettingsViewState(
val roomSummary: Async<RoomSummary> = Uninitialized,
val isLoading: Boolean = false,
val notificationState: Async<RoomNotificationState> = Uninitialized
) : MvRxState {
) : MavericksState {
constructor(args: RoomProfileArgs) : this(roomId = args.roomId)
constructor(args: RoomListActionsArgs) : this(roomId = args.roomId)
}

View File

@ -17,7 +17,7 @@
package im.vector.app.features.roomprofile.permissions
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
import im.vector.app.features.roomprofile.RoomProfileArgs
import org.matrix.android.sdk.api.session.room.model.PowerLevelsContent
@ -30,7 +30,7 @@ data class RoomPermissionsViewState(
val showAdvancedPermissions: Boolean = false,
val currentPowerLevelsContent: Async<PowerLevelsContent> = Uninitialized,
val isLoading: Boolean = false
) : MvRxState {
) : MavericksState {
constructor(args: RoomProfileArgs) : this(roomId = args.roomId)

View File

@ -18,7 +18,7 @@ package im.vector.app.features.roomprofile.settings
import android.net.Uri
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
import im.vector.app.R
import im.vector.app.core.resources.StringProvider
@ -46,7 +46,7 @@ data class RoomSettingsViewState(
val actionPermissions: ActionPermissions = ActionPermissions(),
val supportsRestricted: Boolean = false,
val canUpgradeToRestricted: Boolean = false
) : MvRxState {
) : MavericksState {
constructor(args: RoomProfileArgs) : this(roomId = args.roomId)

View File

@ -17,7 +17,7 @@
package im.vector.app.features.roomprofile.settings.joinrule.advanced
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
import im.vector.app.features.roomprofile.RoomProfileArgs
import im.vector.app.features.roomprofile.settings.joinrule.JoinRulesOptionSupport
@ -45,6 +45,6 @@ data class RoomJoinRuleChooseRestrictedState(
val restrictedSupportedByThisVersion: Boolean = false,
val restrictedVersionNeeded: String? = null,
val didSwitchToReplacementRoom: Boolean = false
) : MvRxState {
) : MavericksState {
constructor(args: RoomProfileArgs) : this(roomId = args.roomId)
}

View File

@ -17,7 +17,7 @@
package im.vector.app.features.roomprofile.uploads
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
import im.vector.app.features.roomprofile.RoomProfileArgs
import org.matrix.android.sdk.api.session.room.model.RoomSummary
@ -33,7 +33,7 @@ data class RoomUploadsViewState(
val asyncEventsRequest: Async<Unit> = Uninitialized,
// True if more result are available server side
val hasMore: Boolean = true
) : MvRxState {
) : MavericksState {
constructor(args: RoomProfileArgs) : this(roomId = args.roomId)
}

View File

@ -17,7 +17,7 @@ package im.vector.app.features.settings.account.deactivation
import androidx.lifecycle.viewModelScope
import com.airbnb.mvrx.FragmentViewModelContext
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.MvRxViewModelFactory
import com.airbnb.mvrx.ViewModelContext
import dagger.assisted.Assisted
@ -42,7 +42,7 @@ import kotlin.coroutines.resumeWithException
data class DeactivateAccountViewState(
val dummy: Boolean = false
) : MvRxState
) : MavericksState
class DeactivateAccountViewModel @AssistedInject constructor(@Assisted private val initialState: DeactivateAccountViewState,
private val session: Session)

View File

@ -16,7 +16,7 @@
package im.vector.app.features.settings.crosssigning
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import org.matrix.android.sdk.api.session.crypto.crosssigning.MXCrossSigningInfo
data class CrossSigningSettingsViewState(
@ -24,4 +24,4 @@ data class CrossSigningSettingsViewState(
val xSigningIsEnableInAccount: Boolean = false,
val xSigningKeysAreTrusted: Boolean = false,
val xSigningKeyCanSign: Boolean = true
) : MvRxState
) : MavericksState

View File

@ -17,7 +17,7 @@
package im.vector.app.features.settings.devices
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
import org.matrix.android.sdk.internal.crypto.model.CryptoDeviceInfo
import org.matrix.android.sdk.internal.crypto.model.rest.DeviceInfo
@ -30,7 +30,7 @@ data class DeviceVerificationInfoBottomSheetViewState(
val isMine: Boolean = false,
val hasOtherSessions: Boolean = false,
val isRecoverySetup: Boolean = false
) : MvRxState {
) : MavericksState {
val canVerifySession: Boolean
get() = hasOtherSessions || isRecoverySetup

View File

@ -21,7 +21,7 @@ import com.airbnb.mvrx.Async
import com.airbnb.mvrx.Fail
import com.airbnb.mvrx.FragmentViewModelContext
import com.airbnb.mvrx.Loading
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.MvRxViewModelFactory
import com.airbnb.mvrx.Success
import com.airbnb.mvrx.Uninitialized
@ -75,7 +75,7 @@ data class DevicesViewState(
val request: Async<Unit> = Uninitialized,
val hasAccountCrossSigning: Boolean = false,
val accountCrossSigningIsTrusted: Boolean = false
) : MvRxState
) : MavericksState
data class DeviceFullInfo(
val deviceInfo: DeviceInfo,

View File

@ -19,7 +19,7 @@ package im.vector.app.features.settings.devtools
import androidx.lifecycle.viewModelScope
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.FragmentViewModelContext
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.MvRxViewModelFactory
import com.airbnb.mvrx.Uninitialized
import com.airbnb.mvrx.ViewModelContext
@ -36,7 +36,7 @@ import org.matrix.android.sdk.rx.rx
data class AccountDataViewState(
val accountData: Async<List<UserAccountDataEvent>> = Uninitialized
) : MvRxState
) : MavericksState
class AccountDataViewModel @AssistedInject constructor(@Assisted initialState: AccountDataViewState,
private val session: Session)

View File

@ -20,7 +20,7 @@ import androidx.paging.PagedList
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.FragmentViewModelContext
import com.airbnb.mvrx.Loading
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.MvRxViewModelFactory
import com.airbnb.mvrx.Uninitialized
import com.airbnb.mvrx.ViewModelContext
@ -36,7 +36,7 @@ import org.matrix.android.sdk.rx.asObservable
data class GossipingEventsPaperTrailState(
val events: Async<PagedList<Event>> = Uninitialized
) : MvRxState
) : MavericksState
class GossipingEventsPaperTrailViewModel @AssistedInject constructor(@Assisted initialState: GossipingEventsPaperTrailState,
private val session: Session)

View File

@ -20,7 +20,7 @@ import androidx.lifecycle.viewModelScope
import androidx.paging.PagedList
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.FragmentViewModelContext
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.MvRxViewModelFactory
import com.airbnb.mvrx.Uninitialized
import com.airbnb.mvrx.ViewModelContext
@ -39,7 +39,7 @@ import org.matrix.android.sdk.rx.asObservable
data class KeyRequestListViewState(
val incomingRequests: Async<PagedList<IncomingRoomKeyRequest>> = Uninitialized,
val outgoingRoomKeyRequests: Async<PagedList<OutgoingRoomKeyRequest>> = Uninitialized
) : MvRxState
) : MavericksState
class KeyRequestListViewModel @AssistedInject constructor(@Assisted initialState: KeyRequestListViewState,
private val session: Session)

View File

@ -22,7 +22,7 @@ import com.airbnb.mvrx.Async
import com.airbnb.mvrx.Fail
import com.airbnb.mvrx.FragmentViewModelContext
import com.airbnb.mvrx.Loading
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.MvRxViewModelFactory
import com.airbnb.mvrx.Success
import com.airbnb.mvrx.Uninitialized
@ -48,7 +48,7 @@ sealed class KeyRequestEvents : VectorViewEvents {
data class KeyRequestViewState(
val exporting: Async<Unit> = Uninitialized
) : MvRxState
) : MavericksState
class KeyRequestViewModel @AssistedInject constructor(
@Assisted initialState: KeyRequestViewState,

View File

@ -17,7 +17,7 @@
package im.vector.app.features.settings.homeserver
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
import org.matrix.android.sdk.api.federation.FederationVersion
import org.matrix.android.sdk.api.session.homeserver.HomeServerCapabilities
@ -27,4 +27,4 @@ data class HomeServerSettingsViewState(
val homeserverClientServerApiUrl: String = "",
val homeServerCapabilities: HomeServerCapabilities = HomeServerCapabilities(),
val federationVersion: Async<FederationVersion> = Uninitialized
) : MvRxState
) : MavericksState

View File

@ -21,7 +21,7 @@ import com.airbnb.mvrx.Async
import com.airbnb.mvrx.Fail
import com.airbnb.mvrx.FragmentViewModelContext
import com.airbnb.mvrx.Loading
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.MvRxViewModelFactory
import com.airbnb.mvrx.Success
import com.airbnb.mvrx.Uninitialized
@ -39,7 +39,7 @@ import org.matrix.android.sdk.rx.rx
data class IgnoredUsersViewState(
val ignoredUsers: List<User> = emptyList(),
val unIgnoreRequest: Async<Unit> = Uninitialized
) : MvRxState
) : MavericksState
sealed class IgnoredUsersAction : VectorViewModelAction {
data class UnIgnore(val userId: String) : IgnoredUsersAction()

View File

@ -17,7 +17,7 @@
package im.vector.app.features.settings.locale
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
import im.vector.app.features.settings.VectorLocale
import java.util.Locale
@ -25,4 +25,4 @@ import java.util.Locale
data class LocalePickerViewState(
val currentLocale: Locale = VectorLocale.applicationLocale,
val locales: Async<List<Locale>> = Uninitialized
) : MvRxState
) : MavericksState

View File

@ -19,7 +19,7 @@ package im.vector.app.features.settings.push
import androidx.lifecycle.viewModelScope
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.FragmentViewModelContext
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.MvRxViewModelFactory
import com.airbnb.mvrx.Uninitialized
import com.airbnb.mvrx.ViewModelContext
@ -35,7 +35,7 @@ import org.matrix.android.sdk.rx.RxSession
data class PushGatewayViewState(
val pushGateways: Async<List<Pusher>> = Uninitialized
) : MvRxState
) : MavericksState
class PushGatewaysViewModel @AssistedInject constructor(@Assisted initialState: PushGatewayViewState,
private val session: Session)

View File

@ -15,7 +15,7 @@
*/
package im.vector.app.features.settings.push
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.MvRxViewModelFactory
import com.airbnb.mvrx.ViewModelContext
import im.vector.app.core.di.HasScreenInjector
@ -26,7 +26,7 @@ import org.matrix.android.sdk.api.pushrules.rest.PushRule
data class PushRulesViewState(
val rules: List<PushRule> = emptyList()
) : MvRxState
) : MavericksState
class PushRulesViewModel(initialState: PushRulesViewState)
: VectorViewModel<PushRulesViewState, EmptyAction, EmptyViewEvents>(initialState) {

View File

@ -17,7 +17,7 @@
package im.vector.app.features.settings.threepids
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
import im.vector.app.core.utils.ReadOnceTrue
import org.matrix.android.sdk.api.session.identity.ThreePid
@ -30,4 +30,4 @@ data class ThreePidsSettingsViewState(
val msisdnValidationRequests: Map<String, Async<Unit>> = emptyMap(),
val editTextReinitiator: ReadOnceTrue = ReadOnceTrue(),
val msisdnValidationReinitiator: Map<ThreePid, ReadOnceTrue> = emptyMap()
) : MvRxState
) : MavericksState

View File

@ -17,7 +17,7 @@
package im.vector.app.features.share
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
import org.matrix.android.sdk.api.session.room.model.RoomSummary
@ -27,4 +27,4 @@ data class IncomingShareViewState(
val filteredRoomSummaries: Async<List<RoomSummary>> = Uninitialized,
val selectedRoomIds: Set<String> = emptySet(),
val isInMultiSelectionMode: Boolean = false
) : MvRxState
) : MavericksState

View File

@ -18,7 +18,7 @@ package im.vector.app.features.signout.soft
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.Loading
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Success
import com.airbnb.mvrx.Uninitialized
import im.vector.app.features.login.LoginMode
@ -32,7 +32,7 @@ data class SoftLogoutViewState(
val userDisplayName: String,
val hasUnsavedKeys: Boolean,
val enteredPassword: String = ""
) : MvRxState {
) : MavericksState {
fun isLoading(): Boolean {
return asyncLoginAction is Loading

View File

@ -17,7 +17,7 @@
package im.vector.app.features.spaces
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
import im.vector.app.RoomGroupingMethod
import org.matrix.android.sdk.api.session.group.model.GroupSummary
@ -35,4 +35,4 @@ data class SpaceListViewState(
val legacyGroups: List<GroupSummary>? = null,
val expandedStates: Map<String, Boolean> = emptyMap(),
val homeAggregateCount : RoomAggregateNotificationCount = RoomAggregateNotificationCount(0, 0)
) : MvRxState
) : MavericksState

View File

@ -17,7 +17,7 @@
package im.vector.app.features.spaces
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
import org.matrix.android.sdk.api.session.room.model.RoomSummary
@ -30,7 +30,7 @@ data class SpaceMenuState(
val isLastAdmin: Boolean = false,
val leaveMode: LeaveMode = LeaveMode.LEAVE_NONE,
val leavingState: Async<Unit> = Uninitialized
) : MvRxState {
) : MavericksState {
constructor(args: SpaceBottomSheetSettingsArgs) : this(spaceId = args.spaceId)
enum class LeaveMode {

View File

@ -18,7 +18,7 @@ package im.vector.app.features.spaces.create
import android.net.Uri
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
data class CreateSpaceState(
@ -38,7 +38,7 @@ data class CreateSpaceState(
val emailValidationResult: Map<Int /** position in form */, Boolean>? = null,
val creationResult: Async<String> = Uninitialized,
val canInviteByMail: Boolean = false
) : MvRxState {
) : MavericksState {
enum class Step {
ChooseType,

View File

@ -17,7 +17,7 @@
package im.vector.app.features.spaces.explore
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import org.matrix.android.sdk.api.session.room.members.ChangeMembershipState
import org.matrix.android.sdk.api.session.room.model.RoomSummary
import org.matrix.android.sdk.api.session.room.model.SpaceChildInfo
@ -39,7 +39,7 @@ data class SpaceDirectoryState(
// cached room summaries of known rooms, we use it because computed room name would be better using it
val knownRoomSummaries: List<RoomSummary> = emptyList(),
val paginationStatus: Map<String, Async<Unit>> = emptyMap()
) : MvRxState {
) : MavericksState {
constructor(args: SpaceDirectoryArgs) : this(
spaceId = args.spaceId
)

View File

@ -17,7 +17,7 @@
package im.vector.app.features.spaces.invite
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
import org.matrix.android.sdk.api.session.room.model.RoomSummary
import org.matrix.android.sdk.api.session.user.model.User
@ -29,7 +29,7 @@ data class SpaceInviteBottomSheetState(
val peopleYouKnow: Async<List<User>> = Uninitialized,
val joinActionState: Async<Unit> = Uninitialized,
val rejectActionState: Async<Unit> = Uninitialized
) : MvRxState {
) : MavericksState {
constructor(args: SpaceInviteBottomSheet.Args) : this(
spaceId = args.spaceId
)

View File

@ -17,7 +17,7 @@
package im.vector.app.features.spaces.leave
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
import im.vector.app.features.spaces.SpaceBottomSheetSettingsArgs
import org.matrix.android.sdk.api.session.room.model.RoomSummary
@ -29,7 +29,7 @@ data class SpaceLeaveAdvanceViewState(
val selectedRooms: List<String> = emptyList(),
val currentFilter: String = "",
val leaveState: Async<Unit> = Uninitialized
) : MvRxState {
) : MavericksState {
constructor(args: SpaceBottomSheetSettingsArgs) : this(
spaceId = args.spaceId
)

View File

@ -17,7 +17,7 @@
package im.vector.app.features.spaces.manage
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
data class SpaceAddRoomsState(
@ -30,7 +30,7 @@ data class SpaceAddRoomsState(
val shouldShowDMs: Boolean = false,
val onlyShowSpaces: Boolean = false
// val selectionList: Map<String, Boolean> = emptyMap()
) : MvRxState {
) : MavericksState {
constructor(args: SpaceManageArgs) : this(
spaceId = args.spaceId,
onlyShowSpaces = args.manageType == ManageType.AddRoomsOnlySpaces

View File

@ -17,7 +17,7 @@
package im.vector.app.features.spaces.manage
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
import org.matrix.android.sdk.api.session.room.model.RoomSummary
import org.matrix.android.sdk.api.session.space.SpaceHierarchyData
@ -32,7 +32,7 @@ data class SpaceManageRoomViewState(
val paginationStatus: Async<Unit> = Uninitialized,
// cached room summaries of known rooms, we use it because computed room name would be better using it
val knownRoomSummaries: List<RoomSummary> = emptyList()
) : MvRxState {
) : MavericksState {
constructor(args: SpaceManageArgs) : this(
spaceId = args.spaceId
)

View File

@ -16,7 +16,7 @@
package im.vector.app.features.spaces.manage
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
enum class ManageType {
AddRooms,
@ -27,7 +27,7 @@ enum class ManageType {
data class SpaceManageViewState(
val spaceId: String = "",
val manageType: ManageType
) : MvRxState {
) : MavericksState {
constructor(args: SpaceManageArgs) : this(
spaceId = args.spaceId,
manageType = args.manageType

View File

@ -17,14 +17,14 @@
package im.vector.app.features.spaces.people
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
import im.vector.app.core.platform.GenericIdArgs
data class SpacePeopleViewState(
val spaceId: String,
val createAndInviteState: Async<String> = Uninitialized
) : MvRxState {
) : MavericksState {
constructor(args: GenericIdArgs) : this(
spaceId = args.id
)

View File

@ -17,7 +17,7 @@
package im.vector.app.features.spaces.preview
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
data class SpacePreviewState(
@ -28,7 +28,7 @@ data class SpacePreviewState(
val spaceInfo: Async<ChildInfo> = Uninitialized,
val childInfoList: Async<List<ChildInfo>> = Uninitialized,
val inviteTermination: Async<Unit> = Uninitialized
) : MvRxState {
) : MavericksState {
constructor(args: SpacePreviewArgs) : this(idOrAlias = args.idOrAlias)
}

View File

@ -17,7 +17,7 @@
package im.vector.app.features.spaces.share
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
import org.matrix.android.sdk.api.session.room.model.RoomSummary
@ -27,7 +27,7 @@ data class ShareSpaceViewState(
val canInviteByMxId: Boolean = false,
val canShareLink: Boolean = false,
val postCreation: Boolean = false
) : MvRxState {
) : MavericksState {
constructor(args: ShareSpaceBottomSheet.Args) : this(
spaceId = args.spaceId,
postCreation = args.postCreation

View File

@ -17,9 +17,9 @@
package im.vector.app.features.terms
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
data class ReviewTermsViewState(
val termsList: Async<List<Term>> = Uninitialized
) : MvRxState
) : MavericksState

View File

@ -16,7 +16,7 @@
package im.vector.app.features.usercode
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import org.matrix.android.sdk.api.util.MatrixItem
data class UserCodeState(
@ -24,7 +24,7 @@ data class UserCodeState(
val matrixItem: MatrixItem? = null,
val shareLink: String? = null,
val mode: Mode = Mode.SHOW
) : MvRxState {
) : MavericksState {
sealed class Mode {
object SHOW : Mode()
object SCAN : Mode()

View File

@ -18,7 +18,7 @@ package im.vector.app.features.userdirectory
import androidx.paging.PagedList
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
import im.vector.app.core.contacts.MappedContact
import org.matrix.android.sdk.api.session.user.model.User
@ -35,7 +35,7 @@ data class UserListViewState(
val configuredIdentityServer: String? = null,
private val showInviteActions: Boolean,
val showContactBookAction: Boolean
) : MvRxState {
) : MavericksState {
constructor(args: UserListFragmentArgs) : this(
excludedUserIds = args.excludedUserIds,

View File

@ -18,7 +18,7 @@ package im.vector.app.features.widgets
import androidx.annotation.StringRes
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
import im.vector.app.R
import org.matrix.android.sdk.api.session.widgets.model.Widget
@ -52,7 +52,7 @@ data class WidgetViewState(
val widgetName: String = "",
val canManageWidgets: Boolean = false,
val asyncWidget: Async<Widget> = Uninitialized
) : MvRxState {
) : MavericksState {
constructor(widgetArgs: WidgetArgs) : this(
widgetKind = widgetArgs.kind,

View File

@ -17,7 +17,7 @@
package im.vector.app.features.widgets.permissions
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.Uninitialized
import im.vector.app.features.widgets.WidgetArgs
import org.matrix.android.sdk.api.session.widgets.model.Widget
@ -26,7 +26,7 @@ data class RoomWidgetPermissionViewState(
val roomId: String,
val widgetId: String?,
val permissionData: Async<WidgetPermissionData> = Uninitialized
) : MvRxState {
) : MavericksState {
constructor(widgetArgs: WidgetArgs) : this(
roomId = widgetArgs.roomId,

View File

@ -20,7 +20,7 @@ import androidx.lifecycle.MutableLiveData
import com.airbnb.mvrx.ActivityViewModelContext
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.FragmentViewModelContext
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.MvRxViewModelFactory
import com.airbnb.mvrx.Uninitialized
import com.airbnb.mvrx.ViewModelContext
@ -49,7 +49,7 @@ import java.util.concurrent.TimeUnit
data class ServerBackupStatusViewState(
val bannerState: Async<BannerState> = Uninitialized
) : MvRxState
) : MavericksState
/**
* The state representing the view

View File

@ -22,7 +22,7 @@ import com.airbnb.mvrx.ActivityViewModelContext
import com.airbnb.mvrx.Async
import com.airbnb.mvrx.FragmentViewModelContext
import com.airbnb.mvrx.Loading
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import com.airbnb.mvrx.MvRxViewModelFactory
import com.airbnb.mvrx.Success
import com.airbnb.mvrx.Uninitialized
@ -51,7 +51,7 @@ data class SignoutCheckViewState(
val crossSigningSetupAllKeysKnown: Boolean = false,
val keysBackupState: KeysBackupState = KeysBackupState.Unknown,
val hasBeenExportedToFile: Async<Boolean> = Uninitialized
) : MvRxState
) : MavericksState
class SignoutCheckViewModel @AssistedInject constructor(
@Assisted initialState: SignoutCheckViewState,

View File

@ -16,7 +16,7 @@
package im.vector.app.test
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MavericksState
import im.vector.app.core.platform.VectorViewEvents
import im.vector.app.core.platform.VectorViewModel
import im.vector.app.core.platform.VectorViewModelAction
@ -25,7 +25,7 @@ import org.amshove.kluent.shouldBeEqualTo
fun String.trimIndentOneLine() = trimIndent().replace("\n", "")
fun <S : MvRxState, VA : VectorViewModelAction, VE : VectorViewEvents> VectorViewModel<S, VA, VE>.test(): ViewModelTest<S, VE> {
fun <S : MavericksState, VA : VectorViewModelAction, VE : VectorViewEvents> VectorViewModel<S, VA, VE>.test(): ViewModelTest<S, VE> {
val state = { com.airbnb.mvrx.withState(this) { it } }
val viewEvents = viewEvents.observe().test()
return ViewModelTest(state, viewEvents)