diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/item/MessagePollItem.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/item/MessagePollItem.kt index ddae2ed1f5..9175af1d43 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/item/MessagePollItem.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/item/MessagePollItem.kt @@ -17,6 +17,7 @@ package im.vector.riotx.features.home.room.detail.timeline.item import android.view.View +import android.view.ViewGroup import android.widget.Button import android.widget.TextView import androidx.core.view.isVisible @@ -70,6 +71,7 @@ abstract class MessagePollItem : AbsMessageItem() { if (!iHaveVoted) { // Show buttons if i have not voted + holder.resultWrapper.isVisible = false optionsContent?.options?.forEachIndexed { index, item -> if (index < buttons.size) { buttons[index].let { @@ -79,6 +81,7 @@ abstract class MessagePollItem : AbsMessageItem() { } } } else { + holder.resultWrapper.isVisible = true val maxCount = votes?.maxBy { it.value }?.value ?: 0 optionsContent?.options?.forEachIndexed { index, item -> if (index < resultLines.size) { @@ -131,6 +134,8 @@ abstract class MessagePollItem : AbsMessageItem() { val labelText by bind(R.id.pollLabelText) val infoText by bind(R.id.pollInfosText) + val resultWrapper by bind(R.id.pollResultsWrapper) + override fun bindView(itemView: View) { super.bindView(itemView) val buttons = listOf(button1, button2, button3, button4, button5) diff --git a/vector/src/main/res/layout/item_timeline_event_poll_result_item.xml b/vector/src/main/res/layout/item_timeline_event_poll_result_item.xml index a65c709d9a..a7b16fee54 100644 --- a/vector/src/main/res/layout/item_timeline_event_poll_result_item.xml +++ b/vector/src/main/res/layout/item_timeline_event_poll_result_item.xml @@ -8,14 +8,14 @@ + android:tint="?riotx_text_secondary" /> - - + android:layout_height="wrap_content" + android:background="@drawable/bg_attachment_type_selector" + android:orientation="vertical" + android:paddingStart="8dp" + android:paddingEnd="8dp"> - + - + - + + + + + +