Skip to content

Fixed improper rendering of ThumbimageSource in Slider#34064

Open
NirmalKumarYuvaraj wants to merge 18 commits intodotnet:mainfrom
NirmalKumarYuvaraj:fix-13258
Open

Fixed improper rendering of ThumbimageSource in Slider#34064
NirmalKumarYuvaraj wants to merge 18 commits intodotnet:mainfrom
NirmalKumarYuvaraj:fix-13258

Conversation

@NirmalKumarYuvaraj
Copy link
Contributor

Description of Change

This pull request addresses the issue of oversized slider thumb images on Android, iOS, and macOS by ensuring that custom thumb images are properly scaled to match platform guidelines. It introduces platform-specific logic to resize thumb images and adds a test case to validate the fix. Additionally, it includes minor code improvements for null checking and code clarity.

Platform-specific slider thumb image scaling:

  • Android: Custom thumb images for sliders are now resized to a target size (20dp diameter as per Material Design guidelines) before being applied. If no image is provided, the default thumb is restored. The logic avoids redundant drawable assignments and ensures proper color filtering. (SliderExtensions.cs) [1] [2] [3]
  • iOS: Custom thumb images are resized to match the default thumb size of the UISlider using the slider's track and thumb rects. This ensures consistent appearance with native controls. (SliderExtensions.cs) [1] [2] [3]

Test coverage:

  • Added a new UI test to verify that the slider thumb image is correctly scaled and can be changed at runtime. (Issue13258.cs in both TestCases.HostApp and TestCases.Shared.Tests) [1] [2]

Code quality improvements:

  • Replaced != null checks with is not null for clarity and consistency. (SliderExtensions.cs for both Android and iOS) [1] [2] [3]
  • Minor refactoring for readability, such as early returns and using explicit variable names. [1] [2]

These changes ensure that slider thumb images are visually consistent across platforms and address the reported issue with minimal impact on existing functionality.

Issues Fixed

Fixes #13258

Previously closed PR - #27472

@dotnet-policy-service dotnet-policy-service bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Feb 16, 2026
@sheiksyedm sheiksyedm marked this pull request as ready for review February 16, 2026 07:44
Copilot AI review requested due to automatic review settings February 16, 2026 07:44
@sheiksyedm sheiksyedm added this to the .NET 10 SR5 milestone Feb 16, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates MAUI Slider thumb image handling to avoid oversized custom thumb images (primarily on Android, and also iOS/macOS), and adds an Issue test case + updated snapshot baselines to validate the visual behavior.

Changes:

  • Android: scale custom thumb drawables to a target dp size before applying to SeekBar.
  • iOS: resize custom thumb images to match the platform default thumb size derived from UISlider geometry.
  • Tests: add Issue13258 UI test page + UITest, and update/add snapshot baselines impacted by the change.

Reviewed changes

Copilot reviewed 4 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/Core/src/Platform/Android/SliderExtensions.cs Adds thumb scaling logic and refactors default-thumb restoration/tint behavior.
src/Core/src/Platform/iOS/SliderExtensions.cs Resizes thumb images to the slider’s default thumb size; minor null-check refactors.
src/Controls/tests/TestCases.HostApp/Issues/Issue13258.cs New HostApp reproduction page for thumb image sizing + runtime changes.
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue13258.cs New screenshot-based UITest for Issue13258.
src/Controls/tests/TestCases.Android.Tests/snapshots/android/SliderShouldChangeThumbImageAndResetIt.png Updated/added Android snapshot baseline impacted by thumb sizing changes.
src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/SliderShouldChangeThumbImageAndResetIt.png Updated/added iOS snapshot baseline impacted by thumb sizing changes.
src/Controls/tests/TestCases.Mac.Tests/snapshots/mac/SliderThumbImageShouldBeScaled.png Adds Mac snapshot baseline for the new Issue13258 test method.
src/Controls/tests/TestCases.Mac.Tests/snapshots/mac/SliderShouldChangeThumbImageAndResetIt.png Updated/added Mac snapshot baseline impacted by thumb sizing changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-controls-slider Slider community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/android platform/ios

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Slider] MAUI Slider thumb image is big on android

2 participants