code review

This commit is contained in:
Valere 2021-09-17 10:26:32 +02:00
parent 84ef079206
commit 6d023188da
1 changed files with 2 additions and 8 deletions

View File

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