Skip to content

Comments

Set menuItem show action back to Never#14623

Merged
PureWeen merged 3 commits intomainfrom
fix_14617
Apr 26, 2023
Merged

Set menuItem show action back to Never#14623
PureWeen merged 3 commits intomainfrom
fix_14617

Conversation

@PureWeen
Copy link
Member

Description of Change

Prior to MAUI whenever the ToolbarItems changed we'd remove and readd all of them. This caused an awkward reshuffling effect with MAUI and the MaterialToolbar. So, we need to add code to switch MenuItems back to Primary when navigating.

Issues Fixed

Fixes #14617

@PureWeen PureWeen added the backport/suggested The PR author or issue review has suggested that the change should be backported. label Apr 17, 2023
@PureWeen
Copy link
Member Author

This PR might have some dependencies on #12888


if (item.Order != ToolbarItemOrder.Secondary)
menuitem.SetShowAsAction(ShowAsAction.Always);
else
Copy link
Member Author

@PureWeen PureWeen Apr 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only functional change. Never is the default so we are just reverting this back to the default if the user hasn't indicated Primary

image

@github-actions
Copy link
Contributor

Thank you for your pull request. We are auto-formatting your source code to follow our code guidelines.

@PureWeen PureWeen enabled auto-merge (squash) April 18, 2023 19:46
@PureWeen PureWeen merged commit 8b02815 into main Apr 26, 2023
@PureWeen PureWeen deleted the fix_14617 branch April 26, 2023 16:06
@hartez hartez added the backport/approved After some discussion or review, this PR or change was approved to be backported. label May 31, 2023
@hartez
Copy link
Contributor

hartez commented Jun 1, 2023

/backport to net7.0

@github-actions
Copy link
Contributor

github-actions bot commented Jun 1, 2023

@github-actions
Copy link
Contributor

github-actions bot commented Jun 1, 2023

@hartez backporting to net7.0 failed, the patch most likely resulted in conflicts:

$ git am --3way --ignore-whitespace --keep-non-patch changes.patch

Applying: Set menuItem show action back to Never
.git/rebase-apply/patch:38: trailing whitespace.
								
warning: 1 line adds whitespace errors.
Using index info to reconstruct a base tree...
M	src/Controls/src/Core/Platform/Android/Extensions/ToolbarExtensions.cs
M	src/Controls/tests/DeviceTests/ControlsHandlerTestBase.Android.cs
M	src/Controls/tests/DeviceTests/ControlsHandlerTestBase.Windows.cs
M	src/Controls/tests/DeviceTests/Elements/NavigationPage/NavigationPageTests.cs
Falling back to patching base and 3-way merge...
Auto-merging src/Controls/tests/DeviceTests/Elements/NavigationPage/NavigationPageTests.cs
CONFLICT (content): Merge conflict in src/Controls/tests/DeviceTests/Elements/NavigationPage/NavigationPageTests.cs
Auto-merging src/Controls/tests/DeviceTests/ControlsHandlerTestBase.Windows.cs
Auto-merging src/Controls/tests/DeviceTests/ControlsHandlerTestBase.Android.cs
Auto-merging src/Controls/src/Core/Platform/Android/Extensions/ToolbarExtensions.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Set menuItem show action back to Never
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

@github-actions
Copy link
Contributor

github-actions bot commented Jun 1, 2023

@hartez an error occurred while backporting to net7.0, please check the run log for details!

Error: git am failed, most likely due to a merge conflict.

hartez added a commit that referenced this pull request Jun 2, 2023
* Set menuItem show action back to Never

* Auto-format source code

* - fix iOS handler registration

---------

Co-authored-by: GitHub Actions Autoformatter <autoformat@example.com>
PureWeen added a commit that referenced this pull request Jun 5, 2023
* Set menuItem show action back to Never (#14623)

* Set menuItem show action back to Never

* Auto-format source code

* - fix iOS handler registration

---------

Co-authored-by: GitHub Actions Autoformatter <autoformat@example.com>

* - backport testing helpers

* - fix up tests

---------

Co-authored-by: GitHub Actions Autoformatter <autoformat@example.com>
Co-authored-by: Shane Neuville <shane94@hotmail.com>
Co-authored-by: Shane Neuville <shneuvil@microsoft.com>
@github-actions github-actions bot locked and limited conversation to collaborators Dec 11, 2023
@samhouts samhouts added the fixed-in-8.0.0-preview.4.8333 Look for this fix in 8.0.0-preview.4.8333! label Aug 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

backport/approved After some discussion or review, this PR or change was approved to be backported. backport/suggested The PR author or issue review has suggested that the change should be backported. fixed-in-8.0.0-preview.4.8333 Look for this fix in 8.0.0-preview.4.8333!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Non-Shell] Toolbar items are affected from previous page on Android

4 participants