Interface UIContextMenuInteractionDelegate

    • Method Detail

      • contextMenuInteractionConfigurationForMenuAtLocation

        @Nullable
        @Nullable UIContextMenuConfiguration contextMenuInteractionConfigurationForMenuAtLocation​(@NotNull
                                                                                                  @NotNull UIContextMenuInteraction interaction,
                                                                                                  CGPoint location)
        Called when the interaction begins.
        Parameters:
        interaction - The UIContextMenuInteraction.
        location - The location of the interaction in its view.
        Returns:
        A UIContextMenuConfiguration describing the menu to be presented. Return nil to prevent the interaction from beginning. Returning an empty configuration causes the interaction to begin then fail with a cancellation effect. You might use this to indicate to users that it's possible for a menu to be presented from this view, but that there are no actions to present at this particular time.
      • contextMenuInteractionPreviewForDismissingMenuWithConfiguration

        @Nullable
        @Deprecated
        default @Nullable UITargetedPreview contextMenuInteractionPreviewForDismissingMenuWithConfiguration​(@NotNull
                                                                                                            @NotNull UIContextMenuInteraction interaction,
                                                                                                            @NotNull
                                                                                                            @NotNull UIContextMenuConfiguration configuration)
        Deprecated.
        Called when the interaction is about to dismiss. Return a UITargetedPreview describing the desired dismissal target. The interaction will animate the presented menu to the target. Use this to customize the dismissal animation.
        Parameters:
        interaction - The UIContextMenuInteraction requesting a dismissal preview.
        configuration - The configuration of the menu displayed by this interaction.
        Returns:
        Return a UITargetedPreview describing the desired dismissal target. Return nil to cause the menu to animate away without morphing into a specific view. API-Since: 13.0 Deprecated-Since: 16.0
      • contextMenuInteractionPreviewForHighlightingMenuWithConfiguration

        @Nullable
        @Deprecated
        default @Nullable UITargetedPreview contextMenuInteractionPreviewForHighlightingMenuWithConfiguration​(@NotNull
                                                                                                              @NotNull UIContextMenuInteraction interaction,
                                                                                                              @NotNull
                                                                                                              @NotNull UIContextMenuConfiguration configuration)
        Deprecated.
        Called when the interaction begins. Return a UITargetedPreview describing the desired highlight preview.
        Parameters:
        interaction - The UIContextMenuInteraction requesting a highlighting preview.
        configuration - The configuration of the menu about to be displayed by this interaction. API-Since: 13.0 Deprecated-Since: 16.0
      • contextMenuInteractionWillDisplayMenuForConfigurationAnimator

        default void contextMenuInteractionWillDisplayMenuForConfigurationAnimator​(@NotNull
                                                                                   @NotNull UIContextMenuInteraction interaction,
                                                                                   @NotNull
                                                                                   @NotNull UIContextMenuConfiguration configuration,
                                                                                   @Nullable
                                                                                   @Nullable UIContextMenuInteractionAnimating animator)
        Called when the interaction is about to display a menu.
        Parameters:
        interaction - The UIContextMenuInteraction.
        configuration - The configuration of the menu about to be displayed by this interaction.
        animator - Appearance animator. Add animations to run them alongside the appearance transition.
      • contextMenuInteractionWillEndForConfigurationAnimator

        default void contextMenuInteractionWillEndForConfigurationAnimator​(@NotNull
                                                                           @NotNull UIContextMenuInteraction interaction,
                                                                           @NotNull
                                                                           @NotNull UIContextMenuConfiguration configuration,
                                                                           @Nullable
                                                                           @Nullable UIContextMenuInteractionAnimating animator)
        Called when the interaction is about to end.
        Parameters:
        interaction - The UIContextMenuInteraction.
        configuration - Ending configuration.
        animator - Disappearance animator. Add animations to run them alongside the disappearance transition.
      • contextMenuInteractionWillPerformPreviewActionForMenuWithConfigurationAnimator

        default void contextMenuInteractionWillPerformPreviewActionForMenuWithConfigurationAnimator​(@NotNull
                                                                                                    @NotNull UIContextMenuInteraction interaction,
                                                                                                    @NotNull
                                                                                                    @NotNull UIContextMenuConfiguration configuration,
                                                                                                    @NotNull
                                                                                                    @NotNull UIContextMenuInteractionCommitAnimating animator)
        Called when the interaction is about to "commit" in response to the user tapping the preview.
        Parameters:
        interaction - The UIContextMenuInteraction.
        configuration - Configuration of the currently displayed menu.
        animator - Commit animator. Add animations to this object to run them alongside the commit transition.
      • contextMenuInteractionConfigurationDismissalPreviewForItemWithIdentifier

        @Nullable
        default @Nullable UITargetedPreview contextMenuInteractionConfigurationDismissalPreviewForItemWithIdentifier​(@NotNull
                                                                                                                     @NotNull UIContextMenuInteraction interaction,
                                                                                                                     @NotNull
                                                                                                                     @NotNull UIContextMenuConfiguration configuration,
                                                                                                                     @NotNull
                                                                                                                     @NotNull java.lang.Object identifier)
        Called when a context menu is dismissed. Return a UITargetedPreview corresponding to the item with the given identifier.
        Parameters:
        interaction - The UIContextMenuInteraction.
        configuration - Configuration of the menu being dismissed.
        identifier - Identifier for the item whose preview is being requested. API-Since: 16.0
      • contextMenuInteractionConfigurationHighlightPreviewForItemWithIdentifier

        @Nullable
        default @Nullable UITargetedPreview contextMenuInteractionConfigurationHighlightPreviewForItemWithIdentifier​(@NotNull
                                                                                                                     @NotNull UIContextMenuInteraction interaction,
                                                                                                                     @NotNull
                                                                                                                     @NotNull UIContextMenuConfiguration configuration,
                                                                                                                     @NotNull
                                                                                                                     @NotNull java.lang.Object identifier)
        Called when a context menu interaction begins. Return a UITargetedPreview corresponding to the item with the given identifier.
        Parameters:
        interaction - The UIContextMenuInteraction.
        configuration - Configuration of the menu that will be presented if the interaction proceeds.
        identifier - Identifier for the item whose preview is being requested. API-Since: 16.0