mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 21:32:34 +00:00
Merge
This commit is contained in:
+7
@@ -11,6 +11,13 @@ package io.element.android.features.poll.api.actions
|
||||
import io.element.android.libraries.matrix.api.core.EventId
|
||||
import io.element.android.libraries.matrix.api.timeline.Timeline
|
||||
|
||||
/**
|
||||
* Closes a poll so no further answers are accepted, wrapping the timeline call so the analytics are captured in one place.
|
||||
*/
|
||||
interface EndPollAction {
|
||||
/**
|
||||
* @param timeline the timeline the poll lives in.
|
||||
* @param pollStartId the poll start event to close.
|
||||
*/
|
||||
suspend fun execute(timeline: Timeline, pollStartId: EventId): Result<Unit>
|
||||
}
|
||||
|
||||
+8
@@ -11,7 +11,15 @@ package io.element.android.features.poll.api.actions
|
||||
import io.element.android.libraries.matrix.api.core.EventId
|
||||
import io.element.android.libraries.matrix.api.timeline.Timeline
|
||||
|
||||
/**
|
||||
* Sends the current user's answer to a poll, wrapping the timeline call so the analytics are captured in one place.
|
||||
*/
|
||||
interface SendPollResponseAction {
|
||||
/**
|
||||
* @param timeline the timeline the poll lives in.
|
||||
* @param pollStartId the poll start event being answered.
|
||||
* @param answerId the id of the chosen answer.
|
||||
*/
|
||||
suspend fun execute(
|
||||
timeline: Timeline,
|
||||
pollStartId: EventId,
|
||||
|
||||
+16
@@ -12,7 +12,16 @@ import io.element.android.libraries.matrix.api.core.EventId
|
||||
import io.element.android.libraries.matrix.api.timeline.item.event.EventTimelineItem
|
||||
import io.element.android.libraries.matrix.api.timeline.item.event.PollContent
|
||||
|
||||
/**
|
||||
* Turns the poll content of a timeline event into the state the poll UI renders.
|
||||
*/
|
||||
interface PollContentStateFactory {
|
||||
/**
|
||||
* Convenience overload that reads the editability and ownership from the timeline item itself.
|
||||
*
|
||||
* @param eventTimelineItem the timeline item carrying the poll.
|
||||
* @param content the poll content of that item.
|
||||
*/
|
||||
suspend fun create(eventTimelineItem: EventTimelineItem, content: PollContent): PollContentState {
|
||||
return create(
|
||||
eventId = eventTimelineItem.eventId,
|
||||
@@ -21,5 +30,12 @@ interface PollContentStateFactory {
|
||||
content = content,
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* @param eventId the poll start event, or `null` while the poll is still a local echo.
|
||||
* @param isEditable whether the current user may still edit the poll.
|
||||
* @param isOwn whether the poll was created by the current user.
|
||||
* @param content the poll question, answers and votes.
|
||||
*/
|
||||
suspend fun create(eventId: EventId?, isEditable: Boolean, isOwn: Boolean, content: PollContent): PollContentState
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<plurals name="a11y_polls_percent_of_total">
|
||||
<item quantity="zero">"%1$d بالمئة من إجمالي الأصوات"</item>
|
||||
<item quantity="one">"%1$d بالمئة من إجمالي الأصوات"</item>
|
||||
<item quantity="two">"%1$d بالمئة من إجمالي الأصوات"</item>
|
||||
<item quantity="few">"%1$d بالمئة من إجمالي الأصوات"</item>
|
||||
<item quantity="many">"%1$d بالمئة من إجمالي الأصوات"</item>
|
||||
<item quantity="other">"%1$d بالمئة من إجمالي الأصوات"</item>
|
||||
</plurals>
|
||||
<string name="a11y_polls_will_remove_selection">"ٍسيتم حذف الإختيار السابق"</string>
|
||||
<string name="a11y_polls_winning_answer">"هذه هي الإجابة الفائزة"</string>
|
||||
</resources>
|
||||
@@ -1,4 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<plurals name="a11y_polls_percent_of_total">
|
||||
<item quantity="one">"%1$d por ciento de todos los votos"</item>
|
||||
<item quantity="other">"%1$d por ciento de todos los votos"</item>
|
||||
</plurals>
|
||||
<string name="a11y_polls_will_remove_selection">"Eliminará la selección anterior"</string>
|
||||
<string name="a11y_polls_winning_answer">"Esta es la respuesta ganadora"</string>
|
||||
</resources>
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<plurals name="a11y_polls_percent_of_total">
|
||||
<item quantity="one">"درصد %1$d از کل آرا"</item>
|
||||
<item quantity="other">"درصد %1$d از کل آرا"</item>
|
||||
</plurals>
|
||||
<string name="a11y_polls_will_remove_selection">"گزینش پیشین را برخواهد داشت"</string>
|
||||
<string name="a11y_polls_winning_answer">"این پاسخ برنده است"</string>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user