Skip to content

Fixed Material Slider addOnChangeListener method missing issue#1335

Merged
jonathanpeppers merged 5 commits intodotnet:mainfrom
sheiksyedm:fix_230
Jan 6, 2026
Merged

Fixed Material Slider addOnChangeListener method missing issue#1335
jonathanpeppers merged 5 commits intodotnet:mainfrom
sheiksyedm:fix_230

Conversation

@sheiksyedm
Copy link
Copy Markdown
Contributor

@sheiksyedm sheiksyedm commented Dec 29, 2025

Issues details

The binding generator was unable to bind the following methods due to unknown generic parameter types L and T:

  • addOnChangeListener(L listener)
  • removeOnChangeListener(L listener)
  • addOnSliderTouchListener(T listener)
  • removeOnSliderTouchListener(T listener)

Error Messages:

BINDINGSGENERATOR : warning BG8800: Unknown parameter type L in method AddOnChangeListener in managed type Google.Android.Material.Slider.Slider.
BINDINGSGENERATOR : warning BG8800: Unknown parameter type T in method AddOnSliderTouchListener in managed type Google.Android.Material.Slider.Slider.

Solution

Added metadata transforms in source/com.google.android.material/material/Transforms/Metadata.xml to explicitly map the generic type parameters:

  • Generic type Lcom.google.android.material.slider.BaseOnChangeListener
  • Generic type Tcom.google.android.material.slider.BaseOnSliderTouchListener

Applied to the BaseSlider class (base class for both Slider and RangeSlider).

Verification Results

✅ Slider Class - All 4 methods now available:

public virtual unsafe void AddOnChangeListener(global::Google.Android.Material.Slider.IBaseOnChangeListener listener)
public virtual unsafe void AddOnSliderTouchListener(global::Google.Android.Material.Slider.IBaseOnSliderTouchListener listener)
public virtual unsafe void RemoveOnChangeListener(global::Google.Android.Material.Slider.IBaseOnChangeListener listener)
public virtual unsafe void RemoveOnSliderTouchListener(global::Google.Android.Material.Slider.IBaseOnSliderTouchListener listener)

✅ RangeSlider Class - All 4 methods now available:

public virtual unsafe void AddOnChangeListener(global::Google.Android.Material.Slider.IBaseOnChangeListener listener)
public virtual unsafe void AddOnSliderTouchListener(global::Google.Android.Material.Slider.IBaseOnSliderTouchListener listener)
public virtual unsafe void RemoveOnChangeListener(global::Google.Android.Material.Slider.IBaseOnChangeListener listener)
public virtual unsafe void RemoveOnSliderTouchListener(global::Google.Android.Material.Slider.IBaseOnSliderTouchListener listener)

✅ Build Status:

  • Material library compiled successfully
  • No BG8800 warnings for slider methods
  • DLL generated: Xamarin.Google.Android.Material.dll (3.0M)

Usage Example (Now Works!)

// This also works but triggers XAOBS001 obsolete warning since IBaseOnChangeListener 
// is considered internal API by Google
class MyBaseChangeListener : Java.Lang.Object, Google.Android.Material.Slider.IBaseOnChangeListener
{
    public void OnValueChange(Java.Lang.Object slider, float value, bool fromUser)
    {
        // Handle value change
    }
}

slider.AddOnChangeListener(new MyBaseChangeListener());

Files Modified

  • source/com.google.android.material/material/Transforms/Metadata.xml - Added 4 metadata transforms for BaseSlider class

Test Status

✅ Issue fully resolved
✅ Source compiles successfully with new changes
✅ All required methods are now accessible in both Slider and RangeSlider classes

@sheiksyedm sheiksyedm added the missing-api Java types/members not available in binding label Dec 29, 2025
Copy link
Copy Markdown
Member

@jonathanpeppers jonathanpeppers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also find the specific package, and increase the 4th version component by .1?

So, 1.0.1 would become 1.0.1.1, for example

@sheiksyedm
Copy link
Copy Markdown
Contributor Author

sheiksyedm commented Jan 5, 2026

Can you also find the specific package, and increase the 4th version component by .1?

So, 1.0.1 would become 1.0.1.1, for example

@jonathanpeppers Yes, I updated the Xamarin.Google.Android.Material package 4th version component by .1(from 1.13.0 to 1.13.0.1)

@jonathanpeppers jonathanpeppers enabled auto-merge (squash) January 5, 2026 16:28
@jonathanpeppers jonathanpeppers merged commit eece43e into dotnet:main Jan 6, 2026
2 checks passed
sheiksyedm added a commit to sheiksyedm/maui that referenced this pull request Jan 9, 2026
…hangeListener

