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

ChatBackgroundMaker

public class ChatBackgroundMaker extends Object

Fields Summary
private final android.graphics.drawable.Drawable
mIncomingBg
private final android.graphics.drawable.Drawable
mDivider
private final android.graphics.Rect
mPadding
Constructors Summary
public ChatBackgroundMaker(android.content.Context context)

        Resources res = context.getResources();
        mIncomingBg = res.getDrawable(R.drawable.textfield_im_received);
        mDivider = res.getDrawable(R.drawable.text_divider_horizontal);
        mPadding = new Rect();
        mIncomingBg.getPadding(mPadding);
    
Methods Summary
public voidsetBackground(MessageView view, java.lang.String contact, int type)

        View msgText = view.findViewById(R.id.message);

        switch (type) {
            case Im.MessageType.INCOMING:
                // TODO: set color according different contact
                msgText.setBackgroundDrawable(mIncomingBg);
                break;

            case Im.MessageType.OUTGOING:
            case Im.MessageType.POSTPONED:
                msgText.setBackgroundDrawable(null);
                msgText.setPadding(mPadding.left, mPadding.top, mPadding.right,
                      mPadding.bottom);
                break;

            default:
                msgText.setBackgroundDrawable(mDivider);
        }