Adds getBestX following merge from develop
This commit is contained in:
parent
9806f1bf8f
commit
98b7d194eb
|
@ -258,9 +258,10 @@ class MessageItemFactory @Inject constructor(
|
||||||
): PollItem {
|
): PollItem {
|
||||||
val pollResponseSummary = informationData.pollResponseAggregatedSummary
|
val pollResponseSummary = informationData.pollResponseAggregatedSummary
|
||||||
val pollState = createPollState(informationData, pollResponseSummary, pollContent)
|
val pollState = createPollState(informationData, pollResponseSummary, pollContent)
|
||||||
val optionViewStates = pollContent.pollCreationInfo?.answers?.mapToOptions(pollState, informationData)
|
val pollCreationInfo = pollContent.getBestPollCreationInfo()
|
||||||
val questionText = pollContent.pollCreationInfo?.question?.question.orEmpty()
|
val questionText = pollCreationInfo?.question?.getBestQuestion().orEmpty()
|
||||||
val question = createPollQuestion(informationData, questionText, callback)
|
val question = createPollQuestion(informationData, questionText, callback)
|
||||||
|
val optionViewStates = pollCreationInfo?.answers?.mapToOptions(pollState, informationData)
|
||||||
val totalVotesText = createTotalVotesText(pollState, pollResponseSummary)
|
val totalVotesText = createTotalVotesText(pollState, pollResponseSummary)
|
||||||
|
|
||||||
return PollItem_()
|
return PollItem_()
|
||||||
|
@ -283,7 +284,7 @@ class MessageItemFactory @Inject constructor(
|
||||||
): PollState = when {
|
): PollState = when {
|
||||||
!informationData.sendState.isSent() -> Sending
|
!informationData.sendState.isSent() -> Sending
|
||||||
pollResponseSummary?.isClosed.orFalse() -> Ended
|
pollResponseSummary?.isClosed.orFalse() -> Ended
|
||||||
pollContent.pollCreationInfo?.kind == PollType.UNDISCLOSED -> Undisclosed
|
pollContent.getBestPollCreationInfo()?.kind == PollType.UNDISCLOSED -> Undisclosed
|
||||||
pollResponseSummary?.myVote?.isNotEmpty().orFalse() -> Voted(pollResponseSummary?.totalVotes ?: 0)
|
pollResponseSummary?.myVote?.isNotEmpty().orFalse() -> Voted(pollResponseSummary?.totalVotes ?: 0)
|
||||||
else -> Ready
|
else -> Ready
|
||||||
}
|
}
|
||||||
|
@ -295,7 +296,7 @@ class MessageItemFactory @Inject constructor(
|
||||||
val pollResponseSummary = informationData.pollResponseAggregatedSummary
|
val pollResponseSummary = informationData.pollResponseAggregatedSummary
|
||||||
val winnerVoteCount = pollResponseSummary?.winnerVoteCount
|
val winnerVoteCount = pollResponseSummary?.winnerVoteCount
|
||||||
val optionId = answer.id ?: ""
|
val optionId = answer.id ?: ""
|
||||||
val optionAnswer = answer.answer ?: ""
|
val optionAnswer = answer.getBestAnswer() ?: ""
|
||||||
val voteSummary = pollResponseSummary?.votes?.get(answer.id)
|
val voteSummary = pollResponseSummary?.votes?.get(answer.id)
|
||||||
val voteCount = voteSummary?.total ?: 0
|
val voteCount = voteSummary?.total ?: 0
|
||||||
val votePercentage = voteSummary?.percentage ?: 0.0
|
val votePercentage = voteSummary?.percentage ?: 0.0
|
||||||
|
|
Loading…
Reference in New Issue