use of com.keylesspalace.tusky.view.RoundedTransformation in project Tusky by tuskyapp.
the class MentionAutoCompleteAdapter method getView.
@Override
@NonNull
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
View view = convertView;
Context context = getContext();
if (convertView == null) {
LayoutInflater layoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
// noinspection ConstantConditions
view = layoutInflater.inflate(layoutId, parent, false);
}
Account account = getItem(position);
if (account != null) {
TextView username = view.findViewById(R.id.username);
TextView displayName = view.findViewById(R.id.display_name);
ImageView avatar = view.findViewById(R.id.avatar);
String format = getContext().getString(R.string.status_username_format);
String formattedUsername = String.format(format, account.getUsername());
username.setText(formattedUsername);
displayName.setText(account.getName());
if (!account.getAvatar().isEmpty()) {
Picasso.with(context).load(account.getAvatar()).placeholder(R.drawable.avatar_default).transform(new RoundedTransformation(25)).into(avatar);
}
}
return view;
}
Aggregations