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