diff --git a/vector/src/main/java/im/vector/app/features/home/room/list/RoomListFragment.kt b/vector/src/main/java/im/vector/app/features/home/room/list/RoomListFragment.kt index 80f545b166..c25fe546c3 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/list/RoomListFragment.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/list/RoomListFragment.kt @@ -211,14 +211,12 @@ class RoomListFragment @Inject constructor( } private fun setupCreateRoomButton() { - // TODO: Uncomment -// when (roomListParams.displayMode) { -// RoomListDisplayMode.NOTIFICATIONS -> views.createChatFabMenu.isVisible = true -// RoomListDisplayMode.PEOPLE -> views.createChatRoomButton.isVisible = false -// RoomListDisplayMode.PEOPLE -> views.createChatRoomButton.isVisible = true -// RoomListDisplayMode.ROOMS -> views.createGroupRoomButton.isVisible = true -// RoomListDisplayMode.FILTERED -> Unit // No button in this mode -// } + when (roomListParams.displayMode) { + RoomListDisplayMode.NOTIFICATIONS -> views.createChatFabMenu.isVisible = true + RoomListDisplayMode.PEOPLE -> views.createChatRoomButton.isVisible = true + RoomListDisplayMode.ROOMS -> views.createGroupRoomButton.isVisible = true + RoomListDisplayMode.FILTERED -> Unit // No button in this mode + } views.createChatRoomButton.debouncedClicks { fabCreateDirectChat() diff --git a/vector/src/main/java/im/vector/app/features/home/room/list/home/HomeRoomListFragment.kt b/vector/src/main/java/im/vector/app/features/home/room/list/home/HomeRoomListFragment.kt index f0eb027785..cc211a31fa 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/list/home/HomeRoomListFragment.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/list/home/HomeRoomListFragment.kt @@ -20,6 +20,7 @@ import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import androidx.core.view.isVisible import androidx.lifecycle.lifecycleScope import androidx.recyclerview.widget.ConcatAdapter import androidx.recyclerview.widget.LinearLayoutManager @@ -90,6 +91,7 @@ class HomeRoomListFragment @Inject constructor( } setupRecyclerView() + setupFabs() } private fun setupRecyclerView() { @@ -108,6 +110,19 @@ class HomeRoomListFragment @Inject constructor( views.roomListView.adapter = concatAdapter } + private fun setupFabs() { + views.newLayoutCreateChatButton.isVisible = true + views.newLayoutOpenSpacesButton.isVisible = true + + views.newLayoutCreateChatButton.setOnClickListener { + // Click action for create chat modal goes here + } + + views.newLayoutOpenSpacesButton.setOnClickListener { + // Click action for open spaces modal goes here + } + } + override fun invalidate() = withState(roomListViewModel) { state -> views.stateView.state = state.state } diff --git a/vector/src/main/res/layout/fragment_room_list.xml b/vector/src/main/res/layout/fragment_room_list.xml index 97e2725a1f..631602bb14 100644 --- a/vector/src/main/res/layout/fragment_room_list.xml +++ b/vector/src/main/res/layout/fragment_room_list.xml @@ -56,46 +56,45 @@ tools:visibility="visible" /> - - + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_gravity="bottom|end"> + tools:visibility="visible" + tools:targetApi="lollipop_mr1" /> + + +