Add a selection state to the attachment delete icon.
Fixes b/6472010 No feedback on attachment bar
Change-Id: Ic2e340e1e2bf495faf988950fff405ddcf82a2e2
diff --git a/res/layout/attachment.xml b/res/layout/attachment.xml
index 81880f3..dfb4f43 100644
--- a/res/layout/attachment.xml
+++ b/res/layout/attachment.xml
@@ -52,14 +52,16 @@
</LinearLayout>
<!-- Remove button -->
- <ImageView android:id="@+id/remove_attachment"
+ <ImageButton android:id="@+id/remove_attachment"
android:src="@drawable/ic_cancel_holo_light"
- android:layout_width="24dip"
- android:layout_height="24dip"
+ android:layout_width="32dp"
+ android:layout_height="match_parent"
android:layout_alignParentRight="true"
- android:layout_marginRight="8dip"
+ android:paddingRight="8dip"
+ android:paddingLeft="8dip"
android:clickable="true"
- android:layout_centerVertical="true"/>
+ android:layout_centerVertical="true"
+ android:background="?android:attr/selectableItemBackground"/>
</RelativeLayout>
diff --git a/src/com/android/mail/compose/AttachmentComposeView.java b/src/com/android/mail/compose/AttachmentComposeView.java
index 42f179e..783b601 100644
--- a/src/com/android/mail/compose/AttachmentComposeView.java
+++ b/src/com/android/mail/compose/AttachmentComposeView.java
@@ -18,7 +18,7 @@
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
-import android.widget.ImageView;
+import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.TextView;
@@ -58,7 +58,7 @@
}
public void addDeleteListener(OnClickListener clickListener) {
- ImageView deleteButton = (ImageView) findViewById(R.id.remove_attachment);
+ ImageButton deleteButton = (ImageButton) findViewById(R.id.remove_attachment);
deleteButton.setOnClickListener(clickListener);
}