summaryrefslogtreecommitdiffstats
path: root/src/com/android/mail/compose/ComposeAttachmentTile.java
blob: 7038455ad2495972071625524620497dccf118eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package com.android.mail.compose;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import android.widget.ImageButton;

import com.android.mail.R;
import com.android.mail.ui.AttachmentTile;

public class ComposeAttachmentTile extends AttachmentTile implements AttachmentDeletionInterface {
    private ImageButton mDeleteButton;

    public ComposeAttachmentTile(Context context) {
        this(context, null);
    }

    public ComposeAttachmentTile(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public static ComposeAttachmentTile inflate(LayoutInflater inflater, ViewGroup parent) {
        ComposeAttachmentTile view = (ComposeAttachmentTile) inflater.inflate(
                R.layout.compose_attachment_tile, parent, false);
        return view;
    }

    @Override
    protected void onFinishInflate() {
        super.onFinishInflate();

        mDeleteButton = (ImageButton) findViewById(R.id.attachment_tile_close_button);
    }

    @Override
    public void addDeleteListener(OnClickListener clickListener) {
        mDeleteButton.setOnClickListener(clickListener);
    }
}