diff --git a/app/src/main/java/com/nextcloud/talk/polls/adapters/PollResultHeaderViewHolder.kt b/app/src/main/java/com/nextcloud/talk/polls/adapters/PollResultHeaderViewHolder.kt index 6f780e64c..b963f515d 100644 --- a/app/src/main/java/com/nextcloud/talk/polls/adapters/PollResultHeaderViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/polls/adapters/PollResultHeaderViewHolder.kt @@ -32,7 +32,7 @@ class PollResultHeaderViewHolder( override fun bind(pollResultItem: PollResultItem, clickListener: PollResultItemClickListener) { val item = pollResultItem as PollResultHeaderItem - binding.root.setOnClickListener { clickListener.onClick(pollResultItem) } + binding.root.setOnClickListener { clickListener.onClick() } binding.pollOptionText.text = item.name binding.pollOptionPercentText.text = "${item.percent}%" diff --git a/app/src/main/java/com/nextcloud/talk/polls/adapters/PollResultItemClickListener.kt b/app/src/main/java/com/nextcloud/talk/polls/adapters/PollResultItemClickListener.kt index f5e5b1267..d0a15156e 100644 --- a/app/src/main/java/com/nextcloud/talk/polls/adapters/PollResultItemClickListener.kt +++ b/app/src/main/java/com/nextcloud/talk/polls/adapters/PollResultItemClickListener.kt @@ -21,5 +21,5 @@ package com.nextcloud.talk.polls.adapters interface PollResultItemClickListener { - fun onClick(pollResultHeaderItem: PollResultHeaderItem) + fun onClick() } diff --git a/app/src/main/java/com/nextcloud/talk/polls/adapters/PollResultVoterViewHolder.kt b/app/src/main/java/com/nextcloud/talk/polls/adapters/PollResultVoterViewHolder.kt index 756887c4b..543591302 100644 --- a/app/src/main/java/com/nextcloud/talk/polls/adapters/PollResultVoterViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/polls/adapters/PollResultVoterViewHolder.kt @@ -40,6 +40,9 @@ class PollResultVoterViewHolder( @SuppressLint("SetTextI18n") override fun bind(pollResultItem: PollResultItem, clickListener: PollResultItemClickListener) { val item = pollResultItem as PollResultVoterItem + + binding.root.setOnClickListener { clickListener.onClick() } + binding.pollVoterName.text = item.details.actorDisplayName binding.pollVoterAvatar.controller = getAvatarDraweeController(item.details) } diff --git a/app/src/main/java/com/nextcloud/talk/polls/adapters/PollResultVotersOverviewViewHolder.kt b/app/src/main/java/com/nextcloud/talk/polls/adapters/PollResultVotersOverviewViewHolder.kt index c421ef80b..8e2f0206a 100644 --- a/app/src/main/java/com/nextcloud/talk/polls/adapters/PollResultVotersOverviewViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/polls/adapters/PollResultVotersOverviewViewHolder.kt @@ -44,6 +44,8 @@ class PollResultVotersOverviewViewHolder( override fun bind(pollResultItem: PollResultItem, clickListener: PollResultItemClickListener) { val item = pollResultItem as PollResultVotersOverviewItem + binding.root.setOnClickListener { clickListener.onClick() } + val lp = LinearLayout.LayoutParams( AVATAR_WIDTH, AVATAR_HEIGHT diff --git a/app/src/main/java/com/nextcloud/talk/polls/ui/PollResultsFragment.kt b/app/src/main/java/com/nextcloud/talk/polls/ui/PollResultsFragment.kt index 578a7d648..8945483e4 100644 --- a/app/src/main/java/com/nextcloud/talk/polls/ui/PollResultsFragment.kt +++ b/app/src/main/java/com/nextcloud/talk/polls/ui/PollResultsFragment.kt @@ -34,7 +34,6 @@ import autodagger.AutoInjector import com.nextcloud.talk.R import com.nextcloud.talk.application.NextcloudTalkApplication import com.nextcloud.talk.databinding.DialogPollResultsBinding -import com.nextcloud.talk.polls.adapters.PollResultHeaderItem import com.nextcloud.talk.polls.adapters.PollResultItemClickListener import com.nextcloud.talk.polls.adapters.PollResultsAdapter import com.nextcloud.talk.polls.viewmodels.PollMainViewModel @@ -127,7 +126,7 @@ class PollResultsFragment : Fragment(), PollResultItemClickListener { } } - override fun onClick(pollResultHeaderItem: PollResultHeaderItem) { + override fun onClick() { viewModel.toggleDetails() }