Remove default values for InvitableUser's constructor
This commit is contained in:
parent
590c9fa6f5
commit
e74fcde43e
2 changed files with 26 additions and 12 deletions
|
|
@ -33,11 +33,11 @@ internal class DefaultInvitePeopleStateProvider : PreviewParameterProvider<Defau
|
||||||
),
|
),
|
||||||
searchResults = SearchBarResultState.Results(
|
searchResults = SearchBarResultState.Results(
|
||||||
persistentListOf(
|
persistentListOf(
|
||||||
InvitableUser(aMatrixUser("@alice:server.org")),
|
anInvitableUser(aMatrixUser("@alice:server.org")),
|
||||||
InvitableUser(aMatrixUser("@bob:server.org", "Bob")),
|
anInvitableUser(aMatrixUser("@bob:server.org", "Bob")),
|
||||||
InvitableUser(aMatrixUser("@carol:server.org", "Carol"), isSelected = true),
|
anInvitableUser(aMatrixUser("@carol:server.org", "Carol"), isSelected = true),
|
||||||
InvitableUser(aMatrixUser("@eve:server.org", "Eve"), isSelected = true, isAlreadyJoined = true),
|
anInvitableUser(aMatrixUser("@eve:server.org", "Eve"), isSelected = true, isAlreadyJoined = true),
|
||||||
InvitableUser(aMatrixUser("@justin:server.org", "Justin"), isSelected = true, isAlreadyInvited = true),
|
anInvitableUser(aMatrixUser("@justin:server.org", "Justin"), isSelected = true, isAlreadyInvited = true),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|
@ -50,8 +50,8 @@ internal class DefaultInvitePeopleStateProvider : PreviewParameterProvider<Defau
|
||||||
),
|
),
|
||||||
searchResults = SearchBarResultState.Results(
|
searchResults = SearchBarResultState.Results(
|
||||||
persistentListOf(
|
persistentListOf(
|
||||||
InvitableUser(aMatrixUser("@alice:server.org"), isUnresolved = true),
|
anInvitableUser(aMatrixUser("@alice:server.org"), isUnresolved = true),
|
||||||
InvitableUser(aMatrixUser("@bob:server.org", "Bob")),
|
anInvitableUser(aMatrixUser("@bob:server.org", "Bob")),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|
@ -61,7 +61,7 @@ internal class DefaultInvitePeopleStateProvider : PreviewParameterProvider<Defau
|
||||||
searchQuery = "@alice:server.org",
|
searchQuery = "@alice:server.org",
|
||||||
searchResults = SearchBarResultState.Results(
|
searchResults = SearchBarResultState.Results(
|
||||||
persistentListOf(
|
persistentListOf(
|
||||||
InvitableUser(aMatrixUser("@alice:server.org"), isUnresolved = true),
|
anInvitableUser(aMatrixUser("@alice:server.org"), isUnresolved = true),
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
showSearchLoader = true,
|
showSearchLoader = true,
|
||||||
|
|
@ -69,6 +69,20 @@ internal class DefaultInvitePeopleStateProvider : PreviewParameterProvider<Defau
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun anInvitableUser(
|
||||||
|
matrixUser: MatrixUser,
|
||||||
|
isSelected: Boolean = false,
|
||||||
|
isAlreadyJoined: Boolean = false,
|
||||||
|
isAlreadyInvited: Boolean = false,
|
||||||
|
isUnresolved: Boolean = false,
|
||||||
|
) = InvitableUser(
|
||||||
|
matrixUser = matrixUser,
|
||||||
|
isSelected = isSelected,
|
||||||
|
isAlreadyJoined = isAlreadyJoined,
|
||||||
|
isAlreadyInvited = isAlreadyInvited,
|
||||||
|
isUnresolved = isUnresolved,
|
||||||
|
)
|
||||||
|
|
||||||
private fun aDefaultInvitePeopleState(
|
private fun aDefaultInvitePeopleState(
|
||||||
canInvite: Boolean = false,
|
canInvite: Boolean = false,
|
||||||
searchQuery: String = "",
|
searchQuery: String = "",
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,8 @@ import io.element.android.libraries.matrix.api.user.MatrixUser
|
||||||
|
|
||||||
data class InvitableUser(
|
data class InvitableUser(
|
||||||
val matrixUser: MatrixUser,
|
val matrixUser: MatrixUser,
|
||||||
val isSelected: Boolean = false,
|
val isSelected: Boolean,
|
||||||
val isAlreadyJoined: Boolean = false,
|
val isAlreadyJoined: Boolean,
|
||||||
val isAlreadyInvited: Boolean = false,
|
val isAlreadyInvited: Boolean,
|
||||||
val isUnresolved: Boolean = false,
|
val isUnresolved: Boolean,
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue