Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10880] Android: Slider value not being set on creation on OS 4.0+

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-09-14T14:49:50.000+0000
Affected Version/sRelease 2.1.2, Release 2.1.3, Release 3.0.0
Fix Version/sRelease 2.1.3, Release 3.0.0, Sprint 2012-20 API, 2012 Sprint 20
ComponentsAndroid
LabelsSupportTeam, api, module_slider, qe-testadded
ReporterDaniel Sefton
AssigneeVishal Duggal
Created2012-09-12T13:48:33.000+0000
Updated2012-10-26T22:23:55.000+0000

Description

Problem description

Slider value is not being set on creation on OS 4.0+

Steps to Reproduce

Create a slider with a value property and build the app. Result: Slider value is not set - it keeps the default value = 0
win = Titanium.UI.createWindow({
	barColor : '#929292',
	title : 'testing',
	backgroundColor : '#FFFFFF',
	backButtonTitle : 'back',
	tabBarHidden : false,
	top : 0
});

var ss = Ti.UI.createSlider({
	top : 25,
	value : 20,
	min : 0,
	max : 50,
	left : 0,
	right : 0
})

win.add(ss)

// Workaround #1
//win.addEventListener('open', function(e) {
    //ss.value = 20;
//})

// Workaround #2
//setTimeout(function setSSvalue() {
    //ss.value = 20;
//}, 200);

win.open();
Note: The slider shows the correct value if the value property is set after the slider has been created.

Comments

  1. Vishal Duggal 2012-09-13

    Pull pending https://github.com/appcelerator/titanium_mobile/pull/2936
  2. Lokesh Choudhary 2012-09-17

    Verified fix on: Titanium studio : 2.1.2.201208301612 SDK version : 2.1.3.v20120915120319 SDK version : 3.0.0.v20120917105713 Android 4.0+ (Galaxy S3)

JSON Source