Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dbankier/realswitch
Titanium native module for a real Android Switch.
https://github.com/dbankier/realswitch
Last synced: about 2 months ago
JSON representation
Titanium native module for a real Android Switch.
- Host: GitHub
- URL: https://github.com/dbankier/realswitch
- Owner: dbankier
- License: mit
- Created: 2014-06-09T09:14:14.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-06-09T09:16:10.000Z (over 10 years ago)
- Last Synced: 2024-08-03T07:02:08.110Z (5 months ago)
- Language: Java
- Size: 191 KB
- Stars: 31
- Watchers: 7
- Forks: 8
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RealSwitch for Android
A native Android Titanium module for a **real** Switch for Android - not a Toggle or Checkbox - an `android.widget.Switch;`
![switch](http://developer.android.com/images/ui/switch.png)
**Note**: API 14 and above.
## Install
The modules/zip files is in the `dist` folder of the repository. Add it to your project like you would any other native module.
Require the module with the following code:
~~~
var RealSwitch = require("com.yydigital.realswitch");
~~~## Usage
RealSwitch uses the same API as `Ti.UI.Switch`.
Here is an example usage:
~~~
var realSwitch = RealSwitch.createRealSwitch({
value:true
});
win.add(realSwitch);realSwitch.addEventListener('change',function(e){
Ti.API.info('Switch value: ' + basicSwitch.value);
});
~~~###Licence: MIT