Home: continue room list rework.

This commit is contained in:
ganfra
2019-05-17 17:07:02 +02:00
committed by Benoit Marty
parent c0fd06fd2d
commit eb2344a43f
12 changed files with 165 additions and 82 deletions

View File

@ -9,12 +9,12 @@
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:paddingBottom="16dp"
android:paddingTop="16dp"
android:paddingStart="8dp"
android:paddingLeft="8dp"
android:paddingTop="8dp"
android:paddingEnd="16dp"
android:paddingRight="16dp">
android:paddingRight="16dp"
android:paddingBottom="8dp">
<ImageView
android:id="@+id/roomAvatarImageView"
@ -29,30 +29,41 @@
<TextView
android:id="@+id/roomNameView"
android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginEnd="8dp"
android:duplicateParentState="true"
android:ellipsize="end"
android:maxLines="1"
android:textColor="@color/black_87"
android:textSize="14sp"
app:layout_constraintEnd_toStartOf="@+id/roomLastEventTimeView"
app:layout_constrainedWidth="true"
app:layout_constraintEnd_toStartOf="@+id/roomUnreadCounterBadgeView"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toEndOf="@id/roomAvatarImageView"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintTop_toTopOf="@+id/roomAvatarImageView"
tools:text="@tools:sample/full_names" />
<TextView
android:id="@+id/roomLastEventView"
android:layout_width="0dp"
<im.vector.riotredesign.features.home.room.list.UnreadCounterBadgeView
android:id="@+id/roomUnreadCounterBadgeView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/black_38"
android:textSize="14sp"
android:maxLines="2"
android:ellipsize="end"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@+id/roomNameView"
app:layout_constraintTop_toBottomOf="@+id/roomNameView"
tools:text="@tools:sample/lorem/random" />
android:layout_marginRight="8dp"
android:gravity="center"
android:minWidth="16dp"
android:minHeight="16dp"
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:textColor="@android:color/white"
android:textSize="10sp"
app:layout_constraintEnd_toStartOf="@+id/roomLastEventTimeView"
app:layout_constraintStart_toEndOf="@+id/roomNameView"
app:layout_constraintTop_toTopOf="@+id/roomAvatarImageView"
tools:background="@drawable/bg_unread_highlight"
tools:text="4" />
<TextView
android:id="@+id/roomLastEventTimeView"
@ -63,9 +74,23 @@
android:textColor="@color/black_38"
android:textSize="12sp"
app:layout_constraintBaseline_toBaselineOf="@id/messageMemberNameView"
app:layout_constraintTop_toTopOf="@+id/roomAvatarImageView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/messageMemberNameView"
tools:text="@tools:sample/date/hhmm" />
<TextView
android:id="@+id/roomLastEventView"
android:layout_width="0dp"
android:layout_height="34dp"
android:ellipsize="end"
android:maxLines="2"
android:textColor="@color/black_38"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@+id/roomNameView"
app:layout_constraintTop_toBottomOf="@+id/roomNameView"
tools:text="@tools:sample/lorem/random" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/roomCategoryRootView"
android:layout_width="match_parent"
@ -9,6 +8,7 @@
android:clickable="true"
android:focusable="true"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingStart="16dp"
android:paddingLeft="16dp"
android:paddingTop="8dp"
@ -19,49 +19,32 @@
<TextView
android:id="@+id/roomCategoryTitleView"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:drawableStart="@drawable/ic_expand_more_white"
android:drawableLeft="@drawable/ic_expand_more_white"
android:drawableTint="@color/bluey_grey_two"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="1"
android:textColor="@color/bluey_grey_two"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/roomCategoryUnreadCounterBadgeView"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="@string/direct_chats_header" />
tools:text="@string/room_recents_favourites" />
<im.vector.riotredesign.features.home.room.list.UnreadCounterBadgeView
android:id="@+id/roomCategoryUnreadCounterBadgeView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:minWidth="24dp"
android:minHeight="24dp"
android:paddingLeft="4dp"
android:minWidth="16dp"
android:minHeight="16dp"
android:paddingRight="4dp"
android:paddingLeft="4dp"
android:textSize="10sp"
android:textColor="@android:color/white"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/roomCategoryAddButton"
app:layout_constraintTop_toTopOf="parent"
tools:background="@drawable/bg_unread_highlight"
tools:text="4" />
<ImageView
android:id="@+id/roomCategoryAddButton"
android:layout_width="40dp"
android:layout_height="40dp"
android:scaleType="centerInside"
android:src="@drawable/ic_add_circle_white"
android:tint="@color/bluey_grey_two"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
tools:background="@drawable/bg_unread_highlight"
tools:text="24" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>

View File

@ -2,8 +2,7 @@
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="40dp"
android:layout_height="match_parent"
android:padding="8dp"
tools:parentTag="android.widget.FrameLayout">
@ -11,13 +10,14 @@
android:id="@+id/progressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" />
android:layout_gravity="center" />
<LinearLayout
android:id="@+id/errorView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical"
android:padding="8dp">
@ -48,9 +48,26 @@
android:id="@+id/emptyView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical"
android:padding="8dp">
<TextView
android:id="@+id/emptyTitleView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="40dp"
android:gravity="center"
android:textColor="@android:color/black"
android:textSize="16sp" />
<ImageView
android:id="@+id/emptyImageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="40dp" />
<TextView
android:id="@+id/emptyMessageView"
android:layout_width="wrap_content"
@ -60,14 +77,6 @@
android:textColor="@android:color/black"
android:textSize="16sp" />
<ImageView
android:id="@+id/emptyImageView"
android:layout_width="190dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="8dp" />
</LinearLayout>
</merge>

View File

@ -7,6 +7,10 @@
<string name="send_you_invite">"Sent you an invitation"</string>
<string name="invited_by">Invited by %s</string>
<string name="room_list_catchup_empty_title">Youre all caught up!</string>
<string name="room_list_catchup_empty_body">You have no more unread messages</string>
<string name="room_list_catchup_welcome_title">Welcome home!</string>
<string name="room_list_catchup_welcome_body">Catch up on unread messages here</string>
<string name="title_activity_emoji_reaction_picker">Reactions</string>
<string name="reactions_agree">Agree</string>