[TIMOB-2100] Android: Implement minRange and maxRange on Slider

GitHub Issuen/a
TypeNew Feature
Resolution Date2011-04-17T01:58:05.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.5.0
Labelsandroid, feature, rplist
ReporterDon Thorp
AssigneeDon Thorp


By default minRange = min and maxRange = max. These settings are backward compatible.

During creation of the control, min and max settings are determined first, then minRange and maxRange are checked. If they are out of bounds then they are set to min or max depending on the direction.

Example 1:
min = 0, max = 10
if (minRange < min) minRange = min; if (minRange > max) minRange = max;
if (maxRange > max) maxRange = max; if (maxRange < min) maxRange = min;

This keeps the values sane.

If min or max is changed dynamically, then their range value is set to the new min or max.

Example 2:

slider.min = 12; // minRange will now be 12
slider.max = 14; // maxRange will now be 14

After setting the bounds if you want a new min/max Range you may set them.


  1. Don Thorp 2011-04-15

    (from [523fd69721113ab829bd9fdab9a2a7f28568e4b2]) [#2100] Implemented on android_native_refactor needs to be ported to master http://github.com/appcelerator/titanium_mobile/commit/523fd69721113ab829bd9fdab9a2a7f28568e4b2"> http://github.com/appcelerator/titanium_mobile/commit/523fd69721113...

  2. Don Thorp 2011-04-15

    (from [49be0e6f88158503394d3bb4ffd2b5f840bdb035]) [#2100] ported to master, need to add KS example http://github.com/appcelerator/titanium_mobile/commit/49be0e6f88158503394d3bb4ffd2b5f840bdb035"> http://github.com/appcelerator/titanium_mobile/commit/49be0e6f88158...

  3. Don Thorp 2011-04-15

    (from [8bc11b39ba40d41581da9cff2e31e2002170a3f3]) [#2100 state:fixed-in-qa] Ported slider minRange/maxRange support from android_native_refactor. Added example in KitchenSink for Android support. Added messages instead of crashing for [#2176 state:fixed-in-qa] also fixed a bug that surfaced when fixing 2176 where a drawable w/ a null bitmap was created. http://github.com/appcelerator/titanium_mobile/commit/8bc11b39ba40d41581da9cff2e31e2002170a3f3"> http://github.com/appcelerator/titanium_mobile/commit/8bc11b39ba40d...

  4. Matt Schmulen 2011-04-15

    pass regression android 2.1 sim

  5. Matt Schmulen 2011-04-15

    passed regression android 1.6 sim Titanium SDK version: 1.5.0 (11/24/10 12:05 c0aff27)

JSON Source