Граф коммитов

15110 Коммитов

Автор SHA1 Сообщение Дата
Jonathan Peppers a02f1d420f
[android] cache `Join` and `Cap` enum values (#24248)
Context: https://github.com/dotnet/maui/issues/23991
Context: https://github.com/chabiss/periodictable

In the above sample, a lot of time is spent in:

    921.46ms (4.3%) mono!Android.Graphics.Paint.Cap.get_Butt()
    872.40ms (4.1%) mono!Android.Graphics.Paint.Join.get_Miter()

This exposes a performance issue with `Java.Lang.Enum` values:

* `java.lang.Enum` in Java are objects (not `int` like C#)

* When accessing an enum value, Java returns an object we have to wrap
  in a C# object.

* .NET for Android has to do bookkeeping around this, lookup in a hash
  table, etc.

To avoid this, we can store the `Join` and `Cap` values in a static
field and avoid calling into Java. This approach is already working
in .NET MAUI for `ImageView.ScaleType`:

9361f90a5d/src/Core/src/Platform/Android/AspectExtensions.cs (L7-L10)

After this change, the time spent is completely gone:

    2.41ms (0.02%) mono.android!Android.Graphics.Paint.Join.get_Miter()

I can't find the same call for (the unfortunately named) `get_Butt()`
at all.

In the future, we might consider changing the C# binding for
`Java.Lang.Enum` to "auto-cache" values in C# static fields. Not sure
if there is enough time left for it to happen in .NET 9, though.
2024-08-16 11:54:01 -05:00
Shane Neuville 0370361000
Fix cake scripts to work locally (#24111)
* Fix cake scripts to work locally

* - fix for windows

* - cleanup device retrieval

* - fix processSettings.RedirectedStandardOutputHandler

* Add build tasks
2024-08-16 08:15:01 -05:00
Matthew Leibowitz 700fc8fc14
Print the workload rollback after install (#24265) 2024-08-15 15:41:50 -05:00
Shane Neuville d85c05fca3
Add some defensive code around layout propagation (#24217)
* Add some defensive code around layout propagation

* - remove from superview

* - fix view decomposition
2024-08-15 11:22:48 -05:00
Gerald Versluis d6cb19d9c9
Update bug report template with .NET 9 preview 7 (#24261) 2024-08-15 09:09:12 -05:00
Mike Corsaro 76f12f761f
Adopt chromium methodology for determining tablet on Windows (#22809)
### Description of Change

Uses a more conservative approach of determining tablet mode on Windows.
This approach is functionally identical to [Chromium's implementation](

https://source.chromium.org/chromium/chromium/src/+/main:base/win/win_util.cc;l=537;drc=ac83a5a2d3c04763d86ce16d92f3904cc9566d3a;bpv=0;bpt=1)
for determining tablet on Windows. Additionally, it adds a few
documentation comments on the observed behavior.

I don't have a good idea on how to add a unit test for this, and it's a
bit of an implicit breaking change (some users who had tablet layouts
may have desktop layouts now), but I think that number of users affected
will be near, or at 0.

### Issues Fixed

Possibly fixes #22093
2024-08-15 06:17:51 -07:00
Jakub Florkowski fa9e3702f4
NavigationBar properties not updating - fix (#23076)
* Title not updated after OnAppearing for TabbedPage - fix (#22899)

* Added a test category

* Update Issues22899.xaml

* Added snapshots
2024-08-14 15:55:33 -05:00
Jonathan Peppers 6c21d39e97
[android] call `PlatformContentViewGroup.postInvalidate()` less (#24222)
Context: https://github.com/dotnet/maui/issues/23991

@chabiss's sample app is running a lot of GCs:

    [riodictablemaui] Explicit concurrent copying GC freed 933(127KB) AllocSpace objects, 31(4092KB) LOS objects, 49% free, 4423KB/8846KB, paused 1.328ms,169us total 33.513ms
    [riodictablemaui] Explicit concurrent copying GC freed 722(46KB) AllocSpace objects, 0(0B) LOS objects, 49% free, 4581KB/9162KB, paused 1.856ms,170us total 14.835ms
    [riodictablemaui] Explicit concurrent copying GC freed 641(43KB) AllocSpace objects, 1(108KB) LOS objects, 49% free, 4525KB/9050KB, paused 1.420ms,176us total 14.112ms
    [riodictablemaui] Explicit concurrent copying GC freed 619(41KB) AllocSpace objects, 0(0B) LOS objects, 49% free, 4579KB/9158KB, paused 1.263ms,173us total 13.825ms
    ... many many more lines

This doesn't seem like a normal amount of GCs for a simple app like this.

Attaching Android Studio's allocation profiler, I can see a significant
amount of allocations at:

    com.microsoft.maui.PlatformContentViewGroup.setHasClip()
        Allocations: 35,906
        Deallocations: 143
        Total Count: 35,763
        Shallow Size: 2,288,832

The call to `postInvalidate()` is running *a lot*, and this causes:

* A layout cycle

* `android.os.Message` to be allocated

* etc. etc.

I think we can simply check if `hasClip` has changed, and only call
`postInvalidate()` if it has.

Additionally, we can apply same change for `WrapperView.setHasShadow()`.
2024-08-14 20:54:32 +00:00
Javier Suárez 4a519d846a
[Testing] Added UITest to validate the Switch OnColor property (#20542)
* Added UITest to validate the Switch OnColor property

* Added snapshots

* Updated snapshot

* Updated snapshots

* Updated snapshot

* Update Issue20535.cs

* Add Category

* Move Windows snapshot

* Move snapshot to the actual right place

---------

Co-authored-by: Gerald Versluis <gerald.versluis@microsoft.com>
2024-08-14 15:47:35 -05:00
Javier Suárez 2a7960705d
[Testing] Added specific actions by platform (#21330)
* Added platform specific Android Appium actions

* Adding inline comments

* More methods

* iOS specifics

* Changs based on PR feedback

* Fix test

* Update Issue18740.cs

---------

Co-authored-by: Gerald Versluis <gerald.versluis@microsoft.com>
2024-08-14 15:45:47 -05:00
Tommi Gustafsson 9361f90a5d
Fixed low quality images in Resizetizer (#23924)
* Fixed low quality images in Resizetizer, issue #23212.

* Regenerate all images

---------

Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
2024-08-15 00:26:11 +08:00
Gerald Versluis 25adb9b023
Remove reference to removed styling (#24199) 2024-08-13 21:53:17 +01:00
Mike Corsaro c891e4f281
Fixed scroll to group item on Android + Windows (#16704)
### Description of Change

Fixed scrolling to a group via `CollectionView.ScrollTo(index,
groupIndex)` not working on Windows or Android.

### Issues Fixed

Fixes #8718


### Demo

The demo below shows scrolling to the group letter "N"


https://github.com/dotnet/maui/assets/890772/af943949-e10d-416e-b928-d7114f1a48b7


https://github.com/dotnet/maui/assets/890772/51da9dac-f18a-4894-865a-30273433b0b4
2024-08-13 13:04:29 -07:00
Eilon Lipton e9b5ead300
Add xUnit types to avoid first-chance exceptions in tests (#24130)
* WIP: Add xUnit types to avoid first-chance exceptions in tests

While debugging tests if you have the debugger set to catch *all* exceptions, you'll see a bunch of them for various xUnit types, such as:

System.MissingMethodException: 'Constructor on type 'Xunit.Sdk.InlineDataDiscoverer' not found.'

While they're harmless from a functional perspective, several of these happen when you start debugging tests.

This change re-implements the affected xUnit types as well as a custom MAUI test type to avoid the exception.

* Update xUnitCustomizations.cs

* Clean up code
2024-08-13 14:13:26 -05:00
TJ Lambert 8df65d66ba
make flyout titles on iOS read as buttons (#24018) 2024-08-13 11:14:56 -05:00
Javier Suárez 210bc3581a
Fix Shell.NavBarIsVisible property (#20173)
* Fix the issue

* Added XAML Test
2024-08-13 11:49:57 +01:00
dotnet-maestro[bot] 6fa52c6bce
Update dependencies from https://github.com/dotnet/xharness build 20240805.1 (#24154)
Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Common , Microsoft.DotNet.XHarness.TestRunners.Xunit
 From Version 9.0.0-prerelease.24379.2 -> To Version 9.0.0-prerelease.24405.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2024-08-13 11:15:05 +01:00
Mike Corsaro 7d55d06747
Fix memory leak w/ main window (#24176)
Co-authored-by: Mike Corsaro <mikecorsaro@microsoft.com>
2024-08-13 11:09:56 +01:00
Shane Neuville e39d4b16f1
Move EnsureSupportForCustomWebViewClients to Appium (#24167)
* Move EnsureSupportForCustomWebViewClients to Appium

* - fix
2024-08-13 11:07:26 +01:00
Gerald Versluis f40b6c79b5
Remove MAUI styling from Blazor Hybrid template (#24135)
* Remove MAUI styling from Blazor Hybrid template

* Use fwlink
2024-08-12 19:23:55 +02:00
Jakub Florkowski 64f23db187
[Android] App crash when using a binding value that exceeds Entry max length (#24138) 2024-08-12 08:18:49 -05:00
MartyIX 363b626df4
Allow setting `PlatformCanvas.Antialias` on Windows (#23965) 2024-08-12 02:46:33 +08:00
Eilon Lipton 27b00f10f0
Remove instances of '#if NET6_0_OR_GREATER' (#24126)
We're way past that, so deleting these unused cases.
2024-08-10 15:47:40 +02:00
Mike Corsaro 8363dcfe14
Ensure border stroke does not regenerate on Parent or Window property changes (#24125)
Co-authored-by: Mike Corsaro <mikecorsaro@microsoft.com>
2024-08-10 15:47:00 +02:00
Gerald Versluis 3b7791ba18
Add shared project to primaryOutputs (#24095) 2024-08-10 09:15:21 +08:00
Gerald Versluis fde2b98f5c
Remove excessive StackLayout API docs (#24114) 2024-08-09 19:30:31 +00:00
Jonathan Peppers 813e4c1d9d
[xaml] improve performance of `BindableProperty.TryConvert` (#23685)
* [xaml] improve performance of `BindableProperty.TryConvert`

Context: https://github.com/davidortinau/AllTheLists

Profiling @davidortinau's app, I noticed the "Check-ins" sample felt
the slowest on Android.

One thing I noticed while scrolling:

    58.46ms (0.87%) Microsoft.Maui.Controls!Microsoft.Maui.Controls.BindableProperty.TryConvert(object&)
    47.96ms (0.74%) Microsoft.Maui.Controls!Microsoft.Maui.Controls.Xaml.TypeConversionExtensions.GetImplicitConversionOperator(System.Type,System.Type,System.Type)

`GetImplicitConversionOperator()` is using System.Reflection to look up
if a type has an implicit conversion operator. This is a slow operation.

I added some logging, to find out which types trigger this:

    System.String -> Microsoft.Maui.Controls.ImageSource
    System.Double -> System.String
    System.String -> System.Double

For the first, `ImageSource`, we can add an entry to
`KnownTypeConverters`.

For the second, `System.Double -> System.String`, we can add an entry
to `SimpleConvertTypes`. I also added an entry for `System.Bool`.

Lastly, I don't think we should actually be looking up implicit
operators on built-in, primitive types like: `double`, `string`,
`bool`, etc. I added a check to skip these.

With this change in-place, `GetImplicitConversionOperator()` is no
longer called anymore in this app:

    12.29ms (0.23%) Microsoft.Maui.Controls!Microsoft.Maui.Controls.BindableProperty.TryConvert(object&)

This should improve the performance of data-binding on all platforms.

This should hopefully not change any behavior and simply avoids
looking up implicit operators on types that do not contain any.

* Fix test failures
2024-08-09 10:45:04 -05:00
Jonathan Peppers 0a3d5208b4
[android] use cached value for `GetDisplayDensity()` (#23666)
Context: https://github.com/davidortinau/AllTheLists

Profiling @davidortinau's app, I noticed the "Check-ins" sample felt
the slowest on Android.

One thing I noticed while scrolling:

    44.37ms (0.48%) Microsoft.Maui!Microsoft.Maui.Platform.StrokeExtensions.UpdateMauiDrawable(Android.Views.View,Microsoft.Maui.IBorderStr
    40.59ms (0.44%) Microsoft.Maui!Microsoft.Maui.Graphics.MauiDrawable..ctor(Android.Content.Context)

Where a lot of the time is actually just spent in:

    54.48ms (0.59%) Microsoft.Maui!Microsoft.Maui.Platform.ContextExtensions.GetDisplayDensity(Android.Content.Context)

The `GetDisplayDensity()` method is called a lot, and it's not using
the cached value we already have!

Reading the history in 6babd4ec, there does not appear to be a reason
we *didn't* use the cached value.

With this change in place, I see instead:

    7.81ms (0.12%) Microsoft.Maui!Microsoft.Maui.Platform.StrokeExtensions.UpdateMauiDrawable(Android.Views.View,Microsoft.Maui.IBorderStr

And I don't see *any* time spent in `MauiDrawable..ctor()` anymore.

This change should improve the performance of any `<Border/>` on Android.
2024-08-09 10:33:45 -05:00
Gerald Versluis 68b0ad29cd
Remove excessive Grid API comment (#24037) 2024-08-09 09:59:07 -05:00
MartyIX 534ed023c6
[Windows][GestureManager] Unsubscribe control tap events only if they were subscribed (#23976)
* Optimize

* feedback

* More

* fix build
2024-08-09 14:57:13 +02:00
Jakub Florkowski fd6332899a
[Testing] Added a support for the device's theme change (#22508)
* [Testing] Added a support for the device's theme change

* Comments resolved

* Use Adb

* UI Test improvement

* Updated test

* More snapshots

* [Testing] Added a support for the device's theme change

* Comments resolved

* Use Adb

* UI Test improvement

* Updated test

* More snapshots

* Update ThemeChange.cs

* Test fixes

* Added the first android snapshot

* Create AppThemeShouldChangeLightTheme.png

---------

Co-authored-by: Javier Suárez <javiersuarezruiz@hotmail.com>
Co-authored-by: Jonathan Dick <jodick@microsoft.com>
Co-authored-by: Gerald Versluis <gerald.versluis@microsoft.com>
2024-08-09 11:49:19 +02:00
Shane Neuville aa83a1909b
Update bug-report.yml with 8.0.80 SR8 (#24083) 2024-08-07 16:07:05 -05:00
Jakub Florkowski 2e9eee0c5f
[Android] Border Stroke gradient can only switch to another gradient - fix (#22168)
* Fixed the issue #22042 & added a UITest

* Added snapshot

* Added a test category

* Updated a Ui test

* Update Issue22042.cs

* Added snapshots

* Fixed WIndows test

* Windows snapshot

---------

Co-authored-by: Javier Suárez <javiersuarezruiz@hotmail.com>
2024-08-07 11:52:12 -05:00
Shane Neuville 1ddf88cf31
Release Branding SR8 (#24052) 2024-08-06 16:47:43 -05:00
Shane Neuville 1d82ab08ab
Revert "[X] do not apply Bindings if DataType doesnt match (#22056)" (#24046)
This reverts commit cb0a332557.
2024-08-06 16:44:19 -05:00
Shane Neuville 698f64dd21
Bump main to 8.0.90 (#24050) 2024-08-06 15:38:06 -05:00
Matthew Leibowitz 1aac6a6377
Update the aar from CI (#24038) 2024-08-06 17:52:47 +01:00
Javier Suárez b0032c7512
[UI Testing] Add legacy tests (alternative) (#22635)
* Added Compatibility UITests (ported to Appium) to TestCases project

* Added tests pages

* More changes

* More changes

* More changes

* More changes

* More fixes

* More fixes

* More changes

* More changes

* More changes

* More changes

* More fixes

* Avoid problems with duplicated issues

* More changes

* More changes

* More fixes

* Fixes on Windows tests

* More fixes

* More fixes

* More changes

* Removed duplicated tests

* More fixes

* More changes

* More changes

* More changes

* More changes

* More changes

* Removed unnecessary changes

* More changes

* Ignore golden tests on macOS

* More changes

* More changes

* More changes

* Changes in AppiumLifecycleActions

* More changes

* Removed IgnoreIfPlatforms usage

* Small changes

* Fix build errors

* Fix build error

* Add missing category

* Update Issue24574.cs

* Ignore on Mac for now

---------

Co-authored-by: Shane Neuville <shneuvil@microsoft.com>
Co-authored-by: Gerald Versluis <gerald.versluis@microsoft.com>
2024-08-06 10:34:23 -05:00
dotnet-maestro[bot] 0dfc44284b
Update dependencies from https://github.com/dotnet/xharness build 20240729.2 (#24012)
Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Common , Microsoft.DotNet.XHarness.TestRunners.Xunit
 From Version 9.0.0-prerelease.24374.1 -> To Version 9.0.0-prerelease.24379.2

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2024-08-06 16:27:44 +01:00
Shane Neuville b0da2a0b4c
Check to see if Image Should Reload When Attached (#24023)
* Check to see if Image Should Reload When Attached

* - cleanup

* Update ImageSourcePartLoader.cs

* - fix images
2024-08-06 09:06:18 -05:00
jpiechowiak 6bfd7e16f6
Added condition in WindowStateManager for selecting proper scene used with role Application (#23945) 2024-08-06 11:56:49 +01:00
Mike Corsaro cd7107eee6
[Windows] Fix CarouselView not showing new items (#23779)
* Fix missing vector change event propigation

* Add test

* Add ref images
Add WeakVectorChangedChangedProxy

---------

Co-authored-by: Mike Corsaro <mikecorsaro@microsoft.com>
2024-08-06 11:56:09 +01:00
Gerald Versluis c57d4bd3e7
Update Rebase GitHub Action (#24031)
Update checkout step to use checkout at v4 which uses a newer Node version. v2 uses a Node version that might be removed at some point.
2024-08-06 18:34:43 +08:00
Shane Neuville f6ec10b184
[iOS] Add a Container around ImageButton (#24020)
* Add a Container around ImageButton

* Update PublicAPI.Unshipped.txt

* - don't animate push
2024-08-05 19:40:57 -05:00
Alberto Aldegheri 7cb2341272
Fixes Android FontModel Glide In-Memory Caching (#24021) 2024-08-05 18:31:01 -05:00
Matthew Leibowitz ad886be385
Remove the 'Resources' prefix from BundleResource (#23978)
* Remove the 'Resources' prefix from BundleResource

Fixes #23554

Prior to Maui 8.0.70, there was a bug that only removed the "Resources/" prefix, and not the correct "Platforms/iOS/Resource": https://github.com/dotnet/maui/issues/16734

This PR https://github.com/dotnet/maui/pull/23269 fixes the original issue, but now exposed the case where BundleResource were included in the root Resources folder instead of the Platforms/iOS/ folder.

* Update Microsoft.Maui.Controls.SingleProject.targets

* Update Microsoft.Maui.Controls.SingleProject.targets

* Add a test

* string
2024-08-06 04:52:33 +08:00
Matthew Leibowitz 946f4628ef
Use explicit platform versions (#23995)
This is used to avoid the case where some SDKs bump their platform
version and we end up forcing the entire ecosystem to update SDKs.
2024-08-05 12:21:52 -05:00
Shane Neuville 4fa5fead91
Add SR7 Versions for bug reports (#23990) 2024-08-02 15:30:54 -05:00
Shane Neuville a7e1f84d98
Update Versions for bug reports 2024-08-02 15:28:54 -05:00
MartyIX 4856f37f5b
[Windows] Handle non-seekable streams in `PlatformImage.FromStream` (take 2) (#23824)
* Fix

* Optimize

* Seek back

* Optimization

* Use Microsoft.IO.RecyclableMemoryStream

* Not needed?

* It seems I can remove version now

* Review

* Add test
2024-08-01 13:00:54 +08:00