Merge pull request #7016 from vector-im/bugfix/eric/new-layout-accessibility-fixes
New Layout Accessibility Fixes
This commit is contained in:
commit
e2ba576318
|
@ -0,0 +1 @@
|
|||
[New Layout] Improves talkback accessibility
|
|
@ -140,8 +140,10 @@
|
|||
<string name="start_chat">Start Chat</string>
|
||||
<string name="create_room">Create Room</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>
|
||||
<!-- Note to translators: %s refers to the space whose children is being expanded -->
|
||||
<string name="a11y_expand_space_children">Expand %s children</string>
|
||||
<!-- Note to translators: %s refers to the space whose children is being collapsed -->
|
||||
<string name="a11y_collapse_space_children">Collapse %s children</string>
|
||||
|
||||
<!-- Last seen time -->
|
||||
|
||||
|
|
|
@ -58,7 +58,10 @@ abstract class NewSpaceSummaryItem : VectorEpoxyModel<NewSpaceSummaryItem.Holder
|
|||
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)
|
||||
holder.chevron.contentDescription = context.getString(
|
||||
if (expanded) R.string.a11y_collapse_space_children else R.string.a11y_expand_space_children,
|
||||
matrixItem.displayName,
|
||||
)
|
||||
|
||||
avatarRenderer.render(matrixItem, holder.avatar)
|
||||
holder.unreadCounter.render(countState)
|
||||
|
|
|
@ -50,6 +50,7 @@ abstract class NewSubSpaceSummaryItem : VectorEpoxyModel<NewSubSpaceSummaryItem.
|
|||
|
||||
override fun bind(holder: Holder) {
|
||||
super.bind(holder)
|
||||
val context = holder.root.context
|
||||
holder.root.onClick(onSubSpaceSelectedListener)
|
||||
holder.name.text = matrixItem.displayName
|
||||
holder.root.isChecked = selected
|
||||
|
@ -63,6 +64,10 @@ abstract class NewSubSpaceSummaryItem : VectorEpoxyModel<NewSubSpaceSummaryItem.
|
|||
)
|
||||
holder.chevron.onClick(onToggleExpandListener)
|
||||
holder.chevron.isVisible = hasChildren
|
||||
holder.chevron.contentDescription = context.getString(
|
||||
if (expanded) R.string.a11y_collapse_space_children else R.string.a11y_expand_space_children,
|
||||
matrixItem.displayName,
|
||||
)
|
||||
|
||||
holder.indent.isVisible = indent > 0
|
||||
holder.indent.updateLayoutParams {
|
||||
|
|
|
@ -127,7 +127,6 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:accessibilityTraversalBefore="@id/roomListView"
|
||||
android:contentDescription="@string/a11y_create_message"
|
||||
android:src="@drawable/ic_new_chat"
|
||||
android:visibility="gone"
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
android:layout_marginTop="4dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:ellipsize="end"
|
||||
android:importantForAccessibility="no"
|
||||
android:lines="1"
|
||||
android:textColor="?vctr_content_primary"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
|
Loading…
Reference in New Issue