diff --git a/vector/sampledata/matrix.json b/vector/sampledata/matrix.json index 5a806c87..1c808168 100644 --- a/vector/sampledata/matrix.json +++ b/vector/sampledata/matrix.json @@ -1,5 +1,10 @@ { "data": [ + { + "displayName": "Long display name useful to test layout with a long display name", + "mxid": "@longmatrixidbecausesometimesuserschooselongmxid:matrix.org", + "message": "William Shakespeare (bapt. 26 April 1564 – 23 April 1616) was an English poet, playwright and actor, widely regarded as the greatest writer in the English language and the world's greatest dramatist. He is often called England's national poet and the \"Bard of Avon\". His extant works, including collaborations, consist of approximately 39 plays, 154 sonnets, two long narrative poems, and a few other verses, some of uncertain authorship. His plays have been translated into every major living language and are performed more often than those of any other playwright.\n\nShakespeare was born and raised in Stratford-upon-Avon, Warwickshire. At the age of 18, he married Anne Hathaway, with whom he had three children: Susanna and twins Hamnet and Judith. Sometime between 1585 and 1592, he began a successful career in London as an actor, writer, and part-owner of a playing company called the Lord Chamberlain's Men, later known as the King's Men. At age 49 (around 1613), he appears to have retired to Stratford, where he died three years later. Few records of Shakespeare's private life survive; this has stimulated considerable speculation about such matters as his physical appearance, his sexuality, his religious beliefs, and whether the works attributed to him were written by others. Such theories are often criticised for failing to adequately note that few records survive of most commoners of the period.\n\nShakespeare produced most of his known works between 1589 and 1613. His early plays were primarily comedies and histories and are regarded as some of the best work produced in these genres. Until about 1608, he wrote mainly tragedies, among them Hamlet, Othello, King Lear, and Macbeth, all considered to be among the finest works in the English language. In the last phase of his life, he wrote tragicomedies (also known as romances) and collaborated with other playwrights.\n\nMany of Shakespeare's plays were published in editions of varying quality and accuracy in his lifetime. However, in 1623, two fellow actors and friends of Shakespeare's, John Heminges and Henry Condell, published a more definitive text known as the First Folio, a posthumous collected edition of Shakespeare's dramatic works that included all but two of his plays. The volume was prefaced with a poem by Ben Jonson, in which Jonson presciently hails Shakespeare in a now-famous quote as \"not of an age, but for all time\".\n\nThroughout the 20th and 21st centuries, Shakespeare's works have been continually adapted and rediscovered by new movements in scholarship and performance. His plays remain popular and are studied, performed, and reinterpreted through various cultural and political contexts around the world." + }, { "displayName": "benoit", "mxid": "@benoit:matrix.org", diff --git a/vector/src/main/java/im/vector/riotredesign/features/home/HomeDetailFragment.kt b/vector/src/main/java/im/vector/riotredesign/features/home/HomeDetailFragment.kt index 7550f02d..dea2bcef 100644 --- a/vector/src/main/java/im/vector/riotredesign/features/home/HomeDetailFragment.kt +++ b/vector/src/main/java/im/vector/riotredesign/features/home/HomeDetailFragment.kt @@ -56,7 +56,7 @@ class HomeDetailFragment : VectorBaseFragment() { override fun onActivityCreated(savedInstanceState: Bundle?) { super.onActivityCreated(savedInstanceState) currentDisplayMode = savedInstanceState?.getSerializable(CURRENT_DISPLAY_MODE) as? RoomListFragment.DisplayMode - ?: RoomListFragment.DisplayMode.HOME + ?: RoomListFragment.DisplayMode.HOME switchDisplayMode(currentDisplayMode) setupBottomNavigationView() setupToolbar() @@ -87,10 +87,11 @@ class HomeDetailFragment : VectorBaseFragment() { private fun setupBottomNavigationView() { bottomNavigationView.setOnNavigationItemSelectedListener { - val displayMode = when { - it.itemId == R.id.bottom_action_people -> RoomListFragment.DisplayMode.PEOPLE - it.itemId == R.id.bottom_action_rooms -> RoomListFragment.DisplayMode.ROOMS - else -> RoomListFragment.DisplayMode.HOME + val displayMode = when (it.itemId) { + R.id.bottom_action_home -> RoomListFragment.DisplayMode.HOME + R.id.bottom_action_people -> RoomListFragment.DisplayMode.PEOPLE + R.id.bottom_action_rooms -> RoomListFragment.DisplayMode.ROOMS + else -> RoomListFragment.DisplayMode.HOME } if (currentDisplayMode != displayMode) { currentDisplayMode = displayMode @@ -98,6 +99,7 @@ class HomeDetailFragment : VectorBaseFragment() { } true } + val menuView = bottomNavigationView.getChildAt(0) as BottomNavigationMenuView menuView.forEachIndexed { index, view -> val itemView = view as BottomNavigationItemView diff --git a/vector/src/main/java/im/vector/riotredesign/features/home/room/list/RoomListFragment.kt b/vector/src/main/java/im/vector/riotredesign/features/home/room/list/RoomListFragment.kt index 88b048b7..c271ee0d 100644 --- a/vector/src/main/java/im/vector/riotredesign/features/home/room/list/RoomListFragment.kt +++ b/vector/src/main/java/im/vector/riotredesign/features/home/room/list/RoomListFragment.kt @@ -16,10 +16,10 @@ package im.vector.riotredesign.features.home.room.list -import android.content.Intent import android.os.Bundle import android.os.Parcelable import androidx.annotation.StringRes +import androidx.core.view.isVisible import androidx.recyclerview.widget.LinearLayoutManager import com.airbnb.mvrx.* import im.vector.matrix.android.api.failure.Failure @@ -29,7 +29,6 @@ import im.vector.riotredesign.core.epoxy.LayoutManagerStateRestorer import im.vector.riotredesign.core.extensions.observeEvent import im.vector.riotredesign.core.platform.StateView import im.vector.riotredesign.core.platform.VectorBaseFragment -import im.vector.riotredesign.features.roomdirectory.RoomDirectoryActivity import kotlinx.android.parcel.Parcelize import kotlinx.android.synthetic.main.fragment_room_list.* import org.koin.android.ext.android.inject @@ -73,10 +72,19 @@ class RoomListFragment : VectorBaseFragment(), RoomSummaryController.Callback { } private fun setupCreateRoomButton() { - createRoomButton.setImageResource(R.drawable.ic_add_white) + createRoomButton.isVisible = roomListParams.displayMode == DisplayMode.HOME + createChatRoomButton.isVisible = roomListParams.displayMode == DisplayMode.PEOPLE + createGroupRoomButton.isVisible = roomListParams.displayMode == DisplayMode.ROOMS + createRoomButton.setOnClickListener { navigator.openRoomDirectory() } + createChatRoomButton.setOnClickListener { + navigator.openRoomDirectory() + } + createGroupRoomButton.setOnClickListener { + navigator.openRoomDirectory() + } } private fun setupRecyclerView() { diff --git a/vector/src/main/res/color/home_bottom_nav_view_tint.xml b/vector/src/main/res/color/home_bottom_nav_view_tint.xml index ad4b5ff4..ff64c3c0 100644 --- a/vector/src/main/res/color/home_bottom_nav_view_tint.xml +++ b/vector/src/main/res/color/home_bottom_nav_view_tint.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/vector/src/main/res/drawable/ic_arrow_right.xml b/vector/src/main/res/drawable/ic_arrow_right.xml new file mode 100644 index 00000000..c314196b --- /dev/null +++ b/vector/src/main/res/drawable/ic_arrow_right.xml @@ -0,0 +1,14 @@ + + + diff --git a/vector/src/main/res/drawable/ic_fab_add.xml b/vector/src/main/res/drawable/ic_fab_add.xml new file mode 100644 index 00000000..62f2f987 --- /dev/null +++ b/vector/src/main/res/drawable/ic_fab_add.xml @@ -0,0 +1,10 @@ + + + diff --git a/vector/src/main/res/drawable/ic_fab_add_chat.xml b/vector/src/main/res/drawable/ic_fab_add_chat.xml new file mode 100644 index 00000000..3e1b9a0e --- /dev/null +++ b/vector/src/main/res/drawable/ic_fab_add_chat.xml @@ -0,0 +1,21 @@ + + + + diff --git a/vector/src/main/res/drawable/ic_fab_add_room.xml b/vector/src/main/res/drawable/ic_fab_add_room.xml new file mode 100644 index 00000000..5ac25b5a --- /dev/null +++ b/vector/src/main/res/drawable/ic_fab_add_room.xml @@ -0,0 +1,37 @@ + + + + + + diff --git a/vector/src/main/res/drawable/ic_home_bottom_catchup.xml b/vector/src/main/res/drawable/ic_home_bottom_catchup.xml new file mode 100644 index 00000000..f59c2d64 --- /dev/null +++ b/vector/src/main/res/drawable/ic_home_bottom_catchup.xml @@ -0,0 +1,22 @@ + + + + diff --git a/vector/src/main/res/drawable/ic_home_bottom_chat.xml b/vector/src/main/res/drawable/ic_home_bottom_chat.xml new file mode 100644 index 00000000..2f785242 --- /dev/null +++ b/vector/src/main/res/drawable/ic_home_bottom_chat.xml @@ -0,0 +1,14 @@ + + + diff --git a/vector/src/main/res/drawable/ic_home_bottom_group.xml b/vector/src/main/res/drawable/ic_home_bottom_group.xml new file mode 100644 index 00000000..29be415b --- /dev/null +++ b/vector/src/main/res/drawable/ic_home_bottom_group.xml @@ -0,0 +1,14 @@ + + + diff --git a/vector/src/main/res/drawable/ic_settings_x.xml b/vector/src/main/res/drawable/ic_settings_x.xml new file mode 100644 index 00000000..994da00c --- /dev/null +++ b/vector/src/main/res/drawable/ic_settings_x.xml @@ -0,0 +1,22 @@ + + + + diff --git a/vector/src/main/res/layout/fragment_home_detail.xml b/vector/src/main/res/layout/fragment_home_detail.xml index 7b4a59bf..fa6d9e5b 100644 --- a/vector/src/main/res/layout/fragment_home_detail.xml +++ b/vector/src/main/res/layout/fragment_home_detail.xml @@ -11,6 +11,7 @@ style="@style/VectorToolbarStyle" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" + android:background="#FFFFFF" app:contentInsetStartWithNavigation="0dp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent" @@ -25,20 +26,21 @@ @@ -49,20 +51,21 @@ android:id="@+id/roomListContainer" android:layout_width="match_parent" android:layout_height="0dp" + android:background="#F3F8FD" app:layout_constraintBottom_toTopOf="@+id/bottomNavigationView" app:layout_constraintTop_toBottomOf="@+id/groupToolbar" /> + app:menu="@menu/home_bottom_navigation" /> \ No newline at end of file diff --git a/vector/src/main/res/layout/fragment_home_drawer.xml b/vector/src/main/res/layout/fragment_home_drawer.xml index e0a4b60a..7fc45709 100644 --- a/vector/src/main/res/layout/fragment_home_drawer.xml +++ b/vector/src/main/res/layout/fragment_home_drawer.xml @@ -29,28 +29,33 @@ - diff --git a/vector/src/main/res/layout/fragment_room_list.xml b/vector/src/main/res/layout/fragment_room_list.xml index 249e14ae..852d7460 100644 --- a/vector/src/main/res/layout/fragment_room_list.xml +++ b/vector/src/main/res/layout/fragment_room_list.xml @@ -2,6 +2,8 @@ + + android:layout_margin="16dp" + android:src="@drawable/ic_fab_add" + app:maxImageSize="14dp" /> + + + + diff --git a/vector/src/main/res/layout/item_group.xml b/vector/src/main/res/layout/item_group.xml index 63177c1f..cbff1e47 100644 --- a/vector/src/main/res/layout/item_group.xml +++ b/vector/src/main/res/layout/item_group.xml @@ -48,7 +48,7 @@ android:layout_height="wrap_content" android:layout_marginEnd="21dp" android:layout_marginRight="21dp" - android:src="@drawable/ic_material_chevron_right_black" + android:src="@drawable/ic_arrow_right" app:layout_constraintBottom_toTopOf="@+id/groupBottomSeparator" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent" /> diff --git a/vector/src/main/res/layout/item_room.xml b/vector/src/main/res/layout/item_room.xml index 05953f1a..c084fd3a 100644 --- a/vector/src/main/res/layout/item_room.xml +++ b/vector/src/main/res/layout/item_room.xml @@ -1,5 +1,4 @@ - + tools:background="@color/pale_grey"> + + + + tools:text="@sample/matrix.json/data/displayName" /> + tools:text="@sample/matrix.json/data/message" /> + + + + + - + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/roomBottomBarrier" /> diff --git a/vector/src/main/res/layout/item_room_category.xml b/vector/src/main/res/layout/item_room_category.xml index 5fda2366..b5559e1f 100644 --- a/vector/src/main/res/layout/item_room_category.xml +++ b/vector/src/main/res/layout/item_room_category.xml @@ -9,12 +9,11 @@ android:focusable="true" android:gravity="center_vertical" android:orientation="horizontal" - android:paddingStart="16dp" - android:paddingLeft="16dp" - android:paddingTop="8dp" - android:paddingEnd="8dp" - android:paddingRight="8dp" - android:paddingBottom="8dp" + android:paddingStart="@dimen/layout_horizontal_margin" + android:paddingLeft="@dimen/layout_horizontal_margin" + android:paddingTop="@dimen/layout_vertical_margin" + android:paddingEnd="@dimen/layout_horizontal_margin" + android:paddingRight="@dimen/layout_horizontal_margin" tools:background="@color/pale_grey"> + android:textColor="#7E899C" + android:textSize="14sp" + tools:text="@string/room_participants_header_direct_chats" /> - \ No newline at end of file diff --git a/vector/src/main/res/menu/bottom_navigation_main.xml b/vector/src/main/res/menu/bottom_navigation_main.xml deleted file mode 100644 index e8619718..00000000 --- a/vector/src/main/res/menu/bottom_navigation_main.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - diff --git a/vector/src/main/res/menu/selected_group_navigation.xml b/vector/src/main/res/menu/home_bottom_navigation.xml similarity index 77% rename from vector/src/main/res/menu/selected_group_navigation.xml rename to vector/src/main/res/menu/home_bottom_navigation.xml index e0491950..4f8a4cf9 100644 --- a/vector/src/main/res/menu/selected_group_navigation.xml +++ b/vector/src/main/res/menu/home_bottom_navigation.xml @@ -1,25 +1,26 @@ + + - diff --git a/vector/src/main/res/menu/vector_choose_sticker.xml b/vector/src/main/res/menu/vector_choose_sticker.xml index 868d5700..f22096ca 100644 --- a/vector/src/main/res/menu/vector_choose_sticker.xml +++ b/vector/src/main/res/menu/vector_choose_sticker.xml @@ -4,7 +4,7 @@ diff --git a/vector/src/main/res/menu/vector_home_sliding_menu.xml b/vector/src/main/res/menu/vector_home_sliding_menu.xml index da6704ab..a206bd09 100755 --- a/vector/src/main/res/menu/vector_home_sliding_menu.xml +++ b/vector/src/main/res/menu/vector_home_sliding_menu.xml @@ -9,7 +9,7 @@