Appcelerator Titanium widget for advanced slider which supports steps.
you can install the widget directly by downloading a zip file from this repo. or you can download it usign gitTio package manager using the following command
$ gittio install ti.accu.slider
You can easily use the widget with the following way.
<Widget id="Slider" src="ti.accu.slider" title="Loan Amount" sliderTint="red" min="10" max="250" step="5" width="Ti.UI.FILL" value="70" onChange="valueChanged"/>
OR
var Slider = Alloy.createWidget('ti.accu.slider',{
title:"Loan Amount",
sliderTint:"red", // OS(iOS, Android) default
min:10, //default 0
max:250, //default 1
step:5, //default 1
value:50
}).getView();
Slider.on("change",valueChanged);
$.anyView.add(Slider);
function valueChanged(e){
console.log(e.value);
}
$.Slider.setSliderTintColor('green');
$.Slider.setTitleStyle({
color: 'blue'
});// all styles available for Label
$.Slider.setTextFieldStyle({
borderColor: 'black',
borderWidth: 1,
textAlign: Ti.UI.TEXT_ALIGNMENT_CENTER
});// all styles available for TextField
var value = $.Slider.getValue();
Pull request are welcome to add any new features to the widget.
Apache License, Version 2.0
- Abdullah Al-Faqeir (abdullah@accusolutions.net) AccuSolutions LLC 2020