This update is required to use the fixed Material Slider binding from dotnet/android-libraries#1335.
The Material Slider was missing the addOnChangeListener method, which has been fixed in the latest
android-libraries package release.

Changes:
- Update Xamarin.Google.Android.Material from 1.12.0.5 to 1.13.0.1
- Update required AndroidX dependencies to match Material 1.13.0.1 requirements
- Add explicit Ktx package references to resolve transitive dependency conflicts

Package Updates:
- Xamarin.Google.Android.Material: 1.12.0.5 → 1.13.0.1
- Xamarin.AndroidX.Activity: 1.10.1.3 → 1.12.2
- Xamarin.AndroidX.Lifecycle.LiveData: 2.9.2.1 → 2.10.0
- Added 10 new Ktx and dependency packages required by Material 1.13.0.1

Fixes dotnet/android-libraries#1335
@YBTopaz8
Copy link
Copy Markdown

YBTopaz8 commented Jan 10, 2026

Thank you kindly for this! though IBaseOnSliderTouchListener, IBaseOnChangeListener are depreciated, with hopes its not going to be an issue later on.
It's better than using .Touch event though!

sheiksyedm added a commit to sheiksyedm/maui that referenced this pull request Jan 14, 2026
…hangeListener

This update is required to use the fixed Material Slider binding from dotnet/android-libraries#1335.
The Material Slider was missing the addOnChangeListener method, which has been fixed in the latest
android-libraries package release.

Changes:
- Update Xamarin.Google.Android.Material from 1.12.0.5 to 1.13.0.1
- Update required AndroidX dependencies to match Material 1.13.0.1 requirements
- Add explicit Ktx package references to resolve transitive dependency conflicts

Package Updates:
- Xamarin.Google.Android.Material: 1.12.0.5 → 1.13.0.1
- Xamarin.AndroidX.Activity: 1.10.1.3 → 1.12.2
- Xamarin.AndroidX.Lifecycle.LiveData: 2.9.2.1 → 2.10.0
- Added 10 new Ktx and dependency packages required by Material 1.13.0.1

Fixes dotnet/android-libraries#1335
sheiksyedm added a commit to sheiksyedm/maui that referenced this pull request Jan 30, 2026
…hangeListener

This update is required to use the fixed Material Slider binding from dotnet/android-libraries#1335.
The Material Slider was missing the addOnChangeListener method, which has been fixed in the latest
android-libraries package release.

Changes:
- Update Xamarin.Google.Android.Material from 1.12.0.5 to 1.13.0.1
- Update required AndroidX dependencies to match Material 1.13.0.1 requirements
- Add explicit Ktx package references to resolve transitive dependency conflicts

Package Updates:
- Xamarin.Google.Android.Material: 1.12.0.5 → 1.13.0.1
- Xamarin.AndroidX.Activity: 1.10.1.3 → 1.12.2
- Xamarin.AndroidX.Lifecycle.LiveData: 2.9.2.1 → 2.10.0
- Added 10 new Ktx and dependency packages required by Material 1.13.0.1

Fixes dotnet/android-libraries#1335
sheiksyedm added a commit to sheiksyedm/maui that referenced this pull request Feb 2, 2026
…hangeListener

This update is required to use the fixed Material Slider binding from dotnet/android-libraries#1335.
The Material Slider was missing the addOnChangeListener method, which has been fixed in the latest
android-libraries package release.

Changes:
- Update Xamarin.Google.Android.Material from 1.12.0.5 to 1.13.0.1
- Update required AndroidX dependencies to match Material 1.13.0.1 requirements
- Add explicit Ktx package references to resolve transitive dependency conflicts

Package Updates:
- Xamarin.Google.Android.Material: 1.12.0.5 → 1.13.0.1
- Xamarin.AndroidX.Activity: 1.10.1.3 → 1.12.2
- Xamarin.AndroidX.Lifecycle.LiveData: 2.9.2.1 → 2.10.0
- Added 10 new Ktx and dependency packages required by Material 1.13.0.1

Fixes dotnet/android-libraries#1335
sheiksyedm added a commit to sheiksyedm/maui that referenced this pull request Feb 2, 2026
…hangeListener

This update is required to use the fixed Material Slider binding from dotnet/android-libraries#1335.
The Material Slider was missing the addOnChangeListener method, which has been fixed in the latest
android-libraries package release.

Changes:
- Update Xamarin.Google.Android.Material from 1.12.0.5 to 1.13.0.1
- Update required AndroidX dependencies to match Material 1.13.0.1 requirements
- Add explicit Ktx package references to resolve transitive dependency conflicts

