unoplatform / uno

Open-source platform for building cross-platform native Mobile, Web, Desktop and Embedded apps quickly. Create rich, C#/XAML, single-codebase apps from any IDE. Hot Reload included! 90m+ NuGet Downloads!!
https://platform.uno
Apache License 2.0
9.03k stars 733 forks source link

[Android] `NavigationBar` PrimaryCommands unresponsive #18506

Open morning4coffe-dev opened 2 months ago

morning4coffe-dev commented 2 months ago

Current behavior

When I try to put AppBarButton in PrimaryCommands, it becomes unresponsive, the Command and Click doesn't work. When I put it outside of NavigationBar, everything works as expected.

This seems to be a regression in the latest dev versions. I tested with 5.5.0-dev.40 and 5.5.0-dev.50, on both the issue appears.

How to reproduce it (as minimally and precisely as possible)

      <utu:NavigationBar>
        <utu:NavigationBar.PrimaryCommands>
          <AppBarButton Icon="Favorite" Click="AppBarButton_Click" />
        </utu:NavigationBar.PrimaryCommands>
      </utu:NavigationBar>
          <AppBarButton Icon="Account" Click="AppBarButton_Click" />

NavigationBarRepro.zip

Nuget Package:

Uno.Sdk 5.5.0-dev.50

Affected platform(s):

kazo0 commented 1 month ago

@agneszitte this one sounds kinda bad, we should investigate where this started happening from

Perhaps @vatsashah45 can take a look?

vatsashah45 commented 1 month ago

Closing this issue as it seems to be a local emulator error for the author, and not an actual uno issue.

agneszitte commented 1 month ago

Closing this issue as it seems to be a local emulator error for the author, and not an actual uno issue.

@morning4coffe-dev so if you are creating a new emulator, you are not able to reproduce the issue on your side for example?

jp-weber commented 1 month ago

I can also reproduce the problem in my case. However, I would not have a small example project like the thread creator.

Uno.WinUI.* v5.4.39 Uno.Toolkit.Skia.WinUI v6.2.6 Uno.Toolkit.WinUI.Cupertino v6.2.6

Tested with Android 14 emulator and Sony XZ2 Compact (Android 10): navigationbar_top_commandbarbutton

agneszitte commented 1 month ago

It seems related to https://github.com/unoplatform/uno/discussions/18498 as well

agneszitte commented 1 month ago

The problem began with Uno.Sdk 5.4.0-dev.236 (it is not reproducible with Uno.Sdk 5.4.0-dev.234 or earlier versions). image

MSBuild Property Uno.Sdk 5.4.0-dev.234 and below
(Issue not present)
Uno.Sdk 5.4.0-dev.236 and above
(Issue present)
Comparison/Changes
UnoVersion 5.4.0-dev.1604
(Related Build)
5.4.0-dev.1720
(Related Build)
Updated 1604 -> 1720
Related changes: f30d9f62...639e813f
UnoExtensionsVersion 5.0.0-dev.391
(Related Build)
5.0.0-dev.401
(Related Build)
Updated 391 -> 401
Related changes: 9079fb1e...05a1422d
UnoToolkitVersion 6.2.0-dev.41 6.2.0-dev.41 No changes
UnoThemesVersion 5.2.0-dev.17
(Related Build)
5.2.0-dev.22
(Related Build)
Updated 17 -> 22
Related changes: 98e8c9a...569a9c0c
UnoCSharpMarkupVersion 5.4.0-dev.35 5.4.0-dev.37 Updated 35 -> 37

Based on the versions differences between these two Uno.Sdk versions, it does not seem related to an Uno Toolkit change. And based on the other changes, it is normally an UnoVersion related issue.

I also can confirm that this is the same issue for https://github.com/unoplatform/uno/discussions/18498 as well

morning4coffe-dev commented 1 month ago

@agneszitte, @vatsashah45, I did a quick round of tests as well and can reproduce this on both an emulator and an actual device with similar versions to the ones Agnès shared.

agneszitte commented 1 month ago

@MartinZikmund as we discussed together, here is the sample app I created for a simple reproduction of the issue (using the blank preset + Toolkit). I conducted a quick check on the other platforms (except macOS), and it seems that the issue is indeed only Android-specific, as mentioned in this issue.

You can find the sample app here: NavigationBarSampleApp.zip

Based on my investigation, it looks like the issue might have originated from the changes introduced in PR #17860. I'll leave it to you to confirm my findings.

jeromelaban commented 3 days ago

@MartinZikmund would you know if this has been fixed?