Changes content description of chevron based on expanded state

This commit is contained in:
ericdecanini 2022-08-24 20:22:46 +02:00
parent 8892fac062
commit e9120c8e33
3 changed files with 7 additions and 2 deletions

View File

@ -46,14 +46,19 @@ abstract class NewSpaceSummaryItem : VectorEpoxyModel<NewSpaceSummaryItem.Holder
override fun bind(holder: Holder) {
super.bind(holder)
val context = holder.root.context
holder.root.onClick(onSpaceSelectedListener)
holder.root.setOnLongClickListener { onLongClickListener?.invoke(holder.root).let { true } }
holder.root.setOnLongClickListener {
onLongClickListener?.invoke(holder.root)
true
}
holder.name.text = matrixItem.displayName
holder.root.isChecked = selected
holder.chevron.setOnClickListener(onToggleExpandListener)
holder.chevron.isVisible = hasChildren
holder.chevron.setImageResource(if (expanded) R.drawable.ic_expand_more else R.drawable.ic_arrow_right)
holder.chevron.contentDescription = context.getString(if (expanded) R.string.a11y_collapse_space_children else R.string.a11y_expand_space_children)
avatarRenderer.render(matrixItem, holder.avatar)
holder.unreadCounter.render(countState)

View File

@ -66,7 +66,6 @@
android:layout_height="48dp"
android:layout_marginEnd="21dp"
android:background="?selectableItemBackground"
android:contentDescription="@string/a11y_expand_space_children"
android:scaleType="centerInside"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"

View File

@ -142,6 +142,7 @@
<string name="change_space">Change Space</string>
<string name="explore_rooms">Explore Rooms</string>
<string name="a11y_expand_space_children">Expand space children</string>
<string name="a11y_collapse_space_children">Collapse space children</string>
<!-- Last seen time -->