Package Updates:
- Xamarin.Google.Android.Material: 1.12.0.5 → 1.13.0.1
- Xamarin.AndroidX.Activity: 1.10.1.3 → 1.12.2
- Xamarin.AndroidX.Lifecycle.LiveData: 2.9.2.1 → 2.10.0
- Added 10 new Ktx and dependency packages required by Material 1.13.0.1

Fixes dotnet/android-libraries#1335
sheiksyedm added a commit to sheiksyedm/maui that referenced this pull request Feb 24, 2026
…hangeListener

This update is required to use the fixed Material Slider binding from dotnet/android-libraries#1335.
The Material Slider was missing the addOnChangeListener method, which has been fixed in the latest
android-libraries package release.

Changes:
- Update Xamarin.Google.Android.Material from 1.12.0.5 to 1.13.0.1
- Update required AndroidX dependencies to match Material 1.13.0.1 requirements
- Add explicit Ktx package references to resolve transitive dependency conflicts

Package Updates:
- Xamarin.Google.Android.Material: 1.12.0.5 → 1.13.0.1
- Xamarin.AndroidX.Activity: 1.10.1.3 → 1.12.2
- Xamarin.AndroidX.Lifecycle.LiveData: 2.9.2.1 → 2.10.0
- Added 10 new Ktx and dependency packages required by Material 1.13.0.1

Fixes dotnet/android-libraries#1335
sheiksyedm added a commit to sheiksyedm/maui that referenced this pull request Feb 24, 2026
…hangeListener

This update is required to use the fixed Material Slider binding from dotnet/android-libraries#1335.
The Material Slider was missing the addOnChangeListener method, which has been fixed in the latest
android-libraries package release.

Changes:
- Update Xamarin.Google.Android.Material from 1.12.0.5 to 1.13.0.1
- Update required AndroidX dependencies to match Material 1.13.0.1 requirements
- Add explicit Ktx package references to resolve transitive dependency conflicts

Package Updates:
- Xamarin.Google.Android.Material: 1.12.0.5 → 1.13.0.1
- Xamarin.AndroidX.Activity: 1.10.1.3 → 1.12.2
- Xamarin.AndroidX.Lifecycle.LiveData: 2.9.2.1 → 2.10.0
- Added 10 new Ktx and dependency packages required by Material 1.13.0.1

Fixes dotnet/android-libraries#1335
sheiksyedm added a commit to sheiksyedm/maui that referenced this pull request Mar 3, 2026
…hangeListener

This update is required to use the fixed Material Slider binding from dotnet/android-libraries#1335.
The Material Slider was missing the addOnChangeListener method, which has been fixed in the latest
android-libraries package release.

Changes:
- Update Xamarin.Google.Android.Material from 1.12.0.5 to 1.13.0.1
- Update required AndroidX dependencies to match Material 1.13.0.1 requirements
- Add explicit Ktx package references to resolve transitive dependency conflicts

Package Updates:
- Xamarin.Google.Android.Material: 1.12.0.5 → 1.13.0.1
- Xamarin.AndroidX.Activity: 1.10.1.3 → 1.12.2
- Xamarin.AndroidX.Lifecycle.LiveData: 2.9.2.1 → 2.10.0
- Added 10 new Ktx and dependency packages required by Material 1.13.0.1

Fixes dotnet/android-libraries#1335
sheiksyedm added a commit to sheiksyedm/maui that referenced this pull request Mar 3, 2026
…hangeListener

This update is required to use the fixed Material Slider binding from dotnet/android-libraries#1335.
The Material Slider was missing the addOnChangeListener method, which has been fixed in the latest
android-libraries package release.

Changes:
- Update Xamarin.Google.Android.Material from 1.12.0.5 to 1.13.0.1
- Update required AndroidX dependencies to match Material 1.13.0.1 requirements
- Add explicit Ktx package references to resolve transitive dependency conflicts

Package Updates:
- Xamarin.Google.Android.Material: 1.12.0.5 → 1.13.0.1
- Xamarin.AndroidX.Activity: 1.10.1.3 → 1.12.2
- Xamarin.AndroidX.Lifecycle.LiveData: 2.9.2.1 → 2.10.0
- Added 10 new Ktx and dependency packages required by Material 1.13.0.1

Fixes dotnet/android-libraries#1335
sheiksyedm added a commit to sheiksyedm/maui that referenced this pull request Mar 10, 2026
…hangeListener

This update is required to use the fixed Material Slider binding from dotnet/android-libraries#1335.
The Material Slider was missing the addOnChangeListener method, which has been fixed in the latest
android-libraries package release.

Changes:
- Update Xamarin.Google.Android.Material from 1.12.0.5 to 1.13.0.1
- Update required AndroidX dependencies to match Material 1.13.0.1 requirements
- Add explicit Ktx package references to resolve transitive dependency conflicts

