mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 02:39:05 +01:00
Remove empty forum warning bubble.
This commit is contained in:
@@ -52,19 +52,15 @@ class ForumListAdapter
|
||||
// Post Count
|
||||
int postCount = item.getPostCount();
|
||||
if (postCount > 0) {
|
||||
ui.avatar.setProblem(false);
|
||||
ui.postCount.setText(ctx.getResources()
|
||||
.getQuantityString(R.plurals.posts, postCount,
|
||||
postCount));
|
||||
ui.postCount.setTextColor(
|
||||
ContextCompat
|
||||
.getColor(ctx, R.color.briar_text_secondary));
|
||||
ContextCompat.getColor(ctx, R.color.briar_text_secondary));
|
||||
} else {
|
||||
ui.avatar.setProblem(true);
|
||||
ui.postCount.setText(ctx.getString(R.string.no_posts));
|
||||
ui.postCount.setTextColor(
|
||||
ContextCompat
|
||||
.getColor(ctx, R.color.briar_text_tertiary));
|
||||
ContextCompat.getColor(ctx, R.color.briar_text_tertiary));
|
||||
}
|
||||
|
||||
// Date
|
||||
|
||||
@@ -74,9 +74,7 @@ class GroupViewHolder extends RecyclerView.ViewHolder {
|
||||
if (group.isEmpty()) {
|
||||
postCount.setVisibility(GONE);
|
||||
date.setVisibility(GONE);
|
||||
avatar.setProblem(true);
|
||||
status
|
||||
.setText(ctx.getString(R.string.groups_group_is_empty));
|
||||
status.setText(ctx.getString(R.string.groups_group_is_empty));
|
||||
status.setVisibility(VISIBLE);
|
||||
} else {
|
||||
// Message Count
|
||||
@@ -91,7 +89,6 @@ class GroupViewHolder extends RecyclerView.ViewHolder {
|
||||
long lastUpdate = group.getTimestamp();
|
||||
date.setText(UiUtils.formatDate(ctx, lastUpdate));
|
||||
date.setVisibility(VISIBLE);
|
||||
avatar.setProblem(false);
|
||||
status.setVisibility(GONE);
|
||||
}
|
||||
remove.setVisibility(GONE);
|
||||
|
||||
@@ -5,7 +5,6 @@ import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.support.annotation.UiThread;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v7.widget.AppCompatTextView;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -26,7 +25,6 @@ public class TextAvatarView extends FrameLayout {
|
||||
private final AppCompatTextView character;
|
||||
private final CircleImageView background;
|
||||
private final TextView badge;
|
||||
private int unreadCount;
|
||||
|
||||
public TextAvatarView(Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
@@ -49,30 +47,14 @@ public class TextAvatarView extends FrameLayout {
|
||||
}
|
||||
|
||||
public void setUnreadCount(int count) {
|
||||
unreadCount = count;
|
||||
if (count > 0) {
|
||||
badge.setBackgroundResource(R.drawable.bubble);
|
||||
badge.setText(String.valueOf(count));
|
||||
badge.setTextColor(ContextCompat.getColor(getContext(),
|
||||
R.color.briar_text_primary_inverse));
|
||||
badge.setVisibility(VISIBLE);
|
||||
} else {
|
||||
badge.setVisibility(INVISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
public void setProblem(boolean problem) {
|
||||
if (problem) {
|
||||
badge.setBackgroundResource(R.drawable.bubble_problem);
|
||||
badge.setText("!");
|
||||
badge.setTextColor(ContextCompat
|
||||
.getColor(getContext(), R.color.briar_primary));
|
||||
badge.setVisibility(VISIBLE);
|
||||
} else {
|
||||
setUnreadCount(unreadCount);
|
||||
}
|
||||
}
|
||||
|
||||
public void setBackgroundBytes(byte[] bytes) {
|
||||
int r = getByte(bytes, 0) * 3 / 4 + 96;
|
||||
int g = getByte(bytes, 1) * 3 / 4 + 96;
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<corners
|
||||
android:radius="@dimen/unread_bubble_size"/>
|
||||
|
||||
<padding
|
||||
android:left="@dimen/unread_bubble_padding_horizontal"
|
||||
android:right="@dimen/unread_bubble_padding_horizontal"/>
|
||||
|
||||
<solid
|
||||
android:color="@color/briar_gold"/>
|
||||
|
||||
<stroke
|
||||
android:color="@color/briar_primary"
|
||||
android:width="@dimen/avatar_border_width"/>
|
||||
|
||||
</shape>
|
||||
|
||||
Reference in New Issue
Block a user