diff --git a/res/drawable/unread_count_background_dark.xml b/res/drawable/unread_count_background_dark.xml new file mode 100644 index 0000000000..8666e43f67 --- /dev/null +++ b/res/drawable/unread_count_background_dark.xml @@ -0,0 +1,14 @@ + + + + + + + + + + \ No newline at end of file diff --git a/res/drawable/unread_count_background_light.xml b/res/drawable/unread_count_background_light.xml new file mode 100644 index 0000000000..e87f516098 --- /dev/null +++ b/res/drawable/unread_count_background_light.xml @@ -0,0 +1,14 @@ + + + + + + + + + + \ No newline at end of file diff --git a/res/layout/conversation_list_item_view.xml b/res/layout/conversation_list_item_view.xml index 248356c0cd..d67e77e8f1 100644 --- a/res/layout/conversation_list_item_view.xml +++ b/res/layout/conversation_list_item_view.xml @@ -12,27 +12,47 @@ android:paddingLeft="16dp" android:paddingRight="16dp"> - + android:layout_marginRight="6dp" + android:layout_marginEnd="6dp"> + + + + + + @@ -151,10 +171,6 @@ android:layout_gravity="center_vertical" app:iconColor="?attr/conversation_list_item_delivery_icon_color"/> - - diff --git a/res/values/attrs.xml b/res/values/attrs.xml index 4624417076..87d9f9879a 100644 --- a/res/values/attrs.xml +++ b/res/values/attrs.xml @@ -12,6 +12,7 @@ + diff --git a/res/values/dimens.xml b/res/values/dimens.xml index 833b858da3..f463d1012a 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -55,6 +55,9 @@ 16dp 10dp + 13sp + 26sp + diff --git a/res/values/themes.xml b/res/values/themes.xml index 6e45d1919d..e1bc8c0658 100644 --- a/res/values/themes.xml +++ b/res/values/themes.xml @@ -137,6 +137,7 @@ @color/core_grey_45 @color/core_grey_60 @color/core_black + @drawable/unread_count_background_light @drawable/conversation_list_divider_shape @color/core_blue @@ -284,6 +285,7 @@ @color/core_grey_45 #ffdddddd @color/core_white + @drawable/unread_count_background_dark @drawable/conversation_list_divider_shape_dark @color/core_grey_90 diff --git a/src/org/thoughtcrime/securesms/ConversationListItem.java b/src/org/thoughtcrime/securesms/ConversationListItem.java index 1fe541ee8c..12a6785968 100644 --- a/src/org/thoughtcrime/securesms/ConversationListItem.java +++ b/src/org/thoughtcrime/securesms/ConversationListItem.java @@ -81,7 +81,7 @@ public class ConversationListItem extends RelativeLayout private TextView archivedView; private DeliveryStatusView deliveryStatusIndicator; private AlertView alertView; - private ImageView unreadIndicator; + private TextView unreadIndicator; private long lastSeen; private int unreadCount; @@ -311,14 +311,7 @@ public class ConversationListItem extends RelativeLayout return; } - unreadIndicator.setImageDrawable(TextDrawable.builder() - .beginConfig() - .width(ViewUtil.dpToPx(getContext(), 24)) - .height(ViewUtil.dpToPx(getContext(), 24)) - .textColor(Color.WHITE) - .bold() - .endConfig() - .buildRound(String.valueOf(thread.getUnreadCount()), getResources().getColor(R.color.textsecure_primary_dark))); + unreadIndicator.setText(String.valueOf(unreadCount)); unreadIndicator.setVisibility(View.VISIBLE); }