Package Updates:
- Xamarin.Google.Android.Material: 1.12.0.5 → 1.13.0.1
- Xamarin.AndroidX.Activity: 1.10.1.3 → 1.12.2
- Xamarin.AndroidX.Lifecycle.LiveData: 2.9.2.1 → 2.10.0
- Added 10 new Ktx and dependency packages required by Material 1.13.0.1

Fixes dotnet/android-libraries#1335
sheiksyedm added a commit to sheiksyedm/maui that referenced this pull request Mar 10, 2026
…hangeListener

This update is required to use the fixed Material Slider binding from dotnet/android-libraries#1335.
The Material Slider was missing the addOnChangeListener method, which has been fixed in the latest
android-libraries package release.

Changes:
- Update Xamarin.Google.Android.Material from 1.12.0.5 to 1.13.0.1
- Update required AndroidX dependencies to match Material 1.13.0.1 requirements
- Add explicit Ktx package references to resolve transitive dependency conflicts

Package Updates:
- Xamarin.Google.Android.Material: 1.12.0.5 → 1.13.0.1
- Xamarin.AndroidX.Activity: 1.10.1.3 → 1.12.2
- Xamarin.AndroidX.Lifecycle.LiveData: 2.9.2.1 → 2.10.0
- Added 10 new Ktx and dependency packages required by Material 1.13.0.1

Fixes dotnet/android-libraries#1335
jfversluis pushed a commit to dotnet/maui that referenced this pull request Mar 17, 2026
This pull request updates the minimum supported Android platform version
across the codebase from API level 21 to API level 23 and upgrades
several AndroidX and Google dependencies. It also includes minor code
fixes to ensure compatibility with these changes and to prevent runtime
errors.

Platform version updates:

* Increased `SupportedOSPlatformVersion` and `TargetPlatformMinVersion`
for Android from 21.0 to 23.0 in project and target files, affecting
build requirements for all Android projects and templates.
[[1]](diffhunk://#diff-50e91c82311ea26f2a73202525dfdf2b0a89c178ee666b2bf3ad4c84ac4c06dcL52-R53)
[[2]](diffhunk://#diff-defa1b5ec944712f9b05ccd6a7babd8897ad11e0c9aad7d14d459610498f359fL28-R28)
[[3]](diffhunk://#diff-8b9c404f9891037c65ea0768ec01e0d8930e03001ee9f470e3b906b6aaca8606L43-R43)
[[4]](diffhunk://#diff-7e83bb9506bf80facc20f8f8e65a9dd83d8182a7a798a0e9f33d991e77885b76L35-R35)
[[5]](diffhunk://#diff-390a8abc062ea23cb41f09cba95230d40af3c6a099eac04fa3729480ff12ab01L4-R4)
[[6]](diffhunk://#diff-3da64a09d22fe1c649c9cd1e4d489d0a3836294ec9ac739d1bc2741db0a10203L63-R63)
[[7]](diffhunk://#diff-5ce941f8cda449994a41056896936305152d7cd634ce40907a2c2463f164ff68L16-R16)
[[8]](diffhunk://#diff-89619ac038b59e0a1637d71c540fb17308cae3fbbf85d6f185598f6b4650cd5eL41-R41)
[[9]](diffhunk://#diff-0bdc2f8265754b8666aeb32d0e4560eeed50df8830d6e754d9190f492d495926L5-R5)

Dependency upgrades:

* Updated AndroidX and Google dependencies in `eng/AndroidX.targets` to
newer versions, including `Xamarin.Android.Glide`,
`Xamarin.AndroidX.Activity`, `Xamarin.AndroidX.Browser`, and others;
added a workaround for duplicate class errors with
`Xamarin.AndroidX.Compose.Runtime.Annotation.Jvm`.

Code compatibility and bug fixes:

* Improved null checks in `LaunchChromeTabs` in `Browser.android.cs` to
prevent potential crashes when setting intent flags or launching URLs.
* Simplified and removed outdated Android version checks in
`AreAnimationsEnabled()` in `PlatformTicker.Android.cs` to align with
the new minimum API level.## Summary

This PR updates `Xamarin.Google.Android.Material` from `1.12.0.5` to
`1.13.0.1` to incorporate the fix for Material Slider's missing
`addOnChangeListener` method from
[dotnet/android-libraries#1335](dotnet/android-libraries#1335).
Also, updated the other packages inorder to avoid the dependency isuses.

Main reason for update packages: 

The Material Slider binding was missing the `addOnChangeListener`
method, which is required for properly handling slider value changes in
.NET MAUI applications. This has been fixed in the latest
android-libraries package release.

**Related Issue**: dotnet/android-libraries#1335

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

missing-api Java types/members not available in binding

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Material] Slider.addOnChangeListener binding missing

3 participants