[TIMOB-2100] Android: Implement minRange and maxRange on Slider
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:58:05.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.5.0 |
Components | Android |
Labels | android, feature, rplist |
Reporter | Don Thorp |
Assignee | Don Thorp |
Created | 2011-04-15T03:10:26.000+0000 |
Updated | 2011-04-17T01:58:05.000+0000 |
Description
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.
Comments
- 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...
- 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...
- 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...
- Matt Schmulen 2011-04-15
pass regression android 2.1 sim
- Matt Schmulen 2011-04-15
passed regression android 1.6 sim Titanium SDK version: 1.5.0 (11/24/10 12:05 c0aff27)