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

Exception in AppBarButton when it is inside a NavigationBar in Android #623

Closed
Suriman opened this issue Jun 23, 2023 · 7 comments · Fixed by #622 or #1045
Closed

Exception in AppBarButton when it is inside a NavigationBar in Android #623

Suriman opened this issue Jun 23, 2023 · 7 comments · Fixed by #622 or #1045
Assignees
Labels
control/navigationbar kind/bug Something isn't working

Comments

@Suriman
Copy link

Suriman commented Jun 23, 2023

Current behavior

The AppBarButton works correctly in WinUI but:
- Does not support SVG images in Wasm and Android.
- When it is included in a NavigationBar it raises exception if the content is different of a BitmapImage in Android platform.

Expected behavior

The AppBarButton supports all functionality on all platforms.

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

Open the attached project and compile it.
Execute the Android project and the NavigationBar fails to load because the AppBarButton image load throws an exception, if all the AppBarButton are commented except the one containing the BitmapImage it loads correctly.

Code that reproduces the error in this file:
UnoAppBarButtonAndroid.zip

Workaround

No workaround.

Works on UWP/WinUI

Yes

Environment

Uno.WinUI / Uno.WinUI.WebAssembly / Uno.WinUI.Skia

NuGet package version(s)

Uno.WinUI 4.9.20

Affected platforms

WebAssembly, Android

IDE

Visual Studio 2022

IDE version

17.6.3

Relevant plugins

No response

Anything else we need to know?

No response

@Suriman Suriman added kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification. labels Jun 23, 2023
@francoistanguay
Copy link
Contributor

Am pretty sure it has indeed to be a BitmapImage as it is a limitation of the underlying plarform(s).

cc @kazo0 ?

@kazo0
Copy link
Contributor

kazo0 commented Jun 23, 2023

@Suriman @francoistanguay

Yes there's currently a limitation that only allows BitmapIcon to work as the Icon for AppBarButtons within the NavigationBar for iOS and Android. Docs here

The crash without any helpful error message should be fixed with the following PR but the images will still only work as BitmapIcons at this point

You can use some conditional XAML to set the icon to different types depending on the platform for now

The SVG not working on WASM is curious though, I will take a look at the sample app

@kazo0 kazo0 transferred this issue from unoplatform/uno Jun 23, 2023
@kazo0 kazo0 self-assigned this Jun 23, 2023
@kazo0 kazo0 added control/navigationbar and removed triage/untriaged Indicates an issue requires triaging or verification. labels Jun 23, 2023
@kazo0 kazo0 pinned this issue Jun 23, 2023
@kazo0
Copy link
Contributor

kazo0 commented Jun 26, 2023

@Suriman Looking into this now, I am able to see the FontIcons on WASM, is there another issue on WASM that you are experiencing?
image

Also, I have updated the package versions used in the sample app to the latest dev bits and the NavigationBar will now render, although the AppBarButtons that are not using a BitmapIcon will not display as this is still a limitation of the native bar being used on Android and iOS:
image

Attached is the up-to-date repro app
AddInfo.zip

@ADD-Eugenio-Lopez
Copy link

Yes, we know the limitation of the documentation that on Android it only works with BitmapImage, that's why we have commented it with Sasha and the issue has been opened as feature enhancement.

We have updated the package versions used in the sample app to the latest dev bits.
In WinUI we can see all the image sources:
image

In Wasm we can see all the image sources except the Svg image, but the ImageIcon with a Svg can be loaded correctly outside an AppBarButton:
image

In Android we can see only the BitmapIcon, and now the exceptions are no longer thrown in the loading of images even if they are not loaded, note that content is also not loaded with the TextBlock in the NavigationBar:
image

@kazo0
Copy link
Contributor

kazo0 commented Jul 26, 2023

Should be fixed by #622

@kazo0 kazo0 closed this as completed Jul 26, 2023
@ADD-Eugenio-Lopez
Copy link

Although the title of the issue indicates that an exception occurs, that was corrected in
#622, in the description of the issue we also indicate that we need to support all the IconElements that are being solved in the #631, so we believe that this issue should not be closed until the #631.

@roubachof roubachof unpinned this issue Sep 13, 2023
@agneszitte agneszitte reopened this Oct 11, 2023
@agneszitte
Copy link
Contributor

Re-Open and waiting for #631

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
control/navigationbar kind/bug Something isn't working
Projects
None yet
5 participants