-
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
[Android] Overflow Actions (onto main branch) #5668
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.
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.
Hi @robin-liao. Thanks for helping make the AdaptiveCards JS renderer + tooling better. As additional verification, once the JS build succeeds, please go to the test site to test out your website/designer changes. |
karthikgopal36
approved these changes
Apr 14, 2021
golddove
approved these changes
Apr 14, 2021
Just commenting here for future reference: original PR was #5606 which has review comments / approvals. |
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. * SplitActionMode code moved to AdaptiveCardRenderer. shouldDisplayCustomOverflowActionMenu() added to IOverflowActionRenderer.java rootLevelFlags added to RenderArgs. * 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. * Addressed PR comments. * Unused files removed. * Java 8 support added to mobileChatApp * Androidx annotation updated. 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. * SplitActionMode code moved to AdaptiveCardRenderer. shouldDisplayCustomOverflowActionMenu() added to IOverflowActionRenderer.java rootLevelFlags added to RenderArgs. * 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. * Addressed PR comments. * Unused files removed. * Java 8 support added to mobileChatApp * Androidx annotation updated. 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 control overflow button "..." and flyout menu actions rendering:
View onRenderOverflowAction(@NonNull ViewGroup viewGroup, boolean isRootLevelActions)
viewGroup
is the container view to which client can optionally attach the Overflow view, andisRootLevelActions
indicates if the current "..." overflow action belongs to root level actions array. If it's false then it indicates it's ActionSet as body elements.View
instance. Returningnull
means let SDK continue to render "..." button, whileView
informs SDK don't render the current "..." button.boolean onDisplayOverflowActionMenu(@NonNull List<View> actionViewList, @NonNull View view)
actionViewList
are those rendered secondary actions views , andview
is the element that triggered the context menu, which usually is the “…” button. It can be used by client to position the context menu if client wants to renderflyout
actions itself.false
means let SDK continue to renderflyout
context menu, whiletrue
informs SDK don't renderflyout
(which implies client code might render context menu by itself viaonDisplayOverflowActionMenu
callback)boolean shouldAllowMoreThanMaxActionsInOverflowMenu()
boolean
value. Returningtrue
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 andfalse
indicates excess action elements will be left out.Sample Card
How Verified
Added Unit Test "SecondaryAcrionsPropertiesSet.Java" to test the different scenarios.