From c2e8737b789bcd42e220ec8fc180f5e97b4aa992 Mon Sep 17 00:00:00 2001 From: Valere Date: Fri, 19 Mar 2021 17:30:53 +0100 Subject: [PATCH 1/2] Simple space context menu --- .../java/im/vector/app/AppStateHandler.kt | 3 + .../im/vector/app/core/di/ScreenComponent.kt | 2 + .../vector/app/features/home/HomeActivity.kt | 7 + .../features/home/HomeActivitySharedAction.kt | 1 + .../app/features/home/HomeDetailFragment.kt | 21 ++- .../home/room/list/RoomListViewModel.kt | 2 +- .../roomprofile/RoomProfileActivity.kt | 4 + .../app/features/spaces/SpaceListFragment.kt | 4 +- .../spaces/SpaceSettingsMenuBottomSheet.kt | 135 ++++++++++++++++++ .../features/spaces/SpaceSummaryController.kt | 4 +- .../app/features/spaces/SpaceSummaryItem.kt | 12 +- vector/src/main/res/drawable/ic_explore.xml | 13 ++ .../layout/bottom_sheet_space_settings.xml | 120 ++++++++++++++++ .../main/res/layout/fragment_home_detail.xml | 1 + vector/src/main/res/layout/item_space.xml | 4 +- vector/src/main/res/values/strings.xml | 3 + 16 files changed, 317 insertions(+), 19 deletions(-) create mode 100644 vector/src/main/java/im/vector/app/features/spaces/SpaceSettingsMenuBottomSheet.kt create mode 100644 vector/src/main/res/drawable/ic_explore.xml create mode 100644 vector/src/main/res/layout/bottom_sheet_space_settings.xml diff --git a/vector/src/main/java/im/vector/app/AppStateHandler.kt b/vector/src/main/java/im/vector/app/AppStateHandler.kt index 71fe1880be7..f209b8d590b 100644 --- a/vector/src/main/java/im/vector/app/AppStateHandler.kt +++ b/vector/src/main/java/im/vector/app/AppStateHandler.kt @@ -106,6 +106,7 @@ class AppStateHandler @Inject constructor( GlobalScope.launch { sessionDataSource.currentValue?.orNull()?.let { session -> val currentSpace = currentSpaceOptional.orNull() + .takeIf { it?.roomId != im.vector.app.features.spaces.ALL_COMMUNITIES_GROUP_ID } if (currentSpace != null) { val childInfo = withContext(Dispatchers.IO) { tryOrNull { @@ -115,6 +116,8 @@ class AppStateHandler @Inject constructor( childInfo?.second?.let { currentSpaceSuggestedDataSource.post(it) } ?: kotlin.run { currentSpaceSuggestedDataSource.post(emptyList()) } + } else { + currentSpaceSuggestedDataSource.post(emptyList()) } } } diff --git a/vector/src/main/java/im/vector/app/core/di/ScreenComponent.kt b/vector/src/main/java/im/vector/app/core/di/ScreenComponent.kt index b1c1e73081e..59939a13182 100644 --- a/vector/src/main/java/im/vector/app/core/di/ScreenComponent.kt +++ b/vector/src/main/java/im/vector/app/core/di/ScreenComponent.kt @@ -80,6 +80,7 @@ import im.vector.app.features.signout.soft.SoftLogoutActivity import im.vector.app.features.spaces.ShareSpaceBottomSheet import im.vector.app.features.spaces.SpaceCreationActivity import im.vector.app.features.spaces.SpaceExploreActivity +import im.vector.app.features.spaces.SpaceSettingsMenuBottomSheet import im.vector.app.features.terms.ReviewTermsActivity import im.vector.app.features.ui.UiStateRepository import im.vector.app.features.usercode.UserCodeActivity @@ -179,6 +180,7 @@ interface ScreenComponent { fun inject(bottomSheet: SignOutBottomSheetDialogFragment) fun inject(bottomSheet: MatrixToBottomSheet) fun inject(bottomSheet: ShareSpaceBottomSheet) + fun inject(bottomSheet: SpaceSettingsMenuBottomSheet) /* ========================================================================================== * Others diff --git a/vector/src/main/java/im/vector/app/features/home/HomeActivity.kt b/vector/src/main/java/im/vector/app/features/home/HomeActivity.kt index 84098b8281b..452afd434bc 100644 --- a/vector/src/main/java/im/vector/app/features/home/HomeActivity.kt +++ b/vector/src/main/java/im/vector/app/features/home/HomeActivity.kt @@ -58,6 +58,7 @@ import im.vector.app.features.settings.VectorPreferences import im.vector.app.features.settings.VectorSettingsActivity import im.vector.app.features.spaces.SpaceCreationActivity import im.vector.app.features.spaces.SpacePreviewActivity +import im.vector.app.features.spaces.SpaceSettingsMenuBottomSheet import im.vector.app.features.themes.ThemeUtils import im.vector.app.features.workers.signout.ServerBackupStatusViewModel import im.vector.app.features.workers.signout.ServerBackupStatusViewState @@ -164,6 +165,12 @@ class HomeActivity : is HomeActivitySharedAction.AddSpace -> { createSpaceResultLauncher.launch(SpaceCreationActivity.newIntent(this)) } + is HomeActivitySharedAction.ShowSpaceSettings -> { + // open bottom sheet + SpaceSettingsMenuBottomSheet + .newInstance(sharedAction.spaceId) + .show(supportFragmentManager, "SPACE_SETTINGS") + } }.exhaustive } .disposeOnDestroy() diff --git a/vector/src/main/java/im/vector/app/features/home/HomeActivitySharedAction.kt b/vector/src/main/java/im/vector/app/features/home/HomeActivitySharedAction.kt index 72e35233360..e87ce3476fa 100644 --- a/vector/src/main/java/im/vector/app/features/home/HomeActivitySharedAction.kt +++ b/vector/src/main/java/im/vector/app/features/home/HomeActivitySharedAction.kt @@ -27,4 +27,5 @@ sealed class HomeActivitySharedAction : VectorSharedAction { object OpenGroup : HomeActivitySharedAction() object AddSpace : HomeActivitySharedAction() data class OpenSpacePreview(val spaceId: String) : HomeActivitySharedAction() + data class ShowSpaceSettings(val spaceId: String) : HomeActivitySharedAction() } diff --git a/vector/src/main/java/im/vector/app/features/home/HomeDetailFragment.kt b/vector/src/main/java/im/vector/app/features/home/HomeDetailFragment.kt index 97d3bbaf474..658fd8ee63c 100644 --- a/vector/src/main/java/im/vector/app/features/home/HomeDetailFragment.kt +++ b/vector/src/main/java/im/vector/app/features/home/HomeDetailFragment.kt @@ -35,8 +35,8 @@ import im.vector.app.core.platform.ToolbarConfigurable import im.vector.app.core.platform.VectorBaseActivity import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.core.ui.views.CurrentCallsView -import im.vector.app.core.ui.views.KnownCallsViewHolder import im.vector.app.core.ui.views.KeysBackupBanner +import im.vector.app.core.ui.views.KnownCallsViewHolder import im.vector.app.databinding.FragmentHomeDetailBinding import im.vector.app.features.call.SharedKnownCallsViewModel import im.vector.app.features.call.VectorCallActivity @@ -52,7 +52,6 @@ import im.vector.app.features.themes.ThemeUtils import im.vector.app.features.workers.signout.BannerState import im.vector.app.features.workers.signout.ServerBackupStatusViewModel import im.vector.app.features.workers.signout.ServerBackupStatusViewState - import org.matrix.android.sdk.api.session.group.model.GroupSummary import org.matrix.android.sdk.api.session.room.model.RoomSummary import org.matrix.android.sdk.api.util.toMatrixItem @@ -246,10 +245,10 @@ class HomeDetailFragment @Inject constructor( serverBackupStatusViewModel .subscribe(this) { when (val banState = it.bannerState.invoke()) { - is BannerState.Setup -> views.homeKeysBackupBanner.render(KeysBackupBanner.State.Setup(banState.numberOfKeys), false) + is BannerState.Setup -> views.homeKeysBackupBanner.render(KeysBackupBanner.State.Setup(banState.numberOfKeys), false) BannerState.BackingUp -> views.homeKeysBackupBanner.render(KeysBackupBanner.State.BackingUp, false) null, - BannerState.Hidden -> views.homeKeysBackupBanner.render(KeysBackupBanner.State.Hidden, false) + BannerState.Hidden -> views.homeKeysBackupBanner.render(KeysBackupBanner.State.Hidden, false) } } views.homeKeysBackupBanner.delegate = this @@ -273,6 +272,16 @@ class HomeDetailFragment @Inject constructor( views.groupToolbarAvatarImageView.debouncedClicks { sharedActionViewModel.post(HomeActivitySharedAction.OpenDrawer) } + + views.homeToolbarContent.debouncedClicks { + withState(viewModel) { + val currentSpace = it.spaceSummary.orNull() + ?.takeIf { it.roomId != ALL_COMMUNITIES_GROUP_ID } + if (vectorPreferences.labSpaces() && currentSpace != null) { + sharedActionViewModel.post(HomeActivitySharedAction.ShowSpaceSettings(currentSpace.roomId)) + } + } + } } private fun setupBottomNavigationView() { @@ -280,7 +289,7 @@ class HomeDetailFragment @Inject constructor( views.bottomNavigationView.setOnNavigationItemSelectedListener { val displayMode = when (it.itemId) { R.id.bottom_action_people -> RoomListDisplayMode.PEOPLE - R.id.bottom_action_rooms -> RoomListDisplayMode.ROOMS + R.id.bottom_action_rooms -> RoomListDisplayMode.ROOMS else -> RoomListDisplayMode.NOTIFICATIONS } viewModel.handle(HomeDetailAction.SwitchDisplayMode(displayMode)) @@ -356,7 +365,7 @@ class HomeDetailFragment @Inject constructor( private fun RoomListDisplayMode.toMenuId() = when (this) { RoomListDisplayMode.PEOPLE -> R.id.bottom_action_people - RoomListDisplayMode.ROOMS -> R.id.bottom_action_rooms + RoomListDisplayMode.ROOMS -> R.id.bottom_action_rooms else -> R.id.bottom_action_notification } diff --git a/vector/src/main/java/im/vector/app/features/home/room/list/RoomListViewModel.kt b/vector/src/main/java/im/vector/app/features/home/room/list/RoomListViewModel.kt index 9337b365861..d7db2b3f921 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/list/RoomListViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/list/RoomListViewModel.kt @@ -46,7 +46,7 @@ import javax.inject.Inject class RoomListViewModel @Inject constructor(initialState: RoomListViewState, private val session: Session, private val roomSummariesSource: DataSource>, - private val suggestedRoomListDataSource: DataSource>) + suggestedRoomListDataSource: DataSource>) : VectorViewModel(initialState) { interface Factory { diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileActivity.kt b/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileActivity.kt index 7cb713d3788..e45ad69e7e7 100644 --- a/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileActivity.kt +++ b/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileActivity.kt @@ -54,6 +54,7 @@ class RoomProfileActivity : const val EXTRA_DIRECT_ACCESS_ROOM_ROOT = 0 const val EXTRA_DIRECT_ACCESS_ROOM_SETTINGS = 1 + const val EXTRA_DIRECT_ACCESS_ROOM_MEMBERS = 2 fun newIntent(context: Context, roomId: String, directAccess: Int?): Intent { val roomProfileArgs = RoomProfileArgs(roomId) @@ -97,6 +98,9 @@ class RoomProfileActivity : addFragment(R.id.simpleFragmentContainer, RoomProfileFragment::class.java, roomProfileArgs) addFragmentToBackstack(R.id.simpleFragmentContainer, RoomSettingsFragment::class.java, roomProfileArgs) } + EXTRA_DIRECT_ACCESS_ROOM_MEMBERS -> { + addFragment(R.id.simpleFragmentContainer, RoomMemberListFragment::class.java, roomProfileArgs) + } else -> addFragment(R.id.simpleFragmentContainer, RoomProfileFragment::class.java, roomProfileArgs) } } diff --git a/vector/src/main/java/im/vector/app/features/spaces/SpaceListFragment.kt b/vector/src/main/java/im/vector/app/features/spaces/SpaceListFragment.kt index b3e16a709d8..011453e6423 100644 --- a/vector/src/main/java/im/vector/app/features/spaces/SpaceListFragment.kt +++ b/vector/src/main/java/im/vector/app/features/spaces/SpaceListFragment.kt @@ -80,8 +80,8 @@ class SpaceListFragment @Inject constructor( viewModel.handle(SpaceListAction.SelectSpace(spaceSummary)) } - override fun onLeaveSpace(spaceSummary: RoomSummary) { - viewModel.handle(SpaceListAction.LeaveSpace(spaceSummary)) + override fun onSpaceSettings(spaceSummary: RoomSummary) { + sharedActionViewModel.post(HomeActivitySharedAction.ShowSpaceSettings(spaceSummary.roomId)) } override fun onAddSpaceSelected() { diff --git a/vector/src/main/java/im/vector/app/features/spaces/SpaceSettingsMenuBottomSheet.kt b/vector/src/main/java/im/vector/app/features/spaces/SpaceSettingsMenuBottomSheet.kt new file mode 100644 index 00000000000..02d40e96ddd --- /dev/null +++ b/vector/src/main/java/im/vector/app/features/spaces/SpaceSettingsMenuBottomSheet.kt @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2021 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package im.vector.app.features.spaces + +import android.os.Bundle +import android.os.Parcelable +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import androidx.appcompat.app.AlertDialog +import androidx.core.view.isVisible +import com.airbnb.mvrx.args +import im.vector.app.R +import im.vector.app.core.di.ActiveSessionHolder +import im.vector.app.core.di.ScreenComponent +import im.vector.app.core.platform.VectorBaseBottomSheetDialogFragment +import im.vector.app.databinding.BottomSheetSpaceSettingsBinding +import im.vector.app.features.home.AvatarRenderer +import im.vector.app.features.navigation.Navigator +import im.vector.app.features.powerlevel.PowerLevelsObservableFactory +import im.vector.app.features.roomprofile.RoomProfileActivity +import im.vector.app.features.settings.VectorPreferences +import io.reactivex.android.schedulers.AndroidSchedulers +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import kotlinx.parcelize.Parcelize +import org.matrix.android.sdk.api.session.room.powerlevels.PowerLevelsHelper +import org.matrix.android.sdk.api.util.toMatrixItem +import org.matrix.android.sdk.internal.util.awaitCallback +import timber.log.Timber +import javax.inject.Inject + +@Parcelize +data class SpaceBottomSheetSettingsArgs( + val spaceId: String +) : Parcelable + +class SpaceSettingsMenuBottomSheet : VectorBaseBottomSheetDialogFragment() { + + @Inject lateinit var navigator: Navigator + @Inject lateinit var activeSessionHolder: ActiveSessionHolder + @Inject lateinit var avatarRenderer: AvatarRenderer + @Inject lateinit var vectorPreferences: VectorPreferences + + private val spaceArgs: SpaceBottomSheetSettingsArgs by args() + + override fun injectWith(injector: ScreenComponent) { + injector.inject(this) + } + + override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): BottomSheetSpaceSettingsBinding { + return BottomSheetSpaceSettingsBinding.inflate(inflater, container, false) + } + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + + val session = activeSessionHolder.getSafeActiveSession() ?: return + val roomSummary = session.getRoomSummary(spaceArgs.spaceId) + roomSummary?.let { roomSummary -> + avatarRenderer.renderSpace(roomSummary.toMatrixItem(), views.roomAvatarImageView) + views.roomNameView.text = roomSummary.displayName + views.roomDescription.text = roomSummary.topic + } + + val room = session.getRoom(spaceArgs.spaceId) ?: return + + PowerLevelsObservableFactory(room) + .createObservable() + .observeOn(AndroidSchedulers.mainThread()) + .subscribe { powerLevelContent -> + val powerLevelsHelper = PowerLevelsHelper(powerLevelContent) + val canInvite = powerLevelsHelper.isUserAbleToInvite(session.myUserId) + views.invitePeople.isVisible = canInvite + }.disposeOnDestroyView() + + views.invitePeople.views.bottomSheetActionClickableZone.debouncedClicks { + navigator.openInviteUsersToRoom(requireContext(), spaceArgs.spaceId) + } + + views.showMemberList.views.bottomSheetActionClickableZone.debouncedClicks { + navigator.openRoomProfile(requireContext(), spaceArgs.spaceId, RoomProfileActivity.EXTRA_DIRECT_ACCESS_ROOM_MEMBERS) + } + + views.spaceSettings.isVisible = vectorPreferences.developerMode() + views.spaceSettings.views.bottomSheetActionClickableZone.debouncedClicks { + navigator.openRoomProfile(requireContext(), spaceArgs.spaceId) + } + + views.exploreRooms.views.bottomSheetActionClickableZone.debouncedClicks { + startActivity(SpaceExploreActivity.newIntent(requireContext(), spaceArgs.spaceId)) + } + + views.leaveSpace.views.bottomSheetActionClickableZone.debouncedClicks { + AlertDialog.Builder(requireContext()) + .setMessage(getString(R.string.space_leave_prompt_msg)) + .setPositiveButton(R.string.leave) { _, _ -> + GlobalScope.launch { + try { + awaitCallback { + session.getRoom(spaceArgs.spaceId)?.leave(null, it) + } + } catch (failure: Throwable) { + Timber.e(failure, "Failed to leave space") + } + } + dismiss() + } + .setNegativeButton(R.string.cancel, null) + .show() + } + } + + companion object { + fun newInstance(spaceId: String): SpaceSettingsMenuBottomSheet { + return SpaceSettingsMenuBottomSheet().apply { + setArguments(SpaceBottomSheetSettingsArgs(spaceId)) + } + } + } +} diff --git a/vector/src/main/java/im/vector/app/features/spaces/SpaceSummaryController.kt b/vector/src/main/java/im/vector/app/features/spaces/SpaceSummaryController.kt index 7718da79dcb..7c9c3969b1d 100644 --- a/vector/src/main/java/im/vector/app/features/spaces/SpaceSummaryController.kt +++ b/vector/src/main/java/im/vector/app/features/spaces/SpaceSummaryController.kt @@ -102,7 +102,7 @@ class SpaceSummaryController @Inject constructor( id(groupSummary.roomId) matrixItem(groupSummary.toMatrixItem()) selected(isSelected) - onLeave { callback?.onLeaveSpace(groupSummary) } + onMore { callback?.onSpaceSettings(groupSummary) } listener { callback?.onSpaceSelected(groupSummary) } } } @@ -120,7 +120,7 @@ class SpaceSummaryController @Inject constructor( interface Callback { fun onSpaceSelected(spaceSummary: RoomSummary) - fun onLeaveSpace(spaceSummary: RoomSummary) + fun onSpaceSettings(spaceSummary: RoomSummary) fun onAddSpaceSelected() } } diff --git a/vector/src/main/java/im/vector/app/features/spaces/SpaceSummaryItem.kt b/vector/src/main/java/im/vector/app/features/spaces/SpaceSummaryItem.kt index ffd27446f41..af151a16248 100644 --- a/vector/src/main/java/im/vector/app/features/spaces/SpaceSummaryItem.kt +++ b/vector/src/main/java/im/vector/app/features/spaces/SpaceSummaryItem.kt @@ -38,7 +38,7 @@ abstract class SpaceSummaryItem : VectorEpoxyModel() { @EpoxyAttribute lateinit var matrixItem: MatrixItem @EpoxyAttribute var selected: Boolean = false @EpoxyAttribute var listener: (() -> Unit)? = null - @EpoxyAttribute var onLeave: (() -> Unit)? = null + @EpoxyAttribute var onMore: (() -> Unit)? = null @EpoxyAttribute var toggleExpand: (() -> Unit)? = null @EpoxyAttribute var expanded: Boolean? = null @@ -47,14 +47,14 @@ abstract class SpaceSummaryItem : VectorEpoxyModel() { holder.rootView.setOnClickListener { listener?.invoke() } holder.groupNameView.text = matrixItem.displayName holder.rootView.isChecked = selected - if (onLeave != null) { - holder.leaveView.setOnClickListener( + if (onMore != null) { + holder.moreView.setOnClickListener( DebouncedClickListener({ _ -> - onLeave?.invoke() + onMore?.invoke() }) ) } else { - holder.leaveView.isVisible = false + holder.moreView.isVisible = false } when (expanded) { @@ -88,7 +88,7 @@ abstract class SpaceSummaryItem : VectorEpoxyModel() { val avatarImageView by bind(R.id.groupAvatarImageView) val groupNameView by bind(R.id.groupNameView) val rootView by bind(R.id.itemGroupLayout) - val leaveView by bind(R.id.groupTmpLeave) + val moreView by bind(R.id.groupTmpLeave) val collapseIndicator by bind(R.id.groupChildrenCollapse) } } diff --git a/vector/src/main/res/drawable/ic_explore.xml b/vector/src/main/res/drawable/ic_explore.xml new file mode 100644 index 00000000000..09a496170f3 --- /dev/null +++ b/vector/src/main/res/drawable/ic_explore.xml @@ -0,0 +1,13 @@ + + + + diff --git a/vector/src/main/res/layout/bottom_sheet_space_settings.xml b/vector/src/main/res/layout/bottom_sheet_space_settings.xml new file mode 100644 index 00000000000..65d87257c64 --- /dev/null +++ b/vector/src/main/res/layout/bottom_sheet_space_settings.xml @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vector/src/main/res/layout/fragment_home_detail.xml b/vector/src/main/res/layout/fragment_home_detail.xml index ba2b630efe5..bea64bcab16 100644 --- a/vector/src/main/res/layout/fragment_home_detail.xml +++ b/vector/src/main/res/layout/fragment_home_detail.xml @@ -35,6 +35,7 @@ android:layout_weight="1" android:gravity="start" android:orientation="vertical" + android:id="@+id/homeToolbarContent" android:paddingStart="8dp" android:paddingEnd="8dp"> diff --git a/vector/src/main/res/layout/item_space.xml b/vector/src/main/res/layout/item_space.xml index 92f0fcc1d5f..ce3b5c69bcb 100644 --- a/vector/src/main/res/layout/item_space.xml +++ b/vector/src/main/res/layout/item_space.xml @@ -66,8 +66,8 @@ android:padding="4dp" android:layout_marginEnd="4dp" android:importantForAccessibility="no" - android:src="@drawable/ic_room_actions_leave" - app:tint="@color/riotx_destructive_accent" + android:src="@drawable/ic_more_vertical" + app:tint="?riotx_text_secondary" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toStartOf="@id/groupAvatarChevron" app:layout_constraintTop_toTopOf="parent" /> diff --git a/vector/src/main/res/values/strings.xml b/vector/src/main/res/values/strings.xml index a7a5f26d560..3e357b3b898 100644 --- a/vector/src/main/res/values/strings.xml +++ b/vector/src/main/res/values/strings.xml @@ -3281,6 +3281,7 @@ Random Creating Space… Invite people to your space + Invite people It’s just you at the moment. %s will be even better with others. Invite by email Invite by username @@ -3295,4 +3296,6 @@ You’re not in any rooms yet. Below are some suggested rooms, but you can see more with the green button bottom right. Explore rooms + Leave Space + Are you sure you want to leave the space? From ea5cc370754f7e730fc887ca76e75b28911f23fb Mon Sep 17 00:00:00 2001 From: Valere Date: Fri, 19 Mar 2021 18:55:29 +0100 Subject: [PATCH 2/2] cleaning --- .../app/features/spaces/SpaceSettingsMenuBottomSheet.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/spaces/SpaceSettingsMenuBottomSheet.kt b/vector/src/main/java/im/vector/app/features/spaces/SpaceSettingsMenuBottomSheet.kt index 02d40e96ddd..5153401d39f 100644 --- a/vector/src/main/java/im/vector/app/features/spaces/SpaceSettingsMenuBottomSheet.kt +++ b/vector/src/main/java/im/vector/app/features/spaces/SpaceSettingsMenuBottomSheet.kt @@ -71,11 +71,11 @@ class SpaceSettingsMenuBottomSheet : VectorBaseBottomSheetDialogFragment - avatarRenderer.renderSpace(roomSummary.toMatrixItem(), views.roomAvatarImageView) - views.roomNameView.text = roomSummary.displayName - views.roomDescription.text = roomSummary.topic + roomSummary?.toMatrixItem()?.let { + avatarRenderer.renderSpace(it, views.roomAvatarImageView) } + views.roomNameView.text = roomSummary?.displayName + views.roomDescription.text = roomSummary?.topic val room = session.getRoom(spaceArgs.spaceId) ?: return