[a11y] label remove attachment button
b/17490470
Change-Id: Iab4eb9689c3cd7a08c56dabba705823402b2d0e1
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 26671e6..0fe8821 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -225,6 +225,8 @@
<string name="download_again">Download again</string>
<!-- A supplemental option on attachments for apps to override. This string intentionally blank here. [CHAR LIMIT=20] -->
<string name="attachment_extra_option1" translatable="false"></string>
+ <!-- Remove this attachment [CHAR LIMIT=50] -->
+ <string name="remove_attachment_desc">Remove attachment <xliff:g id="attachmentName">%s</xliff:g></string>
<!-- Dialog box title [CHAR LIMIT=30] -->
<string name="more_info_attachment">Info</string>
<!-- Dialog box message, displayed when we could not view an attachment. [CHAR LIMIT=200]-->
diff --git a/src/com/android/mail/compose/AttachmentComposeView.java b/src/com/android/mail/compose/AttachmentComposeView.java
index 2c4198c..89216e1 100644
--- a/src/com/android/mail/compose/AttachmentComposeView.java
+++ b/src/com/android/mail/compose/AttachmentComposeView.java
@@ -60,8 +60,10 @@
@Override
public void addDeleteListener(OnClickListener clickListener) {
- ImageButton deleteButton = (ImageButton) findViewById(R.id.remove_attachment);
+ final ImageButton deleteButton = (ImageButton) findViewById(R.id.remove_attachment);
deleteButton.setOnClickListener(clickListener);
+ deleteButton.setContentDescription(getResources().getString(R.string.remove_attachment_desc,
+ mAttachment.getName()));
}
private void populateAttachmentData(Context context) {