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 @@