Commit 1a6b375c authored by Filipe de Lima Brito's avatar Filipe de Lima Brito

Update methods removing unnecessary parameters.

parent 7d35b2ac
......@@ -225,7 +225,7 @@ public class SidebarMainFragment extends AbstractFragment implements SidebarMain
private void onRenderCurrentUser(User user, RocketChatAbsoluteUrl absoluteUrl) {
if (user != null && absoluteUrl != null) {
new UserRenderer(getContext(), user)
.avatarInto(rootView.findViewById(R.id.current_user_avatar), absoluteUrl, false)
.avatarInto(rootView.findViewById(R.id.current_user_avatar), absoluteUrl)
.usernameInto(rootView.findViewById(R.id.current_user_name))
.statusColorInto(rootView.findViewById(R.id.current_user_status));
}
......
......@@ -58,12 +58,12 @@ public class RoomUserAdapter extends RecyclerView.Adapter<RoomUserViewHolder> {
.setUtcOffset(0)
.build();
new UserRenderer(context, user)
.avatarInto(holder.avatar, absoluteUrl, false)
.avatarInto(holder.avatar, absoluteUrl)
.usernameInto(holder.username);
} else {
new UserRenderer(context, realmUser.asUser())
.statusColorInto(holder.status)
.avatarInto(holder.avatar, absoluteUrl, false)
.avatarInto(holder.avatar, absoluteUrl)
.usernameInto(holder.username);
}
}
......
......@@ -2,7 +2,6 @@ package chat.rocket.android.layouthelper.sidebar.dialog;
import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import java.util.Iterator;
import java.util.List;
......@@ -11,7 +10,6 @@ import chat.rocket.android.widget.AbsoluteUrl;
import chat.rocket.persistence.realm.models.ddp.RealmUser;
import chat.rocket.persistence.realm.RealmAutoCompleteAdapter;
import chat.rocket.android.renderer.UserRenderer;
import chat.rocket.android.widget.RocketChatAvatar;
/**
* adapter to suggest user names.
......@@ -27,8 +25,8 @@ public class SuggestUserAdapter extends RealmAutoCompleteAdapter<RealmUser> {
@Override
protected void onBindItemView(View itemView, RealmUser user) {
new UserRenderer(itemView.getContext(), user.asUser())
.statusColorInto((ImageView) itemView.findViewById(R.id.room_user_status))
.avatarInto((RocketChatAvatar) itemView.findViewById(R.id.room_user_avatar), absoluteUrl, false);
.statusColorInto(itemView.findViewById(R.id.room_user_status))
.avatarInto(itemView.findViewById(R.id.room_user_avatar), absoluteUrl);
}
@Override
......
......@@ -21,14 +21,14 @@ public class UserRenderer extends AbstractRenderer<User> {
/**
* show Avatar image
*/
public UserRenderer avatarInto(RocketChatAvatar rocketChatAvatar, AbsoluteUrl absoluteUrl, boolean showFailureImage) {
public UserRenderer avatarInto(RocketChatAvatar rocketChatAvatar, AbsoluteUrl absoluteUrl) {
if (!shouldHandle(rocketChatAvatar)) {
return this;
}
if (!TextUtils.isEmpty(object.getUsername())) {
new Avatar(absoluteUrl, object.getUsername())
.into(rocketChatAvatar, showFailureImage);
.into(rocketChatAvatar);
}
return this;
}
......
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