mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-19 19:49:33 +01:00
fix to send votes
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
5a070f5e1b
commit
d31a9b1ade
@ -536,10 +536,11 @@ public interface NcApi {
|
||||
Observable<PollOverall> createPoll(@Header("Authorization") String authorization,
|
||||
@Url String url);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST
|
||||
Observable<PollOverall> votePoll(@Header("Authorization") String authorization,
|
||||
@Url String url,
|
||||
@Query("optionIds[]") List<Integer> optionIds);
|
||||
@Field("optionIds[]") List<Integer> optionIds);
|
||||
|
||||
@DELETE
|
||||
Observable<PollOverall> closePoll(@Header("Authorization") String authorization,
|
||||
|
@ -115,7 +115,7 @@ class PollResultsFragment(
|
||||
val oneVoteInPercent = 100 / votersAmount
|
||||
|
||||
poll.options?.forEachIndexed { index, option ->
|
||||
val votersForThisOption = poll.votes?.filter { it.value == index }?.size!!
|
||||
val votersForThisOption = poll.votes?.filter { it.key.toInt() == index }?.size!!
|
||||
val optionsPercent = oneVoteInPercent * votersForThisOption
|
||||
|
||||
val pollResultItem = PollResultItem(option, optionsPercent)
|
||||
|
@ -30,7 +30,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:layout_height="400dp"
|
||||
tools:layout_width="match_parent"></RadioGroup>
|
||||
tools:layout_width="match_parent" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/submitVote"
|
||||
|
Loading…
Reference in New Issue
Block a user