-
Notifications
You must be signed in to change notification settings - Fork 540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[iOS] Overflow Actions (onto main branch) #5670
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* [JS] Overflow actions #4715 * use global setting to control exceeding actions * address PR comments * fix PR build * fix PR build * fix PR build * fix pr build * address PR comments * address PR comments Co-authored-by: David Claux <dclaux@users.noreply.github.com> Ignoring unrelated Android check failures
…ry on execute (#5449) * Action.mode designer support Promote secondary action to primary on execute * Slight change in behavior for action promotion * Slight refactor
Enum created for "Mode" with "Primary" & " Secondary" constants. "Mode" is parsed from the json string.
If allowMoreThanMaxActionsInOverflowMenu is set, excess buttons will be moved to Overflow,
BottomSheetDoalog is Integrated and DropdownElement is created. Resource files added for Overflow view & BottomSheetDialog's background. Scheme keys added. IOverllowActionRenderer interface created for customizing the Overflow rendering behavior.
Method added for custom context menu . Version 1.5 introduced and sample json files added. Additional method added to AdaptiveCardRenderer for customizing OverflowActionRenderer.
OnclickListener added to custom overflow view.
- getRootLevelAction(), shouldDisplayCustomActionMenu() methods removed.
Conflicts: samples/v1.5/Elements/SecondaryActions.json
shouldDisplayCustomOverflowActionMenu() added to IOverflowActionRenderer.java rootLevelFlags added to RenderArgs.
Added Java 8 support. IoverflowActionRenderer Callbacks refactored. Swig java object models files committed. PR comments resolved.
…nto yilia/overflow-menu-ios
…nto yilia/overflow-menu-ios
robin-liao
requested review from
jwoo-msft,
paulcam206,
dclaux,
karthikgopal36 and
golddove
April 15, 2021 00:21
paulcam206
approved these changes
Apr 15, 2021
karthikgopal36
approved these changes
Apr 15, 2021
source/ios/AdaptiveCards/AdaptiveCards/AdaptiveCards/ACRActionOverflowRenderer.mm
Show resolved
Hide resolved
paulcam206
reviewed
Apr 15, 2021
Comment on lines
+221
to
+225
button = [actionRenderer renderButton:rootView | ||
inputs:inputs | ||
superview:superview | ||
baseActionElement:acoElem | ||
hostConfig:config]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alignment here looks a bit off
michaelfarnsworth
pushed a commit
to michaelfarnsworth/AdaptiveCards
that referenced
this pull request
Nov 10, 2022
* [JS] Overflow actions (flyout menu) microsoft#4715 (Pre-Release) (microsoft#5446) * [JS] Overflow actions microsoft#4715 * use global setting to control exceeding actions * address PR comments * fix PR build * fix PR build * fix PR build * fix pr build * address PR comments * address PR comments Co-authored-by: David Claux <dclaux@users.noreply.github.com> Ignoring unrelated Android check failures * [JS] Action.mode designer support + promote secondary action to primary on execute (microsoft#5449) * Action.mode designer support Promote secondary action to primary on execute * Slight change in behavior for action promotion * Slight refactor * "Mode" property added to AdaptiveCardSchemaKey. Enum created for "Mode" with "Primary" & " Secondary" constants. "Mode" is parsed from the json string. * allowMoreThanMaxActionsInOverflowMenu flag added to HostConfig. If allowMoreThanMaxActionsInOverflowMenu is set, excess buttons will be moved to Overflow, * OverflowAction view is rendered for secondary action elements. BottomSheetDoalog is Integrated and DropdownElement is created. Resource files added for Overflow view & BottomSheetDialog's background. Scheme keys added. IOverllowActionRenderer interface created for customizing the Overflow rendering behavior. * Unit Test "ActionModePropertiesTest.java" added. Method added for custom context menu . Version 1.5 introduced and sample json files added. Additional method added to AdaptiveCardRenderer for customizing OverflowActionRenderer. * IOverflowLayout onRenderOverflowAction callback refactored. OnclickListener added to custom overflow view. * Addressed PR comments. Code formatted. * Addressed PR comments. * Addressed review comments. * rootLevelAction implementation logic is refactored. * IOverflowActionRenderer callback methods refactored. - getRootLevelAction(), shouldDisplayCustomActionMenu() methods removed. * [iOS] [Preview] Overflow Actions * merge * SplitActionMode code moved to AdaptiveCardRenderer. shouldDisplayCustomOverflowActionMenu() added to IOverflowActionRenderer.java rootLevelFlags added to RenderArgs. * update * address PR comments * revert unncessary change * clang-format * clang-format * PopupWindow is integrated and BottomSheetDialog dependency is removed. Added Java 8 support. IoverflowActionRenderer Callbacks refactored. Swig java object models files committed. PR comments resolved. * Swig files committed. * address PR comments * update due to merge * update due to merge * fix due to merge * update callback declaration to conform the spec * minor update * icon image lazy load Co-authored-by: David Claux <dclaux@users.noreply.github.com> Co-authored-by: REDMOND\kargopal <kargopal@microsoft.com>
rankush
pushed a commit
to rankush/AdaptiveCards
that referenced
this pull request
May 8, 2024
* [JS] Overflow actions (flyout menu) microsoft#4715 (Pre-Release) (microsoft#5446) * [JS] Overflow actions microsoft#4715 * use global setting to control exceeding actions * address PR comments * fix PR build * fix PR build * fix PR build * fix pr build * address PR comments * address PR comments Co-authored-by: David Claux <dclaux@users.noreply.github.com> Ignoring unrelated Android check failures * [JS] Action.mode designer support + promote secondary action to primary on execute (microsoft#5449) * Action.mode designer support Promote secondary action to primary on execute * Slight change in behavior for action promotion * Slight refactor * "Mode" property added to AdaptiveCardSchemaKey. Enum created for "Mode" with "Primary" & " Secondary" constants. "Mode" is parsed from the json string. * allowMoreThanMaxActionsInOverflowMenu flag added to HostConfig. If allowMoreThanMaxActionsInOverflowMenu is set, excess buttons will be moved to Overflow, * OverflowAction view is rendered for secondary action elements. BottomSheetDoalog is Integrated and DropdownElement is created. Resource files added for Overflow view & BottomSheetDialog's background. Scheme keys added. IOverllowActionRenderer interface created for customizing the Overflow rendering behavior. * Unit Test "ActionModePropertiesTest.java" added. Method added for custom context menu . Version 1.5 introduced and sample json files added. Additional method added to AdaptiveCardRenderer for customizing OverflowActionRenderer. * IOverflowLayout onRenderOverflowAction callback refactored. OnclickListener added to custom overflow view. * Addressed PR comments. Code formatted. * Addressed PR comments. * Addressed review comments. * rootLevelAction implementation logic is refactored. * IOverflowActionRenderer callback methods refactored. - getRootLevelAction(), shouldDisplayCustomActionMenu() methods removed. * [iOS] [Preview] Overflow Actions * merge * SplitActionMode code moved to AdaptiveCardRenderer. shouldDisplayCustomOverflowActionMenu() added to IOverflowActionRenderer.java rootLevelFlags added to RenderArgs. * update * address PR comments * revert unncessary change * clang-format * clang-format * PopupWindow is integrated and BottomSheetDialog dependency is removed. Added Java 8 support. IoverflowActionRenderer Callbacks refactored. Swig java object models files committed. PR comments resolved. * Swig files committed. * address PR comments * update due to merge * update due to merge * fix due to merge * update callback declaration to conform the spec * minor update * icon image lazy load Co-authored-by: David Claux <dclaux@users.noreply.github.com> Co-authored-by: REDMOND\kargopal <kargopal@microsoft.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related Issue
ActionSet overflow flyout (... actions menu) 4715
Description
To introduce a new feature of overflow actions, the implementation follows the spec:
This new feature will bring as part of Schema version 1.5
Introduce a new property field
mode
to all Action type. Its value can beprimary
(default) orsecondary
. For all secondary action instances in the sameactions
array (either the root levelactions
section orActionSet
inside card elements) they'll group as overflow actions, wrap up within a "..." button and display flyout context menu when user clicks "..." button.hostConfig.actions.maxActions
doesn't count "..." button itself.Client callbacks are added to
ACRActionDelegate
to control overflow button "..." and flyout menu actions rendering:- (BOOL)onRenderOverflowAction:(UIButton *)button forTarget:(ACROverflowTarget *)target isAtRootLevelActions:(BOOL)isAtRootLevelActions;
button
: the current "..." overflow buttontarget
: the target to trigger popup menu or current "..." overflow button. Client can access its associated menu item actions throughtarget.menuItems
, or add this target to anyUIButton
to trigger the popupisRootLevelActions
: indicates if the current "..." overflow action belongs to root level actions array. If it's NO then it indicates it's inActionSet
as body elements.BOOL
. ReturningNO
means let SDK continue to render "..." button, while returningYES
informs SDK don't render the current "..." button.- (BOOL)onDisplayOverflowActionMenu:(NSArray<ACROverflowMenuItem *> *)menuItems alertController:(UIAlertController *)alert;
menuItems
: the action items on the overflow menu associated with the current triggered overflow "..." buttonalert
: presentable-ready alert controller. Client can just use its view controller to present this. Or client can grabmenuItems
to prepare its own overflow menuBOOL
value. If client returnsNO
, SDK will continue to present default overflow menu in action sheet, while returningYES
informs SDK don't display the popup overflow menu.- (BOOL)shouldAllowMoreThanMaxActionsInOverflowMenu;
BOOL
value. ReturningYES
indicates that the actions exceeding the number defined inhostConfig.actions.maxActions
will be auto wrapped up as overflow actions and "..." button for context menu will be displayed andNO
indicates excess action elements will be left out.Sample Card
How Verified
Updated
ADCIOSVisualizer
"ViewController.m" to test the different scenarios.