Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1481] Ti.UI.createSlider fails to work on Android

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionInvalid
Resolution Date2014-07-24T23:31:09.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsStudio
Labelsandroid, slider, ui
ReporterGeoffrey Hoffman
AssigneeMauro Parra-Miranda
Created2014-07-11T03:28:39.000+0000
Updated2016-03-08T07:37:55.000+0000

Description

Titanium Studio 3.3.0.201407100905 Pasting the example here http://docs.appcelerator.com/titanium/3.0/#!/api/Titanium.UI.Slider into a new single page app, I am unable do make a workable slider for any Android emulator. I'm testing using a couple of GenY ones. I get the following errors; I don't know if it is related. Hope it helps. [ERROR] : TitaniumModule: (KrollRuntimeThread) [33,33] Error occured while formatting string [ERROR] : TitaniumModule: java.util.IllegalFormatConversionException: %f can't format java.lang.Integer arguments [ERROR] : TitaniumModule: at java.util.Formatter.badArgumentType(Formatter.java:1489) [ERROR] : TitaniumModule: at java.util.Formatter.transformFromFloat(Formatter.java:2038) [ERROR] : TitaniumModule: at java.util.Formatter.transform(Formatter.java:1465) [ERROR] : TitaniumModule: at java.util.Formatter.doFormat(Formatter.java:1081) [ERROR] : TitaniumModule: at java.util.Formatter.format(Formatter.java:1042) [ERROR] : TitaniumModule: at java.util.Formatter.format(Formatter.java:1011) [ERROR] : TitaniumModule: at java.lang.String.format(String.java:1999) [ERROR] : TitaniumModule: at java.lang.String.format(String.java:1973) [ERROR] : TitaniumModule: at ti.modules.titanium.TitaniumModule.stringFormat(TitaniumModule.java:261) [ERROR] : TitaniumModule: at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) [ERROR] : TitaniumModule: at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:64) [ERROR] : TitaniumModule: at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:884) [ERROR] : TitaniumModule: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1107) [ERROR] : TitaniumModule: at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:327) [ERROR] : TitaniumModule: at android.os.Handler.dispatchMessage(Handler.java:98) [ERROR] : TitaniumModule: at android.os.Looper.loop(Looper.java:136) [ERROR] : TitaniumModule: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) [ERROR] : TitaniumModule: (KrollRuntimeThread) [1,34] Error occured while formatting string [ERROR] : TitaniumModule: java.util.IllegalFormatConversionException: %f can't format java.lang.Integer arguments [ERROR] : TitaniumModule: at java.util.Formatter.badArgumentType(Formatter.java:1489) [ERROR] : TitaniumModule: at java.util.Formatter.transformFromFloat(Formatter.java:2038) [ERROR] : TitaniumModule: at java.util.Formatter.transform(Formatter.java:1465) [ERROR] : TitaniumModule: at java.util.Formatter.doFormat(Formatter.java:1081) [ERROR] : TitaniumModule: at java.util.Formatter.format(Formatter.java:1042) [ERROR] : TitaniumModule: at java.util.Formatter.format(Formatter.java:1011) [ERROR] : TitaniumModule: at java.lang.String.format(String.java:1999) [ERROR] : TitaniumModule: at java.lang.String.format(String.java:1973) [ERROR] : TitaniumModule: at ti.modules.titanium.TitaniumModule.stringFormat(TitaniumModule.java:261) [ERROR] : TitaniumModule: at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) [ERROR] : TitaniumModule: at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:64) [ERROR] : TitaniumModule: at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:884) [ERROR] : TitaniumModule: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1107) [ERROR] : TitaniumModule: at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:327) [ERROR] : TitaniumModule: at android.os.Handler.dispatchMessage(Handler.java:98) [ERROR] : TitaniumModule: at android.os.Looper.loop(Looper.java:136) [ERROR] : TitaniumModule: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) [WARN] : EGL_genymotion: eglSurfaceAttrib not implemented [ERROR] : OpenGLRenderer: Getting MAX_TEXTURE_SIZE from GradienCache [ERROR] : OpenGLRenderer: MAX_TEXTURE_SIZE: 16384 [ERROR] : OpenGLRenderer: Getting MAX_TEXTURE_SIZE from Caches::initConstraints() [ERROR] : OpenGLRenderer: MAX_TEXTURE_SIZE: 16384

Comments

  1. Geoffrey Hoffman 2014-07-11

    The behavior I was seeing was that the slider was drawn on the screen, but it was not selectable or draggable. Actually, I think you can close this bug. I think I was working in ApplicationWindow.js. When I place the code below into FirstView.js - It works. //FirstView Component Constructor function FirstView() { //create object instance, a parasitic subclass of Observable var self = Ti.UI.createView(); //label using localization-ready strings from /i18n/en/strings.xml var label = Ti.UI.createLabel({ color:'#000000', text:String.format(L('welcome'),'Titanium'), height:'auto', width:'auto' }); self.add(label); //Add behavior for UI label.addEventListener('click', function(e) { alert(e.source.text); }); var slider = Titanium.UI.createSlider({ top: 50, min: 0, max: 100, width: '50%', value: 50 }); var label = Ti.UI.createLabel({ text: slider.value, width: '100%', height: 'auto', top: 30, left: 0, textAlign: Ti.UI.TEXT_ALIGNMENT_CENTER }); slider.addEventListener('change', function(e) { label.text = String.format("%3.1f", e.value); }); self.add(slider); self.add(label); return self; } module.exports = FirstView;
  2. Mauro Parra-Miranda 2014-07-24

    Closed per user comment.

JSON Source