1
0
Fork 1

show number of users in channel discovery

This commit is contained in:
Christian Schneppe 2021-09-17 22:44:54 +02:00 committed by Arne
parent 59f1c31d8f
commit 06ba238903

View file

@ -13,6 +13,7 @@ import androidx.recyclerview.widget.DiffUtil;
import androidx.recyclerview.widget.ListAdapter;
import androidx.recyclerview.widget.RecyclerView;
import java.text.MessageFormat;
import java.util.Locale;
import eu.siacs.conversations.R;
@ -52,7 +53,8 @@ public class ChannelSearchResultAdapter extends ListAdapter<Room, ChannelSearchR
@Override
public void onBindViewHolder(@NonNull ViewHolder viewHolder, int position) {
final Room searchResult = getItem(position);
viewHolder.binding.name.setText(searchResult.getName());
final String user = '[' + String.valueOf(searchResult.nusers) + ']';
viewHolder.binding.name.setText(MessageFormat.format("{0} {1}", searchResult.getName(), user));
final String description = searchResult.getDescription();
final String language = searchResult.getLanguage();
if (TextUtils.isEmpty(description)) {