mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 11:49:04 +01:00
@@ -1,13 +1,9 @@
|
||||
package org.briarproject.android.util;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v7.widget.AppCompatTextView;
|
||||
import android.graphics.Typeface;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
@@ -18,6 +14,8 @@ import org.briarproject.api.identity.Author.Status;
|
||||
import de.hdodenhof.circleimageview.CircleImageView;
|
||||
import im.delight.android.identicons.IdenticonDrawable;
|
||||
|
||||
import static org.briarproject.api.identity.Author.Status.OURSELVES;
|
||||
|
||||
public class AuthorView extends RelativeLayout {
|
||||
|
||||
private final CircleImageView avatar;
|
||||
@@ -51,6 +49,12 @@ public class AuthorView extends RelativeLayout {
|
||||
|
||||
public void setAuthorStatus(Status status) {
|
||||
trustIndicator.setTrustLevel(status);
|
||||
if (status == OURSELVES) {
|
||||
authorName.setTypeface(authorName.getTypeface(), Typeface.BOLD);
|
||||
}
|
||||
|
||||
invalidate();
|
||||
requestLayout();
|
||||
}
|
||||
|
||||
public void setDate(long date) {
|
||||
|
||||
@@ -26,11 +26,6 @@ public class TrustIndicatorView extends ImageView {
|
||||
}
|
||||
|
||||
public void setTrustLevel(Status status) {
|
||||
if (status == OURSELVES) {
|
||||
setVisibility(GONE);
|
||||
return;
|
||||
}
|
||||
|
||||
int res;
|
||||
switch (status) {
|
||||
case ANONYMOUS:
|
||||
@@ -42,6 +37,9 @@ public class TrustIndicatorView extends ImageView {
|
||||
case VERIFIED:
|
||||
res = R.drawable.trust_indicator_verified;
|
||||
break;
|
||||
case OURSELVES:
|
||||
res = R.drawable.ic_our_identity_black;
|
||||
break;
|
||||
default:
|
||||
res = R.drawable.trust_indicator_unknown;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user