migrate object to data object (#1135)
This commit is contained in:
@@ -178,10 +178,10 @@ class LoggedInFlowNode @AssistedInject constructor(
|
||||
|
||||
sealed interface NavTarget : Parcelable {
|
||||
@Parcelize
|
||||
object Permanent : NavTarget
|
||||
data object Permanent : NavTarget
|
||||
|
||||
@Parcelize
|
||||
object RoomList : NavTarget
|
||||
data object RoomList : NavTarget
|
||||
|
||||
@Parcelize
|
||||
data class Room(
|
||||
@@ -190,19 +190,19 @@ class LoggedInFlowNode @AssistedInject constructor(
|
||||
) : NavTarget
|
||||
|
||||
@Parcelize
|
||||
object Settings : NavTarget
|
||||
data object Settings : NavTarget
|
||||
|
||||
@Parcelize
|
||||
object CreateRoom : NavTarget
|
||||
data object CreateRoom : NavTarget
|
||||
|
||||
@Parcelize
|
||||
object VerifySession : NavTarget
|
||||
data object VerifySession : NavTarget
|
||||
|
||||
@Parcelize
|
||||
object InviteList : NavTarget
|
||||
data object InviteList : NavTarget
|
||||
|
||||
@Parcelize
|
||||
object Ftue : NavTarget
|
||||
data object Ftue : NavTarget
|
||||
}
|
||||
|
||||
override fun resolve(navTarget: NavTarget, buildContext: BuildContext): Node {
|
||||
|
||||
@@ -64,7 +64,7 @@ class NotLoggedInFlowNode @AssistedInject constructor(
|
||||
|
||||
sealed interface NavTarget : Parcelable {
|
||||
@Parcelize
|
||||
object OnBoarding : NavTarget
|
||||
data object OnBoarding : NavTarget
|
||||
|
||||
@Parcelize
|
||||
data class LoginFlow(
|
||||
|
||||
@@ -170,10 +170,10 @@ class RootFlowNode @AssistedInject constructor(
|
||||
|
||||
sealed interface NavTarget : Parcelable {
|
||||
@Parcelize
|
||||
object SplashScreen : NavTarget
|
||||
data object SplashScreen : NavTarget
|
||||
|
||||
@Parcelize
|
||||
object NotLoggedInFlow : NavTarget
|
||||
data object NotLoggedInFlow : NavTarget
|
||||
|
||||
@Parcelize
|
||||
data class LoggedInFlow(
|
||||
@@ -182,7 +182,7 @@ class RootFlowNode @AssistedInject constructor(
|
||||
) : NavTarget
|
||||
|
||||
@Parcelize
|
||||
object BugReport : NavTarget
|
||||
data object BugReport : NavTarget
|
||||
}
|
||||
|
||||
override fun resolve(navTarget: NavTarget, buildContext: BuildContext): Node {
|
||||
|
||||
@@ -17,5 +17,5 @@
|
||||
package io.element.android.appnav.loggedin
|
||||
|
||||
// sealed interface LoggedInEvents {
|
||||
// object MyEvent : LoggedInEvents
|
||||
// data object MyEvent : LoggedInEvents
|
||||
// }
|
||||
|
||||
@@ -32,8 +32,8 @@ import kotlinx.coroutines.flow.stateIn
|
||||
import javax.inject.Inject
|
||||
|
||||
sealed interface LoadingRoomState {
|
||||
object Loading : LoadingRoomState
|
||||
object Error : LoadingRoomState
|
||||
data object Loading : LoadingRoomState
|
||||
data object Error : LoadingRoomState
|
||||
data class Loaded(val room: MatrixRoom) : LoadingRoomState
|
||||
}
|
||||
|
||||
|
||||
@@ -77,10 +77,10 @@ class RoomFlowNode @AssistedInject constructor(
|
||||
|
||||
sealed interface NavTarget : Parcelable {
|
||||
@Parcelize
|
||||
object Loading : NavTarget
|
||||
data object Loading : NavTarget
|
||||
|
||||
@Parcelize
|
||||
object Loaded : NavTarget
|
||||
data object Loaded : NavTarget
|
||||
}
|
||||
|
||||
override fun onBuilt() {
|
||||
|
||||
@@ -152,10 +152,10 @@ class RoomLoadedFlowNode @AssistedInject constructor(
|
||||
|
||||
sealed interface NavTarget : Parcelable {
|
||||
@Parcelize
|
||||
object Messages : NavTarget
|
||||
data object Messages : NavTarget
|
||||
|
||||
@Parcelize
|
||||
object RoomDetails : NavTarget
|
||||
data object RoomDetails : NavTarget
|
||||
|
||||
@Parcelize
|
||||
data class RoomMemberDetails(val userId: UserId) : NavTarget
|
||||
|
||||
@@ -63,10 +63,10 @@ class ConfigureRoomFlowNode @AssistedInject constructor(
|
||||
|
||||
sealed interface NavTarget : Parcelable {
|
||||
@Parcelize
|
||||
object Root : NavTarget
|
||||
data object Root : NavTarget
|
||||
|
||||
@Parcelize
|
||||
object ConfigureRoom : NavTarget
|
||||
data object ConfigureRoom : NavTarget
|
||||
}
|
||||
|
||||
override fun resolve(navTarget: NavTarget, buildContext: BuildContext): Node {
|
||||
|
||||
@@ -54,10 +54,10 @@ class CreateRoomFlowNode @AssistedInject constructor(
|
||||
|
||||
sealed interface NavTarget : Parcelable {
|
||||
@Parcelize
|
||||
object Root : NavTarget
|
||||
data object Root : NavTarget
|
||||
|
||||
@Parcelize
|
||||
object NewRoom : NavTarget
|
||||
data object NewRoom : NavTarget
|
||||
}
|
||||
|
||||
override fun resolve(navTarget: NavTarget, buildContext: BuildContext): Node {
|
||||
|
||||
@@ -27,5 +27,5 @@ sealed interface ConfigureRoomEvents {
|
||||
data class RemoveFromSelection(val matrixUser: MatrixUser) : ConfigureRoomEvents
|
||||
data class CreateRoom(val config: CreateRoomConfig) : ConfigureRoomEvents
|
||||
data class HandleAvatarAction(val action: AvatarAction) : ConfigureRoomEvents
|
||||
object CancelCreateRoom : ConfigureRoomEvents
|
||||
data object CancelCreateRoom : ConfigureRoomEvents
|
||||
}
|
||||
|
||||
@@ -20,5 +20,5 @@ import io.element.android.libraries.matrix.api.user.MatrixUser
|
||||
|
||||
sealed interface CreateRoomRootEvents {
|
||||
data class StartDM(val matrixUser: MatrixUser) : CreateRoomRootEvents
|
||||
object CancelStartDM : CreateRoomRootEvents
|
||||
data object CancelStartDM : CreateRoomRootEvents
|
||||
}
|
||||
|
||||
@@ -69,13 +69,13 @@ class FtueFlowNode @AssistedInject constructor(
|
||||
|
||||
sealed interface NavTarget : Parcelable {
|
||||
@Parcelize
|
||||
object Placeholder : NavTarget
|
||||
data object Placeholder : NavTarget
|
||||
|
||||
@Parcelize
|
||||
object WelcomeScreen : NavTarget
|
||||
data object WelcomeScreen : NavTarget
|
||||
|
||||
@Parcelize
|
||||
object AnalyticsOptIn : NavTarget
|
||||
data object AnalyticsOptIn : NavTarget
|
||||
}
|
||||
|
||||
private val callback = plugins.filterIsInstance<FtueEntryPoint.Callback>().firstOrNull()
|
||||
|
||||
@@ -89,6 +89,6 @@ class DefaultFtueState @Inject constructor(
|
||||
}
|
||||
|
||||
sealed interface FtueStep {
|
||||
object WelcomeScreen : FtueStep
|
||||
object AnalyticsOptIn : FtueStep
|
||||
data object WelcomeScreen : FtueStep
|
||||
data object AnalyticsOptIn : FtueStep
|
||||
}
|
||||
|
||||
@@ -19,14 +19,12 @@ package io.element.android.features.invitelist.impl
|
||||
import io.element.android.features.invitelist.impl.model.InviteListInviteSummary
|
||||
|
||||
sealed interface InviteListEvents {
|
||||
|
||||
data class AcceptInvite(val invite: InviteListInviteSummary) : InviteListEvents
|
||||
data class DeclineInvite(val invite: InviteListInviteSummary) : InviteListEvents
|
||||
|
||||
object ConfirmDeclineInvite: InviteListEvents
|
||||
object CancelDeclineInvite: InviteListEvents
|
||||
|
||||
object DismissAcceptError: InviteListEvents
|
||||
object DismissDeclineError: InviteListEvents
|
||||
data object ConfirmDeclineInvite: InviteListEvents
|
||||
data object CancelDeclineInvite: InviteListEvents
|
||||
|
||||
data object DismissAcceptError: InviteListEvents
|
||||
data object DismissDeclineError: InviteListEvents
|
||||
}
|
||||
|
||||
@@ -32,6 +32,6 @@ data class InviteListState(
|
||||
)
|
||||
|
||||
sealed interface InviteDeclineConfirmationDialog {
|
||||
object Hidden : InviteDeclineConfirmationDialog
|
||||
data object Hidden : InviteDeclineConfirmationDialog
|
||||
data class Visible(val isDirect: Boolean, val name: String) : InviteDeclineConfirmationDialog
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ import io.element.android.libraries.matrix.api.core.RoomId
|
||||
|
||||
sealed interface LeaveRoomEvent {
|
||||
data class ShowConfirmation(val roomId: RoomId) : LeaveRoomEvent
|
||||
object HideConfirmation : LeaveRoomEvent
|
||||
data object HideConfirmation : LeaveRoomEvent
|
||||
data class LeaveRoom(val roomId: RoomId) : LeaveRoomEvent
|
||||
object HideError : LeaveRoomEvent
|
||||
data object HideError : LeaveRoomEvent
|
||||
}
|
||||
|
||||
@@ -25,19 +25,19 @@ data class LeaveRoomState(
|
||||
val eventSink: (LeaveRoomEvent) -> Unit = {},
|
||||
) {
|
||||
sealed interface Confirmation {
|
||||
object Hidden : Confirmation
|
||||
data object Hidden : Confirmation
|
||||
data class Generic(val roomId: RoomId) : Confirmation
|
||||
data class PrivateRoom(val roomId: RoomId) : Confirmation
|
||||
data class LastUserInRoom(val roomId: RoomId) : Confirmation
|
||||
}
|
||||
|
||||
sealed interface Progress {
|
||||
object Hidden : Progress
|
||||
object Shown : Progress
|
||||
data object Hidden : Progress
|
||||
data object Shown : Progress
|
||||
}
|
||||
|
||||
sealed interface Error {
|
||||
object Hidden : Error
|
||||
object Shown : Error
|
||||
data object Hidden : Error
|
||||
data object Shown : Error
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,5 +17,5 @@
|
||||
package io.element.android.features.location.impl.common.permissions
|
||||
|
||||
sealed interface PermissionsEvents {
|
||||
object RequestPermissions : PermissionsEvents
|
||||
data object RequestPermissions : PermissionsEvents
|
||||
}
|
||||
|
||||
@@ -22,9 +22,9 @@ data class PermissionsState(
|
||||
val eventSink: (PermissionsEvents) -> Unit = {},
|
||||
) {
|
||||
sealed interface Permissions {
|
||||
object AllGranted : Permissions
|
||||
object SomeGranted : Permissions
|
||||
object NoneGranted : Permissions
|
||||
data object AllGranted : Permissions
|
||||
data object SomeGranted : Permissions
|
||||
data object NoneGranted : Permissions
|
||||
}
|
||||
|
||||
val isAnyGranted: Boolean
|
||||
|
||||
@@ -30,13 +30,9 @@ sealed interface SendLocationEvents {
|
||||
)
|
||||
}
|
||||
|
||||
object SwitchToMyLocationMode : SendLocationEvents
|
||||
|
||||
object SwitchToPinLocationMode : SendLocationEvents
|
||||
|
||||
object DismissDialog : SendLocationEvents
|
||||
|
||||
object RequestPermissions : SendLocationEvents
|
||||
|
||||
object OpenAppSettings : SendLocationEvents
|
||||
data object SwitchToMyLocationMode : SendLocationEvents
|
||||
data object SwitchToPinLocationMode : SendLocationEvents
|
||||
data object DismissDialog : SendLocationEvents
|
||||
data object RequestPermissions : SendLocationEvents
|
||||
data object OpenAppSettings : SendLocationEvents
|
||||
}
|
||||
|
||||
@@ -24,13 +24,13 @@ data class SendLocationState(
|
||||
val eventSink: (SendLocationEvents) -> Unit = {},
|
||||
) {
|
||||
sealed interface Mode {
|
||||
object SenderLocation : Mode
|
||||
object PinLocation : Mode
|
||||
data object SenderLocation : Mode
|
||||
data object PinLocation : Mode
|
||||
}
|
||||
|
||||
sealed interface Dialog {
|
||||
object None : Dialog
|
||||
object PermissionRationale : Dialog
|
||||
object PermissionDenied : Dialog
|
||||
data object None : Dialog
|
||||
data object PermissionRationale : Dialog
|
||||
data object PermissionDenied : Dialog
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,11 +17,9 @@
|
||||
package io.element.android.features.location.impl.show
|
||||
|
||||
sealed interface ShowLocationEvents {
|
||||
object Share : ShowLocationEvents
|
||||
data object Share : ShowLocationEvents
|
||||
data class TrackMyLocation(val enabled: Boolean) : ShowLocationEvents
|
||||
object DismissDialog : ShowLocationEvents
|
||||
|
||||
object RequestPermissions : ShowLocationEvents
|
||||
|
||||
object OpenAppSettings : ShowLocationEvents
|
||||
data object DismissDialog : ShowLocationEvents
|
||||
data object RequestPermissions : ShowLocationEvents
|
||||
data object OpenAppSettings : ShowLocationEvents
|
||||
}
|
||||
|
||||
@@ -28,8 +28,8 @@ data class ShowLocationState(
|
||||
val eventSink: (ShowLocationEvents) -> Unit,
|
||||
) {
|
||||
sealed interface Dialog {
|
||||
object None : Dialog
|
||||
object PermissionRationale : Dialog
|
||||
object PermissionDenied : Dialog
|
||||
data object None : Dialog
|
||||
data object PermissionRationale : Dialog
|
||||
data object PermissionDenied : Dialog
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,6 @@
|
||||
package io.element.android.features.login.api.oidc
|
||||
|
||||
sealed interface OidcAction {
|
||||
object GoBack : OidcAction
|
||||
data object GoBack : OidcAction
|
||||
data class Success(val url: String) : OidcAction
|
||||
}
|
||||
|
||||
@@ -85,16 +85,16 @@ class LoginFlowNode @AssistedInject constructor(
|
||||
|
||||
sealed interface NavTarget : Parcelable {
|
||||
@Parcelize
|
||||
object ConfirmAccountProvider : NavTarget
|
||||
data object ConfirmAccountProvider : NavTarget
|
||||
|
||||
@Parcelize
|
||||
object ChangeAccountProvider : NavTarget
|
||||
data object ChangeAccountProvider : NavTarget
|
||||
|
||||
@Parcelize
|
||||
object SearchAccountProvider : NavTarget
|
||||
data object SearchAccountProvider : NavTarget
|
||||
|
||||
@Parcelize
|
||||
object LoginPassword : NavTarget
|
||||
data object LoginPassword : NavTarget
|
||||
|
||||
@Parcelize
|
||||
data class WaitList(val loginFormState: LoginFormState) : NavTarget
|
||||
|
||||
@@ -20,5 +20,5 @@ import io.element.android.features.login.impl.accountprovider.AccountProvider
|
||||
|
||||
sealed interface ChangeServerEvents {
|
||||
data class ChangeServer(val accountProvider: AccountProvider) : ChangeServerEvents
|
||||
object ClearError : ChangeServerEvents
|
||||
data object ClearError : ChangeServerEvents
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ sealed class ChangeServerError : Throwable() {
|
||||
@Composable
|
||||
fun message(): String = stringResource(messageId)
|
||||
}
|
||||
object SlidingSyncAlert : ChangeServerError()
|
||||
data object SlidingSyncAlert : ChangeServerError()
|
||||
|
||||
companion object {
|
||||
fun from(error: Throwable): ChangeServerError = when (error) {
|
||||
|
||||
@@ -19,7 +19,7 @@ package io.element.android.features.login.impl.oidc.webview
|
||||
import io.element.android.features.login.api.oidc.OidcAction
|
||||
|
||||
sealed interface OidcEvents {
|
||||
object Cancel : OidcEvents
|
||||
data object Cancel : OidcEvents
|
||||
data class OidcActionEvent(val oidcAction: OidcAction): OidcEvents
|
||||
object ClearError : OidcEvents
|
||||
data object ClearError : OidcEvents
|
||||
}
|
||||
|
||||
@@ -17,6 +17,6 @@
|
||||
package io.element.android.features.login.impl.screens.confirmaccountprovider
|
||||
|
||||
sealed interface ConfirmAccountProviderEvents {
|
||||
object Continue : ConfirmAccountProviderEvents
|
||||
object ClearError : ConfirmAccountProviderEvents
|
||||
data object Continue : ConfirmAccountProviderEvents
|
||||
data object ClearError : ConfirmAccountProviderEvents
|
||||
}
|
||||
|
||||
@@ -31,6 +31,6 @@ data class ConfirmAccountProviderState(
|
||||
}
|
||||
|
||||
sealed interface LoginFlow {
|
||||
object PasswordLogin : LoginFlow
|
||||
data object PasswordLogin : LoginFlow
|
||||
data class OidcFlow(val oidcDetails: OidcDetails) : LoginFlow
|
||||
}
|
||||
|
||||
@@ -19,6 +19,6 @@ package io.element.android.features.login.impl.screens.loginpassword
|
||||
sealed interface LoginPasswordEvents {
|
||||
data class SetLogin(val login: String) : LoginPasswordEvents
|
||||
data class SetPassword(val password: String) : LoginPasswordEvents
|
||||
object Submit : LoginPasswordEvents
|
||||
object ClearError : LoginPasswordEvents
|
||||
data object Submit : LoginPasswordEvents
|
||||
data object ClearError : LoginPasswordEvents
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
package io.element.android.features.login.impl.screens.waitlistscreen
|
||||
|
||||
sealed interface WaitListEvents {
|
||||
object AttemptLogin : WaitListEvents
|
||||
object ClearError : WaitListEvents
|
||||
object Continue : WaitListEvents
|
||||
data object AttemptLogin : WaitListEvents
|
||||
data object ClearError : WaitListEvents
|
||||
data object Continue : WaitListEvents
|
||||
}
|
||||
|
||||
@@ -17,5 +17,5 @@
|
||||
package io.element.android.features.logout.api
|
||||
|
||||
sealed interface LogoutPreferenceEvents {
|
||||
object Logout : LogoutPreferenceEvents
|
||||
data object Logout : LogoutPreferenceEvents
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ sealed interface MessagesEvents {
|
||||
data class HandleAction(val action: TimelineItemAction, val event: TimelineItem.Event) : MessagesEvents
|
||||
data class ToggleReaction(val emoji: String, val eventId: EventId) : MessagesEvents
|
||||
data class InviteDialogDismissed(val action: InviteDialogAction) : MessagesEvents
|
||||
object Dismiss : MessagesEvents
|
||||
data object Dismiss : MessagesEvents
|
||||
}
|
||||
|
||||
enum class InviteDialogAction {
|
||||
|
||||
@@ -75,7 +75,7 @@ class MessagesFlowNode @AssistedInject constructor(
|
||||
|
||||
sealed interface NavTarget : Parcelable {
|
||||
@Parcelize
|
||||
object Messages : NavTarget
|
||||
data object Messages : NavTarget
|
||||
|
||||
@Parcelize
|
||||
data class MediaViewer(
|
||||
@@ -100,7 +100,7 @@ class MessagesFlowNode @AssistedInject constructor(
|
||||
data class ReportMessage(val eventId: EventId, val senderId: UserId) : NavTarget
|
||||
|
||||
@Parcelize
|
||||
object SendLocation : NavTarget
|
||||
data object SendLocation : NavTarget
|
||||
}
|
||||
|
||||
private val callback = plugins<MessagesEntryPoint.Callback>().firstOrNull()
|
||||
|
||||
@@ -19,6 +19,6 @@ package io.element.android.features.messages.impl.actionlist
|
||||
import io.element.android.features.messages.impl.timeline.model.TimelineItem
|
||||
|
||||
sealed interface ActionListEvents {
|
||||
object Clear : ActionListEvents
|
||||
data object Clear : ActionListEvents
|
||||
data class ComputeForMessage(val event: TimelineItem.Event, val canRedact: Boolean) : ActionListEvents
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ data class ActionListState(
|
||||
val eventSink: (ActionListEvents) -> Unit,
|
||||
) {
|
||||
sealed interface Target {
|
||||
object None : Target
|
||||
data object None : Target
|
||||
data class Loading(val event: TimelineItem.Event) : Target
|
||||
data class Success(
|
||||
val event: TimelineItem.Event,
|
||||
|
||||
@@ -28,11 +28,11 @@ sealed class TimelineItemAction(
|
||||
@DrawableRes val icon: Int,
|
||||
val destructive: Boolean = false
|
||||
) {
|
||||
object Forward : TimelineItemAction(CommonStrings.action_forward, VectorIcons.Forward)
|
||||
object Copy : TimelineItemAction(CommonStrings.action_copy, VectorIcons.Copy)
|
||||
object Redact : TimelineItemAction(CommonStrings.action_remove, VectorIcons.Delete, destructive = true)
|
||||
object Reply : TimelineItemAction(CommonStrings.action_reply, VectorIcons.Reply)
|
||||
object Edit : TimelineItemAction(CommonStrings.action_edit, VectorIcons.Edit)
|
||||
object Developer : TimelineItemAction(CommonStrings.action_view_source, VectorIcons.DeveloperMode)
|
||||
object ReportContent : TimelineItemAction(CommonStrings.action_report_content, VectorIcons.ReportContent, destructive = true)
|
||||
data object Forward : TimelineItemAction(CommonStrings.action_forward, VectorIcons.Forward)
|
||||
data object Copy : TimelineItemAction(CommonStrings.action_copy, VectorIcons.Copy)
|
||||
data object Redact : TimelineItemAction(CommonStrings.action_remove, VectorIcons.Delete, destructive = true)
|
||||
data object Reply : TimelineItemAction(CommonStrings.action_reply, VectorIcons.Reply)
|
||||
data object Edit : TimelineItemAction(CommonStrings.action_edit, VectorIcons.Edit)
|
||||
data object Developer : TimelineItemAction(CommonStrings.action_view_source, VectorIcons.DeveloperMode)
|
||||
data object ReportContent : TimelineItemAction(CommonStrings.action_report_content, VectorIcons.ReportContent, destructive = true)
|
||||
}
|
||||
|
||||
@@ -20,6 +20,6 @@ import androidx.compose.runtime.Immutable
|
||||
|
||||
@Immutable
|
||||
sealed interface AttachmentsPreviewEvents {
|
||||
object SendAttachment : AttachmentsPreviewEvents
|
||||
object ClearSendState : AttachmentsPreviewEvents
|
||||
data object SendAttachment : AttachmentsPreviewEvents
|
||||
data object ClearSendState : AttachmentsPreviewEvents
|
||||
}
|
||||
|
||||
@@ -25,13 +25,13 @@ data class AttachmentsPreviewState(
|
||||
)
|
||||
|
||||
sealed interface SendActionState {
|
||||
object Idle : SendActionState
|
||||
data object Idle : SendActionState
|
||||
sealed interface Sending : SendActionState {
|
||||
object Processing : Sending
|
||||
data object Processing : Sending
|
||||
data class Uploading(val progress: Float) : Sending
|
||||
}
|
||||
|
||||
data class Failure(val error: Throwable) : SendActionState
|
||||
object Done : SendActionState
|
||||
data object Done : SendActionState
|
||||
}
|
||||
|
||||
|
||||
@@ -21,9 +21,9 @@ import io.element.android.libraries.matrix.api.roomlist.RoomSummaryDetails
|
||||
sealed interface ForwardMessagesEvents {
|
||||
data class SetSelectedRoom(val room: RoomSummaryDetails) : ForwardMessagesEvents
|
||||
// TODO remove to restore multi-selection
|
||||
object RemoveSelectedRoom : ForwardMessagesEvents
|
||||
object ToggleSearchActive : ForwardMessagesEvents
|
||||
data object RemoveSelectedRoom : ForwardMessagesEvents
|
||||
data object ToggleSearchActive : ForwardMessagesEvents
|
||||
data class UpdateQuery(val query: String) : ForwardMessagesEvents
|
||||
object ForwardEvent : ForwardMessagesEvents
|
||||
object ClearError : ForwardMessagesEvents
|
||||
data object ForwardEvent : ForwardMessagesEvents
|
||||
data object ClearError : ForwardMessagesEvents
|
||||
}
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
package io.element.android.features.messages.impl.media.viewer
|
||||
|
||||
sealed interface MediaViewerEvents {
|
||||
object SaveOnDisk: MediaViewerEvents
|
||||
object Share: MediaViewerEvents
|
||||
object OpenWith: MediaViewerEvents
|
||||
object RetryLoading : MediaViewerEvents
|
||||
object ClearLoadingError : MediaViewerEvents
|
||||
data object SaveOnDisk: MediaViewerEvents
|
||||
data object Share: MediaViewerEvents
|
||||
data object OpenWith: MediaViewerEvents
|
||||
data object RetryLoading : MediaViewerEvents
|
||||
data object ClearLoadingError : MediaViewerEvents
|
||||
}
|
||||
|
||||
@@ -21,20 +21,20 @@ import io.element.android.libraries.textcomposer.MessageComposerMode
|
||||
|
||||
@Immutable
|
||||
sealed interface MessageComposerEvents {
|
||||
object ToggleFullScreenState : MessageComposerEvents
|
||||
data object ToggleFullScreenState : MessageComposerEvents
|
||||
data class FocusChanged(val hasFocus: Boolean) : MessageComposerEvents
|
||||
data class SendMessage(val message: String) : MessageComposerEvents
|
||||
object CloseSpecialMode : MessageComposerEvents
|
||||
data object CloseSpecialMode : MessageComposerEvents
|
||||
data class SetMode(val composerMode: MessageComposerMode) : MessageComposerEvents
|
||||
data class UpdateText(val text: String) : MessageComposerEvents
|
||||
object AddAttachment : MessageComposerEvents
|
||||
object DismissAttachmentMenu : MessageComposerEvents
|
||||
data object AddAttachment : MessageComposerEvents
|
||||
data object DismissAttachmentMenu : MessageComposerEvents
|
||||
sealed interface PickAttachmentSource : MessageComposerEvents {
|
||||
object FromGallery : PickAttachmentSource
|
||||
object FromFiles : PickAttachmentSource
|
||||
object PhotoFromCamera : PickAttachmentSource
|
||||
object VideoFromCamera : PickAttachmentSource
|
||||
object Location : PickAttachmentSource
|
||||
data object FromGallery : PickAttachmentSource
|
||||
data object FromFiles : PickAttachmentSource
|
||||
data object PhotoFromCamera : PickAttachmentSource
|
||||
data object VideoFromCamera : PickAttachmentSource
|
||||
data object Location : PickAttachmentSource
|
||||
}
|
||||
object CancelSendAttachment : MessageComposerEvents
|
||||
data object CancelSendAttachment : MessageComposerEvents
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ data class MessageComposerState(
|
||||
|
||||
@Immutable
|
||||
sealed interface AttachmentsState {
|
||||
object None : AttachmentsState
|
||||
data object None : AttachmentsState
|
||||
data class Previewing(val attachments: ImmutableList<Attachment>) : AttachmentsState
|
||||
sealed interface Sending : AttachmentsState {
|
||||
data class Processing(val attachments: ImmutableList<Attachment>) : Sending
|
||||
|
||||
@@ -18,7 +18,7 @@ package io.element.android.features.messages.impl.report
|
||||
|
||||
sealed interface ReportMessageEvents {
|
||||
data class UpdateReason(val reason: String) : ReportMessageEvents
|
||||
object ToggleBlockUser : ReportMessageEvents
|
||||
object Report : ReportMessageEvents
|
||||
object ClearError : ReportMessageEvents
|
||||
data object ToggleBlockUser : ReportMessageEvents
|
||||
data object Report : ReportMessageEvents
|
||||
data object ClearError : ReportMessageEvents
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ package io.element.android.features.messages.impl.timeline
|
||||
import io.element.android.libraries.matrix.api.core.EventId
|
||||
|
||||
sealed interface TimelineEvents {
|
||||
object LoadMore : TimelineEvents
|
||||
data object LoadMore : TimelineEvents
|
||||
data class SetHighlightedEvent(val eventId: EventId?) : TimelineEvents
|
||||
data class OnScrollFinished(val firstIndex: Int) : TimelineEvents
|
||||
}
|
||||
|
||||
@@ -20,6 +20,6 @@ import io.element.android.features.messages.impl.timeline.model.AggregatedReacti
|
||||
import io.element.android.libraries.matrix.api.core.EventId
|
||||
|
||||
sealed interface ReactionSummaryEvents {
|
||||
object Clear : ReactionSummaryEvents
|
||||
data object Clear : ReactionSummaryEvents
|
||||
data class ShowReactionSummary(val eventId: EventId, val reactions: List<AggregatedReaction>, val selectedKey: String) : ReactionSummaryEvents
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ import io.element.android.features.messages.impl.timeline.model.TimelineItem
|
||||
|
||||
sealed interface RetrySendMenuEvents {
|
||||
data class EventSelected(val event: TimelineItem.Event) : RetrySendMenuEvents
|
||||
object RetrySend : RetrySendMenuEvents
|
||||
object RemoveFailed : RetrySendMenuEvents
|
||||
object Dismiss: RetrySendMenuEvents
|
||||
data object RetrySend : RetrySendMenuEvents
|
||||
data object RemoveFailed : RetrySendMenuEvents
|
||||
data object Dismiss: RetrySendMenuEvents
|
||||
}
|
||||
|
||||
@@ -40,22 +40,22 @@ sealed interface TimelineItemGroupPosition {
|
||||
/**
|
||||
* The event is part of a group of events from the same sender and is the first sent Event.
|
||||
*/
|
||||
object First : TimelineItemGroupPosition
|
||||
data object First : TimelineItemGroupPosition
|
||||
|
||||
/**
|
||||
* The event is part of a group of events from the same sender and is neither the first nor the last sent Event.
|
||||
*/
|
||||
object Middle : TimelineItemGroupPosition
|
||||
data object Middle : TimelineItemGroupPosition
|
||||
|
||||
/**
|
||||
* The event is part of a group of events from the same sender and is the last sent Event.
|
||||
*/
|
||||
object Last : TimelineItemGroupPosition
|
||||
data object Last : TimelineItemGroupPosition
|
||||
|
||||
/**
|
||||
* The event is not part of a group of events. Sender of previous event is different, and sender of next event is different.
|
||||
*/
|
||||
object None : TimelineItemGroupPosition
|
||||
data object None : TimelineItemGroupPosition
|
||||
|
||||
/**
|
||||
* Return true if the previous sender of the event is a different sender.
|
||||
|
||||
@@ -48,7 +48,7 @@ class PollFlowNode @AssistedInject constructor(
|
||||
|
||||
sealed interface NavTarget : Parcelable {
|
||||
@Parcelize
|
||||
object Root : NavTarget
|
||||
data object Root : NavTarget
|
||||
}
|
||||
|
||||
override fun resolve(navTarget: NavTarget, buildContext: BuildContext): Node {
|
||||
|
||||
@@ -55,16 +55,16 @@ class PreferencesFlowNode @AssistedInject constructor(
|
||||
|
||||
sealed interface NavTarget : Parcelable {
|
||||
@Parcelize
|
||||
object Root : NavTarget
|
||||
data object Root : NavTarget
|
||||
|
||||
@Parcelize
|
||||
object DeveloperSettings : NavTarget
|
||||
data object DeveloperSettings : NavTarget
|
||||
|
||||
@Parcelize
|
||||
object AnalyticsSettings : NavTarget
|
||||
data object AnalyticsSettings : NavTarget
|
||||
|
||||
@Parcelize
|
||||
object About : NavTarget
|
||||
data object About : NavTarget
|
||||
}
|
||||
|
||||
override fun resolve(navTarget: NavTarget, buildContext: BuildContext): Node {
|
||||
|
||||
@@ -27,9 +27,9 @@ sealed class ElementLegal(
|
||||
@StringRes val titleRes: Int,
|
||||
val url: String,
|
||||
) {
|
||||
object Copyright : ElementLegal(CommonStrings.common_copyright, COPYRIGHT_URL)
|
||||
object AcceptableUsePolicy : ElementLegal(CommonStrings.common_acceptable_use_policy, USE_POLICY_URL)
|
||||
object PrivacyPolicy : ElementLegal(CommonStrings.common_privacy_policy, PRIVACY_URL)
|
||||
data object Copyright : ElementLegal(CommonStrings.common_copyright, COPYRIGHT_URL)
|
||||
data object AcceptableUsePolicy : ElementLegal(CommonStrings.common_acceptable_use_policy, USE_POLICY_URL)
|
||||
data object PrivacyPolicy : ElementLegal(CommonStrings.common_privacy_policy, PRIVACY_URL)
|
||||
}
|
||||
|
||||
fun getAllLegals(): List<ElementLegal> {
|
||||
|
||||
@@ -20,5 +20,5 @@ import io.element.android.libraries.featureflag.ui.model.FeatureUiModel
|
||||
|
||||
sealed interface DeveloperSettingsEvents {
|
||||
data class UpdateEnabledFeature(val feature: FeatureUiModel, val isEnabled: Boolean) : DeveloperSettingsEvents
|
||||
object ClearCache: DeveloperSettingsEvents
|
||||
data object ClearCache: DeveloperSettingsEvents
|
||||
}
|
||||
|
||||
@@ -17,6 +17,6 @@
|
||||
package io.element.android.features.rageshake.api.crash
|
||||
|
||||
sealed interface CrashDetectionEvents {
|
||||
object ResetAllCrashData : CrashDetectionEvents
|
||||
object ResetAppHasCrashed : CrashDetectionEvents
|
||||
data object ResetAllCrashData : CrashDetectionEvents
|
||||
data object ResetAppHasCrashed : CrashDetectionEvents
|
||||
}
|
||||
|
||||
@@ -19,9 +19,9 @@ package io.element.android.features.rageshake.api.detection
|
||||
import io.element.android.features.rageshake.api.screenshot.ImageResult
|
||||
|
||||
sealed interface RageshakeDetectionEvents {
|
||||
object Dismiss : RageshakeDetectionEvents
|
||||
object Disable : RageshakeDetectionEvents
|
||||
object StartDetection : RageshakeDetectionEvents
|
||||
object StopDetection : RageshakeDetectionEvents
|
||||
data object Dismiss : RageshakeDetectionEvents
|
||||
data object Disable : RageshakeDetectionEvents
|
||||
data object StartDetection : RageshakeDetectionEvents
|
||||
data object StopDetection : RageshakeDetectionEvents
|
||||
data class ProcessScreenshot(val imageResult: ImageResult) : RageshakeDetectionEvents
|
||||
}
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
package io.element.android.features.rageshake.impl.bugreport
|
||||
|
||||
sealed interface BugReportEvents {
|
||||
object SendBugReport : BugReportEvents
|
||||
object ResetAll : BugReportEvents
|
||||
object ClearError : BugReportEvents
|
||||
data object SendBugReport : BugReportEvents
|
||||
data object ResetAll : BugReportEvents
|
||||
data object ClearError : BugReportEvents
|
||||
|
||||
data class SetDescription(val description: String) : BugReportEvents
|
||||
data class SetSendLog(val sendLog: Boolean) : BugReportEvents
|
||||
|
||||
@@ -29,7 +29,7 @@ interface RoomDetailsEntryPoint : FeatureEntryPoint {
|
||||
|
||||
sealed interface InitialTarget : Parcelable {
|
||||
@Parcelize
|
||||
object RoomDetails : InitialTarget
|
||||
data object RoomDetails : InitialTarget
|
||||
|
||||
@Parcelize
|
||||
data class RoomMemberDetails(val roomMemberId: UserId) : InitialTarget
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
package io.element.android.features.roomdetails.impl
|
||||
|
||||
sealed interface RoomDetailsAction {
|
||||
object Edit : RoomDetailsAction
|
||||
|
||||
object AddTopic : RoomDetailsAction
|
||||
data object Edit : RoomDetailsAction
|
||||
data object AddTopic : RoomDetailsAction
|
||||
}
|
||||
|
||||
@@ -17,5 +17,5 @@
|
||||
package io.element.android.features.roomdetails.impl
|
||||
|
||||
sealed interface RoomDetailsEvent {
|
||||
object LeaveRoom : RoomDetailsEvent
|
||||
data object LeaveRoom : RoomDetailsEvent
|
||||
}
|
||||
|
||||
@@ -55,16 +55,16 @@ class RoomDetailsFlowNode @AssistedInject constructor(
|
||||
|
||||
sealed interface NavTarget : Parcelable {
|
||||
@Parcelize
|
||||
object RoomDetails : NavTarget
|
||||
data object RoomDetails : NavTarget
|
||||
|
||||
@Parcelize
|
||||
object RoomMemberList : NavTarget
|
||||
data object RoomMemberList : NavTarget
|
||||
|
||||
@Parcelize
|
||||
object RoomDetailsEdit : NavTarget
|
||||
data object RoomDetailsEdit : NavTarget
|
||||
|
||||
@Parcelize
|
||||
object InviteMembers : NavTarget
|
||||
data object InviteMembers : NavTarget
|
||||
|
||||
@Parcelize
|
||||
data class RoomMemberDetails(val roomMemberId: UserId) : NavTarget
|
||||
|
||||
@@ -37,12 +37,12 @@ data class RoomDetailsState(
|
||||
)
|
||||
|
||||
sealed interface RoomDetailsType {
|
||||
object Room : RoomDetailsType
|
||||
data object Room : RoomDetailsType
|
||||
data class Dm(val roomMember: RoomMember) : RoomDetailsType
|
||||
}
|
||||
|
||||
sealed interface RoomTopicState {
|
||||
object Hidden : RoomTopicState
|
||||
object CanAddTopic : RoomTopicState
|
||||
data object Hidden : RoomTopicState
|
||||
data object CanAddTopic : RoomTopicState
|
||||
data class ExistingTopic(val topic: String) : RoomTopicState
|
||||
}
|
||||
|
||||
@@ -22,6 +22,6 @@ sealed interface RoomDetailsEditEvents {
|
||||
data class HandleAvatarAction(val action: AvatarAction) : RoomDetailsEditEvents
|
||||
data class UpdateRoomName(val name: String) : RoomDetailsEditEvents
|
||||
data class UpdateRoomTopic(val topic: String) : RoomDetailsEditEvents
|
||||
object Save : RoomDetailsEditEvents
|
||||
object CancelSaveChanges : RoomDetailsEditEvents
|
||||
data object Save : RoomDetailsEditEvents
|
||||
data object CancelSaveChanges : RoomDetailsEditEvents
|
||||
}
|
||||
|
||||
@@ -19,6 +19,6 @@ package io.element.android.features.roomdetails.impl.members.details
|
||||
sealed interface RoomMemberDetailsEvents {
|
||||
data class BlockUser(val needsConfirmation: Boolean = false) : RoomMemberDetailsEvents
|
||||
data class UnblockUser(val needsConfirmation: Boolean = false) : RoomMemberDetailsEvents
|
||||
object ClearBlockUserError : RoomMemberDetailsEvents
|
||||
object ClearConfirmationDialog : RoomMemberDetailsEvents
|
||||
data object ClearBlockUserError : RoomMemberDetailsEvents
|
||||
data object ClearConfirmationDialog : RoomMemberDetailsEvents
|
||||
}
|
||||
|
||||
@@ -22,9 +22,9 @@ import io.element.android.libraries.matrix.api.core.RoomId
|
||||
sealed interface RoomListEvents {
|
||||
data class UpdateFilter(val newFilter: String) : RoomListEvents
|
||||
data class UpdateVisibleRange(val range: IntRange) : RoomListEvents
|
||||
object DismissRequestVerificationPrompt : RoomListEvents
|
||||
object ToggleSearchResults : RoomListEvents
|
||||
data object DismissRequestVerificationPrompt : RoomListEvents
|
||||
data object ToggleSearchResults : RoomListEvents
|
||||
data class ShowContextMenu(val roomListRoomSummary: RoomListRoomSummary) : RoomListEvents
|
||||
object HideContextMenu : RoomListEvents
|
||||
data object HideContextMenu : RoomListEvents
|
||||
data class LeaveRoom(val roomId: RoomId) : RoomListEvents
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ data class RoomListState(
|
||||
val eventSink: (RoomListEvents) -> Unit,
|
||||
) {
|
||||
sealed interface ContextMenu {
|
||||
object Hidden : ContextMenu
|
||||
data object Hidden : ContextMenu
|
||||
data class Shown(
|
||||
val roomId: RoomId,
|
||||
val roomName: String,
|
||||
|
||||
@@ -29,11 +29,11 @@ data class VerifySelfSessionState(
|
||||
|
||||
@Stable
|
||||
sealed interface VerificationStep {
|
||||
object Initial : VerificationStep
|
||||
object Canceled : VerificationStep
|
||||
object AwaitingOtherDeviceResponse : VerificationStep
|
||||
object Ready : VerificationStep
|
||||
data object Initial : VerificationStep
|
||||
data object Canceled : VerificationStep
|
||||
data object AwaitingOtherDeviceResponse : VerificationStep
|
||||
data object Ready : VerificationStep
|
||||
data class Verifying(val emojiList: List<VerificationEmoji>, val state: Async<Unit>) : VerificationStep
|
||||
object Completed : VerificationStep
|
||||
data object Completed : VerificationStep
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,19 +125,19 @@ class VerifySelfSessionStateMachine @Inject constructor(
|
||||
|
||||
sealed interface State {
|
||||
/** The initial state, before verification started. */
|
||||
object Initial : State
|
||||
data object Initial : State
|
||||
|
||||
/** Waiting for verification acceptance. */
|
||||
object RequestingVerification : State
|
||||
data object RequestingVerification : State
|
||||
|
||||
/** Verification request accepted. Waiting for start. */
|
||||
object VerificationRequestAccepted : State
|
||||
data object VerificationRequestAccepted : State
|
||||
|
||||
/** Waiting for SaS verification start. */
|
||||
object StartingSasVerification : State
|
||||
data object StartingSasVerification : State
|
||||
|
||||
/** A SaS verification flow has been started. */
|
||||
object SasVerificationStarted : State
|
||||
data object SasVerificationStarted : State
|
||||
|
||||
sealed class Verifying(open val emojis: List<VerificationEmoji>) : State {
|
||||
/** Verification accepted and emojis received. */
|
||||
@@ -148,50 +148,50 @@ class VerifySelfSessionStateMachine @Inject constructor(
|
||||
}
|
||||
|
||||
/** The verification is being canceled. */
|
||||
object Canceling : State
|
||||
data object Canceling : State
|
||||
|
||||
/** The verification has been canceled, remotely or locally. */
|
||||
object Canceled : State
|
||||
data object Canceled : State
|
||||
|
||||
/** Verification successful. */
|
||||
object Completed : State
|
||||
data object Completed : State
|
||||
}
|
||||
|
||||
sealed interface Event {
|
||||
/** Request verification. */
|
||||
object RequestVerification : Event
|
||||
data object RequestVerification : Event
|
||||
|
||||
/** The current verification request has been accepted. */
|
||||
object DidAcceptVerificationRequest : Event
|
||||
data object DidAcceptVerificationRequest : Event
|
||||
|
||||
/** Start a SaS verification flow. */
|
||||
object StartSasVerification : Event
|
||||
data object StartSasVerification : Event
|
||||
|
||||
/** Started a SaS verification flow. */
|
||||
object DidStartSasVerification : Event
|
||||
data object DidStartSasVerification : Event
|
||||
|
||||
/** Has received emojis. */
|
||||
data class DidReceiveChallenge(val emojis: List<VerificationEmoji>) : Event
|
||||
|
||||
/** Emojis match. */
|
||||
object AcceptChallenge : Event
|
||||
data object AcceptChallenge : Event
|
||||
|
||||
/** Emojis do not match. */
|
||||
object DeclineChallenge : Event
|
||||
data object DeclineChallenge : Event
|
||||
|
||||
/** Remote accepted challenge. */
|
||||
object DidAcceptChallenge : Event
|
||||
data object DidAcceptChallenge : Event
|
||||
|
||||
/** Request cancellation. */
|
||||
object Cancel : Event
|
||||
data object Cancel : Event
|
||||
|
||||
/** Verification cancelled. */
|
||||
object DidCancel : Event
|
||||
data object DidCancel : Event
|
||||
|
||||
/** Request failed. */
|
||||
object DidFail : Event
|
||||
data object DidFail : Event
|
||||
|
||||
/** Restart the verification flow. */
|
||||
object Restart : Event
|
||||
data object Restart : Event
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
package io.element.android.features.verifysession.impl
|
||||
|
||||
sealed interface VerifySelfSessionViewEvents {
|
||||
object RequestVerification: VerifySelfSessionViewEvents
|
||||
object StartSasVerification: VerifySelfSessionViewEvents
|
||||
object Restart: VerifySelfSessionViewEvents
|
||||
object ConfirmVerification: VerifySelfSessionViewEvents
|
||||
object DeclineVerification: VerifySelfSessionViewEvents
|
||||
object CancelAndClose: VerifySelfSessionViewEvents
|
||||
data object RequestVerification: VerifySelfSessionViewEvents
|
||||
data object StartSasVerification: VerifySelfSessionViewEvents
|
||||
data object Restart: VerifySelfSessionViewEvents
|
||||
data object ConfirmVerification: VerifySelfSessionViewEvents
|
||||
data object DeclineVerification: VerifySelfSessionViewEvents
|
||||
data object CancelAndClose: VerifySelfSessionViewEvents
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ class FirstThrottler(private val minimumInterval: Long = 800) {
|
||||
private var lastDate = 0L
|
||||
|
||||
sealed class CanHandleResult {
|
||||
object Yes : CanHandleResult()
|
||||
data object Yes : CanHandleResult()
|
||||
data class No(val shouldWaitMillis: Long) : CanHandleResult()
|
||||
|
||||
fun waitMillis(): Long {
|
||||
|
||||
@@ -63,7 +63,7 @@ sealed interface Async<out T> {
|
||||
/**
|
||||
* Represents an uninitialized operation (i.e. yet to be run).
|
||||
*/
|
||||
object Uninitialized : Async<Nothing>
|
||||
data object Uninitialized : Async<Nothing>
|
||||
|
||||
/**
|
||||
* Returns the data returned by the operation, or null otherwise.
|
||||
|
||||
@@ -105,7 +105,7 @@ sealed class ElementLogoAtomSize(
|
||||
val shadowColorLight: Color,
|
||||
val shadowRadius: Dp,
|
||||
) {
|
||||
object Medium : ElementLogoAtomSize(
|
||||
data object Medium : ElementLogoAtomSize(
|
||||
outerSize = 120.dp,
|
||||
logoSize = 83.5.dp,
|
||||
cornerRadius = 33.dp,
|
||||
@@ -115,7 +115,7 @@ sealed class ElementLogoAtomSize(
|
||||
shadowRadius = 32.dp,
|
||||
)
|
||||
|
||||
object Large : ElementLogoAtomSize(
|
||||
data object Large : ElementLogoAtomSize(
|
||||
outerSize = 158.dp,
|
||||
logoSize = 110.dp,
|
||||
cornerRadius = 44.dp,
|
||||
|
||||
@@ -88,7 +88,7 @@ fun ProgressDialog(
|
||||
@Immutable
|
||||
sealed interface ProgressDialogType {
|
||||
data class Determinate(val progress: Float) : ProgressDialogType
|
||||
object Indeterminate : ProgressDialogType
|
||||
data object Indeterminate : ProgressDialogType
|
||||
}
|
||||
|
||||
@Composable
|
||||
|
||||
@@ -140,9 +140,9 @@ fun ListItem(
|
||||
* The style to use for a [ListItem].
|
||||
*/
|
||||
sealed interface ListItemStyle {
|
||||
object Default : ListItemStyle
|
||||
object Primary: ListItemStyle
|
||||
object Destructive : ListItemStyle
|
||||
data object Default : ListItemStyle
|
||||
data object Primary: ListItemStyle
|
||||
data object Destructive : ListItemStyle
|
||||
}
|
||||
|
||||
// region: Simple list item
|
||||
|
||||
@@ -120,13 +120,13 @@ object ListSupportingTextDefaults {
|
||||
/** Specifies the padding to use for the supporting text. */
|
||||
sealed interface Padding {
|
||||
/** No padding. */
|
||||
object None : Padding
|
||||
data object None : Padding
|
||||
/** Default padding, it will align fine with a [ListItem] with no leading content. */
|
||||
object Default : Padding
|
||||
data object Default : Padding
|
||||
/** It will align to a [ListItem] with an [Icon] or [Checkbox] as leading content. */
|
||||
object SmallLeadingContent : Padding
|
||||
data object SmallLeadingContent : Padding
|
||||
/** It will align to with a [ListItem] with a [Switch] as leading content. */
|
||||
object LargeLeadingContent : Padding
|
||||
data object LargeLeadingContent : Padding
|
||||
/** It will align to with a [ListItem] with a custom start [padding]. */
|
||||
data class Custom(val padding: Dp) : Padding
|
||||
|
||||
|
||||
@@ -40,54 +40,53 @@ data class NotificationData(
|
||||
|
||||
sealed interface NotificationContent {
|
||||
sealed interface MessageLike : NotificationContent {
|
||||
object CallAnswer : MessageLike
|
||||
object CallInvite : MessageLike
|
||||
object CallHangup : MessageLike
|
||||
object CallCandidates : MessageLike
|
||||
object KeyVerificationReady : MessageLike
|
||||
object KeyVerificationStart : MessageLike
|
||||
object KeyVerificationCancel : MessageLike
|
||||
object KeyVerificationAccept : MessageLike
|
||||
object KeyVerificationKey : MessageLike
|
||||
object KeyVerificationMac : MessageLike
|
||||
object KeyVerificationDone : MessageLike
|
||||
data object CallAnswer : MessageLike
|
||||
data object CallInvite : MessageLike
|
||||
data object CallHangup : MessageLike
|
||||
data object CallCandidates : MessageLike
|
||||
data object KeyVerificationReady : MessageLike
|
||||
data object KeyVerificationStart : MessageLike
|
||||
data object KeyVerificationCancel : MessageLike
|
||||
data object KeyVerificationAccept : MessageLike
|
||||
data object KeyVerificationKey : MessageLike
|
||||
data object KeyVerificationMac : MessageLike
|
||||
data object KeyVerificationDone : MessageLike
|
||||
data class ReactionContent(
|
||||
val relatedEventId: String
|
||||
) : MessageLike
|
||||
object RoomEncrypted : MessageLike
|
||||
data object RoomEncrypted : MessageLike
|
||||
data class RoomMessage(
|
||||
val senderId: UserId,
|
||||
val messageType: MessageType
|
||||
) : MessageLike
|
||||
object RoomRedaction : MessageLike
|
||||
object Sticker : MessageLike
|
||||
data object RoomRedaction : MessageLike
|
||||
data object Sticker : MessageLike
|
||||
}
|
||||
|
||||
sealed interface StateEvent : NotificationContent {
|
||||
object PolicyRuleRoom : StateEvent
|
||||
object PolicyRuleServer : StateEvent
|
||||
object PolicyRuleUser : StateEvent
|
||||
object RoomAliases : StateEvent
|
||||
object RoomAvatar : StateEvent
|
||||
object RoomCanonicalAlias : StateEvent
|
||||
object RoomCreate : StateEvent
|
||||
object RoomEncryption : StateEvent
|
||||
object RoomGuestAccess : StateEvent
|
||||
object RoomHistoryVisibility : StateEvent
|
||||
object RoomJoinRules : StateEvent
|
||||
data object PolicyRuleRoom : StateEvent
|
||||
data object PolicyRuleServer : StateEvent
|
||||
data object PolicyRuleUser : StateEvent
|
||||
data object RoomAliases : StateEvent
|
||||
data object RoomAvatar : StateEvent
|
||||
data object RoomCanonicalAlias : StateEvent
|
||||
data object RoomCreate : StateEvent
|
||||
data object RoomEncryption : StateEvent
|
||||
data object RoomGuestAccess : StateEvent
|
||||
data object RoomHistoryVisibility : StateEvent
|
||||
data object RoomJoinRules : StateEvent
|
||||
data class RoomMemberContent(
|
||||
val userId: String,
|
||||
val membershipState: RoomMembershipState
|
||||
) : StateEvent
|
||||
object RoomName : StateEvent
|
||||
object RoomPinnedEvents : StateEvent
|
||||
object RoomPowerLevels : StateEvent
|
||||
object RoomServerAcl : StateEvent
|
||||
object RoomThirdPartyInvite : StateEvent
|
||||
object RoomTombstone : StateEvent
|
||||
object RoomTopic : StateEvent
|
||||
object SpaceChild : StateEvent
|
||||
object SpaceParent : StateEvent
|
||||
data object RoomName : StateEvent
|
||||
data object RoomPinnedEvents : StateEvent
|
||||
data object RoomPowerLevels : StateEvent
|
||||
data object RoomServerAcl : StateEvent
|
||||
data object RoomThirdPartyInvite : StateEvent
|
||||
data object RoomTombstone : StateEvent
|
||||
data object RoomTopic : StateEvent
|
||||
data object SpaceChild : StateEvent
|
||||
data object SpaceParent : StateEvent
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ object PermalinkBuilder {
|
||||
}
|
||||
|
||||
sealed class PermalinkBuilderError : Throwable() {
|
||||
object InvalidRoomAlias : PermalinkBuilderError()
|
||||
object InvalidRoomId : PermalinkBuilderError()
|
||||
object InvalidUserId : PermalinkBuilderError()
|
||||
data object InvalidRoomAlias : PermalinkBuilderError()
|
||||
data object InvalidRoomId : PermalinkBuilderError()
|
||||
data object InvalidUserId : PermalinkBuilderError()
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
package io.element.android.libraries.matrix.api.room
|
||||
|
||||
sealed interface MatrixRoomMembersState {
|
||||
object Unknown : MatrixRoomMembersState
|
||||
data object Unknown : MatrixRoomMembersState
|
||||
data class Pending(val prevRoomMembers: List<RoomMember>? = null) : MatrixRoomMembersState
|
||||
data class Error(val failure: Throwable, val prevRoomMembers: List<RoomMember>? = null) : MatrixRoomMembersState
|
||||
data class Ready(val roomMembers: List<RoomMember>) : MatrixRoomMembersState
|
||||
|
||||
@@ -29,7 +29,7 @@ import kotlin.time.Duration
|
||||
*/
|
||||
interface RoomList {
|
||||
sealed class LoadingState {
|
||||
object NotLoaded : LoadingState()
|
||||
data object NotLoaded : LoadingState()
|
||||
data class Loaded(val numberOfRooms: Int) : LoadingState()
|
||||
}
|
||||
|
||||
|
||||
@@ -26,10 +26,10 @@ import kotlinx.coroutines.flow.StateFlow
|
||||
interface RoomListService {
|
||||
|
||||
sealed class State {
|
||||
object Idle : State()
|
||||
object Running : State()
|
||||
object Error : State()
|
||||
object Terminated : State()
|
||||
data object Idle : State()
|
||||
data object Running : State()
|
||||
data object Error : State()
|
||||
data object Terminated : State()
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,6 +28,6 @@ sealed interface MatrixTimelineItem {
|
||||
}
|
||||
|
||||
data class Virtual(val uniqueId: Long, val virtual: VirtualTimelineItem) : MatrixTimelineItem
|
||||
object Other : MatrixTimelineItem
|
||||
data object Other : MatrixTimelineItem
|
||||
}
|
||||
|
||||
|
||||
@@ -17,5 +17,5 @@
|
||||
package io.element.android.libraries.matrix.api.timeline
|
||||
|
||||
sealed class TimelineException : Exception() {
|
||||
object CannotPaginate : TimelineException()
|
||||
data object CannotPaginate : TimelineException()
|
||||
}
|
||||
|
||||
@@ -35,13 +35,12 @@ data class MessageContent(
|
||||
val type: MessageType?
|
||||
) : EventContent
|
||||
|
||||
|
||||
sealed interface InReplyTo {
|
||||
/** The event details are not loaded yet. We can fetch them. */
|
||||
data class NotLoaded(val eventId: EventId) : InReplyTo
|
||||
|
||||
/** The event details are pending to be fetched. We should **not** fetch them again. */
|
||||
object Pending : InReplyTo
|
||||
data object Pending : InReplyTo
|
||||
|
||||
/** The event details are available. */
|
||||
data class Ready(
|
||||
@@ -60,7 +59,7 @@ sealed interface InReplyTo {
|
||||
* If the reason for the failure is consistent on the server, we'd enter a loop
|
||||
* where we keep trying to fetch the same event.
|
||||
* */
|
||||
object Error : InReplyTo
|
||||
data object Error : InReplyTo
|
||||
}
|
||||
|
||||
object RedactedContent : EventContent
|
||||
@@ -92,7 +91,7 @@ data class UnableToDecryptContent(
|
||||
val sessionId: String
|
||||
) : Data
|
||||
|
||||
object Unknown : Data
|
||||
data object Unknown : Data
|
||||
}
|
||||
}
|
||||
|
||||
@@ -205,55 +204,25 @@ enum class MembershipChange {
|
||||
}
|
||||
|
||||
sealed interface OtherState {
|
||||
object PolicyRuleRoom : OtherState
|
||||
|
||||
object PolicyRuleServer : OtherState
|
||||
|
||||
object PolicyRuleUser : OtherState
|
||||
|
||||
object RoomAliases : OtherState
|
||||
|
||||
data class RoomAvatar(
|
||||
val url: String?
|
||||
) : OtherState
|
||||
|
||||
object RoomCanonicalAlias : OtherState
|
||||
|
||||
object RoomCreate : OtherState
|
||||
|
||||
object RoomEncryption : OtherState
|
||||
|
||||
object RoomGuestAccess : OtherState
|
||||
|
||||
object RoomHistoryVisibility : OtherState
|
||||
|
||||
object RoomJoinRules : OtherState
|
||||
|
||||
data class RoomName(
|
||||
val name: String?
|
||||
) : OtherState
|
||||
|
||||
object RoomPinnedEvents : OtherState
|
||||
|
||||
object RoomPowerLevels : OtherState
|
||||
|
||||
object RoomServerAcl : OtherState
|
||||
|
||||
data class RoomThirdPartyInvite(
|
||||
val displayName: String?
|
||||
) : OtherState
|
||||
|
||||
object RoomTombstone : OtherState
|
||||
|
||||
data class RoomTopic(
|
||||
val topic: String?
|
||||
) : OtherState
|
||||
|
||||
object SpaceChild : OtherState
|
||||
|
||||
object SpaceParent : OtherState
|
||||
|
||||
data class Custom(
|
||||
val eventType: String
|
||||
) : OtherState
|
||||
data object PolicyRuleRoom : OtherState
|
||||
data object PolicyRuleServer : OtherState
|
||||
data object PolicyRuleUser : OtherState
|
||||
data object RoomAliases : OtherState
|
||||
data class RoomAvatar(val url: String?) : OtherState
|
||||
data object RoomCanonicalAlias : OtherState
|
||||
data object RoomCreate : OtherState
|
||||
data object RoomEncryption : OtherState
|
||||
data object RoomGuestAccess : OtherState
|
||||
data object RoomHistoryVisibility : OtherState
|
||||
data object RoomJoinRules : OtherState
|
||||
data class RoomName(val name: String?) : OtherState
|
||||
data object RoomPinnedEvents : OtherState
|
||||
data object RoomPowerLevels : OtherState
|
||||
data object RoomServerAcl : OtherState
|
||||
data class RoomThirdPartyInvite(val displayName: String?) : OtherState
|
||||
data object RoomTombstone : OtherState
|
||||
data class RoomTopic(val topic: String?) : OtherState
|
||||
data object SpaceChild : OtherState
|
||||
data object SpaceParent : OtherState
|
||||
data class Custom(val eventType: String) : OtherState
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@ package io.element.android.libraries.matrix.api.timeline.item.event
|
||||
import io.element.android.libraries.matrix.api.core.EventId
|
||||
|
||||
sealed interface LocalEventSendState {
|
||||
object NotSentYet : LocalEventSendState
|
||||
object Canceled : LocalEventSendState
|
||||
data object NotSentYet : LocalEventSendState
|
||||
data object Canceled : LocalEventSendState
|
||||
|
||||
data class SendingFailed(
|
||||
val error: String
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
package io.element.android.libraries.matrix.api.timeline.item.event
|
||||
|
||||
sealed interface ProfileTimelineDetails {
|
||||
object Unavailable : ProfileTimelineDetails
|
||||
data object Unavailable : ProfileTimelineDetails
|
||||
|
||||
object Pending : ProfileTimelineDetails
|
||||
data object Pending : ProfileTimelineDetails
|
||||
|
||||
data class Ready(
|
||||
val displayName: String?,
|
||||
|
||||
@@ -22,7 +22,7 @@ sealed interface VirtualTimelineItem {
|
||||
val timestamp: Long
|
||||
) : VirtualTimelineItem
|
||||
|
||||
object ReadMarker : VirtualTimelineItem
|
||||
data object ReadMarker : VirtualTimelineItem
|
||||
|
||||
object EncryptedHistoryBanner : VirtualTimelineItem
|
||||
data object EncryptedHistoryBanner : VirtualTimelineItem
|
||||
}
|
||||
|
||||
@@ -60,11 +60,11 @@ enum class Target(open val filter: String) {
|
||||
}
|
||||
|
||||
sealed class LogLevel(val filter: String) {
|
||||
object Warn : LogLevel("warn")
|
||||
object Trace : LogLevel("trace")
|
||||
object Info : LogLevel("info")
|
||||
object Debug : LogLevel("debug")
|
||||
object Error : LogLevel("error")
|
||||
data object Warn : LogLevel("warn")
|
||||
data object Trace : LogLevel("trace")
|
||||
data object Info : LogLevel("info")
|
||||
data object Debug : LogLevel("debug")
|
||||
data object Error : LogLevel("error")
|
||||
}
|
||||
|
||||
object TracingFilterConfigurations {
|
||||
|
||||
@@ -17,6 +17,6 @@
|
||||
package io.element.android.libraries.matrix.api.tracing
|
||||
|
||||
sealed class WriteToFilesConfiguration {
|
||||
object Disabled : WriteToFilesConfiguration()
|
||||
data object Disabled : WriteToFilesConfiguration()
|
||||
data class Enabled(val directory: String, val filenamePrefix: String) : WriteToFilesConfiguration()
|
||||
}
|
||||
|
||||
@@ -71,35 +71,35 @@ interface SessionVerificationService {
|
||||
/** Verification status of the current session. */
|
||||
sealed interface SessionVerifiedStatus {
|
||||
/** Unknown status, we couldn't read the actual value from the SDK. */
|
||||
object Unknown : SessionVerifiedStatus
|
||||
data object Unknown : SessionVerifiedStatus
|
||||
|
||||
/** Not verified session status. */
|
||||
object NotVerified : SessionVerifiedStatus
|
||||
data object NotVerified : SessionVerifiedStatus
|
||||
|
||||
/** Verified session status. */
|
||||
object Verified : SessionVerifiedStatus
|
||||
data object Verified : SessionVerifiedStatus
|
||||
}
|
||||
|
||||
/** States produced by the [SessionVerificationService]. */
|
||||
sealed interface VerificationFlowState {
|
||||
/** Initial state. */
|
||||
object Initial : VerificationFlowState
|
||||
data object Initial : VerificationFlowState
|
||||
|
||||
/** Session verification request was accepted by another device. */
|
||||
object AcceptedVerificationRequest : VerificationFlowState
|
||||
data object AcceptedVerificationRequest : VerificationFlowState
|
||||
|
||||
/** Short Authentication String (SAS) verification started between the 2 devices. */
|
||||
object StartedSasVerification : VerificationFlowState
|
||||
data object StartedSasVerification : VerificationFlowState
|
||||
|
||||
/** Verification data for the SAS verification (emojis) received. */
|
||||
data class ReceivedVerificationData(val emoji: List<VerificationEmoji>) : VerificationFlowState
|
||||
|
||||
/** Verification completed successfully. */
|
||||
object Finished : VerificationFlowState
|
||||
data object Finished : VerificationFlowState
|
||||
|
||||
/** Verification was cancelled by either device. */
|
||||
object Canceled : VerificationFlowState
|
||||
data object Canceled : VerificationFlowState
|
||||
|
||||
/** Verification failed with an error. */
|
||||
object Failed : VerificationFlowState
|
||||
data object Failed : VerificationFlowState
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ sealed class AvatarAction(
|
||||
val icon: ImageVector,
|
||||
val destructive: Boolean = false,
|
||||
) {
|
||||
object TakePhoto : AvatarAction(titleResId = CommonStrings.action_take_photo, icon = Icons.Outlined.PhotoCamera)
|
||||
object ChoosePhoto : AvatarAction(titleResId = CommonStrings.action_choose_photo, icon = Icons.Outlined.PhotoLibrary)
|
||||
object Remove : AvatarAction(titleResId = CommonStrings.action_remove, icon = Icons.Outlined.Delete, destructive = true)
|
||||
data object TakePhoto : AvatarAction(titleResId = CommonStrings.action_take_photo, icon = Icons.Outlined.PhotoCamera)
|
||||
data object ChoosePhoto : AvatarAction(titleResId = CommonStrings.action_choose_photo, icon = Icons.Outlined.PhotoLibrary)
|
||||
data object Remove : AvatarAction(titleResId = CommonStrings.action_remove, icon = Icons.Outlined.Delete, destructive = true)
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ data class MediaRequestData(
|
||||
) {
|
||||
|
||||
sealed interface Kind {
|
||||
object Content : Kind
|
||||
data object Content : Kind
|
||||
data class File(val body: String?, val mimeType: String) : Kind
|
||||
data class Thumbnail(val width: Long, val height: Long) : Kind {
|
||||
constructor(size: Long) : this(size, size)
|
||||
|
||||
@@ -26,14 +26,14 @@ sealed interface PickerType<Input, Output> {
|
||||
fun getContract(): ActivityResultContract<Input, Output>
|
||||
fun getDefaultRequest(): Input
|
||||
|
||||
object Image : PickerType<PickVisualMediaRequest, Uri?> {
|
||||
data object Image : PickerType<PickVisualMediaRequest, Uri?> {
|
||||
override fun getContract() = ActivityResultContracts.PickVisualMedia()
|
||||
override fun getDefaultRequest(): PickVisualMediaRequest {
|
||||
return PickVisualMediaRequest(ActivityResultContracts.PickVisualMedia.ImageOnly)
|
||||
}
|
||||
}
|
||||
|
||||
object ImageAndVideo : PickerType<PickVisualMediaRequest, Uri?> {
|
||||
data object ImageAndVideo : PickerType<PickVisualMediaRequest, Uri?> {
|
||||
override fun getContract() = ActivityResultContracts.PickVisualMedia()
|
||||
override fun getDefaultRequest(): PickVisualMediaRequest {
|
||||
return PickVisualMediaRequest(ActivityResultContracts.PickVisualMedia.ImageAndVideo)
|
||||
|
||||
@@ -114,7 +114,7 @@ data class ImageCompressionResult(
|
||||
)
|
||||
|
||||
sealed interface ResizeMode {
|
||||
object None : ResizeMode
|
||||
data object None : ResizeMode
|
||||
data class Approximate(val desiredWidth: Int, val desiredHeight: Int) : ResizeMode
|
||||
data class Strict(val maxWidth: Int, val maxHeight: Int) : ResizeMode
|
||||
}
|
||||
|
||||
@@ -17,6 +17,6 @@
|
||||
package io.element.android.libraries.permissions.api
|
||||
|
||||
sealed interface PermissionsEvents {
|
||||
object OpenSystemDialog : PermissionsEvents
|
||||
object CloseDialog : PermissionsEvents
|
||||
data object OpenSystemDialog : PermissionsEvents
|
||||
data object CloseDialog : PermissionsEvents
|
||||
}
|
||||
|
||||
@@ -17,5 +17,5 @@
|
||||
package io.element.android.libraries.push.api.gateway
|
||||
|
||||
sealed class PushGatewayFailure : Throwable(cause = null) {
|
||||
object PusherRejected : PushGatewayFailure()
|
||||
data object PusherRejected : PushGatewayFailure()
|
||||
}
|
||||
|
||||
@@ -166,6 +166,6 @@ sealed interface OneShotNotification {
|
||||
}
|
||||
|
||||
sealed interface SummaryNotification {
|
||||
object Removed : SummaryNotification
|
||||
data object Removed : SummaryNotification
|
||||
data class Update(val notification: Notification) : SummaryNotification
|
||||
}
|
||||
|
||||
@@ -31,9 +31,9 @@ class RegisterUnifiedPushUseCase @Inject constructor(
|
||||
) {
|
||||
|
||||
sealed interface RegisterUnifiedPushResult {
|
||||
object Success : RegisterUnifiedPushResult
|
||||
object NeedToAskUserForDistributor : RegisterUnifiedPushResult
|
||||
object Error : RegisterUnifiedPushResult
|
||||
data object Success : RegisterUnifiedPushResult
|
||||
data object NeedToAskUserForDistributor : RegisterUnifiedPushResult
|
||||
data object Error : RegisterUnifiedPushResult
|
||||
}
|
||||
|
||||
suspend fun execute(matrixClient: MatrixClient, distributor: Distributor, clientSecret: String): RegisterUnifiedPushResult {
|
||||
|
||||
@@ -17,13 +17,11 @@
|
||||
package io.element.android.services.apperror.api
|
||||
|
||||
sealed interface AppErrorState {
|
||||
|
||||
object NoError : AppErrorState
|
||||
data object NoError : AppErrorState
|
||||
|
||||
data class Error(
|
||||
val title: String,
|
||||
val body: String,
|
||||
val dismiss: () -> Unit,
|
||||
) : AppErrorState
|
||||
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ import io.element.android.libraries.matrix.api.core.ThreadId
|
||||
* So we assume if we don't get the same owner, we can skip the onLeaving action as we already replaced it.
|
||||
*/
|
||||
sealed class NavigationState(open val owner: String) {
|
||||
object Root : NavigationState("ROOT")
|
||||
data object Root : NavigationState("ROOT")
|
||||
|
||||
data class Session(
|
||||
override val owner: String,
|
||||
|
||||
Reference in New Issue
Block a user