Template project for the custom button plugin for Tabris.js. The plugin currently supports Android.
The plugin currently supports Android.
The following table shows the plugin branches and the minimum required Tabris.js version:
Version | Branch | Minimum Tabris.js version |
---|---|---|
1.0.0 | master |
3.7.2 |
The following snippet shows how the tabris-plugin-template
plugin can be used in a Tabris.js app:
new elshadsm.CustomButton({
left: 0, top: 0, right: 0, bottom: 0,
text: 'Button'
}).appendTo(tabris.contentView);
A more elaborate example can be found in the .example folder. It provides a Tabris.js project that demonstrates the various features of the tabris-plugin-template
plugin. Consult the README of the example for build instructions.
The Tabris.js website provides detailed information on how to integrate custom widgets in your Tabris.js app. To add the plugin to your app add the following entry in your apps config.xml
:
<!-- Not yet on npm -->
<!-- <plugin name="tabris-plugin-template" spec="^1.0.0" /> -->
To fetch the latest development version use the GitHub URL:
<plugin name="tabris-plugin-template" spec="https://github.com/elshadsm/tabris-plugin-template.git" />
The plugin api consists of the elshadsm.CustomButton
Widget
with the following properties and events.
- The button’s label text.
- Limit the number of lines to be displayed to the given maximum. null disables this limit.
-
Fired when the button is pressed.
-
EventObject Type: EventObject
-
This event has no additional parameter.
While not required by the consumer or the widget, this repository provides a project
folder that contains platform specific development artifacts. These artifacts allow to more easily consume the native source code when developing the native parts of the widget.
The project provides a gradle based build configuration, which also allows to import the project into Android Studio.
In order to reference the Tabris.js specific APIs, the environment variable TABRIS_ANDROID_PLATFORM
has to point to the Tabris.js Android Cordova platform root directory.
export TABRIS_ANDROID_PLATFORM=/home/user/tabris-android
The environment variable is consumed in the gradle projects build.gradle file.
See LICENSE notice.