Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13942] Android: Slider ignores values when min/max are floats

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionWon't Fix
Resolution Date2015-01-29T23:26:02.000+0000
Affected Version/sRelease 3.4.1, Release 3.5.0
Fix Version/sRelease 4.1.0
ComponentsAndroid
Labelsandroid, slider
ReporterJeremiah Albrant
AssigneeHieu Pham
Created2013-05-21T03:42:27.000+0000
Updated2015-06-09T23:50:40.000+0000

Description

*Problem* The example below works in the browsers but will not let the user change the value from 0 on Android. *Test case*
var win = Ti.UI.createWindow({backgroundColor:"#FFF"});

var slider = Titanium.UI.createSlider({
	top : 50,
	min : 0.9,
	max : 1.1,
	width : '100%',
	value : 1
});
win.add(slider);

var label = Ti.UI.createLabel({
	text : slider.value,
	width : '100%',
	height : 'auto',
	top : 30,
	left : 0,
	textAlign : Ti.UI.TEXT_ALIGNMENT_CENTER
});
win.add(label);

slider.addEventListener('change', function(e) {
	label.text = String.format("%3.1f", e.value);
});

win.open();

Comments

  1. Daniel Sefton 2013-05-21

    Tested and confirmed on Android 4.1.2 x86 emulator with Ti SDK 3.1 GA and 3.2 CI.
  2. Hieu Pham 2015-01-29

    Android doesn't ignore these values, it simply round them to integers before proceed. Android doesn't support float values for min,max, minrange, and maxrange. Please refer to the documentation: http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.ProgressBar-property-min
  3. Lokesh Choudhary 2015-06-09

    Closing as this is resolved as "won't fix".

JSON Source