From c1ea65356112456369609710265b650f1889b30f Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 13 Dec 2021 21:02:11 +0100 Subject: [PATCH] Reorder classes so that it follows the poll status logical order --- .../timeline/item/PollOptionViewState.kt | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/PollOptionViewState.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/PollOptionViewState.kt index 07ded7c5a8..d2717bb5bd 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/PollOptionViewState.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/PollOptionViewState.kt @@ -16,7 +16,21 @@ package im.vector.app.features.home.room.detail.timeline.item -sealed class PollOptionViewState(open val id: String, open val name: String) { +sealed class PollOptionViewState(open val id: String, + open val name: String) { + /** + * Represents a poll that is not sent to the server yet. + */ + data class DisabledOptionWithInvisibleVotes(override val id: String, + override val name: String + ) : PollOptionViewState(id, name) + + /** + * Represents a poll that is sent but not voted by the user + */ + data class EnabledOptionWithInvisibleVotes(override val id: String, + override val name: String + ) : PollOptionViewState(id, name) /** * Represents a poll that user already voted. @@ -37,14 +51,4 @@ sealed class PollOptionViewState(open val id: String, open val name: String) { val votePercentage: Double, val isWinner: Boolean ) : PollOptionViewState(id, name) - - /** - * Represents a poll that is sent but not voted by the user - */ - data class EnabledOptionWithInvisibleVotes(override val id: String, override val name: String) : PollOptionViewState(id, name) - - /** - * Represents a poll that is not sent to the server yet. - */ - data class DisabledOptionWithInvisibleVotes(override val id: String, override val name: String) : PollOptionViewState(id, name) }