FileDocCategorySizeDatePackage
BlockedContactView.javaAPI DocAndroid 1.5 API2596Wed May 06 22:42:46 BST 2009com.android.im.app

BlockedContactView

public class BlockedContactView extends android.widget.LinearLayout

Fields Summary
private android.widget.ImageView
mAvatar
private android.widget.ImageView
mBlockedIcon
private android.widget.TextView
mLine1
private android.widget.TextView
mLine2
Constructors Summary
public BlockedContactView(android.content.Context context, android.util.AttributeSet attrs)

        super(context, attrs);
    
Methods Summary
public voidbind(android.database.Cursor cursor)

        long providerId = cursor.getLong(BlockedContactsActivity.PROVIDER_COLUMN);
        String username = cursor.getString(BlockedContactsActivity.USERNAME_COLUMN);
        String nickname = cursor.getString(BlockedContactsActivity.NICKNAME_COLUMN);

        Drawable avatar = DatabaseUtils.getAvatarFromCursor(cursor,
                BlockedContactsActivity.AVATAR_COLUMN);

        if (avatar != null) {
            mAvatar.setImageDrawable(avatar);
        } else {
            mAvatar.setImageResource(R.drawable.avatar_unknown);
        }
        ImApp app = ImApp.getApplication((Activity)mContext);
        BrandingResources brandingRes = app.getBrandingResource(providerId);
        mBlockedIcon.setImageDrawable(brandingRes.getDrawable(BrandingResourceIDs.DRAWABLE_BLOCK));
        mLine1.setText(nickname);
        mLine2.setText(ImpsAddressUtils.getDisplayableAddress(username));
    
protected voidonFinishInflate()

        super.onFinishInflate();

        mAvatar = (ImageView) findViewById(R.id.avatar);
        mBlockedIcon = (ImageView)findViewById(R.id.blocked);
        mLine1  = (TextView) findViewById(R.id.line1);
        mLine2  = (TextView) findViewById(R.id.line2);