uno: [Android] `CommandBar` `AppBarButton` style inheritance is not working

Current behavior

Using the NativeCommandBar, the color defined in the Foreground Property of a BitmapIcon, nested inside an AppBarButton, doesn’t appear on iOS and Android.

The documention mentions that only a SolidColorBrush is supported for the color of the button, which is what I used in the sample below.

Expected behavior

Defining a color for an AppBarButton, the color should be seen on mobile devices.

Screenshots

On Android: image On iOS image

On UWP image

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

  • Launch the app
  • Notice how the cog icon on the CommandBar is gray, but is defined as blue in the Xaml.

on UWP, which uses the XamlDefaultCommandBar mode, the color is visible on the commandBar.

CommandBarColoredCommands.zip

Works on UWP/WinUI

Yes, but it doesn’t use the same mode as the commandbar on mobile (XamlDefaultCommandBar vs NativeDefaultCommandBar).

Environment

Nuget Package:

  • Uno.UI / Uno.UI.WebAssembly / Uno.UI.Skia
  • Uno.WinUI / Uno.WinUI.WebAssembly / Uno.WinUI.Skia
  • Uno.SourceGenerationTasks
  • Uno.UI.RemoteControl / Uno.WinUI.RemoteControl
  • Other:

Nuget Package Version(s): Uno.Core: 2.4.0 Uno.UI: 3.9.7 Uno.UI.RemoteControl: 3.9.7

Affected platform(s):

  • iOS
  • Android
  • WebAssembly
  • WebAssembly renderers for Xamarin.Forms
  • macOS
  • Skia
    • WPF
    • GTK (Linux)
    • Tizen
  • Windows
  • Build tasks
  • Solution Templates

IDE:

  • Visual Studio 2017 (version: )
  • Visual Studio 2019 (version: 16.10.3)
  • Visual Studio for Mac (version: )
  • Rider Windows (version: )
  • Rider macOS (version: )
  • Visual Studio Code (version: )

Relevant plugins:

  • Resharper

Anything else we need to know?

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Comments: 17 (11 by maintainers)

Most upvoted comments

Are you using a native CommandBar in your sample @vincentcastagna?

@Youssef1313 just tried, and the issue is also still there on 591. And yes always on Android

@vincentcastagna Can you try the latest dev? currently 591. Are you seeing it on Android?