Commit f9af22f3 authored by Filipe de Lima Brito's avatar Filipe de Lima Brito

Add an imageView to be used with avatars in svg format.

parent 4ec4fff2
......@@ -14,6 +14,7 @@ import chat.rocket.core.SyncState;
public abstract class AbstractMessageViewHolder extends ModelViewHolder<PairedMessage> {
protected final RocketChatAvatar avatar;
protected final ImageView userNotFoundAvatarImageView;
protected final ImageView imageViewSvgUserAvatar;
protected final ImageView errorImageView;
protected final TextView username;
protected final TextView subUsername;
......@@ -31,6 +32,7 @@ public abstract class AbstractMessageViewHolder extends ModelViewHolder<PairedMe
super(itemView);
avatar = itemView.findViewById(R.id.user_avatar);
userNotFoundAvatarImageView = itemView.findViewById(R.id.userNotFoundAvatarImageView);
imageViewSvgUserAvatar = itemView.findViewById(R.id.image_svg_user_avatar);
errorImageView = itemView.findViewById(R.id.errorImageView);
username = itemView.findViewById(R.id.username);
subUsername = itemView.findViewById(R.id.sub_username);
......
......@@ -29,7 +29,7 @@ public class MessageNormalViewHolder extends AbstractMessageViewHolder {
@Override
protected void bindMessage(PairedMessage pairedMessage, boolean autoloadImages) {
MessageRenderer messageRenderer = new MessageRenderer(pairedMessage.target, autoloadImages);
messageRenderer.showAvatar(avatar, hostname, userNotFoundAvatarImageView);
messageRenderer.showAvatar(avatar, hostname, userNotFoundAvatarImageView, imageViewSvgUserAvatar);
messageRenderer.showUsername(username, subUsername);
messageRenderer.showTimestampOrMessageState(timestamp);
messageRenderer.showBody(body);
......
......@@ -24,7 +24,7 @@ public class MessageSystemViewHolder extends AbstractMessageViewHolder {
@Override
protected void bindMessage(PairedMessage pairedMessage, boolean autoloadImages) {
MessageRenderer messageRenderer = new MessageRenderer(pairedMessage.target, autoloadImages);
messageRenderer.showAvatar(avatar, hostname, userNotFoundAvatarImageView);
messageRenderer.showAvatar(avatar, hostname, userNotFoundAvatarImageView, imageViewSvgUserAvatar);
messageRenderer.showUsername(username, subUsername);
messageRenderer.showTimestampOrMessageState(timestamp);
if (pairedMessage.target != null) {
......
......@@ -28,6 +28,13 @@
app:srcCompat="@drawable/ic_user_not_found_avatar_black_24dp"
android:visibility="gone" />
<ImageView
android:id="@+id/image_svg_user_avatar"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_margin="8dp"
android:visibility="gone" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
......
......@@ -27,6 +27,13 @@
app:srcCompat="@drawable/ic_user_not_found_avatar_black_24dp"
android:visibility="gone" />
<ImageView
android:id="@+id/image_svg_user_avatar"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_margin="8dp"
android:visibility="gone" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment