mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 10:25:35 +03:00
Menu: extract management to a common interface / Migrate Fragments
This commit is contained in:
parent
be099dcae0
commit
81505d3802
18 changed files with 58 additions and 31 deletions
|
@ -164,12 +164,13 @@ abstract class VectorBaseFragment<VB : ViewBinding> : Fragment(), MavericksView
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupMenu() {
|
private fun setupMenu() {
|
||||||
val menuRes = getMenuRes().takeIf { it != -1 } ?: return
|
if (this !is VectorMenuProvider) return
|
||||||
|
if (getMenuRes() == -1) return
|
||||||
val menuHost: MenuHost = requireActivity()
|
val menuHost: MenuHost = requireActivity()
|
||||||
menuHost.addMenuProvider(
|
menuHost.addMenuProvider(
|
||||||
object : MenuProvider {
|
object : MenuProvider {
|
||||||
override fun onCreateMenu(menu: Menu, menuInflater: MenuInflater) {
|
override fun onCreateMenu(menu: Menu, menuInflater: MenuInflater) {
|
||||||
menuInflater.inflate(menuRes, menu)
|
menuInflater.inflate(getMenuRes(), menu)
|
||||||
handlePostCreateMenu(menu)
|
handlePostCreateMenu(menu)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -296,18 +297,6 @@ abstract class VectorBaseFragment<VB : ViewBinding> : Fragment(), MavericksView
|
||||||
* MENU MANAGEMENT
|
* MENU MANAGEMENT
|
||||||
* ========================================================================================== */
|
* ========================================================================================== */
|
||||||
|
|
||||||
open fun getMenuRes() = -1
|
|
||||||
|
|
||||||
// No op by default
|
|
||||||
open fun handlePostCreateMenu(menu: Menu) = Unit
|
|
||||||
|
|
||||||
// No op by default
|
|
||||||
open fun handlePrepareMenu(menu: Menu) = Unit
|
|
||||||
|
|
||||||
open fun handleMenuItemSelected(item: MenuItem): Boolean {
|
|
||||||
throw NotImplementedError("You must override this method to handle click on menu item")
|
|
||||||
}
|
|
||||||
|
|
||||||
// This should be provided by the framework
|
// This should be provided by the framework
|
||||||
protected fun invalidateOptionsMenu() = requireActivity().invalidateOptionsMenu()
|
protected fun invalidateOptionsMenu() = requireActivity().invalidateOptionsMenu()
|
||||||
|
|
||||||
|
|
|
@ -44,6 +44,7 @@ import im.vector.app.core.extensions.cleanup
|
||||||
import im.vector.app.core.extensions.insertBeforeLast
|
import im.vector.app.core.extensions.insertBeforeLast
|
||||||
import im.vector.app.core.extensions.registerStartForActivityResult
|
import im.vector.app.core.extensions.registerStartForActivityResult
|
||||||
import im.vector.app.core.platform.VectorBaseFragment
|
import im.vector.app.core.platform.VectorBaseFragment
|
||||||
|
import im.vector.app.core.platform.VectorMenuProvider
|
||||||
import im.vector.app.core.resources.ColorProvider
|
import im.vector.app.core.resources.ColorProvider
|
||||||
import im.vector.app.core.time.Clock
|
import im.vector.app.core.time.Clock
|
||||||
import im.vector.app.core.utils.OnSnapPositionChangeListener
|
import im.vector.app.core.utils.OnSnapPositionChangeListener
|
||||||
|
@ -67,7 +68,9 @@ class AttachmentsPreviewFragment @Inject constructor(
|
||||||
private val attachmentBigPreviewController: AttachmentBigPreviewController,
|
private val attachmentBigPreviewController: AttachmentBigPreviewController,
|
||||||
private val colorProvider: ColorProvider,
|
private val colorProvider: ColorProvider,
|
||||||
private val clock: Clock,
|
private val clock: Clock,
|
||||||
) : VectorBaseFragment<FragmentAttachmentsPreviewBinding>(), AttachmentMiniaturePreviewController.Callback {
|
) : VectorBaseFragment<FragmentAttachmentsPreviewBinding>(),
|
||||||
|
AttachmentMiniaturePreviewController.Callback,
|
||||||
|
VectorMenuProvider {
|
||||||
|
|
||||||
private val fragmentArgs: AttachmentsPreviewArgs by args()
|
private val fragmentArgs: AttachmentsPreviewArgs by args()
|
||||||
private val viewModel: AttachmentsPreviewViewModel by fragmentViewModel()
|
private val viewModel: AttachmentsPreviewViewModel by fragmentViewModel()
|
||||||
|
|
|
@ -36,6 +36,7 @@ import im.vector.app.core.extensions.toMvRxBundle
|
||||||
import im.vector.app.core.platform.OnBackPressed
|
import im.vector.app.core.platform.OnBackPressed
|
||||||
import im.vector.app.core.platform.VectorBaseActivity
|
import im.vector.app.core.platform.VectorBaseActivity
|
||||||
import im.vector.app.core.platform.VectorBaseFragment
|
import im.vector.app.core.platform.VectorBaseFragment
|
||||||
|
import im.vector.app.core.platform.VectorMenuProvider
|
||||||
import im.vector.app.core.resources.ColorProvider
|
import im.vector.app.core.resources.ColorProvider
|
||||||
import im.vector.app.core.ui.views.CurrentCallsView
|
import im.vector.app.core.ui.views.CurrentCallsView
|
||||||
import im.vector.app.core.ui.views.CurrentCallsViewPresenter
|
import im.vector.app.core.ui.views.CurrentCallsViewPresenter
|
||||||
|
@ -71,7 +72,8 @@ class HomeDetailFragment @Inject constructor(
|
||||||
) : VectorBaseFragment<FragmentHomeDetailBinding>(),
|
) : VectorBaseFragment<FragmentHomeDetailBinding>(),
|
||||||
KeysBackupBanner.Delegate,
|
KeysBackupBanner.Delegate,
|
||||||
CurrentCallsView.Callback,
|
CurrentCallsView.Callback,
|
||||||
OnBackPressed {
|
OnBackPressed,
|
||||||
|
VectorMenuProvider {
|
||||||
|
|
||||||
private val viewModel: HomeDetailViewModel by fragmentViewModel()
|
private val viewModel: HomeDetailViewModel by fragmentViewModel()
|
||||||
private val unknownDeviceDetectorSharedViewModel: UnknownDeviceDetectorSharedViewModel by activityViewModel()
|
private val unknownDeviceDetectorSharedViewModel: UnknownDeviceDetectorSharedViewModel by activityViewModel()
|
||||||
|
|
|
@ -88,6 +88,7 @@ import im.vector.app.core.hardware.vibrate
|
||||||
import im.vector.app.core.intent.getFilenameFromUri
|
import im.vector.app.core.intent.getFilenameFromUri
|
||||||
import im.vector.app.core.intent.getMimeTypeFromUri
|
import im.vector.app.core.intent.getMimeTypeFromUri
|
||||||
import im.vector.app.core.platform.VectorBaseFragment
|
import im.vector.app.core.platform.VectorBaseFragment
|
||||||
|
import im.vector.app.core.platform.VectorMenuProvider
|
||||||
import im.vector.app.core.platform.lifecycleAwareLazy
|
import im.vector.app.core.platform.lifecycleAwareLazy
|
||||||
import im.vector.app.core.platform.showOptimizedSnackbar
|
import im.vector.app.core.platform.showOptimizedSnackbar
|
||||||
import im.vector.app.core.resources.ColorProvider
|
import im.vector.app.core.resources.ColorProvider
|
||||||
|
@ -279,7 +280,8 @@ class TimelineFragment @Inject constructor(
|
||||||
AttachmentTypeSelectorView.Callback,
|
AttachmentTypeSelectorView.Callback,
|
||||||
AttachmentsHelper.Callback,
|
AttachmentsHelper.Callback,
|
||||||
GalleryOrCameraDialogHelper.Listener,
|
GalleryOrCameraDialogHelper.Listener,
|
||||||
CurrentCallsView.Callback {
|
CurrentCallsView.Callback,
|
||||||
|
VectorMenuProvider {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,7 @@ import im.vector.app.R
|
||||||
import im.vector.app.core.extensions.cleanup
|
import im.vector.app.core.extensions.cleanup
|
||||||
import im.vector.app.core.extensions.configureWith
|
import im.vector.app.core.extensions.configureWith
|
||||||
import im.vector.app.core.platform.VectorBaseFragment
|
import im.vector.app.core.platform.VectorBaseFragment
|
||||||
|
import im.vector.app.core.platform.VectorMenuProvider
|
||||||
import im.vector.app.databinding.FragmentThreadListBinding
|
import im.vector.app.databinding.FragmentThreadListBinding
|
||||||
import im.vector.app.features.analytics.plan.MobileScreen
|
import im.vector.app.features.analytics.plan.MobileScreen
|
||||||
import im.vector.app.features.home.AvatarRenderer
|
import im.vector.app.features.home.AvatarRenderer
|
||||||
|
@ -53,7 +54,8 @@ class ThreadListFragment @Inject constructor(
|
||||||
private val threadListController: ThreadListController,
|
private val threadListController: ThreadListController,
|
||||||
val threadListViewModelFactory: ThreadListViewModel.Factory
|
val threadListViewModelFactory: ThreadListViewModel.Factory
|
||||||
) : VectorBaseFragment<FragmentThreadListBinding>(),
|
) : VectorBaseFragment<FragmentThreadListBinding>(),
|
||||||
ThreadListController.Listener {
|
ThreadListController.Listener,
|
||||||
|
VectorMenuProvider {
|
||||||
|
|
||||||
private val threadListViewModel: ThreadListViewModel by fragmentViewModel()
|
private val threadListViewModel: ThreadListViewModel by fragmentViewModel()
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,7 @@ import com.airbnb.mvrx.args
|
||||||
import com.mapbox.mapboxsdk.maps.MapView
|
import com.mapbox.mapboxsdk.maps.MapView
|
||||||
import im.vector.app.R
|
import im.vector.app.R
|
||||||
import im.vector.app.core.platform.VectorBaseFragment
|
import im.vector.app.core.platform.VectorBaseFragment
|
||||||
|
import im.vector.app.core.platform.VectorMenuProvider
|
||||||
import im.vector.app.core.utils.openLocation
|
import im.vector.app.core.utils.openLocation
|
||||||
import im.vector.app.databinding.FragmentLocationPreviewBinding
|
import im.vector.app.databinding.FragmentLocationPreviewBinding
|
||||||
import im.vector.app.features.home.room.detail.timeline.helper.LocationPinProvider
|
import im.vector.app.features.home.room.detail.timeline.helper.LocationPinProvider
|
||||||
|
@ -38,7 +39,8 @@ import javax.inject.Inject
|
||||||
class LocationPreviewFragment @Inject constructor(
|
class LocationPreviewFragment @Inject constructor(
|
||||||
private val urlMapProvider: UrlMapProvider,
|
private val urlMapProvider: UrlMapProvider,
|
||||||
private val locationPinProvider: LocationPinProvider
|
private val locationPinProvider: LocationPinProvider
|
||||||
) : VectorBaseFragment<FragmentLocationPreviewBinding>() {
|
) : VectorBaseFragment<FragmentLocationPreviewBinding>(),
|
||||||
|
VectorMenuProvider {
|
||||||
|
|
||||||
private val args: LocationSharingArgs by args()
|
private val args: LocationSharingArgs by args()
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,7 @@ import im.vector.app.core.extensions.cleanup
|
||||||
import im.vector.app.core.extensions.configureWith
|
import im.vector.app.core.extensions.configureWith
|
||||||
import im.vector.app.core.extensions.trackItemsVisibilityChange
|
import im.vector.app.core.extensions.trackItemsVisibilityChange
|
||||||
import im.vector.app.core.platform.VectorBaseFragment
|
import im.vector.app.core.platform.VectorBaseFragment
|
||||||
|
import im.vector.app.core.platform.VectorMenuProvider
|
||||||
import im.vector.app.core.platform.showOptimizedSnackbar
|
import im.vector.app.core.platform.showOptimizedSnackbar
|
||||||
import im.vector.app.core.utils.toast
|
import im.vector.app.core.utils.toast
|
||||||
import im.vector.app.databinding.FragmentPublicRoomsBinding
|
import im.vector.app.databinding.FragmentPublicRoomsBinding
|
||||||
|
@ -55,7 +56,8 @@ class PublicRoomsFragment @Inject constructor(
|
||||||
private val permalinkHandler: PermalinkHandler,
|
private val permalinkHandler: PermalinkHandler,
|
||||||
private val session: Session
|
private val session: Session
|
||||||
) : VectorBaseFragment<FragmentPublicRoomsBinding>(),
|
) : VectorBaseFragment<FragmentPublicRoomsBinding>(),
|
||||||
PublicRoomsController.Callback {
|
PublicRoomsController.Callback,
|
||||||
|
VectorMenuProvider {
|
||||||
|
|
||||||
private val viewModel: RoomDirectoryViewModel by activityViewModel()
|
private val viewModel: RoomDirectoryViewModel by activityViewModel()
|
||||||
private lateinit var sharedActionViewModel: RoomDirectorySharedActionViewModel
|
private lateinit var sharedActionViewModel: RoomDirectorySharedActionViewModel
|
||||||
|
|
|
@ -42,6 +42,7 @@ import im.vector.app.core.extensions.copyOnLongClick
|
||||||
import im.vector.app.core.extensions.setTextOrHide
|
import im.vector.app.core.extensions.setTextOrHide
|
||||||
import im.vector.app.core.platform.StateView
|
import im.vector.app.core.platform.StateView
|
||||||
import im.vector.app.core.platform.VectorBaseFragment
|
import im.vector.app.core.platform.VectorBaseFragment
|
||||||
|
import im.vector.app.core.platform.VectorMenuProvider
|
||||||
import im.vector.app.core.utils.startSharePlainTextIntent
|
import im.vector.app.core.utils.startSharePlainTextIntent
|
||||||
import im.vector.app.databinding.DialogBaseEditTextBinding
|
import im.vector.app.databinding.DialogBaseEditTextBinding
|
||||||
import im.vector.app.databinding.DialogShareQrCodeBinding
|
import im.vector.app.databinding.DialogShareQrCodeBinding
|
||||||
|
@ -74,7 +75,8 @@ class RoomMemberProfileFragment @Inject constructor(
|
||||||
private val roomDetailPendingActionStore: RoomDetailPendingActionStore,
|
private val roomDetailPendingActionStore: RoomDetailPendingActionStore,
|
||||||
private val matrixItemColorProvider: MatrixItemColorProvider
|
private val matrixItemColorProvider: MatrixItemColorProvider
|
||||||
) : VectorBaseFragment<FragmentMatrixProfileBinding>(),
|
) : VectorBaseFragment<FragmentMatrixProfileBinding>(),
|
||||||
RoomMemberProfileController.Callback {
|
RoomMemberProfileController.Callback,
|
||||||
|
VectorMenuProvider {
|
||||||
|
|
||||||
private lateinit var headerViews: ViewStubRoomMemberProfileHeaderBinding
|
private lateinit var headerViews: ViewStubRoomMemberProfileHeaderBinding
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@ import im.vector.app.core.extensions.configureWith
|
||||||
import im.vector.app.core.extensions.copyOnLongClick
|
import im.vector.app.core.extensions.copyOnLongClick
|
||||||
import im.vector.app.core.extensions.setTextOrHide
|
import im.vector.app.core.extensions.setTextOrHide
|
||||||
import im.vector.app.core.platform.VectorBaseFragment
|
import im.vector.app.core.platform.VectorBaseFragment
|
||||||
|
import im.vector.app.core.platform.VectorMenuProvider
|
||||||
import im.vector.app.core.utils.copyToClipboard
|
import im.vector.app.core.utils.copyToClipboard
|
||||||
import im.vector.app.core.utils.startSharePlainTextIntent
|
import im.vector.app.core.utils.startSharePlainTextIntent
|
||||||
import im.vector.app.databinding.FragmentMatrixProfileBinding
|
import im.vector.app.databinding.FragmentMatrixProfileBinding
|
||||||
|
@ -70,7 +71,8 @@ class RoomProfileFragment @Inject constructor(
|
||||||
private val roomDetailPendingActionStore: RoomDetailPendingActionStore,
|
private val roomDetailPendingActionStore: RoomDetailPendingActionStore,
|
||||||
) :
|
) :
|
||||||
VectorBaseFragment<FragmentMatrixProfileBinding>(),
|
VectorBaseFragment<FragmentMatrixProfileBinding>(),
|
||||||
RoomProfileController.Callback {
|
RoomProfileController.Callback,
|
||||||
|
VectorMenuProvider {
|
||||||
|
|
||||||
private lateinit var headerViews: ViewStubRoomProfileHeaderBinding
|
private lateinit var headerViews: ViewStubRoomProfileHeaderBinding
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,7 @@ import im.vector.app.core.extensions.configureWith
|
||||||
import im.vector.app.core.intent.getFilenameFromUri
|
import im.vector.app.core.intent.getFilenameFromUri
|
||||||
import im.vector.app.core.platform.OnBackPressed
|
import im.vector.app.core.platform.OnBackPressed
|
||||||
import im.vector.app.core.platform.VectorBaseFragment
|
import im.vector.app.core.platform.VectorBaseFragment
|
||||||
|
import im.vector.app.core.platform.VectorMenuProvider
|
||||||
import im.vector.app.core.resources.ColorProvider
|
import im.vector.app.core.resources.ColorProvider
|
||||||
import im.vector.app.core.time.Clock
|
import im.vector.app.core.time.Clock
|
||||||
import im.vector.app.core.utils.toast
|
import im.vector.app.core.utils.toast
|
||||||
|
@ -64,7 +65,8 @@ class RoomSettingsFragment @Inject constructor(
|
||||||
VectorBaseFragment<FragmentRoomSettingGenericBinding>(),
|
VectorBaseFragment<FragmentRoomSettingGenericBinding>(),
|
||||||
RoomSettingsController.Callback,
|
RoomSettingsController.Callback,
|
||||||
OnBackPressed,
|
OnBackPressed,
|
||||||
GalleryOrCameraDialogHelper.Listener {
|
GalleryOrCameraDialogHelper.Listener,
|
||||||
|
VectorMenuProvider {
|
||||||
|
|
||||||
private val viewModel: RoomSettingsViewModel by fragmentViewModel()
|
private val viewModel: RoomSettingsViewModel by fragmentViewModel()
|
||||||
private lateinit var roomProfileSharedActionViewModel: RoomProfileSharedActionViewModel
|
private lateinit var roomProfileSharedActionViewModel: RoomProfileSharedActionViewModel
|
||||||
|
|
|
@ -34,6 +34,7 @@ import im.vector.app.R
|
||||||
import im.vector.app.core.extensions.registerStartForActivityResult
|
import im.vector.app.core.extensions.registerStartForActivityResult
|
||||||
import im.vector.app.core.extensions.safeOpenOutputStream
|
import im.vector.app.core.extensions.safeOpenOutputStream
|
||||||
import im.vector.app.core.platform.VectorBaseFragment
|
import im.vector.app.core.platform.VectorBaseFragment
|
||||||
|
import im.vector.app.core.platform.VectorMenuProvider
|
||||||
import im.vector.app.core.time.Clock
|
import im.vector.app.core.time.Clock
|
||||||
import im.vector.app.core.utils.selectTxtFileToWrite
|
import im.vector.app.core.utils.selectTxtFileToWrite
|
||||||
import im.vector.app.databinding.FragmentDevtoolKeyrequestsBinding
|
import im.vector.app.databinding.FragmentDevtoolKeyrequestsBinding
|
||||||
|
@ -42,7 +43,8 @@ import javax.inject.Inject
|
||||||
|
|
||||||
class KeyRequestsFragment @Inject constructor(
|
class KeyRequestsFragment @Inject constructor(
|
||||||
private val clock: Clock,
|
private val clock: Clock,
|
||||||
) : VectorBaseFragment<FragmentDevtoolKeyrequestsBinding>() {
|
) : VectorBaseFragment<FragmentDevtoolKeyrequestsBinding>(),
|
||||||
|
VectorMenuProvider {
|
||||||
|
|
||||||
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentDevtoolKeyrequestsBinding {
|
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentDevtoolKeyrequestsBinding {
|
||||||
return FragmentDevtoolKeyrequestsBinding.inflate(inflater, container, false)
|
return FragmentDevtoolKeyrequestsBinding.inflate(inflater, container, false)
|
||||||
|
|
|
@ -29,6 +29,7 @@ import im.vector.app.R
|
||||||
import im.vector.app.core.extensions.cleanup
|
import im.vector.app.core.extensions.cleanup
|
||||||
import im.vector.app.core.extensions.configureWith
|
import im.vector.app.core.extensions.configureWith
|
||||||
import im.vector.app.core.platform.VectorBaseFragment
|
import im.vector.app.core.platform.VectorBaseFragment
|
||||||
|
import im.vector.app.core.platform.VectorMenuProvider
|
||||||
import im.vector.app.databinding.FragmentGenericRecyclerBinding
|
import im.vector.app.databinding.FragmentGenericRecyclerBinding
|
||||||
import org.matrix.android.sdk.api.session.pushers.Pusher
|
import org.matrix.android.sdk.api.session.pushers.Pusher
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
@ -36,7 +37,8 @@ import javax.inject.Inject
|
||||||
// Referenced in vector_settings_notifications.xml
|
// Referenced in vector_settings_notifications.xml
|
||||||
class PushGatewaysFragment @Inject constructor(
|
class PushGatewaysFragment @Inject constructor(
|
||||||
private val epoxyController: PushGateWayController
|
private val epoxyController: PushGateWayController
|
||||||
) : VectorBaseFragment<FragmentGenericRecyclerBinding>() {
|
) : VectorBaseFragment<FragmentGenericRecyclerBinding>(),
|
||||||
|
VectorMenuProvider {
|
||||||
|
|
||||||
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentGenericRecyclerBinding {
|
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentGenericRecyclerBinding {
|
||||||
return FragmentGenericRecyclerBinding.inflate(inflater, container, false)
|
return FragmentGenericRecyclerBinding.inflate(inflater, container, false)
|
||||||
|
|
|
@ -38,6 +38,7 @@ import im.vector.app.core.extensions.configureWith
|
||||||
import im.vector.app.core.extensions.registerStartForActivityResult
|
import im.vector.app.core.extensions.registerStartForActivityResult
|
||||||
import im.vector.app.core.platform.OnBackPressed
|
import im.vector.app.core.platform.OnBackPressed
|
||||||
import im.vector.app.core.platform.VectorBaseFragment
|
import im.vector.app.core.platform.VectorBaseFragment
|
||||||
|
import im.vector.app.core.platform.VectorMenuProvider
|
||||||
import im.vector.app.core.resources.ColorProvider
|
import im.vector.app.core.resources.ColorProvider
|
||||||
import im.vector.app.core.utils.colorizeMatchingText
|
import im.vector.app.core.utils.colorizeMatchingText
|
||||||
import im.vector.app.core.utils.isValidUrl
|
import im.vector.app.core.utils.isValidUrl
|
||||||
|
@ -67,7 +68,8 @@ class SpaceDirectoryFragment @Inject constructor(
|
||||||
) : VectorBaseFragment<FragmentSpaceDirectoryBinding>(),
|
) : VectorBaseFragment<FragmentSpaceDirectoryBinding>(),
|
||||||
SpaceDirectoryController.InteractionListener,
|
SpaceDirectoryController.InteractionListener,
|
||||||
TimelineEventController.UrlClickCallback,
|
TimelineEventController.UrlClickCallback,
|
||||||
OnBackPressed {
|
OnBackPressed,
|
||||||
|
VectorMenuProvider {
|
||||||
|
|
||||||
override fun getMenuRes() = R.menu.menu_space_directory
|
override fun getMenuRes() = R.menu.menu_space_directory
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@ import im.vector.app.R
|
||||||
import im.vector.app.core.extensions.cleanup
|
import im.vector.app.core.extensions.cleanup
|
||||||
import im.vector.app.core.extensions.configureWith
|
import im.vector.app.core.extensions.configureWith
|
||||||
import im.vector.app.core.platform.VectorBaseFragment
|
import im.vector.app.core.platform.VectorBaseFragment
|
||||||
|
import im.vector.app.core.platform.VectorMenuProvider
|
||||||
import im.vector.app.core.utils.ToggleableAppBarLayoutBehavior
|
import im.vector.app.core.utils.ToggleableAppBarLayoutBehavior
|
||||||
import im.vector.app.databinding.FragmentSpaceLeaveAdvancedBinding
|
import im.vector.app.databinding.FragmentSpaceLeaveAdvancedBinding
|
||||||
import org.matrix.android.sdk.api.session.room.model.RoomSummary
|
import org.matrix.android.sdk.api.session.room.model.RoomSummary
|
||||||
|
@ -40,7 +41,8 @@ import javax.inject.Inject
|
||||||
class SpaceLeaveAdvancedFragment @Inject constructor(
|
class SpaceLeaveAdvancedFragment @Inject constructor(
|
||||||
val controller: SelectChildrenController
|
val controller: SelectChildrenController
|
||||||
) : VectorBaseFragment<FragmentSpaceLeaveAdvancedBinding>(),
|
) : VectorBaseFragment<FragmentSpaceLeaveAdvancedBinding>(),
|
||||||
SelectChildrenController.Listener {
|
SelectChildrenController.Listener,
|
||||||
|
VectorMenuProvider {
|
||||||
|
|
||||||
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?) =
|
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?) =
|
||||||
FragmentSpaceLeaveAdvancedBinding.inflate(layoutInflater, container, false)
|
FragmentSpaceLeaveAdvancedBinding.inflate(layoutInflater, container, false)
|
||||||
|
@ -49,6 +51,8 @@ class SpaceLeaveAdvancedFragment @Inject constructor(
|
||||||
|
|
||||||
override fun getMenuRes() = R.menu.menu_space_leave
|
override fun getMenuRes() = R.menu.menu_space_leave
|
||||||
|
|
||||||
|
override fun handleMenuItemSelected(item: MenuItem) = false
|
||||||
|
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,7 @@ import im.vector.app.R
|
||||||
import im.vector.app.core.extensions.cleanup
|
import im.vector.app.core.extensions.cleanup
|
||||||
import im.vector.app.core.platform.OnBackPressed
|
import im.vector.app.core.platform.OnBackPressed
|
||||||
import im.vector.app.core.platform.VectorBaseFragment
|
import im.vector.app.core.platform.VectorBaseFragment
|
||||||
|
import im.vector.app.core.platform.VectorMenuProvider
|
||||||
import im.vector.app.databinding.FragmentSpaceAddRoomsBinding
|
import im.vector.app.databinding.FragmentSpaceAddRoomsBinding
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
import kotlinx.coroutines.flow.debounce
|
import kotlinx.coroutines.flow.debounce
|
||||||
|
@ -51,7 +52,9 @@ class SpaceAddRoomFragment @Inject constructor(
|
||||||
private val roomEpoxyController: AddRoomListController,
|
private val roomEpoxyController: AddRoomListController,
|
||||||
private val dmEpoxyController: AddRoomListController,
|
private val dmEpoxyController: AddRoomListController,
|
||||||
) : VectorBaseFragment<FragmentSpaceAddRoomsBinding>(),
|
) : VectorBaseFragment<FragmentSpaceAddRoomsBinding>(),
|
||||||
OnBackPressed, AddRoomListController.Listener {
|
OnBackPressed,
|
||||||
|
AddRoomListController.Listener,
|
||||||
|
VectorMenuProvider {
|
||||||
|
|
||||||
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?) =
|
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?) =
|
||||||
FragmentSpaceAddRoomsBinding.inflate(layoutInflater, container, false)
|
FragmentSpaceAddRoomsBinding.inflate(layoutInflater, container, false)
|
||||||
|
|
|
@ -37,6 +37,7 @@ import im.vector.app.core.extensions.configureWith
|
||||||
import im.vector.app.core.intent.getFilenameFromUri
|
import im.vector.app.core.intent.getFilenameFromUri
|
||||||
import im.vector.app.core.platform.OnBackPressed
|
import im.vector.app.core.platform.OnBackPressed
|
||||||
import im.vector.app.core.platform.VectorBaseFragment
|
import im.vector.app.core.platform.VectorBaseFragment
|
||||||
|
import im.vector.app.core.platform.VectorMenuProvider
|
||||||
import im.vector.app.core.resources.ColorProvider
|
import im.vector.app.core.resources.ColorProvider
|
||||||
import im.vector.app.core.time.Clock
|
import im.vector.app.core.time.Clock
|
||||||
import im.vector.app.core.utils.toast
|
import im.vector.app.core.utils.toast
|
||||||
|
@ -66,7 +67,8 @@ class SpaceSettingsFragment @Inject constructor(
|
||||||
) : VectorBaseFragment<FragmentRoomSettingGenericBinding>(),
|
) : VectorBaseFragment<FragmentRoomSettingGenericBinding>(),
|
||||||
SpaceSettingsController.Callback,
|
SpaceSettingsController.Callback,
|
||||||
GalleryOrCameraDialogHelper.Listener,
|
GalleryOrCameraDialogHelper.Listener,
|
||||||
OnBackPressed {
|
OnBackPressed,
|
||||||
|
VectorMenuProvider {
|
||||||
|
|
||||||
private val viewModel: RoomSettingsViewModel by fragmentViewModel()
|
private val viewModel: RoomSettingsViewModel by fragmentViewModel()
|
||||||
private val sharedViewModel: SpaceManageSharedViewModel by activityViewModel()
|
private val sharedViewModel: SpaceManageSharedViewModel by activityViewModel()
|
||||||
|
|
|
@ -36,6 +36,7 @@ import im.vector.app.core.extensions.configureWith
|
||||||
import im.vector.app.core.extensions.hideKeyboard
|
import im.vector.app.core.extensions.hideKeyboard
|
||||||
import im.vector.app.core.extensions.setupAsSearch
|
import im.vector.app.core.extensions.setupAsSearch
|
||||||
import im.vector.app.core.platform.VectorBaseFragment
|
import im.vector.app.core.platform.VectorBaseFragment
|
||||||
|
import im.vector.app.core.platform.VectorMenuProvider
|
||||||
import im.vector.app.core.utils.DimensionConverter
|
import im.vector.app.core.utils.DimensionConverter
|
||||||
import im.vector.app.core.utils.showIdentityServerConsentDialog
|
import im.vector.app.core.utils.showIdentityServerConsentDialog
|
||||||
import im.vector.app.core.utils.startSharePlainTextIntent
|
import im.vector.app.core.utils.startSharePlainTextIntent
|
||||||
|
@ -54,7 +55,8 @@ class UserListFragment @Inject constructor(
|
||||||
private val userListController: UserListController,
|
private val userListController: UserListController,
|
||||||
private val dimensionConverter: DimensionConverter,
|
private val dimensionConverter: DimensionConverter,
|
||||||
) : VectorBaseFragment<FragmentUserListBinding>(),
|
) : VectorBaseFragment<FragmentUserListBinding>(),
|
||||||
UserListController.Callback {
|
UserListController.Callback,
|
||||||
|
VectorMenuProvider {
|
||||||
|
|
||||||
private val args: UserListFragmentArgs by args()
|
private val args: UserListFragmentArgs by args()
|
||||||
private val viewModel: UserListViewModel by activityViewModel()
|
private val viewModel: UserListViewModel by activityViewModel()
|
||||||
|
|
|
@ -42,6 +42,7 @@ import im.vector.app.R
|
||||||
import im.vector.app.core.extensions.registerStartForActivityResult
|
import im.vector.app.core.extensions.registerStartForActivityResult
|
||||||
import im.vector.app.core.platform.OnBackPressed
|
import im.vector.app.core.platform.OnBackPressed
|
||||||
import im.vector.app.core.platform.VectorBaseFragment
|
import im.vector.app.core.platform.VectorBaseFragment
|
||||||
|
import im.vector.app.core.platform.VectorMenuProvider
|
||||||
import im.vector.app.core.utils.openUrlInExternalBrowser
|
import im.vector.app.core.utils.openUrlInExternalBrowser
|
||||||
import im.vector.app.databinding.FragmentRoomWidgetBinding
|
import im.vector.app.databinding.FragmentRoomWidgetBinding
|
||||||
import im.vector.app.features.webview.WebEventListener
|
import im.vector.app.features.webview.WebEventListener
|
||||||
|
@ -68,7 +69,8 @@ class WidgetFragment @Inject constructor(
|
||||||
) :
|
) :
|
||||||
VectorBaseFragment<FragmentRoomWidgetBinding>(),
|
VectorBaseFragment<FragmentRoomWidgetBinding>(),
|
||||||
WebEventListener,
|
WebEventListener,
|
||||||
OnBackPressed {
|
OnBackPressed,
|
||||||
|
VectorMenuProvider {
|
||||||
|
|
||||||
private val fragmentArgs: WidgetArgs by args()
|
private val fragmentArgs: WidgetArgs by args()
|
||||||
private val viewModel: WidgetViewModel by activityViewModel()
|
private val viewModel: WidgetViewModel by activityViewModel()
|
||||||
|
|
Loading…
Reference in a new issue