1 package com.android.mail.compose; 2 3 import android.content.Context; 4 import android.util.AttributeSet; 5 import android.view.LayoutInflater; 6 import android.view.ViewGroup; 7 import android.widget.ImageButton; 8 9 import com.android.mail.R; 10 import com.android.mail.ui.AttachmentTile; 11 12 public class ComposeAttachmentTile extends AttachmentTile implements AttachmentDeletionInterface { 13 private ImageButton mDeleteButton; 14 15 public ComposeAttachmentTile(Context context) { 16 this(context, null); 17 } 18 19 public ComposeAttachmentTile(Context context, AttributeSet attrs) { 20 super(context, attrs); 21 } 22 23 public static ComposeAttachmentTile inflate(LayoutInflater inflater, ViewGroup parent) { 24 ComposeAttachmentTile view = (ComposeAttachmentTile) inflater.inflate( 25 R.layout.compose_attachment_tile, parent, false); 26 return view; 27 } 28 29 @Override 30 protected void onFinishInflate() { 31 super.onFinishInflate(); 32 33 mDeleteButton = (ImageButton) findViewById(R.id.attachment_tile_close_button); 34 } 35 36 @Override 37 public void addDeleteListener(OnClickListener clickListener) { 38 mDeleteButton.setOnClickListener(clickListener); 39 } 40 } 41