Address review comments

This commit is contained in:
Torsten Grote
2016-10-06 12:03:04 -03:00
parent 784561144a
commit 7f2db71160
41 changed files with 171 additions and 159 deletions

View File

@@ -24,7 +24,7 @@ public class TextAvatarView extends FrameLayout {
final private AppCompatTextView character;
final private CircleImageView background;
final private TextView badge;
private long unreadCount;
private int unreadCount;
public TextAvatarView(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
@@ -48,11 +48,7 @@ public class TextAvatarView extends FrameLayout {
}
public void setUnreadCount(int count) {
setUnreadCount((long) count);
}
public void setUnreadCount(long count) {
this.unreadCount = count;
unreadCount = count;
if (count > 0) {
badge.setBackgroundResource(R.drawable.bubble);
badge.setText(String.valueOf(count));
@@ -60,7 +56,6 @@ public class TextAvatarView extends FrameLayout {
R.color.briar_text_primary_inverse));
badge.setVisibility(VISIBLE);
} else {
badge.setText("");
badge.setVisibility(INVISIBLE);
}
}
@@ -72,11 +67,8 @@ public class TextAvatarView extends FrameLayout {
badge.setTextColor(ContextCompat
.getColor(getContext(), R.color.briar_primary));
badge.setVisibility(VISIBLE);
} else if (unreadCount > 0) {
setUnreadCount(unreadCount);
} else {
badge.setText("");
badge.setVisibility(INVISIBLE);
setUnreadCount(unreadCount);
}
}

View File

@@ -9,18 +9,13 @@ import android.support.annotation.CallSuper;
import android.support.annotation.Nullable;
import android.support.annotation.StringRes;
import android.support.annotation.UiThread;
import android.support.v7.widget.AppCompatImageButton;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.AttributeSet;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import org.briarproject.R;
import org.thoughtcrime.securesms.components.KeyboardAwareLinearLayout;
@@ -32,7 +27,6 @@ import org.thoughtcrime.securesms.components.emoji.EmojiToggle;
import java.util.logging.Logger;
import static android.content.Context.INPUT_METHOD_SERVICE;
import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
@UiThread
public class TextInputView extends KeyboardAwareLinearLayout