Skip to content
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] NavigationBar PrimaryCommands unresponsive #18506

Closed
1 of 10 tasks
morning4coffe-dev opened this issue Sep 23, 2024 · 13 comments · Fixed by unoplatform/uno.toolkit.ui#1302
Closed
1 of 10 tasks
Assignees
Labels
kind/bug Something isn't working kind/regression Something was working, now it isn't

Comments

@morning4coffe-dev
Copy link
Member

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):

  • WebAssembly
  • Android
  • [?] iOS
  • macOS (AppKit)
  • Mac Catalyst
  • Skia
    • WPF
    • GTK (Linux)
    • Linux Framebuffer
    • Tizen
  • Windows
@morning4coffe-dev morning4coffe-dev added kind/bug Something isn't working kind/regression Something was working, now it isn't triage/untriaged Indicates an issue requires triaging or verification labels Sep 23, 2024
@kazo0 kazo0 removed the triage/untriaged Indicates an issue requires triaging or verification label Sep 30, 2024
@kazo0
Copy link
Contributor

kazo0 commented Sep 30, 2024

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

Perhaps @vatsashah45 can take a look?

@vatsashah45
Copy link
Contributor

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

@vatsashah45 vatsashah45 closed this as not planned Won't fix, can't repro, duplicate, stale Oct 14, 2024
@agneszitte
Copy link
Contributor

agneszitte commented Oct 15, 2024

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
Copy link
Contributor

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 agneszitte reopened this Oct 16, 2024
@agneszitte
Copy link
Contributor

It seems related to #18498 as well

@agneszitte agneszitte self-assigned this Oct 17, 2024
@agneszitte
Copy link
Contributor

agneszitte commented Oct 17, 2024

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 #18498 as well

@agneszitte agneszitte transferred this issue from unoplatform/uno.toolkit.ui Oct 17, 2024
@agneszitte agneszitte reopened this Oct 17, 2024
@morning4coffe-dev
Copy link
Member Author

@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
Copy link
Contributor

agneszitte commented Oct 21, 2024

@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
Copy link
Member

@MartinZikmund would you know if this has been fixed?

@jeromelaban jeromelaban assigned kazo0 and unassigned MartinZikmund Nov 21, 2024
@kazo0
Copy link
Contributor

kazo0 commented Nov 25, 2024

I can repro as long as the Material styles are not used alongside Toolkit. Interesting

UnoApp113.zip

@kazo0 kazo0 assigned rajamatt and unassigned kazo0 Nov 28, 2024
@rajamatt
Copy link
Contributor

rajamatt commented Dec 2, 2024

Following up on @kazo0's finding I could also only make the NavBar's AppBarButton work with Material. Then I tried removing Material entirely, at this point the issue is reproducible

However then I removed the Icon property from the AppBarButton and the command was being triggered again. So it seems to be related to the Icon in Fluent in a way or another. It is not working with a BitmapIcon defined either.

Next step would be to debug in here https://github.com/unoplatform/uno.toolkit.ui/blob/91c5efcb40ef385f98225c258ff60664c2735815/src/Uno.Toolkit.UI/Controls/NavigationBar/AppBarButtonRenderer.Android.cs#L167

I'll post my findings once that's done

@rajamatt
Copy link
Contributor

rajamatt commented Dec 3, 2024

When using Material, the AppBarButton in the NavBar renders once when loading the app, then clicking on the AppBarButton triggers the the AppBarButton's Click event. As expected.

When not using Material (Fluent), the AppBarButton in the NavBar renders once when loading the app, but then clicking on the AppBarButton does not trigger the the AppBarButton's Click event, instead it triggers Render() every click.

@rajamatt
Copy link
Contributor

rajamatt commented Dec 4, 2024

Another update, turns out its being invalidated when clicking on the button since fluent is changing the opacity of the icon OnPressed: these lines show the Icon foreground is being observed.

Will be removing these and adding a test for the scenario

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working kind/regression Something was working, now it isn't
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants