Files
briar/briar-android/res/layout/text_avatar_view.xml
Torsten Grote 5d06f42000 This commit adds badges to the forum list that indicate unread posts.
It does so by extending the compound view `TextAvatarView` and provides
convienient setters that take care of the required UI changes.
The new badge can also be used to indicate a problem with the forum.

Closes #408
2016-06-03 12:44:03 -03:00

47 lines
1.6 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<merge
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:showIn="@layout/list_item_forum">
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/avatarBackground"
style="@style/BriarAvatar"
android:layout_width="@dimen/avatar_forum_size"
android:layout_height="@dimen/avatar_forum_size"
android:layout_gravity="bottom|left"
android:src="@android:color/transparent"
app:civ_fill_color="@color/briar_button_positive"/>
<android.support.v7.widget.AppCompatTextView
android:id="@+id/textAvatarView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginRight="@dimen/listitem_picture_frame_offset"
android:layout_marginTop="@dimen/listitem_picture_frame_offset"
android:maxLength="1"
android:shadowColor="@color/forum_avatar_shadow"
android:shadowDx="0"
android:shadowDy="1.5"
android:shadowRadius="1.5"
android:textColor="@color/briar_text_primary_inverse"
android:textSize="@dimen/avatar_text_size"
tools:text="T"/>
<TextView
android:id="@+id/unreadCountView"
android:layout_width="wrap_content"
android:layout_height="@dimen/unread_bubble_size"
android:layout_gravity="right|top"
android:background="@drawable/bubble"
android:gravity="center"
android:minWidth="@dimen/unread_bubble_size"
android:textColor="@color/briar_text_primary_inverse"
android:textSize="@dimen/unread_bubble_text_size"
android:textStyle="bold"
tools:text="12"/>
</merge>