Skip to content

Xamarin.Google.Android.Material namespace casing for newer multi-word Material packages is hard to discover #1427

@tipa

Description

@tipa

Android framework version

net10.0-android

Affected platform version

net10.0-android36.0

Description

Some generated C# namespaces in Xamarin.Google.Android.Material do not preserve the expected multi-word casing for newer Material package names.

The bindings exist, but the generated namespaces are surprising and difficult to discover from the upstream Java package names or Material component names.

Examples observed:

Java package:
com.google.android.material.listitem

Generated C# namespace:
Google.Android.Material.Listitem

Expected/discoverable C# namespace:
Google.Android.Material.ListItem

Other similar examples:

  • com.google.android.material.loadingindicator -> Google.Android.Material.Loadingindicator, expected Google.Android.Material.LoadingIndicator
  • com.google.android.material.dockedtoolbar -> Google.Android.Material.Dockedtoolbar, expected Google.Android.Material.DockedToolbar
  • com.google.android.material.floatingtoolbar -> Google.Android.Material.Floatingtoolbar, expected Google.Android.Material.FloatingToolbar

Steps to Reproduce

  1. Create a .NET Android app targeting net10.0-android / net10.0-android36.0.
  2. Reference Xamarin.Google.Android.Material 1.14.0.
  3. Try to use the new Material list item bindings from C#.
  4. Attempt to import the expected namespace:
using Google.Android.Material.ListItem;
  1. Observe that this namespace does not exist.
  2. The actual namespace is:
using Google.Android.Material.Listitem;

Expected behavior:
The generated namespaces for newer multi-word Material packages should use discoverable .NET-style casing, for example:

  • Google.Android.Material.ListItem
  • Google.Android.Material.LoadingIndicator
  • Google.Android.Material.DockedToolbar
  • Google.Android.Material.FloatingToolbar

Actual behavior:
The generated namespaces use only first-letter casing after Material, for example:

  • Google.Android.Material.Listitem
  • Google.Android.Material.Loadingindicator
  • Google.Android.Material.Dockedtoolbar
  • Google.Android.Material.Floatingtoolbar

Did you find any workaround?

Use the generated namespaces as-is:

using Google.Android.Material.Listitem;
using Google.Android.Material.Loadingindicator;
using Google.Android.Material.Dockedtoolbar;
using Google.Android.Material.Floatingtoolbar;

Relevant log output

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions