mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 19:29:06 +01:00
Contact aliases: address review comments
This commit is contained in:
@@ -10,7 +10,6 @@ import org.briarproject.briar.android.threaded.BaseThreadItemViewHolder;
|
||||
import org.briarproject.briar.android.threaded.ThreadItemAdapter.ThreadItemListener;
|
||||
|
||||
import static org.briarproject.bramble.api.identity.AuthorInfo.Status.OURSELVES;
|
||||
import static org.briarproject.briar.android.util.UiUtils.getContactDisplayName;
|
||||
|
||||
@UiThread
|
||||
@NotNullByDefault
|
||||
@@ -37,8 +36,7 @@ class JoinMessageItemViewHolder
|
||||
if (item.isInitial()) {
|
||||
textView.setText(R.string.groups_member_created_you);
|
||||
} else {
|
||||
String name = getContactDisplayName(item.getAuthor(),
|
||||
item.getAuthorInfo().getAlias());
|
||||
String name = item.getAuthorName();
|
||||
textView.setText(getContext()
|
||||
.getString(R.string.groups_member_joined, name));
|
||||
}
|
||||
@@ -46,8 +44,7 @@ class JoinMessageItemViewHolder
|
||||
|
||||
private void bind(JoinMessageItem item) {
|
||||
Context ctx = getContext();
|
||||
String name = getContactDisplayName(item.getAuthor(),
|
||||
item.getAuthorInfo().getAlias());
|
||||
String name = item.getAuthorName();
|
||||
|
||||
if (item.isInitial()) {
|
||||
textView.setText(
|
||||
|
||||
@@ -10,6 +10,7 @@ import javax.annotation.Nullable;
|
||||
import javax.annotation.concurrent.NotThreadSafe;
|
||||
|
||||
import static org.briarproject.briar.android.threaded.ThreadItemAdapter.UNDEFINED;
|
||||
import static org.briarproject.briar.android.util.UiUtils.getContactDisplayName;
|
||||
|
||||
@NotThreadSafe
|
||||
@NotNullByDefault
|
||||
@@ -70,6 +71,13 @@ public abstract class ThreadItem implements MessageNode {
|
||||
return authorInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the author's name, with an alias if one exists.
|
||||
*/
|
||||
public String getAuthorName() {
|
||||
return getContactDisplayName(author, authorInfo.getAlias());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLevel(int level) {
|
||||
this.level = level;
|
||||
|
||||
@@ -141,7 +141,7 @@ public class UiUtils {
|
||||
}
|
||||
|
||||
public static Spanned getSpanned(@Nullable String s) {
|
||||
// TODO move to HtmlCompat
|
||||
// TODO move to HtmlCompat #1435
|
||||
// https://commonsware.com/blog/2018/05/29/at-last-htmlcompat.html
|
||||
return Html.fromHtml(s);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user