mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-22 13:09:46 +01:00
fix text of submit button
+ rename variables Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
385d5ccd4a
commit
c848659fda
@ -126,21 +126,21 @@ class PollMainViewModel @Inject constructor(private val repository: PollReposito
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onError(e: Throwable) {
|
override fun onError(e: Throwable) {
|
||||||
Log.d(TAG, "An error occurred: $e")
|
Log.e(TAG, "An error occurred: $e")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onComplete() {
|
override fun onComplete() {
|
||||||
val showCloseButton = poll.status == Poll.STATUS_OPEN && isPollCreatedByCurrentUser(poll)
|
val showEndPollButton = poll.status == Poll.STATUS_OPEN && isPollCreatedByCurrentUser(poll)
|
||||||
|
|
||||||
if (votedForOpenHiddenPoll(poll)) {
|
if (votedForOpenHiddenPoll(poll)) {
|
||||||
_viewState.value = PollVoteHiddenState(poll, showCloseButton)
|
_viewState.value = PollVoteHiddenState(poll, showEndPollButton)
|
||||||
} else if (editPoll && poll.status == Poll.STATUS_OPEN) {
|
} else if (editPoll && poll.status == Poll.STATUS_OPEN) {
|
||||||
_viewState.value = PollVoteState(poll, showCloseButton)
|
_viewState.value = PollVoteState(poll, showEndPollButton)
|
||||||
editPoll = false
|
editPoll = false
|
||||||
} else if (poll.status == Poll.STATUS_CLOSED || poll.votedSelf?.isNotEmpty() == true) {
|
} else if (poll.status == Poll.STATUS_CLOSED || poll.votedSelf?.isNotEmpty() == true) {
|
||||||
setPollResultState(poll)
|
setPollResultState(poll)
|
||||||
} else if (poll.votedSelf.isNullOrEmpty()) {
|
} else if (poll.votedSelf.isNullOrEmpty()) {
|
||||||
_viewState.value = PollVoteState(poll, showCloseButton)
|
_viewState.value = PollVoteState(poll, showEndPollButton)
|
||||||
} else {
|
} else {
|
||||||
Log.w(TAG, "unknown poll state")
|
Log.w(TAG, "unknown poll state")
|
||||||
}
|
}
|
||||||
@ -149,9 +149,9 @@ class PollMainViewModel @Inject constructor(private val repository: PollReposito
|
|||||||
|
|
||||||
private fun setPollResultState(poll: Poll) {
|
private fun setPollResultState(poll: Poll) {
|
||||||
val showEditButton = poll.status == Poll.STATUS_OPEN && poll.resultMode == Poll.RESULT_MODE_PUBLIC
|
val showEditButton = poll.status == Poll.STATUS_OPEN && poll.resultMode == Poll.RESULT_MODE_PUBLIC
|
||||||
val showCloseButton = poll.status == Poll.STATUS_OPEN && isPollCreatedByCurrentUser(poll)
|
val showEndPollButton = poll.status == Poll.STATUS_OPEN && isPollCreatedByCurrentUser(poll)
|
||||||
|
|
||||||
_viewState.value = PollResultState(poll, showEditButton, showCloseButton)
|
_viewState.value = PollResultState(poll, showEditButton, showEndPollButton)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun votedForOpenHiddenPoll(poll: Poll): Boolean {
|
private fun votedForOpenHiddenPoll(poll: Poll): Boolean {
|
||||||
|
@ -70,7 +70,7 @@
|
|||||||
android:id="@+id/poll_vote_submit_button"
|
android:id="@+id/poll_vote_submit_button"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/edit"
|
android:text="@string/nc_common_submit"
|
||||||
android:theme="@style/Button.Primary"
|
android:theme="@style/Button.Primary"
|
||||||
app:cornerRadius="@dimen/button_corner_radius" />
|
app:cornerRadius="@dimen/button_corner_radius" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
Loading…
Reference in New Issue
Block a user