diff --git a/vector/src/main/java/im/vector/riotx/core/platform/VectorBaseFragment.kt b/vector/src/main/java/im/vector/riotx/core/platform/VectorBaseFragment.kt index 8261b5991b..cbb0e904e4 100644 --- a/vector/src/main/java/im/vector/riotx/core/platform/VectorBaseFragment.kt +++ b/vector/src/main/java/im/vector/riotx/core/platform/VectorBaseFragment.kt @@ -263,6 +263,9 @@ abstract class VectorBaseFragment : BaseMvRxFragment(), HasScreenInjector { } } + // This should be provided by the framework + protected fun invalidateOptionsMenu() = requireActivity().invalidateOptionsMenu() + /* ========================================================================================== * Common Dialogs * ========================================================================================== */ diff --git a/vector/src/main/java/im/vector/riotx/features/attachments/preview/AttachmentsPreviewFragment.kt b/vector/src/main/java/im/vector/riotx/features/attachments/preview/AttachmentsPreviewFragment.kt index 062295f586..25f3ebc2d9 100644 --- a/vector/src/main/java/im/vector/riotx/features/attachments/preview/AttachmentsPreviewFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/attachments/preview/AttachmentsPreviewFragment.kt @@ -127,7 +127,7 @@ class AttachmentsPreviewFragment @Inject constructor( } override fun invalidate() = withState(viewModel) { state -> - requireActivity().invalidateOptionsMenu() + invalidateOptionsMenu() if (state.attachments.isEmpty()) { requireActivity().setResult(RESULT_CANCELED) requireActivity().finish() diff --git a/vector/src/main/java/im/vector/riotx/features/createdirect/CreateDirectRoomKnownUsersFragment.kt b/vector/src/main/java/im/vector/riotx/features/createdirect/CreateDirectRoomKnownUsersFragment.kt index e06df21be5..fc1a4b9e65 100644 --- a/vector/src/main/java/im/vector/riotx/features/createdirect/CreateDirectRoomKnownUsersFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/createdirect/CreateDirectRoomKnownUsersFragment.kt @@ -149,7 +149,7 @@ class CreateDirectRoomKnownUsersFragment @Inject constructor( } private fun renderSelectedUsers(selectedUsers: Set) { - vectorBaseActivity.invalidateOptionsMenu() + invalidateOptionsMenu() if (selectedUsers.isNotEmpty() && chipGroup.size == 0) { selectedUsers.forEach { addChipToGroup(it, chipGroup) } } diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/list/RoomListFragment.kt b/vector/src/main/java/im/vector/riotx/features/home/room/list/RoomListFragment.kt index 96af6e5908..e5141975f3 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/list/RoomListFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/list/RoomListFragment.kt @@ -257,7 +257,7 @@ class RoomListFragment @Inject constructor( val newValue = state.hasUnread if (hasUnreadRooms != newValue) { hasUnreadRooms = newValue - requireActivity().invalidateOptionsMenu() + invalidateOptionsMenu() } } else -> Unit