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
- Create a .NET Android app targeting
net10.0-android / net10.0-android36.0.
- Reference
Xamarin.Google.Android.Material 1.14.0.
- Try to use the new Material list item bindings from C#.
- Attempt to import the expected namespace:
using Google.Android.Material.ListItem;
- Observe that this namespace does not exist.
- 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
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.listitemGenerated C# namespace:
Google.Android.Material.ListitemExpected/discoverable C# namespace:
Google.Android.Material.ListItemOther similar examples:
com.google.android.material.loadingindicator->Google.Android.Material.Loadingindicator, expectedGoogle.Android.Material.LoadingIndicatorcom.google.android.material.dockedtoolbar->Google.Android.Material.Dockedtoolbar, expectedGoogle.Android.Material.DockedToolbarcom.google.android.material.floatingtoolbar->Google.Android.Material.Floatingtoolbar, expectedGoogle.Android.Material.FloatingToolbarSteps to Reproduce
net10.0-android/net10.0-android36.0.Xamarin.Google.Android.Material1.14.0.Expected behavior:
The generated namespaces for newer multi-word Material packages should use discoverable .NET-style casing, for example:
Google.Android.Material.ListItemGoogle.Android.Material.LoadingIndicatorGoogle.Android.Material.DockedToolbarGoogle.Android.Material.FloatingToolbarActual behavior:
The generated namespaces use only first-letter casing after
Material, for example:Google.Android.Material.ListitemGoogle.Android.Material.LoadingindicatorGoogle.Android.Material.DockedtoolbarGoogle.Android.Material.FloatingtoolbarDid you find any workaround?
Use the generated namespaces as-is:
Relevant log output