From 6d023188da475565f1dd2312364522381ff531a1 Mon Sep 17 00:00:00 2001 From: Valere Date: Fri, 17 Sep 2021 10:26:32 +0200 Subject: [PATCH] code review --- .../app/features/spaces/manage/SpaceAddRoomFragment.kt | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/spaces/manage/SpaceAddRoomFragment.kt b/vector/src/main/java/im/vector/app/features/spaces/manage/SpaceAddRoomFragment.kt index ee388b336c..e192ec3c88 100644 --- a/vector/src/main/java/im/vector/app/features/spaces/manage/SpaceAddRoomFragment.kt +++ b/vector/src/main/java/im/vector/app/features/spaces/manage/SpaceAddRoomFragment.kt @@ -117,6 +117,8 @@ class SpaceAddRoomFragment @Inject constructor( spaceEpoxyController.disabled = !it roomEpoxyController.disabled = it views.createNewRoom.text = if (it) getString(R.string.create_space) else getString(R.string.create_new_room) + val title = if (it) getString(R.string.space_add_existing_spaces) else getString(R.string.space_add_existing_rooms_only) + views.appBarTitle.text = title }.disposeOnDestroyView() views.createNewRoom.debouncedClicks { @@ -152,14 +154,6 @@ class SpaceAddRoomFragment @Inject constructor( } } - override fun onResume() { - super.onResume() - withState(viewModel) { state -> - val title = if (state.onlyShowSpaces) getString(R.string.space_add_existing_spaces) else getString(R.string.space_add_existing_rooms_only) - views.appBarTitle.text = title - } - } - override fun onPrepareOptionsMenu(menu: Menu) { super.onPrepareOptionsMenu(menu) menu.findItem(R.id.spaceAddRoomSaveItem).isVisible = saveNeeded