FileDocCategorySizeDatePackage
DeliveryReportListItem.javaAPI DocAndroid 1.5 API3031Wed May 06 22:42:46 BST 2009com.android.mms.ui

DeliveryReportListItem

public class DeliveryReportListItem extends android.widget.LinearLayout
This class displays the status for a single recipient of a message. It is used in the ListView of DeliveryReportActivity.

Fields Summary
private android.widget.TextView
mRecipientView
private android.widget.TextView
mStatusView
private android.widget.ImageView
mIconView
Constructors Summary
DeliveryReportListItem(android.content.Context context)

        super(context);
    
public DeliveryReportListItem(android.content.Context context, android.util.AttributeSet attrs)

        super(context, attrs);
    
Methods Summary
public final voidbind(java.lang.String recipient, java.lang.String status)

        ContactInfoCache cache = ContactInfoCache.getInstance();
        Context context = getContext();
        // Recipient
        mRecipientView.setText(cache.getContactName(context, recipient));

        // Status text
        mStatusView.setText(cache.getContactName(context, status));

        // Status icon
        String receivedStr = context.getString(R.string.status_received);
        String failedStr = context.getString(R.string.status_failed);
        String pendingStr = context.getString(R.string.status_pending);
        String rejectStr = context.getString(R.string.status_rejected);

        if (status.compareTo(receivedStr) == 0) {
            mIconView.setImageResource(R.drawable.ic_sms_mms_delivered);
        } else if (status.compareTo(failedStr) == 0) {
            mIconView.setImageResource(R.drawable.ic_sms_mms_not_delivered);
        } else if (status.compareTo(pendingStr) == 0) {
            mIconView.setImageResource(R.drawable.ic_sms_mms_pending);
        } else if (status.compareTo(rejectStr) == 0) {
            // FIXME: need replace ic_sms_mms_not_delivered by a rejected icon.
            mIconView.setImageResource(R.drawable.ic_sms_mms_not_delivered);
        } else {
            // No status report or unknown
        }
    
protected voidonFinishInflate()

        super.onFinishInflate();

        mRecipientView = (TextView) findViewById(R.id.recipient);
        mStatusView = (TextView) findViewById(R.id.status);
        mIconView = (ImageView) findViewById(R.id.icon);