Skip to content

Instantly share code, notes, and snippets.

@dmi3coder
Created October 18, 2016 15:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmi3coder/779f8e6899f2c676ad594df38120273d to your computer and use it in GitHub Desktop.
Save dmi3coder/779f8e6899f2c676ad594df38120273d to your computer and use it in GitHub Desktop.
public class MessageInternalUserTextViewHolder extends MessageTextViewHolder {
public MessageInternalUserTextViewHolder(View itemView, CustomSettings customSettings) {
super(itemView, customSettings);
avatar = (ImageView) itemView.findViewById(R.id.message_user_text_image_view_avatar);
carrot = (ImageView) itemView.findViewById(R.id.message_user_text_image_view_carrot);
initials = (TextView) itemView.findViewById(R.id.message_user_text_text_view_initials);
text = (TextView) itemView.findViewById(R.id.message_user_text_text_view_text);
timestamp = (TextView) itemView.findViewById(R.id.message_user_text_text_view_timestamp);
avatarContainer = (ViewGroup) itemView.findViewById(R.id.message_user_text_view_group_avatar);
bubble = (FrameLayout) itemView.findViewById(R.id.message_user_text_view_group_bubble);
//
Drawable drawable = ContextCompat.getDrawable(itemView.getContext(), R.drawable.shape_rounded_rectangle_white);
// // Drawable drawable = itemView.getContext().getDrawable();
drawable.setColorFilter(customSettings.localBubbleBackgroundColor, PorterDuff.Mode.SRC_ATOP);
bubble.setBackground(drawable);
carrot.setColorFilter(customSettings.localBubbleBackgroundColor);
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
params.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
carrot.setLayoutParams(params);
text.setTextColor(customSettings.localBubbleTextColor);
timestamp.setTextColor(customSettings.timestampColor);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment