From cb1ac24b9a52394169e5d2a0787e7f08543ff9b9 Mon Sep 17 00:00:00 2001 From: TJ Lambert <50846373+tj-devel709@users.noreply.github.com> Date: Wed, 24 Jan 2024 15:21:16 -0600 Subject: [PATCH] Translucent and Transparent NavigationBar on iOS (#19204) * Changes for enabling translucent navigation bar ios * Add UITest for NavigationPage Safe Area Translucence * remove UIKit * Move UITest from gallery to Issues * push a new page for UITests, consolidate code, and save shadowimage * Changes for enabling translucent navigation bar ios * Add UITest for NavigationPage Safe Area Translucence * remove UIKit * Move UITest from gallery to Issues * make the extension method * use the background color alpha for translucent * use same alpha logic for pre ios 15 * accidently added testing comments * add more UITests for the different NavigationPage and Flyout Page scenarios * use additionalsafeareainsets for the secondary toolbar * missing new line * only run the secondary toolbar offset when we have a secondary toolbar * use existing childViewControllers * remove the shadow stuff and simplify the expression with null * style and fixes from merge conflicts * standardAppearance and scrolledgeappearance should be kept in * changes after talking with Shane * change shell behavior to be more like navrenderer with preiOS13 * move code if we are transparent pre13 shell * remove new lines * add screenshot tests * be able to remove and add secondarybar additionalsafeareas --- .../Issues/Issue17022.xaml | 31 ++ .../Issues/Issue17022.xaml.cs | 274 ++++++++++++++++++ .../NavigationPage/iOS/NavigationRenderer.cs | 74 +++-- .../Shell/iOS/ShellNavBarAppearanceTracker.cs | 41 ++- .../Extensions/NavigationPageExtensions.cs | 8 + .../tests/UITests/Tests/Issues/Issue17022.cs | 62 ++++ ...TestNewFlyoutPageGridTranslucentButton.png | Bin 0 -> 46758 bytes ...NewNavigationPageGridTranslucentButton.png | Bin 0 -> 41326 bytes ...miTransparentFlyoutPageBackgroundColor.png | Bin 0 -> 49922 bytes ...7022TestSemiTransparentFlyoutPageBrush.png | Bin 0 -> 49922 bytes ...ansparentNavigationPageBackgroundColor.png | Bin 0 -> 43953 bytes ...TestSemiTransparentNavigationPageBrush.png | Bin 0 -> 43953 bytes 12 files changed, 452 insertions(+), 38 deletions(-) create mode 100644 src/Controls/samples/Controls.Sample.UITests/Issues/Issue17022.xaml create mode 100644 src/Controls/samples/Controls.Sample.UITests/Issues/Issue17022.xaml.cs create mode 100644 src/Controls/tests/UITests/Tests/Issues/Issue17022.cs create mode 100644 src/Controls/tests/UITests/snapshots/ios/Issue17022TestNewFlyoutPageGridTranslucentButton.png create mode 100644 src/Controls/tests/UITests/snapshots/ios/Issue17022TestNewNavigationPageGridTranslucentButton.png create mode 100644 src/Controls/tests/UITests/snapshots/ios/Issue17022TestSemiTransparentFlyoutPageBackgroundColor.png create mode 100644 src/Controls/tests/UITests/snapshots/ios/Issue17022TestSemiTransparentFlyoutPageBrush.png create mode 100644 src/Controls/tests/UITests/snapshots/ios/Issue17022TestSemiTransparentNavigationPageBackgroundColor.png create mode 100644 src/Controls/tests/UITests/snapshots/ios/Issue17022TestSemiTransparentNavigationPageBrush.png diff --git a/src/Controls/samples/Controls.Sample.UITests/Issues/Issue17022.xaml b/src/Controls/samples/Controls.Sample.UITests/Issues/Issue17022.xaml new file mode 100644 index 000000000000..818a40baa44a --- /dev/null +++ b/src/Controls/samples/Controls.Sample.UITests/Issues/Issue17022.xaml @@ -0,0 +1,31 @@ + + + +