ComposeAttachmentTile.java revision 237129ddf57a1e25469d8990322fb7913e18ae20
1package com.android.mail.compose; 2 3import android.content.Context; 4import android.util.AttributeSet; 5import android.view.LayoutInflater; 6import android.view.ViewGroup; 7import android.widget.ImageButton; 8 9import com.android.mail.R; 10import com.android.mail.ui.AttachmentTile; 11 12public 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 public void addDeleteListener(OnClickListener clickListener) { 37 mDeleteButton.setOnClickListener(clickListener); 38 } 39} 40