mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-20 06:39:54 +01:00
Forum Avatars using the first letter of the forum and color from group
Also prevents the snackbar from hiding the bottom of the list. Closes #337
This commit is contained in:
@@ -1,6 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<org.briarproject.android.util.BriarRecyclerView
|
||||
android:id="@+id/forumList"
|
||||
<android.support.design.widget.CoordinatorLayout
|
||||
android:id="@+id/coordinatorLayout"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<org.briarproject.android.util.BriarRecyclerView
|
||||
android:id="@+id/forumList"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="org.briarproject.android.util.BriarRecyclerViewBehavior"/>
|
||||
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -9,6 +10,15 @@
|
||||
android:paddingTop="@dimen/listitem_horizontal_margin"
|
||||
android:background="?attr/selectableItemBackground">
|
||||
|
||||
<org.briarproject.android.util.TextAvatarView
|
||||
android:id="@+id/avatarView"
|
||||
android:layout_height="@dimen/avatar_forum_size"
|
||||
android:layout_width="@dimen/avatar_forum_size"
|
||||
android:layout_marginRight="@dimen/listitem_horizontal_margin"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/forumNameView"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -16,21 +26,23 @@
|
||||
android:maxLines="2"
|
||||
android:textColor="@color/briar_text_primary"
|
||||
android:textSize="@dimen/text_size_medium"
|
||||
tools:text="This is a name of a forum"/>
|
||||
tools:text="This is a name of a forum"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_toRightOf="@+id/avatarView"
|
||||
android:layout_toEndOf="@+id/avatarView"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/unreadView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_below="@+id/forumNameView"
|
||||
android:layout_toLeftOf="@+id/dateView"
|
||||
android:paddingTop="@dimen/margin_medium"
|
||||
android:paddingBottom="@dimen/listitem_horizontal_margin"
|
||||
android:textColor="@color/briar_text_secondary"
|
||||
android:textSize="@dimen/text_size_small"
|
||||
android:text="@string/no_unread_posts"/>
|
||||
android:text="@string/no_unread_posts"
|
||||
android:layout_below="@+id/forumNameView"
|
||||
android:layout_toRightOf="@+id/avatarView"
|
||||
android:layout_toEndOf="@+id/avatarView"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dateView"
|
||||
|
||||
32
briar-android/res/layout/text_avatar_view.xml
Normal file
32
briar-android/res/layout/text_avatar_view.xml
Normal file
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merge
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<de.hdodenhof.circleimageview.CircleImageView
|
||||
android:id="@+id/avatarBackground"
|
||||
android:layout_width="@dimen/avatar_forum_size"
|
||||
android:layout_height="@dimen/avatar_forum_size"
|
||||
android:layout_gravity="center"
|
||||
android:src="@android:color/transparent"
|
||||
app:civ_fill_color="@color/briar_button_positive"
|
||||
app:civ_border_color="@color/briar_primary"
|
||||
app:civ_border_width="@dimen/avatar_border_width"/>
|
||||
|
||||
<android.support.v7.widget.AppCompatTextView
|
||||
android:id="@+id/textAvatarView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
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="30sp"
|
||||
tools:text="T"/>
|
||||
|
||||
</merge>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<color name="horizontal_border">#CCCCCC</color>
|
||||
<color name="forums_available_background">@color/briar_gold</color>
|
||||
<color name="no_private_messages">#AAAAAA</color>
|
||||
<color name="no_posts">#AAAAAA</color>
|
||||
<color name="forum_avatar_shadow">#b3b3b3</color>
|
||||
|
||||
<color name="briar_primary">@color/briar_blue</color>
|
||||
<color name="briar_primary_dark">@color/briar_blue_dark</color>
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
<dimen name="listitem_picture_size">48dp</dimen>
|
||||
<dimen name="listitem_selectable_picture_size">40dp</dimen>
|
||||
<dimen name="dropdown_picture_size">32dp</dimen>
|
||||
<dimen name="avatar_forum_size">48dp</dimen>
|
||||
<dimen name="avatar_border_width">1dp</dimen>
|
||||
|
||||
<dimen name="message_bubble_margin_tail">14dp</dimen>
|
||||
|
||||
Reference in New Issue
Block a user