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);
}