mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 18:35:40 +03:00
Better code
This commit is contained in:
parent
31d5578063
commit
ca0cd9e97d
4 changed files with 6 additions and 3 deletions
|
@ -263,6 +263,9 @@ abstract class VectorBaseFragment : BaseMvRxFragment(), HasScreenInjector {
|
|||
}
|
||||
}
|
||||
|
||||
// This should be provided by the framework
|
||||
protected fun invalidateOptionsMenu() = requireActivity().invalidateOptionsMenu()
|
||||
|
||||
/* ==========================================================================================
|
||||
* Common Dialogs
|
||||
* ========================================================================================== */
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -149,7 +149,7 @@ class CreateDirectRoomKnownUsersFragment @Inject constructor(
|
|||
}
|
||||
|
||||
private fun renderSelectedUsers(selectedUsers: Set<User>) {
|
||||
vectorBaseActivity.invalidateOptionsMenu()
|
||||
invalidateOptionsMenu()
|
||||
if (selectedUsers.isNotEmpty() && chipGroup.size == 0) {
|
||||
selectedUsers.forEach { addChipToGroup(it, chipGroup) }
|
||||
}
|
||||
|
|
|
@ -257,7 +257,7 @@ class RoomListFragment @Inject constructor(
|
|||
val newValue = state.hasUnread
|
||||
if (hasUnreadRooms != newValue) {
|
||||
hasUnreadRooms = newValue
|
||||
requireActivity().invalidateOptionsMenu()
|
||||
invalidateOptionsMenu()
|
||||
}
|
||||
}
|
||||
else -> Unit
|
||||
|
|
Loading…
Reference in a new issue