mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-28 01:24:03 +03:00
toggle details view on click on avatar views
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
20dabf3a72
commit
64412a1876
5 changed files with 8 additions and 4 deletions
|
@ -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}%"
|
||||
|
|
|
@ -21,5 +21,5 @@
|
|||
package com.nextcloud.talk.polls.adapters
|
||||
|
||||
interface PollResultItemClickListener {
|
||||
fun onClick(pollResultHeaderItem: PollResultHeaderItem)
|
||||
fun onClick()
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue