Skip to content

feat(slider): add support for linear gradients for min/max track#10953

Closed
TONYSTARK-EDITH wants to merge 5 commits intoNativeScript:mainfrom
TONYSTARK-EDITH:feature/MPS_slider_linear_gradient
Closed

feat(slider): add support for linear gradients for min/max track#10953
TONYSTARK-EDITH wants to merge 5 commits intoNativeScript:mainfrom
TONYSTARK-EDITH:feature/MPS_slider_linear_gradient

Conversation

@TONYSTARK-EDITH
Copy link

@TONYSTARK-EDITH TONYSTARK-EDITH commented Nov 15, 2025

feat(slider): add support for linear gradients for min/max track

Add support for applying LinearGradient instances to a Slider's min and max tracks
on Android and iOS.

  • Export and register new properties minTrackGradient and maxTrackGradient on SliderBase.
  • Implement Android shader-backed LayerDrawable that substitutes the progress layer with a shader
    drawable while preserving original layer IDs.
  • Implement iOS rendering by rasterizing CAGradientLayer into a resizable track image with
    proper scale, corner radius and angle handling.
  • Add unit tests and automated UI tests to validate property exports, native drawable/image
    retrieval and gradient updates.
  • Add small accessibility/events cleanup and shared index refactor.

Notes:

  • Restores original drawables/images when gradient is set to null.
  • Gradient offsets are handled (percent → 0..1) and color stops are evenly distributed when
    offsets are absent.

Breaking changes: none

Closes: #5940

@NathanWalker
Copy link
Contributor

Thank you for this PR @TONYSTARK-EDITH and your efforts here. We ended up merging this related pr #11015 due to the surface area simplicity, but look forward to your proposals anytime ❤️

@TONYSTARK-EDITH TONYSTARK-EDITH deleted the feature/MPS_slider_linear_gradient branch January 24, 2026 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Slider linear-gradient support

2 participants