mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 10:49:06 +01:00
@@ -9,10 +9,21 @@
|
||||
android:paddingTop="@dimen/listitem_horizontal_margin"
|
||||
android:background="?attr/selectableItemBackground">
|
||||
|
||||
<org.briarproject.android.util.TextAvatarView
|
||||
android:id="@+id/avatarView"
|
||||
android:layout_width="@dimen/avatar_forum_size"
|
||||
android:layout_height="@dimen/avatar_forum_size"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_marginRight="@dimen/listitem_horizontal_margin"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/forumNameView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toEndOf="@+id/avatarView"
|
||||
android:layout_toRightOf="@+id/avatarView"
|
||||
android:maxLines="2"
|
||||
android:textColor="@android:color/primary_text_light"
|
||||
android:textSize="@dimen/text_size_medium"
|
||||
@@ -22,10 +33,10 @@
|
||||
android:id="@+id/sharedByView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_below="@+id/forumNameView"
|
||||
android:layout_marginBottom="-8dp"
|
||||
android:layout_toEndOf="@+id/avatarView"
|
||||
android:layout_toRightOf="@+id/avatarView"
|
||||
android:paddingTop="@dimen/margin_medium"
|
||||
android:textColor="@android:color/secondary_text_light"
|
||||
android:textSize="@dimen/text_size_small"
|
||||
|
||||
@@ -10,6 +10,7 @@ import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import org.briarproject.R;
|
||||
import org.briarproject.android.util.TextAvatarView;
|
||||
import org.briarproject.api.contact.Contact;
|
||||
import org.briarproject.util.StringUtils;
|
||||
|
||||
@@ -43,6 +44,9 @@ class AvailableForumsAdapter extends
|
||||
public void onBindViewHolder(AvailableForumViewHolder ui, int position) {
|
||||
final AvailableForumsItem item = getItem(position);
|
||||
|
||||
ui.avatar.setText(item.getForum().getName().substring(0, 1));
|
||||
ui.avatar.setBackgroundBytes(item.getForum().getId().getBytes());
|
||||
|
||||
ui.name.setText(item.getForum().getName());
|
||||
|
||||
Collection<String> names = new ArrayList<>();
|
||||
@@ -88,6 +92,7 @@ class AvailableForumsAdapter extends
|
||||
protected static class AvailableForumViewHolder
|
||||
extends RecyclerView.ViewHolder {
|
||||
|
||||
private final TextAvatarView avatar;
|
||||
private final TextView name;
|
||||
private final TextView sharedBy;
|
||||
private final Button accept;
|
||||
@@ -96,6 +101,7 @@ class AvailableForumsAdapter extends
|
||||
public AvailableForumViewHolder(View v) {
|
||||
super(v);
|
||||
|
||||
avatar = (TextAvatarView) v.findViewById(R.id.avatarView);
|
||||
name = (TextView) v.findViewById(R.id.forumNameView);
|
||||
sharedBy = (TextView) v.findViewById(R.id.sharedByView);
|
||||
accept = (Button) v.findViewById(R.id.acceptButton);
|
||||
|
||||
@@ -91,7 +91,7 @@ public class ForumListAdapter extends
|
||||
public void onBindViewHolder(ForumViewHolder ui, int position) {
|
||||
final ForumListItem item = getItem(position);
|
||||
|
||||
// TODO add avatar. See #337
|
||||
// Avatar
|
||||
ui.avatar.setText(item.getForum().getName().substring(0, 1));
|
||||
ui.avatar.setBackgroundBytes(item.getForum().getId().getBytes());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user