mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 12:09:45 +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,
|
Observable<PollOverall> createPoll(@Header("Authorization") String authorization,
|
||||||
@Url String url);
|
@Url String url);
|
||||||
|
|
||||||
|
@FormUrlEncoded
|
||||||
@POST
|
@POST
|
||||||
Observable<PollOverall> votePoll(@Header("Authorization") String authorization,
|
Observable<PollOverall> votePoll(@Header("Authorization") String authorization,
|
||||||
@Url String url,
|
@Url String url,
|
||||||
@Query("optionIds[]") List<Integer> optionIds);
|
@Field("optionIds[]") List<Integer> optionIds);
|
||||||
|
|
||||||
@DELETE
|
@DELETE
|
||||||
Observable<PollOverall> closePoll(@Header("Authorization") String authorization,
|
Observable<PollOverall> closePoll(@Header("Authorization") String authorization,
|
||||||
|
@ -115,7 +115,7 @@ class PollResultsFragment(
|
|||||||
val oneVoteInPercent = 100 / votersAmount
|
val oneVoteInPercent = 100 / votersAmount
|
||||||
|
|
||||||
poll.options?.forEachIndexed { index, option ->
|
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 optionsPercent = oneVoteInPercent * votersForThisOption
|
||||||
|
|
||||||
val pollResultItem = PollResultItem(option, optionsPercent)
|
val pollResultItem = PollResultItem(option, optionsPercent)
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
tools:layout_height="400dp"
|
tools:layout_height="400dp"
|
||||||
tools:layout_width="match_parent"></RadioGroup>
|
tools:layout_width="match_parent" />
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/submitVote"
|
android:id="@+id/submitVote"
|
||||||
|
Loading…
Reference in New Issue
Block a user