Adding a description under undisclosed poll when not yet ended

This commit is contained in:
Maxime NATUREL 2022-06-30 09:58:00 +02:00
parent 8da88f9263
commit 9fb19af39c
3 changed files with 3 additions and 2 deletions

View file

@ -107,7 +107,7 @@ class PollItemViewStateFactory @Inject constructor(
): PollViewState { ): PollViewState {
return PollViewState( return PollViewState(
question = question, question = question,
totalVotes = "", totalVotes = stringProvider.getString(R.string.poll_undisclosed_not_ended),
canVote = true, canVote = true,
optionViewStates = pollCreationInfo?.answers?.map { answer -> optionViewStates = pollCreationInfo?.answers?.map { answer ->
val isMyVote = pollResponseSummary?.myVote == answer.id val isMyVote = pollResponseSummary?.myVote == answer.id

View file

@ -2980,6 +2980,7 @@
<item quantity="other">Based on %1$d votes</item> <item quantity="other">Based on %1$d votes</item>
</plurals> </plurals>
<string name="poll_no_votes_cast">No votes cast</string> <string name="poll_no_votes_cast">No votes cast</string>
<string name="poll_undisclosed_not_ended">Results will be visible when the poll is ended</string>
<plurals name="poll_total_vote_count_before_ended_and_not_voted"> <plurals name="poll_total_vote_count_before_ended_and_not_voted">
<item quantity="one">%1$d vote cast. Vote to the see the results</item> <item quantity="one">%1$d vote cast. Vote to the see the results</item>
<item quantity="other">%1$d votes cast. Vote to the see the results</item> <item quantity="other">%1$d votes cast. Vote to the see the results</item>

View file

@ -143,7 +143,7 @@ class PollItemViewStateFactoryTest {
pollViewState shouldBeEqualTo PollViewState( pollViewState shouldBeEqualTo PollViewState(
question = A_POLL_CONTENT.getBestPollCreationInfo()?.question?.getBestQuestion() ?: "", question = A_POLL_CONTENT.getBestPollCreationInfo()?.question?.getBestQuestion() ?: "",
totalVotes = "", totalVotes = stringProvider.instance.getString(R.string.poll_undisclosed_not_ended),
canVote = true, canVote = true,
optionViewStates = A_POLL_CONTENT.getBestPollCreationInfo()?.answers?.map { answer -> optionViewStates = A_POLL_CONTENT.getBestPollCreationInfo()?.answers?.map { answer ->
PollOptionViewState.PollUndisclosed( PollOptionViewState.PollUndisclosed(